Package org.apache.velocity.tools.generic

Examples of org.apache.velocity.tools.generic.Alternator.shift()


        assertStringEquals("red", auto);
        /* test manual alternator (use 'make()' and not 'manual()' since we define the default to be manual in toolbox.xml*/
         Alternator manual = alternatorTool.make(new String[] {"red","blue","yellow"});
        assertStringEquals("red", manual);
        assertStringEquals("red", manual);
        manual.shift();
        assertStringEquals("blue", manual);
        manual.shift();
        manual.shift();
        assertStringEquals("red", manual);
    }
View Full Code Here


         Alternator manual = alternatorTool.make(new String[] {"red","blue","yellow"});
        assertStringEquals("red", manual);
        assertStringEquals("red", manual);
        manual.shift();
        assertStringEquals("blue", manual);
        manual.shift();
        manual.shift();
        assertStringEquals("red", manual);
    }

    protected void assertStringEquals(String expected, Object testThis) {
View Full Code Here

        assertStringEquals("red", manual);
        assertStringEquals("red", manual);
        manual.shift();
        assertStringEquals("blue", manual);
        manual.shift();
        manual.shift();
        assertStringEquals("red", manual);
    }

    protected void assertStringEquals(String expected, Object testThis) {
        assertEquals(expected, String.valueOf(testThis));
View Full Code Here

        assertEquals("red",auto.toString());
        /* test manual alternator (use 'make()' and not 'manual()' since we define the default to be manual in toolbox.xml*/
         Alternator manual = alternatorTool.make(new String[] {"red","blue","yellow"});
        assertEquals("red",manual.toString());
        assertEquals("red",manual.toString());
        manual.shift();
        assertEquals("blue",manual.toString());
        manual.shift();
        manual.shift();
        assertEquals("red",manual.toString());
    }
View Full Code Here

         Alternator manual = alternatorTool.make(new String[] {"red","blue","yellow"});
        assertEquals("red",manual.toString());
        assertEquals("red",manual.toString());
        manual.shift();
        assertEquals("blue",manual.toString());
        manual.shift();
        manual.shift();
        assertEquals("red",manual.toString());
    }

    public @Test void testDateTool() { /* TODO still incomplete */
 
View Full Code Here

        assertEquals("red",manual.toString());
        assertEquals("red",manual.toString());
        manual.shift();
        assertEquals("blue",manual.toString());
        manual.shift();
        manual.shift();
        assertEquals("red",manual.toString());
    }

    public @Test void testDateTool() { /* TODO still incomplete */
        DateTool dateTool = (DateTool)toolbox.get("date");
View Full Code Here

        assertStringEquals("red", auto);
        /* test manual alternator (use 'make()' and not 'manual()' since we define the default to be manual in toolbox.xml*/
         Alternator manual = alternatorTool.make(new String[] {"red","blue","yellow"});
        assertStringEquals("red", manual);
        assertStringEquals("red", manual);
        manual.shift();
        assertStringEquals("blue", manual);
        manual.shift();
        manual.shift();
        assertStringEquals("red", manual);
    }
View Full Code Here

         Alternator manual = alternatorTool.make(new String[] {"red","blue","yellow"});
        assertStringEquals("red", manual);
        assertStringEquals("red", manual);
        manual.shift();
        assertStringEquals("blue", manual);
        manual.shift();
        manual.shift();
        assertStringEquals("red", manual);
    }

    protected void assertStringEquals(String expected, Object testThis) {
View Full Code Here

        assertStringEquals("red", manual);
        assertStringEquals("red", manual);
        manual.shift();
        assertStringEquals("blue", manual);
        manual.shift();
        manual.shift();
        assertStringEquals("red", manual);
    }

    protected void assertStringEquals(String expected, Object testThis) {
        assertEquals(expected, String.valueOf(testThis));
View Full Code Here

        assertTrue((Boolean)result.getNext());
        assertFalse((Boolean)result.getNext());
        assertEquals(0, result.getNext());
        assertEquals("hi", result.getNext());
        result = tool.make(new Object[] { "red", "blue" });
        result.shift();
        assertEquals("blue", result.toString());
    }

    public @Test void methodMake_booleanObjectVarArgs() throws Exception
    {
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.