Package org.apache.hivemind.schema.rules

Examples of org.apache.hivemind.schema.rules.ObjectTranslator


public class TestObjectTranslator extends FrameworkTestCase
{

    public void testNull()
    {
        ObjectTranslator t = new ObjectTranslator();

        assertNull(t.translate(null, null, null));
    }
View Full Code Here


        assertNull(t.translate(null, null, null));
    }

    public void testBadClass() throws Exception
    {
        ObjectTranslator t = new ObjectTranslator();
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestObjectTranslator.class"), 50);
        e.setLocation(l);

        MockControl c = newControl(Module.class);
        Module m = (Module) c.getMock();

        m.getClassResolver();
        c.setReturnValue(new DefaultClassResolver());

        replayControls();

        try
        {
            t.translate(m, null, "bad.class.Name");
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Could not load class bad.class.Name");
        }
View Full Code Here

        verifyControls();
    }

    public void testPrivateObject() throws Exception
    {
        ObjectTranslator t = new ObjectTranslator();
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestObjectTranslator.class"), 50);
        e.setLocation(l);

        MockControl c = newControl(Module.class);
        Module m = (Module) c.getMock();

        m.getClassResolver();
        c.setReturnValue(new DefaultClassResolver());

        replayControls();

        try
        {
            t.translate(m, null, PrivateObject.class.getName());
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(
View Full Code Here

TOP

Related Classes of org.apache.hivemind.schema.rules.ObjectTranslator

Copyright © 2018 www.massapicom. 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.