Package org.apache.velocity.tools.generic

Examples of org.apache.velocity.tools.generic.ComparisonDateTool


    context.put("number", new NumberTool());
    context.put("render", new RenderTool());
    context.put("sorter", new SortTool());
    context.put("math", new MathTool());
    context.put("alternator", new AlternatorTool());
    context.put("comparisonDate", new ComparisonDateTool());
    context.put("iterator", new IteratorTool());
    context.put("parser", new ValueParser());
  }
View Full Code Here


            frenchTool.get("hello.whoever").insert(frenchTool.get("world"));
        assertStringEquals("Bonjour Monde!", frenchHelloWorld);
    }

    public @Test void testComparisonDateTool() { /* TODO still incomplete */
        ComparisonDateTool dateTool = (ComparisonDateTool)toolbox.get("date");
        assertNotNull(dateTool);
        Calendar date1 = new GregorianCalendar(2007,0,2);
        Calendar date2 = new GregorianCalendar(2007,1,15);
        /* test comparing */
        ComparisonDateTool.Comparison whenIs = dateTool.whenIs(date1, date2);
        assertEquals(0l, whenIs.getYears());
        assertEquals(1l, whenIs.getMonths());
        assertEquals(44l, whenIs.getDays());
        // the toolbox config says to skip months, so this should be in weeks
        assertStringEquals("6 weeks later", whenIs);
View Full Code Here

            frenchTool.get("hello.whoever").insert(frenchTool.get("world"));
        assertStringEquals("Bonjour Monde!", frenchHelloWorld);
    }

    public @Test void testComparisonDateTool() { /* TODO still incomplete */
        ComparisonDateTool dateTool = (ComparisonDateTool)toolbox.get("date");
        assertNotNull(dateTool);
        Calendar date1 = new GregorianCalendar(2007,0,2);
        Calendar date2 = new GregorianCalendar(2007,1,15);
        /* test comparing */
        ComparisonDateTool.Comparison whenIs = dateTool.whenIs(date1, date2);
        assertEquals(0l, whenIs.getYears());
        assertEquals(1l, whenIs.getMonths());
        assertEquals(44l, whenIs.getDays());
        // the toolbox config says to skip months, so this should be in weeks
        assertStringEquals("6 weeks later", whenIs);
View Full Code Here

            frenchTool.get("hello.whoever").insert(frenchTool.get("world"));
        assertStringEquals("Bonjour Monde!", frenchHelloWorld);
    }

    public @Test void testComparisonDateTool() { /* TODO still incomplete */
        ComparisonDateTool dateTool = (ComparisonDateTool)toolbox.get("date");
        assertNotNull(dateTool);
        Calendar date1 = new GregorianCalendar(2007,0,2);
        Calendar date2 = new GregorianCalendar(2007,1,15);
        /* test comparing */
        ComparisonDateTool.Comparison whenIs = dateTool.whenIs(date1, date2);
        assertEquals(0l, whenIs.getYears());
        assertEquals(1l, whenIs.getMonths());
        assertEquals(44l, whenIs.getDays());
        // the toolbox config says to skip months, so this should be in weeks
        assertStringEquals("6 weeks later", whenIs);
View Full Code Here

            frenchTool.get("hello.whoever").insert(frenchTool.get("world"));
        assertStringEquals("Bonjour Monde!", frenchHelloWorld);
    }

    public @Test void testComparisonDateTool() { /* TODO still incomplete */
        ComparisonDateTool dateTool = (ComparisonDateTool)toolbox.get("date");
        assertNotNull(dateTool);
        Calendar date1 = new GregorianCalendar(2007,0,2);
        Calendar date2 = new GregorianCalendar(2007,1,15);
        /* test comparing */
        ComparisonDateTool.Comparison whenIs = dateTool.whenIs(date1, date2);
        assertEquals(0l, whenIs.getYears());
        assertEquals(1l, whenIs.getMonths());
        assertEquals(44l, whenIs.getDays());
        // the toolbox config says to skip months, so this should be in weeks
        assertStringEquals("6 weeks later", whenIs);
View Full Code Here

            frenchTool.get("hello.whoever").insert(frenchTool.get("world"));
        assertStringEquals("Bonjour Monde!", frenchHelloWorld);
    }

    public @Test void testComparisonDateTool() { /* TODO still incomplete */
        ComparisonDateTool dateTool = (ComparisonDateTool)toolbox.get("date");
        assertNotNull(dateTool);
        Calendar date1 = new GregorianCalendar(2007,0,2);
        Calendar date2 = new GregorianCalendar(2007,1,15);
        /* test comparing */
        ComparisonDateTool.Comparison whenIs = dateTool.whenIs(date1, date2);
        assertEquals(0l, whenIs.getYears());
        assertEquals(1l, whenIs.getMonths());
        assertEquals(44l, whenIs.getDays());
        // the toolbox config says to skip months, so this should be in weeks
        assertStringEquals("6 weeks later", whenIs);
View Full Code Here

TOP

Related Classes of org.apache.velocity.tools.generic.ComparisonDateTool

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.