Package net.sf.jsqlparser.expression

Examples of net.sf.jsqlparser.expression.DateValue.accept()


    public void testVisit_DateValue() {
        LOG.info("visit(DateValue):");
        String dateStr = "1995-01-01";
        Date squallDate = new DateConversion().fromString(dateStr);
        Expression exp = new DateValue(" " + dateStr + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, squallDate);
    }
   
    @Test
View Full Code Here


        Date END_DATE = _dtc.fromString("1998-12-31");
        Date orderDateEnd = new DateSum(new ValueSpecification(_dtc, END_DATE), Calendar.DATE, -151).eval(null);
       
        String dateExp = "1998-08-02";
        Expression exp = new DateValue(" " + dateExp + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, orderDateEnd);
    }
   
    @Test
View Full Code Here

        Date END_DATE = _dtc.fromString("1998-12-31");
        Date orderDateEnd = new DateSum(new ValueSpecification(_dtc, END_DATE), Calendar.DATE, -30).eval(null);
       
        String dateExp = "1998-12-01";
        Expression exp = new DateValue(" " + dateExp + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, orderDateEnd);
    }   
   
    @Test
View Full Code Here

        Date END_DATE = _dtc.fromString("1998-12-31");
        Date orderDateEnd = new DateSum(new ValueSpecification(_dtc, END_DATE), Calendar.DATE, -61).eval(null);
       
        String dateExp = "1998-10-31";
        Expression exp = new DateValue(" " + dateExp + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, orderDateEnd);
   
   
    @Test
View Full Code Here

        Date END_DATE = _dtc.fromString("1998-12-31");
        Date orderDateEnd = new DateSum(new ValueSpecification(_dtc, END_DATE), Calendar.DATE, -121).eval(null);
       
        String dateExp = "1998-09-01";
        Expression exp = new DateValue(" " + dateExp + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, orderDateEnd);
    }   
}
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.