tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From radcor...@apache.org
Subject [tomee] 03/05: TOMEE-2428 - add print statement to test, modified date and locale
Date Thu, 03 Jan 2019 19:44:19 GMT
This is an automated email from the ASF dual-hosted git repository.

radcortez pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 01081475d958aea207178f4080e3f6821f2b842a
Author: Mariani Federico <federico.mariani.1990@gmail.com>
AuthorDate: Mon Dec 31 02:13:22 2018 +0100

    TOMEE-2428 - add print statement to test, modified date and locale
---
 .../jsonb-configuration/src/main/java/org/superbiz/model/User.java | 2 +-
 .../src/test/java/org/superbiz/rest/UserServiceTest.java           | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/examples/jsonb-configuration/src/main/java/org/superbiz/model/User.java b/examples/jsonb-configuration/src/main/java/org/superbiz/model/User.java
index f001495..3626463 100644
--- a/examples/jsonb-configuration/src/main/java/org/superbiz/model/User.java
+++ b/examples/jsonb-configuration/src/main/java/org/superbiz/model/User.java
@@ -6,7 +6,7 @@ public class User {
 
 	private Integer id;
 	private String name;
-	private Date registration = new Date();
+	private Date registration = new Date(1234);
 
 	public User(Integer id, String name) {
 		super();
diff --git a/examples/jsonb-configuration/src/test/java/org/superbiz/rest/UserServiceTest.java
b/examples/jsonb-configuration/src/test/java/org/superbiz/rest/UserServiceTest.java
index 6ee1c24..e6f88cb 100644
--- a/examples/jsonb-configuration/src/test/java/org/superbiz/rest/UserServiceTest.java
+++ b/examples/jsonb-configuration/src/test/java/org/superbiz/rest/UserServiceTest.java
@@ -3,6 +3,7 @@ package org.superbiz.rest;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Locale;
 
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.openejb.jee.WebApp;
@@ -31,10 +32,12 @@ public class UserServiceTest {
 		final String message = WebClient.create("http://localhost:4204").path("/test/api/users").get(String.class);
 		System.out.println(message);
 
-		final SimpleDateFormat sdf = new SimpleDateFormat("yyyy - MM - dd");
+		final SimpleDateFormat sdf = new SimpleDateFormat("yyyy - MM - dd", Locale.ENGLISH);
 
+		String assertDate = sdf.format(new Date(1234));
+		System.out.println(assertDate);
 		// test withDateFormat("yyyy - MM - dd")
-		Assert.assertTrue(message.contains(sdf.format(new Date())));
+		Assert.assertTrue(message.contains(assertDate));
 		// test withFormatting(true)
 		Assert.assertTrue(message.contains(System.getProperty("line.separator")));
 	}


Mime
View raw message