sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1495950 - /sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/XmlUtilitiesTest.java
Date Mon, 24 Jun 2013 08:23:44 GMT
Author: desruisseaux
Date: Mon Jun 24 08:23:44 2013
New Revision: 1495950

URL: http://svn.apache.org/r1495950
Log:
Ensure that we cleanup the thread-local variable even in case of test failure.

Modified:
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/XmlUtilitiesTest.java

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/XmlUtilitiesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/XmlUtilitiesTest.java?rev=1495950&r1=1495949&r2=1495950&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/XmlUtilitiesTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/XmlUtilitiesTest.java
[UTF-8] Mon Jun 24 08:23:44 2013
@@ -46,10 +46,15 @@ public final strictfp class XmlUtilities
     @Test
     public void testToXML() throws DatatypeConfigurationException {
         final Context context = new Context(0, Locale.FRENCH, TimeZone.getTimeZone("CET"),
null, null, null, null, null);
-        final XMLGregorianCalendar cal = XmlUtilities.toXML(context, new Date(1230786000000L));
-        assertEquals("2009-01-01T06:00:00.000+01:00", cal.toString());
+        final XMLGregorianCalendar calendar;
+        try {
+            calendar = XmlUtilities.toXML(context, new Date(1230786000000L));
+        } finally {
+            context.finish();
+        }
+        assertEquals("2009-01-01T06:00:00.000+01:00", calendar.toString());
 
-        cal.setMillisecond(FIELD_UNDEFINED);
-        assertEquals("2009-01-01T06:00:00+01:00", cal.toString());
+        calendar.setMillisecond(FIELD_UNDEFINED);
+        assertEquals("2009-01-01T06:00:00+01:00", calendar.toString());
     }
 }



Mime
View raw message