diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index be5dc0b..496b2e0 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -51,7 +51,9 @@ maven-surefire-plugin - -Duser.timezone=UTC + + UTC + @@ -82,6 +84,7 @@ verify + -Duser.timezone=UTC ${project.build.directory}/${project.build.finalName}-runner diff --git a/integration-tests/src/main/java/io/quarkiverse/univocityparsers/it/UnivocityParsersResource.java b/integration-tests/src/main/java/io/quarkiverse/univocityparsers/it/UnivocityParsersResource.java index 0c5a4c9..b118482 100644 --- a/integration-tests/src/main/java/io/quarkiverse/univocityparsers/it/UnivocityParsersResource.java +++ b/integration-tests/src/main/java/io/quarkiverse/univocityparsers/it/UnivocityParsersResource.java @@ -55,6 +55,7 @@ public Response csvParse(@FormParam("fromClassPathFile") final String fromClassP throws IOException, ClassNotFoundException, InterruptedException { List generatedRows = new ArrayList<>(); + log.infof("Univocity parsers resource timezone: [%s]", System.getProperty("user.timezone")); // For determining parsing ending int lines = 0; diff --git a/integration-tests/src/main/resources/application.properties b/integration-tests/src/main/resources/application.properties index 3c7ac7f..351ed7d 100644 --- a/integration-tests/src/main/resources/application.properties +++ b/integration-tests/src/main/resources/application.properties @@ -1,2 +1,5 @@ quarkus.native.resources.includes=example.csv -quarkus.native.add-all-charsets=true \ No newline at end of file +# Use this property bellow if you should use a non already prepackaged charset in native image +quarkus.native.add-all-charsets=true +# Use this property bellow if you should use a non already prepackaged timezone in native image +quarkus.native.additional-build-args=-H:+IncludeAllTimeZones \ No newline at end of file diff --git a/integration-tests/src/test/java/io/quarkiverse/univocityparsers/it/UnivocityParsersResourceTest.java b/integration-tests/src/test/java/io/quarkiverse/univocityparsers/it/UnivocityParsersResourceTest.java index 9823f6b..368d478 100644 --- a/integration-tests/src/test/java/io/quarkiverse/univocityparsers/it/UnivocityParsersResourceTest.java +++ b/integration-tests/src/test/java/io/quarkiverse/univocityparsers/it/UnivocityParsersResourceTest.java @@ -19,8 +19,8 @@ public class UnivocityParsersResourceTest { @Test public void testExampleCsvFile() { - assertEquals("UTC", System.getProperty("user.timezone")); + assertEquals("UTC", System.getProperty("user.timezone")); Map formParams = new HashMap<>(); formParams.put("fromClassPathFile", EXAMPLE_CSV_FILE); formParams.put("toClassPathClass", CSVFileExample.class.getName()); @@ -41,46 +41,49 @@ public void testExampleCsvFile() { * * @return */ - private Map generatedExceptedCSVFileExamples() { + protected Map generatedExceptedCSVFileExamples() { + boolean isNativeTesting = System.getProperty("native") != null; + Map jsonStringResult = new HashMap<>(); StringBuilder builder = new StringBuilder(); - jsonStringResult.put("\"DMEADRA-DA\"", builder.append( + builder.append( "{\"admin\":").append(true).append(",") .append("\"billable\":").append(true).append(",") - .append("\"code\":").append("\"DMEADRA-DA\"").append(",") - .append("\"createdAt\":").append("\"2015-10-30T00:00:00Z[UTC]\"").append(",") - .append("\"date\":").append("\"2017-09-21\"").append(",") + .append("\"code\":").append("\"DMEADRA-DA\"").append(","); + builder.append("\"createdAt\":").append("\"2015-10-30T00:00:00Z[UTC]\"").append(","); + builder.append("\"date\":").append("\"2017-09-21\"").append(",") .append("\"fees\":").append("12.90").append(",") .append("\"profile\":").append(9876543211L).append(",") .append("\"stars\":").append(143).append(",") .append("\"type\":").append("\"USER\"").append(",") .append("\"user\":").append("\"ROGER\"").append(",") .append("\"weight\":").append(159.7).append(",") - .append("\"years\":").append(2017).append("}") - .toString()); + .append("\"years\":").append(2017).append("}"); + jsonStringResult.put("\"DMEADRA-DA\"", builder.toString()); builder.setLength(0); - jsonStringResult.put("\"DMEADRA-DB\"", builder.append( + builder.append( "{\"admin\":").append(true).append(",") .append("\"billable\":").append(false).append(",") - .append("\"code\":").append("\"DMEADRA-DB\"").append(",") - .append("\"createdAt\":").append("\"2001-01-21T00:00:00Z[UTC]\"").append(",") - .append("\"date\":").append("\"2018-09-21\"").append(",") + .append("\"code\":").append("\"DMEADRA-DB\"").append(","); + builder.append("\"createdAt\":").append("\"2001-01-21T00:00:00Z[UTC]\"").append(","); + builder.append("\"date\":").append("\"2018-09-21\"").append(",") .append("\"fees\":").append("0.00").append(",") .append("\"profile\":").append(9876543212L).append(",") .append("\"type\":").append("\"SYSTEM\"").append(",") .append("\"user\":").append("\"MICKAEL\"").append(",") .append("\"weight\":").append(169.7).append(",") .append("\"years\":").append(2018).append("}") - .toString()); + .toString(); + jsonStringResult.put("\"DMEADRA-DB\"", builder.toString()); builder.setLength(0); - jsonStringResult.put("\"DMEADRA-DC\"", builder.append( + builder.append( "{\"admin\":").append(false).append(",") .append("\"billable\":").append(false).append(",") - .append("\"code\":").append("\"DMEADRA-DC\"").append(",") - .append("\"createdAt\":").append("\"2002-05-09T00:00:00Z[UTC]\"").append(",") - .append("\"date\":").append("\"2019-09-21\"").append(",") + .append("\"code\":").append("\"DMEADRA-DC\"").append(","); + builder.append("\"createdAt\":").append("\"2002-05-09T00:00:00Z[UTC]\"").append(","); + builder.append("\"date\":").append("\"2019-09-21\"").append(",") .append("\"fees\":").append(98.9078).append(",") .append("\"profile\":").append(9876543213L).append(",") .append("\"stars\":").append(1).append(",") @@ -88,15 +91,16 @@ private Map generatedExceptedCSVFileExamples() { .append("\"user\":").append("\"LUCAS\"").append(",") .append("\"weight\":").append(179.7).append(",") .append("\"years\":").append(2019).append("}") - .toString()); + .toString(); + jsonStringResult.put("\"DMEADRA-DC\"", builder.toString()); builder.setLength(0); - jsonStringResult.put("\"DMEADRA-DD\"", builder.append( + builder.append( "{\"admin\":").append(false).append(",") .append("\"billable\":").append(true).append(",") - .append("\"code\":").append("\"DMEADRA-DD\"").append(",") - .append("\"createdAt\":").append("\"2017-12-30T00:00:00Z[UTC]\"").append(",") - .append("\"date\":").append("\"2020-08-20\"").append(",") + .append("\"code\":").append("\"DMEADRA-DD\"").append(","); + builder.append("\"createdAt\":").append("\"2017-12-30T00:00:00Z[UTC]\"").append(","); + builder.append("\"date\":").append("\"2020-08-20\"").append(",") .append("\"fees\":").append(0.15).append(",") .append("\"profile\":").append(9876543214L).append(",") .append("\"stars\":").append(9999).append(",") @@ -104,15 +108,16 @@ private Map generatedExceptedCSVFileExamples() { .append("\"user\":").append("\"PHILIPPE\"").append(",") .append("\"weight\":").append(189.7).append(",") .append("\"years\":").append(2020).append("}") - .toString()); + .toString(); + jsonStringResult.put("\"DMEADRA-DD\"", builder.toString()); builder.setLength(0); - jsonStringResult.put("\"DMEADRA-DE\"", builder.append( + builder.append( "{\"admin\":").append(true).append(",") .append("\"billable\":").append(false).append(",") - .append("\"code\":").append("\"DMEADRA-DE\"").append(",") - .append("\"createdAt\":").append("\"1999-11-15T00:00:00Z[UTC]\"").append(",") - .append("\"date\":").append("\"2021-08-20\"").append(",") + .append("\"code\":").append("\"DMEADRA-DE\"").append(","); + builder.append("\"createdAt\":").append("\"1999-11-15T00:00:00Z[UTC]\"").append(","); + builder.append("\"date\":").append("\"2021-08-20\"").append(",") .append("\"fees\":").append("3999.90").append(",") .append("\"profile\":").append(9876543215L).append(",") .append("\"stars\":").append(2147483647).append(",") @@ -120,8 +125,8 @@ private Map generatedExceptedCSVFileExamples() { .append("\"user\":").append("\"JEAN-CLAUDE\"").append(",") .append("\"weight\":").append(199.7).append(",") .append("\"years\":").append(2021).append("}") - .toString()); - builder.setLength(0); + .toString(); + jsonStringResult.put("\"DMEADRA-DE\"", builder.toString()); return jsonStringResult; } }