Package org.apache.stratum.xo.classname

Source Code of org.apache.stratum.xo.classname.TestClassNameMapper

package org.apache.stratum.xo.classname;

import java.io.File;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.apache.stratum.xo.Mapper;

public class TestClassNameMapper
    extends TestCase
{
    private static String TEST_DOCUMENT =
        "src/test/org/apache/stratum/xo/classname/container.xml";
       
    private static String TEST_CLASS =
        "org.apache.stratum.xo.classname.Container";

    public TestClassNameMapper(String testName)
    {
        super(testName);
    }

    public static Test suite()
    {
        return new TestSuite(TestClassNameMapper.class);
    }

    public void setUp()
    {
    }
  
    public void tearDown()
    {
    }

    public void testPersonMapping()
    {
        try
        {
            Mapper m = new Mapper();
            m.setDebug(true);
            Container c = (Container) m.map(new File(TEST_DOCUMENT), TEST_CLASS);
           
            assertEquals("item1",c.getItem(0).getName());
            assertEquals("item2",c.getItem(1).getName());
        }           
        catch (Exception e)
        {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }
}
TOP

Related Classes of org.apache.stratum.xo.classname.TestClassNameMapper

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.