Package org.apache.hivemind.schema.rules

Examples of org.apache.hivemind.schema.rules.DoubleTranslator.translate()


     */
    public void testDoubleTranslator()
    {
        DoubleTranslator t = new DoubleTranslator();

        assertEquals(new Double(10.7), t.translate(null, null, "10.7"));
    }

    public void testDoubleDefault()
    {
        DoubleTranslator t = new DoubleTranslator();
View Full Code Here


    public void testDoubleDefault()
    {
        DoubleTranslator t = new DoubleTranslator();

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

    public void testDoubleLow()
    {
        DoubleTranslator t = new DoubleTranslator("min=5.25,max=200");
View Full Code Here

    {
        DoubleTranslator t = new DoubleTranslator("min=5.25,max=200");

        try
        {
            t.translate(null, null, "3");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
      String message = java.text.MessageFormat.format("Value {0} is less than minimum value {1}.",
View Full Code Here

    {
        DoubleTranslator t = new DoubleTranslator("min=07,max=207.5");

        try
        {
            t.translate(null, null, "208.3");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
      String message = java.text.MessageFormat.format("Value {0} is greater than maximum value {1}.",
View Full Code Here

    public void testDoubleDefaultValue()
    {
        DoubleTranslator t = new DoubleTranslator("default=7.77");

        assertEquals(new Double(7.77), t.translate(null, null, null));
    }

    public void testDoubleInvalid()
    {
        DoubleTranslator t = new DoubleTranslator("default=13");
View Full Code Here

    {
        DoubleTranslator t = new DoubleTranslator("default=13");

        try
        {
            t.translate(null, null, "qbert");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "'qbert' is not a double value.");
View Full Code Here

    {
        DoubleTranslator t = new DoubleTranslator("default=13");

        try
        {
            t.translate(null, null, "qbert", null);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "'qbert' is not a double value.");
View Full Code Here

     */
    public void testDoubleTranslator()
    {
        DoubleTranslator t = new DoubleTranslator();

        assertEquals(new Double(10.7), t.translate(null, null, "10.7", null));
    }

    public void testDoubleDefault()
    {
        DoubleTranslator t = new DoubleTranslator();
View Full Code Here

    public void testDoubleDefault()
    {
        DoubleTranslator t = new DoubleTranslator();

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

    public void testDoubleLow()
    {
        DoubleTranslator t = new DoubleTranslator("min=5.25,max=200");
View Full Code Here

    {
        DoubleTranslator t = new DoubleTranslator("min=5.25,max=200");

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