1 30 package test.pdfbox.util; 31 32 import java.io.IOException ; 33 import java.util.GregorianCalendar ; 34 35 import junit.framework.Test; 36 import junit.framework.TestCase; 37 import junit.framework.TestSuite; 38 39 import org.pdfbox.util.DateConverter; 40 41 47 public class TestDateUtil extends TestCase 48 { 49 56 public TestDateUtil( String name ) throws IOException 57 { 58 super( name ); 59 } 60 61 66 public void testExtract() 67 throws Exception 68 { 69 assertEquals( DateConverter.toCalendar( "D:05/12/2005" ), new GregorianCalendar ( 2005, 4, 12 ) ); 70 assertEquals( DateConverter.toCalendar( "5/12/2005 15:57:16" ), new GregorianCalendar ( 2005, 4,12,15,57,16 ) ); 71 } 72 73 78 public static Test suite() 79 { 80 return new TestSuite( TestDateUtil.class ); 81 } 82 83 88 public static void main( String [] args ) 89 { 90 String [] arg = {TestDateUtil.class.getName() }; 91 junit.textui.TestRunner.main( arg ); 92 } 93 } | Popular Tags |