Author: fdesbois Date: 2010-10-03 14:39:45 +0000 (Sun, 03 Oct 2010) New Revision: 649 Log: Use DateUtil from Nuiton-utils Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/io/ImportHelperTest.java Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/io/ImportHelperTest.java =================================================================== --- trunk/wao-business/src/test/java/fr/ifremer/wao/io/ImportHelperTest.java 2010-10-03 14:27:26 UTC (rev 648) +++ trunk/wao-business/src/test/java/fr/ifremer/wao/io/ImportHelperTest.java 2010-10-03 14:39:45 UTC (rev 649) @@ -25,30 +25,32 @@ package fr.ifremer.wao.io; -import fr.ifremer.wao.*; import com.csvreader.CsvReader; +import fr.ifremer.wao.TestManager; import fr.ifremer.wao.io.csv.ImportHelper; import fr.ifremer.wao.io.csv.WaoCsvHeader.CONTACT; import fr.ifremer.wao.io.csv.WaoCsvHeader.DatedHeader; import fr.ifremer.wao.io.csv.WaoCsvHeader.SAMPLING; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.Locale; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.nuiton.util.DateUtils; -import static org.junit.Assert.*; +import org.nuiton.util.DateUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.Locale; + +import static org.junit.Assert.assertEquals; + /** * * @author fdesbois <fdesbois at codelutin.com> @@ -92,38 +94,6 @@ } /** - * Test of getHeaderForContactCsv method, of class ImportHelper. - */ - //@Test - public void testGetHeaderForContactCsv() { - System.out.println("getHeaderForContactCsv"); - } - - /** - * Test of formatContactValidation method, of class ImportHelper. - */ - //@Test - public void testFormatContactValidation() { - System.out.println("formatContactValidation"); - } - - /** - * Test of formatContactMammals method, of class ImportHelper. - */ - //@Test - public void testFormatContactMammals() { - System.out.println("formatContactMammals"); - } - - /** - * Test of parseContactMammals method, of class ImportHelper. - */ - //@Test - public void testParseContactMammals() { - System.out.println("parseContactMammals"); - } - - /** * Test of formatContactCode method, of class ImportHelper. */ @Test @@ -143,6 +113,7 @@ /** * Test of parseContactCreateDate method, of class ImportHelper. + * @throws Exception all exceptions are thrown */ @Test public void testParseContactCreateDate() throws Exception { @@ -156,29 +127,14 @@ calendar.set(Calendar.SECOND, 50); calendar.set(Calendar.MILLISECOND, 718); Date expResult = calendar.getTime(); - Date date = DateUtils.createDate(23,10,2009); + Date date = DateUtil.createDate(23,10,2009); Date result = ImportHelper.parseContactCreateDate(code, date); assertEquals(expResult, result); } /** - * Test of logTimeAndMemory method, of class ImportHelper. - */ - //@Test - public void testLogTimeAndMemory() { - System.out.println("logTimeAndMemory"); - } - - /** - * Test of parseContactValidation method, of class ImportHelper. - */ - //@Test - public void testParseContactValidation() throws Exception { - System.out.println("parseContactValidation"); - } - - /** * Test of readSampleRowCode method, of class ImportHelper. + * @throws Exception all exceptions are thrown */ @Test public void testReadSampleRowCode() throws Exception { @@ -202,15 +158,8 @@ } /** - * Test of getContactDateFormat method, of class ImportHelper. - */ - //@Test - public void testGetContactDateFormat() { - System.out.println("getContactDateFormat"); - } - - /** * Test of read method, of class ImportHelper. + * @throws Exception all exceptions are thrown */ @Test public void testRead() throws Exception { @@ -222,31 +171,8 @@ } /** - * Test of readInt method, of class ImportHelper. - */ - //@Test - public void testReadInt() throws Exception { - System.out.println("readInt"); - } - - /** - * Test of readInteger method, of class ImportHelper. - */ - //@Test - public void testReadInteger() throws Exception { - System.out.println("readInteger"); - } - - /** - * Test of readPeriod method, of class ImportHelper. - */ - //@Test - public void testReadPeriod() throws Exception { - System.out.println("readPeriod"); - } - - /** * Test of readDate method, of class ImportHelper. + * @throws Exception all exceptions are thrown */ @Test public void testReadDate() throws Exception { @@ -275,7 +201,7 @@ }; Date res = ImportHelper.readDate(reader, header1); - Date ref = DateUtils.createDate(10, 2, 2010); + Date ref = DateUtil.createDate(10, 2, 2010); Assert.assertEquals(ref, res); // TEST2 : Date like JJ/MM/AA @@ -312,7 +238,7 @@ }; res = ImportHelper.readDate(reader, header3); - Date ref2 = DateUtils.createDate(1, 2, 2010); + Date ref2 = DateUtil.createDate(1, 2, 2010); Assert.assertEquals(ref2, res); // TEST4: date like JJ/MM/AA