1 package org.apache.fulcrum.yaafi.baseservice;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import java.io.File;
24
25 import org.apache.fulcrum.yaafi.testcontainer.BaseUnitTest;
26
27 /**
28 * Test suite for the project
29 *
30 * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
31 */
32
33 public class DerivedServiceTest extends BaseUnitTest
34 {
35 /**
36 * Constructor
37 * @param name the name of the test case
38 */
39 public DerivedServiceTest( String name )
40 {
41 super(name);
42 }
43
44 /**
45 * Lookup the service and invoke the test() method
46 * @throws Exception invocation failed
47 */
48 public void testDerivedService() throws Exception
49 {
50 DerivedService derivedService = (DerivedService) this.lookup(
51 DerivedService.class.getName()
52 );
53
54
55
56 derivedService.test();
57
58
59
60 String fileName = "./src/test/TestRoleConfig.xml";
61 String absolutePath = derivedService.createAbsolutePath(fileName);
62 File absoluteFile = derivedService.createAbsoluteFile(fileName);
63
64 assertTrue(absoluteFile.isAbsolute());
65 assertTrue(absoluteFile.exists());
66 assertTrue(new File(absolutePath).isAbsolute());
67 assertTrue(new File(absolutePath).exists());
68 }
69 }