Package org.apache.hivemind.schema

Examples of org.apache.hivemind.schema.Translator.translate()


            Object result)
    {
        MockControl control = newControl(Translator.class);
        Translator translator = (Translator) control.getMock();

        translator.translate(module, Object.class, objectReference, location);
        control.setReturnValue(result);

        return translator;
    }
View Full Code Here


        moduleControl.setReturnValue(tm);

        tm.getTranslator("foo");
        tmControl.setReturnValue(translator);

        translator.translate(module, Object.class, "bar", null);
        translatorControl.setReturnValue("BAR");

        replayControls();

        facet.isAssignableToType(params, Object.class);
View Full Code Here

        moduleControl.setReturnValue(tm);

        tm.getTranslator("foo");
        tmControl.setReturnValue(translator);

        translator.translate(module, Object.class, "bar", null);
        ApplicationRuntimeException exception = new ApplicationRuntimeException("");
        translatorControl.setThrowable(exception);

        replayControls();
View Full Code Here

        Translator t = processor.getAttributeTranslator(_attributeName);

        String attributeValue = element.getAttributeValue(_attributeName);

        Object finalValue =
            t.translate(
                processor.getContributingModule(),
                Object.class,
                attributeValue,
                element.getLocation());
View Full Code Here

        replayControls();

        Translator t = new ServicePointTranslator();

        ServicePoint result = (ServicePoint) t.translate(m, null, "Fred", null);

        assertSame(sp, result);

        verifyControls();
    }
View Full Code Here

     */
    public void testInt()
    {
        Translator t = new SmartTranslator();

        Object result = t.translate(null, int.class, "-37", null);

        assertEquals(new Integer(-37), result);
    }

    public void testNullInput()
View Full Code Here

    public void testNullInput()
    {
        Translator t = new SmartTranslator();

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

    public void testBlankInput()
    {
        Translator t = new SmartTranslator();
View Full Code Here

    public void testBlankInput()
    {
        Translator t = new SmartTranslator();

        assertEquals("", t.translate(null, String.class, "", null));
    }

    public void testDefault()
    {
        Translator t = new SmartTranslator("default=100");
View Full Code Here

    public void testDefault()
    {
        Translator t = new SmartTranslator("default=100");

        Object result = t.translate(null, int.class, null, null);

        assertEquals(new Integer(100), result);
    }

    /**
 
View Full Code Here

     */
    public void testDouble()
    {
        Translator t = new SmartTranslator();

        Object result = t.translate(null, Double.class, "3.14", null);

        assertEquals(new Double("3.14"), result);
    }

    /**
 
View Full Code Here

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.