From: <nic...@us...> - 2003-09-03 10:38:48
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/scratchpad/org/krysalis/jcharts/gantt In directory sc8-pr-cvs1:/tmp/cvs-serv9402/src/scratchpad/org/krysalis/jcharts/gantt Added Files: DateHandlerTest.java Log Message: Initial Testcase for DateHandler. --- NEW FILE: DateHandlerTest.java --- /* * Created on 3-set-2003 */ package org.krysalis.jcharts.gantt; import java.util.*; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import junit.framework.Assert; import junit.framework.TestCase; /** * @author barozzink */ public class DateHandlerTest extends TestCase { DateHandler dh; private final static DateFormat dateStampFormat = new SimpleDateFormat("yyyyMMdd"); //TRANSFORMING WEEK: 39 into: Mon Sep 22 10:36:32 CEST 2003 //TRANSFORMING WEEK: 40 into: Wed Sep 03 10:36:32 CEST 2003 public static void main(String[] args) { junit.swingui.TestRunner.run(DateHandlerTest.class); } /* * @see TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); Date startDate = dateStampFormat.parse("20030616"); Date endDate = dateStampFormat.parse("20031029"); dh = new DateHandler(startDate,endDate); } /* * @see TestCase#tearDown() */ protected void tearDown() throws Exception { super.tearDown(); } /** * Constructor for DateHandlerTest. * @param arg0 */ public DateHandlerTest(String arg0) { super(arg0); } final public void testGetStringDateFromWeek() throws ParseException { //TODO Implement getStringDateFromWeek(). //TRANSFORMING WEEK: 39 into: Mon Sep 22 10:36:32 CEST 2003 String result = DateHandler.getStringDateFromWeek(39, true); Assert.assertEquals(result, "20030922"); //TRANSFORMING WEEK: 40 into: Fri Oct 03 10:36:32 CEST 2003 result = DateHandler.getStringDateFromWeek(40, false); Assert.assertEquals(result, "20031003"); } } |