001: /*
002: * ====================================================================
003: * JAFFA - Java Application Framework For All
004: *
005: * Copyright (C) 2002 JAFFA Development Group
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: * Redistribution and use of this software and associated documentation ("Software"),
022: * with or without modification, are permitted provided that the following conditions are met:
023: * 1. Redistributions of source code must retain copyright statements and notices.
024: * Redistributions must also contain a copy of this document.
025: * 2. Redistributions in binary form must reproduce the above copyright notice,
026: * this list of conditions and the following disclaimer in the documentation
027: * and/or other materials provided with the distribution.
028: * 3. The name "JAFFA" must not be used to endorse or promote products derived from
029: * this Software without prior written permission. For written permission,
030: * please contact mail to: jaffagroup@yahoo.com.
031: * 4. Products derived from this Software may not be called "JAFFA" nor may "JAFFA"
032: * appear in their names without prior written permission.
033: * 5. Due credit should be given to the JAFFA Project (http://jaffa.sourceforge.net).
034: *
035: * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
036: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
037: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
038: * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
039: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
040: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
041: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
042: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
043: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
044: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
045: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
046: * SUCH DAMAGE.
047: * ====================================================================
048: */
049:
050: package org.jaffa.datatypes;
051:
052: import java.io.Serializable;
053: import java.util.Date;
054: import java.util.Calendar;
055: import java.util.GregorianCalendar;
056: import java.sql.Time;
057: import java.sql.Timestamp;
058: import java.text.ParseException;
059: import junit.framework.*;
060:
061: public class DateOnlyTest extends TestCase {
062:
063: public DateOnlyTest(java.lang.String testName) {
064: super (testName);
065: }
066:
067: public static void main(java.lang.String[] args) {
068: junit.textui.TestRunner.run(suite());
069: }
070:
071: public static Test suite() {
072: //TestSuite suite = new TestSuite(DateOnlyTest.class);
073: TestSuite suite = new TestSuite();
074: suite.addTest(new DateOnlyTest("testParse"));
075:
076: return suite;
077: }
078:
079: /** Test of clone method, of class org.jaffa.datatypes.DateOnly. */
080: public void testClone() {
081: System.out.println("testClone");
082:
083: // Add your test code below by replacing the default call to fail.
084: fail("The test case is empty.");
085: }
086:
087: /** Test of compareTo method, of class org.jaffa.datatypes.DateOnly. */
088: public void testCompareTo() {
089: System.out.println("testCompareTo");
090:
091: // Add your test code below by replacing the default call to fail.
092: fail("The test case is empty.");
093: }
094:
095: /** Test of equals method, of class org.jaffa.datatypes.DateOnly. */
096: public void testEquals() {
097: System.out.println("testEquals");
098:
099: // Add your test code below by replacing the default call to fail.
100: fail("The test case is empty.");
101: }
102:
103: /** Test of hashCode method, of class org.jaffa.datatypes.DateOnly. */
104: public void testHashCode() {
105: System.out.println("testHashCode");
106:
107: // Add your test code below by replacing the default call to fail.
108: fail("The test case is empty.");
109: }
110:
111: /** Test of toString method, of class org.jaffa.datatypes.DateOnly. */
112: public void testToString() {
113: System.out.println("testToString");
114:
115: // Add your test code below by replacing the default call to fail.
116: fail("The test case is empty.");
117: }
118:
119: /** Test of getTime method, of class org.jaffa.datatypes.DateOnly. */
120: public void testGetTime() {
121: System.out.println("testGetTime");
122:
123: // Add your test code below by replacing the default call to fail.
124: fail("The test case is empty.");
125: }
126:
127: /** Test of getUtilDate method, of class org.jaffa.datatypes.DateOnly. */
128: public void testGetUtilDate() {
129: System.out.println("testGetUtilDate");
130:
131: // Add your test code below by replacing the default call to fail.
132: fail("The test case is empty.");
133: }
134:
135: /** Test of getCalendar method, of class org.jaffa.datatypes.DateOnly. */
136: public void testGetCalendar() {
137: System.out.println("testGetCalendar");
138:
139: // Add your test code below by replacing the default call to fail.
140: fail("The test case is empty.");
141: }
142:
143: /** Test of getSQLDate method, of class org.jaffa.datatypes.DateOnly. */
144: public void testGetSQLDate() {
145: System.out.println("testGetSQLDate");
146:
147: // Add your test code below by replacing the default call to fail.
148: fail("The test case is empty.");
149: }
150:
151: /** Test of getSQLTime method, of class org.jaffa.datatypes.DateOnly. */
152: public void testGetSQLTime() {
153: System.out.println("testGetSQLTime");
154:
155: // Add your test code below by replacing the default call to fail.
156: fail("The test case is empty.");
157: }
158:
159: /** Test of getTimestamp method, of class org.jaffa.datatypes.DateOnly. */
160: public void testGetTimestamp() {
161: System.out.println("testGetTimestamp");
162:
163: // Add your test code below by replacing the default call to fail.
164: fail("The test case is empty.");
165: }
166:
167: /** Test of getYear method, of class org.jaffa.datatypes.DateOnly. */
168: public void testGetYear() {
169: System.out.println("testGetYear");
170:
171: // Add your test code below by replacing the default call to fail.
172: fail("The test case is empty.");
173: }
174:
175: /** Test of getMonth method, of class org.jaffa.datatypes.DateOnly. */
176: public void testGetMonth() {
177: System.out.println("testGetMonth");
178:
179: // Add your test code below by replacing the default call to fail.
180: fail("The test case is empty.");
181: }
182:
183: /** Test of getDay method, of class org.jaffa.datatypes.DateOnly. */
184: public void testGetDay() {
185: System.out.println("testGetDay");
186:
187: // Add your test code below by replacing the default call to fail.
188: fail("The test case is empty.");
189: }
190:
191: /** Test of getDayOfWeek method, of class org.jaffa.datatypes.DateOnly. */
192: public void testGetDayOfWeek() {
193: System.out.println("testGetDayOfWeek");
194:
195: // Add your test code below by replacing the default call to fail.
196: fail("The test case is empty.");
197: }
198:
199: /** Test of getDayOfWeekInMonth method, of class org.jaffa.datatypes.DateOnly. */
200: public void testGetDayOfWeekInMonth() {
201: System.out.println("testGetDayOfWeekInMonth");
202:
203: // Add your test code below by replacing the default call to fail.
204: fail("The test case is empty.");
205: }
206:
207: /** Test of getDayOfYear method, of class org.jaffa.datatypes.DateOnly. */
208: public void testGetDayOfYear() {
209: System.out.println("testGetDayOfYear");
210:
211: // Add your test code below by replacing the default call to fail.
212: fail("The test case is empty.");
213: }
214:
215: /** Test of getWeekOfMonth method, of class org.jaffa.datatypes.DateOnly. */
216: public void testGetWeekOfMonth() {
217: System.out.println("testGetWeekOfMonth");
218:
219: // Add your test code below by replacing the default call to fail.
220: fail("The test case is empty.");
221: }
222:
223: /** Test of getWeekOfYear method, of class org.jaffa.datatypes.DateOnly. */
224: public void testGetWeekOfYear() {
225: System.out.println("testGetWeekOfYear");
226:
227: // Add your test code below by replacing the default call to fail.
228: fail("The test case is empty.");
229: }
230:
231: /** Test of getFirstDayOfWeek method, of class org.jaffa.datatypes.DateOnly. */
232: public void testGetFirstDayOfWeek() {
233: System.out.println("testGetFirstDayOfWeek");
234:
235: // Add your test code below by replacing the default call to fail.
236: fail("The test case is empty.");
237: }
238:
239: /** Test of isAfter method, of class org.jaffa.datatypes.DateOnly. */
240: public void testIsAfter() {
241: System.out.println("testIsAfter");
242:
243: // Add your test code below by replacing the default call to fail.
244: fail("The test case is empty.");
245: }
246:
247: /** Test of isBefore method, of class org.jaffa.datatypes.DateOnly. */
248: public void testIsBefore() {
249: System.out.println("testIsBefore");
250:
251: // Add your test code below by replacing the default call to fail.
252: fail("The test case is empty.");
253: }
254:
255: /** Test of getJulian method, of class org.jaffa.datatypes.DateOnly. */
256: public void testGetJulian() {
257: System.out.println("testGetJulian");
258:
259: // Add your test code below by replacing the default call to fail.
260: fail("The test case is empty.");
261: }
262:
263: /** Test of addYear method, of class org.jaffa.datatypes.DateOnly. */
264: public void testAddYear() {
265: System.out.println("testAddYear");
266:
267: // Add your test code below by replacing the default call to fail.
268: fail("The test case is empty.");
269: }
270:
271: /** Test of addMonth method, of class org.jaffa.datatypes.DateOnly. */
272: public void testAddMonth() {
273: System.out.println("testAddMonth");
274:
275: // Add your test code below by replacing the default call to fail.
276: fail("The test case is empty.");
277: }
278:
279: /** Test of addDay method, of class org.jaffa.datatypes.DateOnly. */
280: public void testAddDay() {
281: System.out.println("testAddDay");
282:
283: // Add your test code below by replacing the default call to fail.
284: fail("The test case is empty.");
285: }
286:
287: /** Test of daysBetween method, of class org.jaffa.datatypes.DateOnly. */
288: public void testDaysBetween() {
289: System.out.println("testDaysBetween");
290:
291: // Add your test code below by replacing the default call to fail.
292: fail("The test case is empty.");
293: }
294:
295: /** Test of toDateTime method, of class org.jaffa.datatypes.DateOnly. */
296: public void testToDateTime() {
297: System.out.println("testToDateTime");
298:
299: // Add your test code below by replacing the default call to fail.
300: fail("The test case is empty.");
301: }
302:
303: /** Test of parse method, of class org.jaffa.datatypes.DateOnly. */
304: public void testParse() {
305: System.out.println("testParse");
306:
307: try {
308: System.out.println("t: " + DateOnly.parse("t"));
309: System.out.println("n: " + DateOnly.parse("n"));
310: System.out.println("n+1: " + DateOnly.parse("n+1"));
311: System.out.println("n-1: " + DateOnly.parse("n-1"));
312: System.out.println("n+1: " + DateOnly.parse("n+1"));
313: System.out.println("n+1m1: " + DateOnly.parse("n+1m1"));
314: System.out.println("n+1m1d-1y2: "
315: + DateOnly.parse("n+1m1d-1y2"));
316: System.out.println("null: " + DateOnly.parse(null));
317: System.out.println("Empty String: " + DateOnly.parse(""));
318:
319: } catch (Exception e) {
320: e.printStackTrace();
321: fail();
322: }
323:
324: // Add your test code below by replacing the default call to fail.
325: //fail("The test case is empty.");
326: }
327:
328: }
|