diff --git a/dist/boda-ztexlscmparser.jar b/dist/boda-ztexlscmparser.jar index 63a91a4..0fab186 100644 Binary files a/dist/boda-ztexlscmparser.jar and b/dist/boda-ztexlscmparser.jar differ diff --git a/pom.xml b/pom.xml index dd36bec..9e2765c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.bodastage.cm boda-ztexlscmparser - 1.2.1-SNAPSHOT + 1.2.2-SNAPSHOT jar UTF-8 @@ -48,27 +48,28 @@ - - maven-assembly-plugin - - - - com.bodastage.boda_ztexmlcmparser.ZTEXLSCMParser - - - - jar-with-dependencies - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - com.bodastage.boda_ztexmlcmparser.ZTEXLSCMParser - - + + maven-assembly-plugin + + + + com.bodastage.boda_ztexmlcmparser.ZTEXLSCMParser + + + + jar-with-dependencies + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + com.bodastage.boda_ztexmlcmparser.ZTEXLSCMParser + + + boda-ztexlscmparser-pr \ No newline at end of file diff --git a/src/main/java/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParser.java b/src/main/java/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParser.java index 7bff689..cbf4a87 100644 --- a/src/main/java/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParser.java +++ b/src/main/java/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParser.java @@ -51,7 +51,7 @@ public class ZTEXLSCMParser { * * Since 1.3.0 */ - final static String VERSION = "1.2.1"; + final static String VERSION = "1.2.2"; private static final Logger LOGGER = LoggerFactory.getLogger(ZTEXLSCMParser.class); diff --git a/src/main/java/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParserTest.java b/src/test/resources/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParserTest.java similarity index 67% rename from src/main/java/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParserTest.java rename to src/test/resources/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParserTest.java index a6934c4..f81751e 100644 --- a/src/main/java/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParserTest.java +++ b/src/test/resources/com/bodastage/boda_ztexmlcmparser/ZTEXLSCMParserTest.java @@ -16,6 +16,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.slf4j.LoggerFactory; /** * @@ -23,10 +24,12 @@ */ public class ZTEXLSCMParserTest extends TestCase { - void testGeneralParsing(){ + private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ZTEXLSCMParser.class); + + public void testGeneralParsing(){ ClassLoader classLoader = getClass().getClassLoader(); - File inFile = new File(classLoader.getResource("tempaltedata.xlsx").getFile()); + File inFile = new File(classLoader.getResource("templatedata.xlsx").getFile()); String inputFile = inFile.getAbsolutePath(); String outputFolder = System.getProperty("java.io.tmpdir"); @@ -39,24 +42,32 @@ void testGeneralParsing(){ String expectedResult [] = { "FileName,varDateTime,NeType,TemplateType,TemplateVersion,DataType,SomeMO1Param1,SomeMO1Param2,SomeMO1Param3", - "templatedata.xlsx,2019-07-14 09:05:16,Multi-mode Controller,Plan,V0123,tech_radio,1,2,3", - "templatedata.xlsx,2019-07-14 09:05:16,Multi-mode Controller,Plan,V0123,tech_radio,4,5,6" + "templatedata.xlsx,YYYY-MM-DD HH:MI:SS,Multi-mode Controller,Plan,V0123,tech_radio,1,2,3", + "templatedata.xlsx,YYYY-MM-DD HH:MI:SS,Multi-mode Controller,Plan,V0123,tech_radio,4,5,6" }; try{ - String csvFile = outputFolder + File.separator + "vsDataSomeMO.csv"; + String csvFile = outputFolder + File.separator + "SomeMO1.csv"; BufferedReader br = new BufferedReader(new FileReader(csvFile)); - String csvResult [] = new String[2]; + String csvResult [] = new String[3]; int i = 0; String st; while ((st = br.readLine()) != null) { - csvResult[i] = st; + //Repalce the date with YYYY-MM-DD HH:MI:SS as the parser generates + //as unique datetime whenever it runs + String c [] = st.split(","); + c[1] = "YYYY-MM-DD HH:MI:SS"; + + csvResult[i] = ""; + for(int idx =0; idx < c.length; idx++){ + if( idx > 0) csvResult[idx] += ","; + csvResult[i] += c[idx]; + } i++; } - assertTrue(Arrays.equals(expectedResult, csvResult)); }catch(FileNotFoundException ex){