Examples of IntTranslator


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

    * Tests {@link org.apache.hivemind.schema.rules.IntTranslator} with
    * the default constructor.
    */
    public void testIntTranslator()
    {
        IntTranslator t = new IntTranslator();

        assertEquals(new Integer(10), t.translate(null, null, "10"));
    }
View Full Code Here

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

        assertEquals(new Integer(10), t.translate(null, null, "10"));
    }

    public void testIntDefault()
    {
        IntTranslator t = new IntTranslator();

        assertEquals(new Integer(0), t.translate(null, null, null));
    }
View Full Code Here

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

        assertEquals(new Integer(0), t.translate(null, null, null));
    }

    public void testIntLow()
    {
        IntTranslator t = new IntTranslator("min=5,max=200");

        try
        {
            t.translate(null, null, "3");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Value 3 is less than minimum value 5.");
View Full Code Here

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

        }
    }

    public void testIntHigh()
    {
        IntTranslator t = new IntTranslator("min=5,max=200");

        try
        {
            t.translate(null, null, "50900");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Value 50900 is greater than maximum value 200.");
View Full Code Here

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

    }

    public void testIntDefaultValue()
    {
        IntTranslator t = new IntTranslator("default=7");

        assertEquals(new Integer(7), t.translate(null, null, null));
    }
View Full Code Here

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

        assertEquals(new Integer(7), t.translate(null, null, null));
    }

    public void testIntInvalid()
    {
        IntTranslator t = new IntTranslator("default=13");

        try
        {
            t.translate(null, null, "qbert");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
View Full Code Here

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

    * Tests {@link org.apache.hivemind.schema.rules.IntTranslator} with
    * the default constructor.
    */
    public void testIntTranslator()
    {
        IntTranslator t = new IntTranslator();

        assertEquals(new Integer(10), t.translate(null, null, "10", null));
    }
View Full Code Here

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

        assertEquals(new Integer(10), t.translate(null, null, "10", null));
    }

    public void testIntDefault()
    {
        IntTranslator t = new IntTranslator();

        assertEquals(new Integer(0), t.translate(null, null, null, null));
    }
View Full Code Here

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

        assertEquals(new Integer(0), t.translate(null, null, null, null));
    }

    public void testIntLow()
    {
        IntTranslator t = new IntTranslator("min=5,max=200");

        try
        {
            t.translate(null, null, "3", null);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, RulesMessages.minIntValue("3", 5));
View Full Code Here

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

        }
    }

    public void testIntHigh()
    {
        IntTranslator t = new IntTranslator("min=5,max=200");

        try
        {
            t.translate(null, null, "50900", null);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, RulesMessages.maxIntValue("50900", 200));
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.