KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > meta > legacy > LegacyTestCase


1
2
3 package org.apache.avalon.meta.legacy;
4
5 import org.apache.avalon.meta.info.Type;
6 import org.apache.avalon.meta.info.builder.TypeBuilder;
7 import junit.framework.TestCase;
8
9 public class LegacyTestCase extends TestCase
10 {
11     private Type m_type;
12
13     public LegacyTestCase( )
14     {
15         this( "legacy" );
16     }
17
18     public LegacyTestCase( String JavaDoc name )
19     {
20         super( name );
21     }
22
23     protected void setUp() throws Exception JavaDoc
24     {
25         TypeBuilder builder = new TypeBuilder();
26         ClassLoader JavaDoc loader = Thread.currentThread().getContextClassLoader();
27         Class JavaDoc clazz = loader.loadClass( "org.apache.avalon.meta.legacy.Test" );
28         m_type = builder.buildType( clazz );
29     }
30
31     public void testName() throws Exception JavaDoc
32     {
33         assertTrue( m_type.getInfo().getName().equals( "test" ) );
34     }
35
36     public void testLifestyle() throws Exception JavaDoc
37     {
38         assertTrue( m_type.getInfo().getLifestyle().equals( "singleton" ) );
39     }
40
41     public void testClassName() throws Exception JavaDoc
42     {
43         assertTrue(
44           m_type.getInfo().getClassname().equals( "org.apache.avalon.meta.legacy.Test" ) );
45     }
46 }
47
Popular Tags