1 package org.apache.archiva.xml;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23
24 import junit.framework.TestCase;
25 import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
26 import org.junit.runner.RunWith;
27
28
29
30
31
32
33 @RunWith( ArchivaBlockJUnit4ClassRunner.class )
34 public abstract class AbstractArchivaXmlTestCase
35 extends TestCase
36 {
37 protected static final String OSLASH = "\u00f8";
38
39 protected static final String TRYGVIS = "Trygve Laugst" + OSLASH + "l";
40
41 protected static final String INFIN = "\u221e";
42
43 protected static final String INFINITE_ARCHIVA = "The " + INFIN + " Archiva";
44
45 protected File getExampleXml( String filename )
46 {
47 File examplesDir = new File( "src/test/examples" );
48 if ( !examplesDir.exists() )
49 {
50 fail( "Missing the examples directory: " + examplesDir.getAbsolutePath() );
51 }
52 File exampleFile = new File( examplesDir, filename );
53 if ( !exampleFile.exists() )
54 {
55 fail( "Missing the example xml file: " + exampleFile.getAbsolutePath() );
56 }
57 return exampleFile;
58 }
59 }