STORM-1670 Fixed unit tests

Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/55c4a687
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/55c4a687
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/55c4a687

Branch: refs/heads/master
Commit: 55c4a6874ddc7e2228a1ea7aa954f378593d3a45
Parents: f6616cc
Author: Satish Duggana <[email protected]>
Authored: Sat Apr 2 08:00:08 2016 +0530
Committer: Satish Duggana <[email protected]>
Committed: Sat Apr 2 08:33:17 2016 +0530

----------------------------------------------------------------------
 .../test/clj/org/apache/storm/versioned_store_test.clj   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/55c4a687/storm-core/test/clj/org/apache/storm/versioned_store_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/versioned_store_test.clj 
b/storm-core/test/clj/org/apache/storm/versioned_store_test.clj
index c4d122d..2ee7a27 100644
--- a/storm-core/test/clj/org/apache/storm/versioned_store_test.clj
+++ b/storm-core/test/clj/org/apache/storm/versioned_store_test.clj
@@ -16,6 +16,8 @@
 (ns org.apache.storm.versioned-store-test
   (:use [clojure test])
   (:use [org.apache.storm testing])
+  (:import [java.io File])
+  (:import [org.apache.commons.io FileUtils])
   (:import [org.apache.storm.utils VersionedStore]))
 
 (defmacro defvstest [name [vs-sym] & body]
@@ -25,18 +27,25 @@
         ~@body
         ))))
 
+(defn writeToFile [^String file]
+  (FileUtils/writeStringToFile (File. file) (str "time:" 
(System/currentTimeMillis))))
+
 (defvstest test-empty-version [vs]
   (let [v (.createVersion vs)]
     (.succeedVersion vs v)
+    (writeToFile v)
     (is (= 1 (count (.getAllVersions vs))))
     (is (= v (.mostRecentVersionPath vs)))
     ))
 
 (defvstest test-multiple-versions [vs]
-  (.succeedVersion vs (.createVersion vs))
+  (let [v (.createVersion vs)]
+    (.succeedVersion vs v)
+    (writeToFile v))
   (Thread/sleep 100)
   (let [v (.createVersion vs)]
     (.succeedVersion vs v)
+    (writeToFile v)
     (is (= 2 (count (.getAllVersions vs))))
     (is (= v (.mostRecentVersionPath vs)))
     

Reply via email to