You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Thomas Christensen (JIRA)" <ta...@jakarta.apache.org> on 2007/01/04 17:33:27 UTC

[jira] Created: (TAPESTRY-1223) Integration tests in tapestry-core fails because of differences in date formats (locale)

Integration tests in tapestry-core fails because of differences in date formats (locale)
----------------------------------------------------------------------------------------

                 Key: TAPESTRY-1223
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1223
             Project: Tapestry
          Issue Type: Bug
          Components: Core
    Affects Versions: 5.0
         Environment: Mac OSX, Danish locale, Tapestry v5.0 snapshot 3rd of Jan 2007
            Reporter: Thomas Christensen
            Priority: Trivial
             Fix For: 5.0


The integration tests fails with the following message:
-------------------------------------------------------------------------------
Test set: Tapestry Core
-------------------------------------------------------------------------------
Tests run: 501, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 89.77 sec <<< FAILURE!
org.apache.tapestry.integration.IntegrationTests.instance_mixin(org.apache.tapestry.integration.IntegrationTests.instance_mixin)  Time elapsed: 1.19 sec  <<< FAILURE!
java.lang.AssertionError: Page did not contain source '[Ljava.lang.String;@9cf2df'.
	at org.apache.tapestry.integration.IntegrationTests.assertSourcePresent(IntegrationTests.java:517)
	at org.apache.tapestry.integration.IntegrationTests.instance_mixin(IntegrationTests.java:264)

This seems to be due to hardcoded US formattede dates in the test case in question. Comparing these to dates formatted according to the JVM's or the HTTP sessions locale ends up failing the test.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Assigned: (TAPESTRY-1223) Integration tests in tapestry-core fails because of differences in date formats (locale)

Posted by "Kent Tong (JIRA)" <ta...@jakarta.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kent Tong reassigned TAPESTRY-1223:
-----------------------------------

    Assignee: Kent Tong

> Integration tests in tapestry-core fails because of differences in date formats (locale)
> ----------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1223
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1223
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 5.0
>         Environment: Mac OSX, Danish locale, Tapestry v5.0 snapshot 3rd of Jan 2007
>            Reporter: Thomas Christensen
>         Assigned To: Kent Tong
>            Priority: Trivial
>             Fix For: 5.0
>
>
> The integration tests fails with the following message:
> -------------------------------------------------------------------------------
> Test set: Tapestry Core
> -------------------------------------------------------------------------------
> Tests run: 501, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 89.77 sec <<< FAILURE!
> org.apache.tapestry.integration.IntegrationTests.instance_mixin(org.apache.tapestry.integration.IntegrationTests.instance_mixin)  Time elapsed: 1.19 sec  <<< FAILURE!
> java.lang.AssertionError: Page did not contain source '[Ljava.lang.String;@9cf2df'.
> 	at org.apache.tapestry.integration.IntegrationTests.assertSourcePresent(IntegrationTests.java:517)
> 	at org.apache.tapestry.integration.IntegrationTests.instance_mixin(IntegrationTests.java:264)
> This seems to be due to hardcoded US formattede dates in the test case in question. Comparing these to dates formatted according to the JVM's or the HTTP sessions locale ends up failing the test.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1223) Integration tests in tapestry-core fails because of differences in date formats (locale)

Posted by "Thomas Christensen (JIRA)" <ta...@jakarta.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462252 ] 

Thomas Christensen commented on TAPESTRY-1223:
----------------------------------------------

Wrong patch command line. Correct is:
patch -p0 < file

> Integration tests in tapestry-core fails because of differences in date formats (locale)
> ----------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1223
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1223
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 5.0
>         Environment: Mac OSX, Danish locale, Tapestry v5.0 snapshot 3rd of Jan 2007
>            Reporter: Thomas Christensen
>            Priority: Trivial
>             Fix For: 5.0
>
>
> The integration tests fails with the following message:
> -------------------------------------------------------------------------------
> Test set: Tapestry Core
> -------------------------------------------------------------------------------
> Tests run: 501, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 89.77 sec <<< FAILURE!
> org.apache.tapestry.integration.IntegrationTests.instance_mixin(org.apache.tapestry.integration.IntegrationTests.instance_mixin)  Time elapsed: 1.19 sec  <<< FAILURE!
> java.lang.AssertionError: Page did not contain source '[Ljava.lang.String;@9cf2df'.
> 	at org.apache.tapestry.integration.IntegrationTests.assertSourcePresent(IntegrationTests.java:517)
> 	at org.apache.tapestry.integration.IntegrationTests.instance_mixin(IntegrationTests.java:264)
> This seems to be due to hardcoded US formattede dates in the test case in question. Comparing these to dates formatted according to the JVM's or the HTTP sessions locale ends up failing the test.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1223) Integration tests in tapestry-core fails because of differences in date formats (locale)

Posted by "Thomas Christensen (JIRA)" <ta...@jakarta.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462250 ] 

Thomas Christensen commented on TAPESTRY-1223:
----------------------------------------------

The following patch makes the test case use the locales date formatting. Apply with patch -p < file in tapestry-core/trunk/

Sorry. Could not attach to Jira for some reason.

----------------------cut------------------------
Index: src/test/java/org/apache/tapestry/integration/IntegrationTests.java
===================================================================
--- src/test/java/org/apache/tapestry/integration/IntegrationTests.java (revision 492604)
+++ src/test/java/org/apache/tapestry/integration/IntegrationTests.java (working copy)
@@ -16,6 +16,11 @@
 
 import static java.lang.String.format;
 
+import java.sql.Date;
+import java.text.DateFormat;
+import java.text.Format;
+import java.util.Calendar;
+
 import java.io.BufferedInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
@@ -252,23 +257,25 @@
     {
         _selenium.open(BASE_URL);
 
-        final String[] dates =
-        { "Jun 13, 1999", "Jul 15, 2001", "Dec 4, 2005" };
+        Format _format = DateFormat.getDateInstance(DateFormat.MEDIUM);
+        
+        final Date[] dates =
+        { new Date(99, Calendar.JUNE, 13), new Date(101, Calendar.JULY, 15), new Date(105, Calendar.DECEMBER, 4) };
 
         clickAndWait("link=InstanceMixin");
 
-        for (String date : dates)
+        for (Date date : dates)
         {
-            String snippet = String.format("[%s]", date);
+            String snippet = String.format("[%s]", _format.format(date));
 
             assertSourcePresent(snippet);
         }
 
         clickAndWait("link=Toggle emphasis");
 
-        for (String date : dates)
+        for (Date date : dates)
         {
-            String snippet = String.format("[<em>%s</em>]", date);
+            String snippet = String.format("[<em>%s</em>]", _format.format(date));
             assertSourcePresent(snippet);
         }
     }
-----------------------cut---------------------

> Integration tests in tapestry-core fails because of differences in date formats (locale)
> ----------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1223
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1223
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 5.0
>         Environment: Mac OSX, Danish locale, Tapestry v5.0 snapshot 3rd of Jan 2007
>            Reporter: Thomas Christensen
>            Priority: Trivial
>             Fix For: 5.0
>
>
> The integration tests fails with the following message:
> -------------------------------------------------------------------------------
> Test set: Tapestry Core
> -------------------------------------------------------------------------------
> Tests run: 501, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 89.77 sec <<< FAILURE!
> org.apache.tapestry.integration.IntegrationTests.instance_mixin(org.apache.tapestry.integration.IntegrationTests.instance_mixin)  Time elapsed: 1.19 sec  <<< FAILURE!
> java.lang.AssertionError: Page did not contain source '[Ljava.lang.String;@9cf2df'.
> 	at org.apache.tapestry.integration.IntegrationTests.assertSourcePresent(IntegrationTests.java:517)
> 	at org.apache.tapestry.integration.IntegrationTests.instance_mixin(IntegrationTests.java:264)
> This seems to be due to hardcoded US formattede dates in the test case in question. Comparing these to dates formatted according to the JVM's or the HTTP sessions locale ends up failing the test.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Resolved: (TAPESTRY-1223) Integration tests in tapestry-core fails because of differences in date formats (locale)

Posted by "Kent Tong (JIRA)" <ta...@jakarta.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kent Tong resolved TAPESTRY-1223.
---------------------------------

    Resolution: Fixed

Fixed. It's simpler to specify Locale.US when creating the formatter.

> Integration tests in tapestry-core fails because of differences in date formats (locale)
> ----------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1223
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1223
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 5.0
>         Environment: Mac OSX, Danish locale, Tapestry v5.0 snapshot 3rd of Jan 2007
>            Reporter: Thomas Christensen
>         Assigned To: Kent Tong
>            Priority: Trivial
>             Fix For: 5.0
>
>
> The integration tests fails with the following message:
> -------------------------------------------------------------------------------
> Test set: Tapestry Core
> -------------------------------------------------------------------------------
> Tests run: 501, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 89.77 sec <<< FAILURE!
> org.apache.tapestry.integration.IntegrationTests.instance_mixin(org.apache.tapestry.integration.IntegrationTests.instance_mixin)  Time elapsed: 1.19 sec  <<< FAILURE!
> java.lang.AssertionError: Page did not contain source '[Ljava.lang.String;@9cf2df'.
> 	at org.apache.tapestry.integration.IntegrationTests.assertSourcePresent(IntegrationTests.java:517)
> 	at org.apache.tapestry.integration.IntegrationTests.instance_mixin(IntegrationTests.java:264)
> This seems to be due to hardcoded US formattede dates in the test case in question. Comparing these to dates formatted according to the JVM's or the HTTP sessions locale ends up failing the test.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org