KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > meta > compat > CompatTestCase


1
2
3 package org.apache.avalon.meta.compat;
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 CompatTestCase extends TestCase
10 {
11     private Type m_type;
12
13     public CompatTestCase( )
14     {
15         this( "compat" );
16     }
17
18     public CompatTestCase( 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.compat.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.compat.Test" ) );
45     }
46 }
47
Popular Tags