If anyone can assist me with this one I would be VERY grateful:

When I do a save() the DATE field in the database table has not had its
Hours Min or Seconds set.

So I am expecting a date with a time (eg 10am ) but get one with no time.


Here is the test case that fails:

    public void testInsert() throws Exception {
        Country c = new Country();
        c.setCountryId(new StringKey("TEST"));
        c.setCountryDesc("Test Country");
        Date date = new GregorianCalendar(2002,0,11,10,5,0).getTime(); //
fails also with = new Date()
        c.setCountryStartDate(date);
        c.setCurrencyCode("TST");
        c.save();

        // check date
        List countryList = CountryPeer.doSelect(new
Criteria().add(CountryPeer.COUNTRY_ID, new StringKey("TEST")));
        assert("should have exactly 1 county inserted",
countryList.size()==1);
        Country result = (Country) countryList.get(0);
        assertEquals("description not inserted", "Test Country",
result.getCountryDesc());
        assertEquals("date should be exact match", date.getTime(),
result.getCountryStartDate().getTime());


    }

failing with "date should be exact match"...


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to