Permalink
Browse files

upgrade libraries

  • Loading branch information...
1 parent fd22ff8 commit 2a179f57055a81b5322f4d84e9e03cc749f1e3e8 @freakinruben freakinruben committed Apr 9, 2014
View
@@ -2,10 +2,11 @@
:description "Titanium a powerful Clojure graph library build on top of Aurelius Titan"
:url "http://titanium.clojurewerkz.org"
:license {:name "Eclipse Public License"}
- :dependencies [[org.clojure/clojure "1.5.1"]
+ :jvm-opts ["-javaagent:lib/jamm-0.2.5.jar"]
+ :dependencies [[org.clojure/clojure "1.6.0"]
[clojurewerkz/support "0.15.0"]
- [com.thinkaurelius.titan/titan-all "0.4.0"]
- [potemkin "0.2.0"]
+ [com.thinkaurelius.titan/titan-all "0.4.2"]
+ [potemkin "0.3.4"]
[clojurewerkz/ogre "2.3.0.1"]
[clojurewerkz/archimedes "1.0.0-alpha4"]]
:source-paths ["src/clojure"]
@@ -38,7 +38,7 @@
(g/set-pre-fn! ensure-graph-is-transaction-safe)
-(defn convert-config-map
+(defn convert-config-map
[m]
(let [conf (org.apache.commons.configuration.BaseConfiguration.)]
(doseq [[k1 v1] m]
@@ -67,9 +67,9 @@
(defn open?
[]
- (and
- (bound? #'archimedes.core/*graph*)
- (not (nil? archimedes.core/*graph*))
+ (and
+ (bound? #'archimedes.core/*graph*)
+ (not (nil? archimedes.core/*graph*))
(.isOpen archimedes.core/*graph*)))
@@ -2,19 +2,21 @@
(:import (org.apache.commons.io FileUtils)))
-(def cs-dir (str (clojure.java.io/as-url
- (clojure.java.io/as-file
- (str (System/getProperty "user.dir")
+(def cs-dir (str (clojure.java.io/as-url
+ (clojure.java.io/as-file
+ (str (System/getProperty "user.dir")
"/resources/test-cassandra.yaml")))))
(def conf {;; Embedded cassandra settings
"storage.backend" "embeddedcassandra"
"storage.cassandra-config-dir" cs-dir
;; Embedded elasticsearch settings
"storage.index.search.backend" "elasticsearch"
- "storage.index.search.directory" "/tmp/cassandra/elasticsearch"
+ "storage.index.search.directory" "/tmp/titanium-test/elasticsearch"
"storage.index.search.client-only" false
- "storage.index.search.local-mode" true})
+ "storage.index.search.local-mode" true
+ "storage.compression.enabled" false
+ "storage.cassandra.db.compression.enabled" false})
(defn clear-db []
(FileUtils/deleteDirectory (java.io.File. "/tmp/titanium-test")))
@@ -163,11 +163,11 @@
(testing "Refresh"
(let [v1 (tg/transact! (tv/create! {:name "v1"}))
v2 (tg/transact! (tv/create! {:name "v2"}))
- edge (tg/transact!
+ edge (tg/transact!
(ted/connect! (tv/refresh v1) :connexion (tv/refresh v2) {:name "bob"}))]
- (is (tg/transact!
+ (is (tg/transact!
(= (.getId edge) (.getId (ted/refresh edge)))))
- (is (tg/transact!
+ (is (tg/transact!
(is (= "bob" (:name (ted/to-map (ted/refresh edge)))))))))
(testing "Edges between"
@@ -176,9 +176,9 @@
edge (tg/transact! (ted/connect! (tv/refresh v1) :connexion (tv/refresh v2)))]
(is edge)
(is (tg/transact! (= (ted/to-map (ted/refresh edge))
- (ted/to-map (first
+ (ted/to-map (first
(ted/edges-between (tv/refresh v1) (tv/refresh v2)))))))))
-
+
(testing "Upconnect!"
(testing "Upconnecting once without data"
(tg/transact!
@@ -2,7 +2,7 @@
(:require [clojurewerkz.titanium.graph :as tg]
[clojurewerkz.titanium.vertices :as tv]
[clojurewerkz.titanium.edges :as ted]
- [clojurewerkz.titanium.types :as tt]
+ [clojurewerkz.titanium.types :as tt]
[clojurewerkz.support.io :as sio]
[archimedes.core :as c])
(:use clojure.test
@@ -45,7 +45,7 @@
StandardTitanGraph)))
(testing "Stored graph"
- (let [vertex (tg/transact! (.addVertex c/*graph*))]
+ (let [vertex (tg/transact! (.addVertex c/*graph*))]
(is (= StandardVertex (type vertex)))))
(testing "Stored graph"
@@ -64,16 +64,16 @@
(do @f1 @f2)) "The futures throw errors.")))
(testing "With retries"
(let [random-long (long (rand-int 100000))
- f1 (future (tg/retry-transact! 3 100
+ f1 (future (tg/retry-transact! 3 100
(tv/upsert! :vertex-id {:vertex-id random-long})))
- f2 (future (tg/retry-transact! 3 100
+ f2 (future (tg/retry-transact! 3 100
(tv/upsert! :vertex-id {:vertex-id random-long})))]
(is (= random-long
(tg/transact!
(tv/get (tv/refresh (first @f1)) :vertex-id))
(tg/transact!
- (tv/get (tv/refresh (first @f2)) :vertex-id)))
+ (tv/get (tv/refresh (first @f2)) :vertex-id)))
"The futures have the correct values.")
(is (= 1 (count
(tg/transact! (tv/find-by-kv :vertex-id random-long))))
@@ -82,9 +82,9 @@
(testing "With retries and an exponential backoff function"
(let [backoff-fn (fn [try-count] (+ (Math/pow 10 try-count) (* try-count (rand-int 100))))
random-long (long (rand-int 100000))
- f1 (future (tg/retry-transact! 3 backoff-fn
+ f1 (future (tg/retry-transact! 3 backoff-fn
(tv/upsert! :vertex-id {:vertex-id random-long})))
- f2 (future (tg/retry-transact! 3 backoff-fn
+ f2 (future (tg/retry-transact! 3 backoff-fn
(tv/upsert! :vertex-id {:vertex-id random-long})))]
(is (= random-long

0 comments on commit 2a179f5

Please sign in to comment.