コード例 #1
0
 public void test_Date_setMinute() {
   Date date = new Date(2005, 12, 30, 12, 15, 45, 1, 2, 0);
   assertTrue(date != null);
   int i = date.setMinute(434);
   assertTrue(i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE);
   assertTrue(date.getMinute() == 0);
   i = date.setMinute(12121);
   assertTrue(i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE);
   assertTrue(date.getMinute() == 0);
   i = date.setMinute(32);
   assertTrue(i == libsbml.LIBSBML_OPERATION_SUCCESS);
   assertTrue(date.getMinute() == 32);
   assertTrue(date.getDateAsString().equals("2005-12-30T12:32:45+02:00"));
   date = null;
 }
コード例 #2
0
 public void test_Date_setDateAsString() {
   Date date = new Date(2007, 10, 23, 14, 15, 16, 1, 3, 0);
   assertTrue(date != null);
   int i = date.setDateAsString("20081-12-30T12:15:45+02:00");
   assertTrue(i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE);
   assertTrue(date.getDateAsString().equals("2007-10-23T14:15:16+03:00"));
   i = date.setDateAsString("200-12-30T12:15:45+02:00");
   assertTrue(i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE);
   assertTrue(date.getDateAsString().equals("2007-10-23T14:15:16+03:00"));
   i = date.setDateAsString("");
   assertTrue(i == libsbml.LIBSBML_OPERATION_SUCCESS);
   assertTrue(date.getDateAsString().equals("2000-01-01T00:00:00Z"));
   i = date.setDateAsString("2008-12-30T12:15:45+02:00");
   assertTrue(i == libsbml.LIBSBML_OPERATION_SUCCESS);
   assertTrue(date.getYear() == 2008);
   assertTrue(date.getMonth() == 12);
   assertTrue(date.getDay() == 30);
   assertTrue(date.getHour() == 12);
   assertTrue(date.getMinute() == 15);
   assertTrue(date.getSecond() == 45);
   assertTrue(date.getSignOffset() == 1);
   assertTrue(date.getHoursOffset() == 2);
   assertTrue(date.getMinutesOffset() == 0);
   date = null;
 }