1 4 package org.oddjob.designer.elements; 5 6 import java.util.Date ; 7 8 import junit.framework.TestCase; 9 10 import org.oddjob.designer.elements.date.DateTimeAttribute; 11 import org.oddjob.designer.elements.date.TimeZoneAttribute; 12 import org.oddjob.util.DateHelper; 13 import org.oddjob.values.types.DateType; 14 15 18 public class DateDETest extends TestCase { 19 20 public void test1() throws Exception { 21 22 DateTimeAttribute f1 = new DateTimeAttribute(); 23 f1.attribute("25-dec-05 10:50"); 24 25 TimeZoneAttribute f2 = new TimeZoneAttribute(); 26 f2.attribute("Europe/London"); 27 28 DateDE de = new DateDE(); 29 de.setDate(f1); 30 de.setTimeZone(f2); 31 32 DateType t = de.toType(); 33 Date d = t.valueFor(null); 34 35 assertEquals(DateHelper.parseDateTime("25-dec-05 10:50"), d); 36 } 37 } 38 | Popular Tags |