tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-tapestry/junit/mock-scripts TestListEdit.xml
Date Wed, 04 Jun 2003 12:36:19 GMT
hlship      2003/06/04 05:36:19

  Modified:    junit/src/org/apache/tapestry/junit
                        TestComponentMessages.java
               framework/src/org/apache/tapestry/engine
                        ComponentMessages.java
               junit/mock-scripts TestListEdit.xml
  Log:
  Patch around some JDK 1.3 localization bugs.
  
  Revision  Changes    Path
  1.3       +3 -2      jakarta-tapestry/junit/src/org/apache/tapestry/junit/TestComponentMessages.java
  
  Index: TestComponentMessages.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/TestComponentMessages.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestComponentMessages.java	2 Jun 2003 21:52:43 -0000	1.2
  +++ TestComponentMessages.java	4 Jun 2003 12:36:19 -0000	1.3
  @@ -179,7 +179,7 @@
       public void testDateFormatLocalization()
       {
           IPage page = createPage(MOCK1, Locale.FRENCH);
  -        
  +
           Calendar c = new GregorianCalendar(1966, Calendar.DECEMBER, 24);
   
           Date d = c.getTime();
  @@ -189,5 +189,6 @@
           assertEquals(
               "A formatted date: 24/12/66",
               page.getMessages().format("using-date-format", d));
  +
       }
   }
  
  
  
  1.4       +9 -2      jakarta-tapestry/framework/src/org/apache/tapestry/engine/ComponentMessages.java
  
  Index: ComponentMessages.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/engine/ComponentMessages.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ComponentMessages.java	2 Jun 2003 21:52:40 -0000	1.3
  +++ ComponentMessages.java	4 Jun 2003 12:36:19 -0000	1.4
  @@ -118,8 +118,15 @@
       {
           String pattern = getMessage(key);
   
  -        MessageFormat messageFormat = new MessageFormat(pattern);
  +		// This ugliness is mandated for JDK 1.3 compatibility, which has a bug 
  +		// in MessageFormat ... the
  +		// pattern is applied in the constructor, using the system default Locale,
  +		// regardless of what locale is later specified!
  +		// It appears that the problem does not exist in JDK 1.4.
  +		
  +        MessageFormat messageFormat = new MessageFormat("");
           messageFormat.setLocale(_locale);
  +        messageFormat.applyPattern(pattern);
   
           return messageFormat.format(arguments);
       }
  
  
  
  1.7       +5 -2      jakarta-tapestry/junit/mock-scripts/TestListEdit.xml
  
  Index: TestListEdit.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/mock-scripts/TestListEdit.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestListEdit.xml	13 May 2003 16:49:42 -0000	1.6
  +++ TestListEdit.xml	4 Jun 2003 12:36:19 -0000	1.7
  @@ -94,8 +94,11 @@
   		org.apache.tapestry.ApplicationRuntimeException
   		</assert-output>
   		
  +		<!-- JDK 1.4 changes this message to:
  +			   		For input string: "3Clothing"	
  +			   -->
   		<assert-output name="Outer Message">
  -		For input string: "3Clothing"	
  +		3Clothing	
   		</assert-output>
   		
   		<assert-output name="Inner Exception">
  
  
  

Mime
View raw message