Posted by Anonymous Fri 2nd Mar 2007 23:09 - Syntax is Java 5 - 132 views
Download | New Post | Modify | Hide line numbers
  1. public void testExactlyOnEndDate() throws ParseException{// Passes
  2.         String someDate = "Fri Feb 10 01:59:59 CST 2007";
  3.         SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd kk:mm:ss zzz yyyy");
  4.         date = formatter.parse(someDate);
  5.         endDate = new SimpleDateFormat("MM/dd/yyyy").parse("02/10/2007");
  6.        
  7.        
  8.         assertTrue("Date should be within range", endDate.after(date));
  9.     }
  10.    
  11.     public void testExactlyOnEndDate2() throws ParseException{ // Passes
  12.         String someDate = "Fri Feb 10 00:00:00 CST 2007";
  13.         SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd kk:mm:ss zzz yyyy");
  14.         date = formatter.parse(someDate);
  15.         endDate = new SimpleDateFormat("MM/dd/yyyy").parse("02/10/2007");
  16.        
  17.        
  18.         assertTrue("Date should be within range", endDate.after(date));
  19.     }
  20.    
  21.     public void testExactlyOnEndDate3() throws ParseException{ // Fails
  22.         String someDate = "Fri Feb 10 02:00:00 CST 2007";
  23.         SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd kk:mm:ss zzz yyyy");
  24.         date = formatter.parse(someDate);
  25.         endDate = new SimpleDateFormat("MM/dd/yyyy").parse("02/10/2007");
  26.        
  27.        
  28.         assertTrue("Date should be within range", endDate.after(date));
  29.     }

PermaLink to this entry https://pastebin.co.uk/11317
Posted by Anonymous Fri 2nd Mar 2007 23:09 - Syntax is Java 5 - 132 views
Download | New Post | Modify | Hide line numbers

 

Comments: 0