1 package org.apache.torque.avalon;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import org.apache.avalon.framework.component.ComponentException;
22 import org.apache.fulcrum.testcontainer.BaseUnitTest;
23
24 /***
25 * Basic testing of the Torque Avalon Component
26 *
27 * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
28 * @version $Id:$
29 */
30 public class AvalonTest extends BaseUnitTest
31 {
32 private Torque torque = null;
33
34 /***
35 * Constructor for test.
36 *
37 * @param testName name of the test being executed
38 */
39 public AvalonTest(String name)
40 {
41 super( name );
42 }
43
44 public void setUp() throws Exception
45 {
46 super.setUp();
47 try
48 {
49 torque = (Torque) this.resolve( Torque.class.getName() );
50 }
51 catch (ComponentException e)
52 {
53 e.printStackTrace();
54 fail(e.getMessage());
55 }
56 }
57
58 /***
59 * Verifies that the container initialization and lookup works properly.
60 */
61 public void testAvalon()
62 {
63 assertTrue(torque.isInit());
64 assertTrue("Instances should be identical", torque == org.apache.torque.Torque.getInstance());
65 }
66 }