Package org.apache.avalon.meta.legacy

Source Code of org.apache.avalon.meta.legacy.LegacyTestCase


package org.apache.avalon.meta.legacy;

import org.apache.avalon.meta.info.Type;
import org.apache.avalon.meta.info.builder.TypeBuilder;
import junit.framework.TestCase;

public class LegacyTestCase extends TestCase
{
    private Type m_type;

    public LegacyTestCase( )
    {
        this( "legacy" );
    }

    public LegacyTestCase( String name )
    {
        super( name );
    }

    protected void setUp() throws Exception
    {
        TypeBuilder builder = new TypeBuilder();
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        Class clazz = loader.loadClass( "org.apache.avalon.meta.legacy.Test" );
        m_type = builder.buildType( clazz );
    }

    public void testName() throws Exception
    {
        assertTrue( m_type.getInfo().getName().equals( "test" ) );
    }

    public void testLifestyle() throws Exception
    {
        assertTrue( m_type.getInfo().getLifestyle().equals( "singleton" ) );
    }

    public void testClassName() throws Exception
    {
        assertTrue(
          m_type.getInfo().getClassname().equals( "org.apache.avalon.meta.legacy.Test" ) );
    }
}
TOP

Related Classes of org.apache.avalon.meta.legacy.LegacyTestCase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.