wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From el...@apache.org
Subject svn commit: r802519 - in /incubator/wink/trunk: wink-component-test-support/src/main/java/org/apache/wink/test/diff/ wink-examples/core/Preconditions/src/main/java/org/apache/wink/example/locking/legacy/ wink-examples/core/Preconditions/src/test/java/o...
Date Sun, 09 Aug 2009 11:19:26 GMT
Author: elman
Date: Sun Aug  9 11:19:26 2009
New Revision: 802519

URL: http://svn.apache.org/viewvc?rev=802519&view=rev
Log:
Fixing WINK-127 - unit test failure in case of daylight saving timezone

Added:
    incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/PreconditionsTest.java
      - copied, changed from r802496, incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/LockingTest.java
Removed:
    incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/LockingTest.java
Modified:
    incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/test/diff/DifferenceListenerIgnoreUpdateOrCompareTimes.java
    incubator/wink/trunk/wink-examples/core/Preconditions/src/main/java/org/apache/wink/example/locking/legacy/DefectBean.java

Modified: incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/test/diff/DifferenceListenerIgnoreUpdateOrCompareTimes.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/test/diff/DifferenceListenerIgnoreUpdateOrCompareTimes.java?rev=802519&r1=802518&r2=802519&view=diff
==============================================================================
--- incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/test/diff/DifferenceListenerIgnoreUpdateOrCompareTimes.java
(original)
+++ incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/test/diff/DifferenceListenerIgnoreUpdateOrCompareTimes.java
Sun Aug  9 11:19:26 2009
@@ -20,8 +20,10 @@
 
 package org.apache.wink.test.diff;
 
+import java.util.Calendar;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.TimeZone;
 
 import javax.xml.datatype.DatatypeConfigurationException;
 import javax.xml.datatype.DatatypeConstants;
@@ -77,6 +79,9 @@
                 XMLGregorianCalendar test = datatypeFactory.newXMLGregorianCalendar(testDateStr);
                 XMLGregorianCalendar control =
                     datatypeFactory.newXMLGregorianCalendar(controlDateStr);
+                if (TimeZone.getDefault().useDaylightTime()) {
+                    test.setTimezone(60);
+                }
                 if (test.compare(control) == DatatypeConstants.EQUAL)
                     return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;
             }

Modified: incubator/wink/trunk/wink-examples/core/Preconditions/src/main/java/org/apache/wink/example/locking/legacy/DefectBean.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-examples/core/Preconditions/src/main/java/org/apache/wink/example/locking/legacy/DefectBean.java?rev=802519&r1=802518&r2=802519&view=diff
==============================================================================
--- incubator/wink/trunk/wink-examples/core/Preconditions/src/main/java/org/apache/wink/example/locking/legacy/DefectBean.java
(original)
+++ incubator/wink/trunk/wink-examples/core/Preconditions/src/main/java/org/apache/wink/example/locking/legacy/DefectBean.java
Sun Aug  9 11:19:26 2009
@@ -44,7 +44,7 @@
     @XmlElement(required = true)
     private String description;
     @XmlElement(required = true)
-    @XmlSchemaType(name = "dateTime")
+    @XmlSchemaType(name = "dateTime", type=javax.xml.datatype.XMLGregorianCalendar.class)
     private Date   created;
     @XmlElement(required = true)
     private String author;

Copied: incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/PreconditionsTest.java
(from r802496, incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/LockingTest.java)
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/PreconditionsTest.java?p2=incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/PreconditionsTest.java&p1=incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/LockingTest.java&r1=802496&r2=802519&rev=802519&view=diff
==============================================================================
--- incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/LockingTest.java
(original)
+++ incubator/wink/trunk/wink-examples/core/Preconditions/src/test/java/org/apache/wink/example/locking/PreconditionsTest.java
Sun Aug  9 11:19:26 2009
@@ -30,7 +30,7 @@
 import org.springframework.mock.web.MockHttpServletRequest;
 import org.springframework.mock.web.MockHttpServletResponse;
 
-public class LockingTest extends MockServletInvocationTest {
+public class PreconditionsTest extends MockServletInvocationTest {
 
     @Override
     protected Class<?>[] getClasses() {
@@ -94,7 +94,8 @@
         request.addHeader("if-match", etag);
         response = invoke(request);
         assertEquals("status", 200, response.getStatus());
-
+        etag = (String)response.getHeader(HttpHeaders.ETAG);
+        
         // now, after the collection was modified
         // 200 should return
         request =



Mime
View raw message