aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kevi...@apache.org
Subject incubator-aurora git commit: [AURORA-986] RequestLoggerTest failed for Locale.FRANCE
Date Tue, 06 Jan 2015 19:35:37 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master c1174a7bb -> aae3783f5


[AURORA-986] RequestLoggerTest failed for Locale.FRANCE

Testing Done:
All tests in RequestLoggerTest pass now.

Reviewed at https://reviews.apache.org/r/29491/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/aae3783f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/aae3783f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/aae3783f

Branch: refs/heads/master
Commit: aae3783f5dacf1ba68562871a1bc1b5e78d76843
Parents: c1174a7
Author: Issam EL ATIF <issam.elatif@gmail.com>
Authored: Tue Jan 6 11:31:20 2015 -0800
Committer: Kevin Sweeney <kevints@apache.org>
Committed: Tue Jan 6 11:31:20 2015 -0800

----------------------------------------------------------------------
 .../aurora/scheduler/http/RequestLoggerTest.java       | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/aae3783f/src/test/java/org/apache/aurora/scheduler/http/RequestLoggerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/http/RequestLoggerTest.java b/src/test/java/org/apache/aurora/scheduler/http/RequestLoggerTest.java
index 298a34e..4999d3a 100644
--- a/src/test/java/org/apache/aurora/scheduler/http/RequestLoggerTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/http/RequestLoggerTest.java
@@ -13,6 +13,7 @@
  */
 package org.apache.aurora.scheduler.http;
 
+import java.util.Locale;
 import java.util.logging.Level;
 
 import com.twitter.common.quantity.Amount;
@@ -25,6 +26,7 @@ import org.eclipse.jetty.http.HttpURI;
 import org.eclipse.jetty.server.Request;
 import org.eclipse.jetty.server.RequestLog;
 import org.eclipse.jetty.server.Response;
+import org.eclipse.jetty.util.DateCache;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -33,6 +35,7 @@ import static org.easymock.EasyMock.expect;
 
 public class RequestLoggerTest extends EasyMockTest {
 
+  private DateCache logDateCache;
   private FakeClock clock;
   private LogSink sink;
   private Request request;
@@ -42,6 +45,8 @@ public class RequestLoggerTest extends EasyMockTest {
 
   @Before
   public void setUp() throws Exception {
+    logDateCache = new DateCache("dd/MMM/yyyy:HH:mm:ss Z", Locale.getDefault());
+    logDateCache.setTimeZoneID("GMT");
     clock = new FakeClock();
     sink = createMock(LogSink.class);
     request = createMock(Request.class);
@@ -66,7 +71,9 @@ public class RequestLoggerTest extends EasyMockTest {
     expect(request.getTimeStamp()).andReturn(clock.nowMillis()).atLeastOnce();
 
     expect(sink.isLoggable(Level.INFO)).andReturn(true);
-    sink.log(Level.INFO, "snoopy easymock-test [22/Dec/2009:00:00:00 +0000]"
+
+    String logDate = logDateCache.format(clock.nowMillis());
+    sink.log(Level.INFO, "snoopy easymock-test [" + logDate + "]"
         + " \"GET / http\" 200 256 \"-\" \"junit\" 110");
 
     control.replay();
@@ -92,7 +99,9 @@ public class RequestLoggerTest extends EasyMockTest {
     expect(request.getTimeStamp()).andReturn(clock.nowMillis()).atLeastOnce();
 
     expect(sink.isLoggable(Level.WARNING)).andReturn(true);
-    sink.log(Level.WARNING, "woodstock easymock-test [22/Dec/2009:00:00:00 +0000]"
+
+    String logDate = logDateCache.format(clock.nowMillis());
+    sink.log(Level.WARNING, "woodstock easymock-test [" + logDate + "]"
         + " \"POST /data http\" 500 128 \"-\" \"junit\" 500");
 
     control.replay();


Mime
View raw message