[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [onionoo/master] Move DummyTime to its own source file.



commit 8e96d945e7d1c42fe7810f696a43d31ab74ddec1
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Fri Mar 21 20:44:34 2014 +0100

    Move DummyTime to its own source file.
---
 test/org/torproject/onionoo/DummyTime.java           |   14 ++++++++++++++
 test/org/torproject/onionoo/ResourceServletTest.java |   12 +-----------
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/test/org/torproject/onionoo/DummyTime.java b/test/org/torproject/onionoo/DummyTime.java
new file mode 100644
index 0000000..7178ed1
--- /dev/null
+++ b/test/org/torproject/onionoo/DummyTime.java
@@ -0,0 +1,14 @@
+/* Copyright 2014 The Tor Project
+ * See LICENSE for licensing information */
+package org.torproject.onionoo;
+
+public class DummyTime extends Time {
+  private long currentTimeMillis;
+  public DummyTime(long currentTimeMillis) {
+    this.currentTimeMillis = currentTimeMillis;
+  }
+  public long currentTimeMillis() {
+    return this.currentTimeMillis;
+  }
+}
+
diff --git a/test/org/torproject/onionoo/ResourceServletTest.java b/test/org/torproject/onionoo/ResourceServletTest.java
index 3b8b5ae..e2a6a7e 100644
--- a/test/org/torproject/onionoo/ResourceServletTest.java
+++ b/test/org/torproject/onionoo/ResourceServletTest.java
@@ -37,16 +37,6 @@ public class ResourceServletTest {
 
   private long currentTimeMillis = 1366806142000L;
 
-  private class TestingTime extends Time {
-    private long currentTimeMillis;
-    public TestingTime(long currentTimeMillis) {
-      this.currentTimeMillis = currentTimeMillis;
-    }
-    public long currentTimeMillis() {
-      return this.currentTimeMillis;
-    }
-  }
-
   private boolean maintenanceMode = false;
 
   private class TestingHttpServletRequestWrapper
@@ -165,7 +155,7 @@ public class ResourceServletTest {
   }
 
   private void createDummyTime() {
-    Time dummyTime = new TestingTime(this.currentTimeMillis);
+    Time dummyTime = new DummyTime(this.currentTimeMillis);
     ApplicationFactory.setTime(dummyTime);
   }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits