sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1651053 - /sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/SlingDateValuesTest.java
Date Mon, 12 Jan 2015 10:40:19 GMT
Author: bdelacretaz
Date: Mon Jan 12 10:40:18 2015
New Revision: 1651053

URL: http://svn.apache.org/r1651053
Log:
SLING-4258 - log what's being tested

Modified:
    sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/SlingDateValuesTest.java

Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/SlingDateValuesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/SlingDateValuesTest.java?rev=1651053&r1=1651052&r2=1651053&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/SlingDateValuesTest.java
(original)
+++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/SlingDateValuesTest.java
Mon Jan 12 10:40:18 2015
@@ -24,6 +24,8 @@ import java.util.Locale;
 import org.apache.sling.commons.testing.integration.HttpTestBase;
 import org.apache.sling.commons.testing.integration.NameValuePairList;
 import org.apache.sling.servlets.post.SlingPostConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  *  checks if the date parsing for non jcr-dates works.
@@ -32,9 +34,8 @@ import org.apache.sling.servlets.post.Sl
 public class SlingDateValuesTest extends HttpTestBase {
 
     public static final String TEST_BASE_PATH = "/sling-tests";
-
-    // TODO: the commented formats do not work beacuse of SLING-242
-    //       the + of the timezone offset is stripped by sling
+    
+    private final Logger log = LoggerFactory.getLogger(getClass());
 
     private final SimpleDateFormat[] testFormats = new SimpleDateFormat[]{
         new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss 'GMT'Z", Locale.US),
@@ -65,15 +66,19 @@ public class SlingDateValuesTest extends
         String content = getContent(createdNodeUrl + ".json", CONTENT_TYPE_JSON);
 
         // default behaviour writes empty string
+        log.info("Expecting [{}] -> [{}] (single value)", input, expected);
         assertJavascript(expected, content, "out.println(data.someDate)");
+        
         assertJavascript(expected, content, "out.println(data.manyDates[0])");
+        
+        log.info("Expecting [{}] -> [{}] (multi-value)", input2, expected2);
         assertJavascript(expected2, content, "out.println(data.manyDates[1])");
     }
 
     public void testDateValues() throws IOException {
         SimpleDateFormat ecmaFmt = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss 'GMT'Z",
Locale.US);
         Date now = new Date();
-        Date date2 = new Date(1000);
+        Date date2 = new Date(10000042L);
         String nowStr = ecmaFmt.format(now);
         String date2Str = ecmaFmt.format(date2);
         for (SimpleDateFormat fmt: testFormats) {
@@ -82,5 +87,4 @@ public class SlingDateValuesTest extends
             doDateTest(nowStr, testStr, date2Str, test2Str);
         }
     }
-
 }
\ No newline at end of file



Mime
View raw message