Skip to content

Commit 5953dec

Browse files
committed
Upgrades version, minor refactoring, removes warnings, fixes broken project coordinates of commons-pool 2.6.0 in build.sbt
1 parent 3f30725 commit 5953dec

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

build.sbt

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ lazy val redisClient = (project in file(".")).settings(coreSettings : _*)
44

55
lazy val commonSettings: Seq[Setting[_]] = Seq(
66
organization := "net.debasishg",
7-
version := "3.8",
8-
scalaVersion := "2.12.6",
9-
crossScalaVersions := Seq("2.12.7", "2.11.12", "2.10.7", "2.13.0-M5"),
7+
version := "3.9",
8+
scalaVersion := "2.12.8",
9+
crossScalaVersions := Seq("2.11.12", "2.10.7", "2.13.0-M5"),
1010

1111
scalacOptions in Compile ++= Seq( "-unchecked", "-feature", "-language:postfixOps", "-deprecation" ),
1212

@@ -18,12 +18,12 @@ lazy val commonSettings: Seq[Setting[_]] = Seq(
1818
lazy val coreSettings = commonSettings ++ Seq(
1919
name := "RedisClient",
2020
libraryDependencies ++= Seq(
21-
"commons-pool" % "commons-pool" % "2.6.0",
22-
"org.slf4j" % "slf4j-api" % "1.7.25",
23-
"org.slf4j" % "slf4j-log4j12" % "1.7.25" % "provided",
24-
"log4j" % "log4j" % "1.2.17" % "provided",
25-
"junit" % "junit" % "4.12" % "test",
26-
"org.scalatest" %% "scalatest" % "3.0.6-SNAP3" % "test"),
21+
"org.apache.commons" % "commons-pool2" % "2.6.0",
22+
"org.slf4j" % "slf4j-api" % "1.7.25",
23+
"org.slf4j" % "slf4j-log4j12" % "1.7.25" % "provided",
24+
"log4j" % "log4j" % "1.2.17" % "provided",
25+
"junit" % "junit" % "4.12" % "test",
26+
"org.scalatest" %% "scalatest" % "3.0.6-SNAP3" % "test"),
2727

2828
parallelExecution in Test := false,
2929
publishTo := version { (v: String) =>

src/test/scala/com/redis/Bench.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object Bench {
3636
def load(opsPerClient: Int, fn: (Int, String) => Unit)(implicit clients: RedisClientPool): (Double, Double, Seq[_]) = {
3737
val start = System.nanoTime
3838
val tasks = (1 to 100) map (i => Future { fn(opsPerClient, "k" + i.toString) })
39-
val results = Await.result(Future.sequence(tasks), 20 seconds)
39+
val results = Await.result(Future.sequence(tasks), 60 seconds)
4040
val elapsedSeconds = (System.nanoTime - start)/1000000000.0
4141
val opsPerSec = (opsPerClient * 100 * 2) / elapsedSeconds
4242
(elapsedSeconds, opsPerSec, results)

src/test/scala/com/redis/PoolSpec.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class PoolSpec extends FunSpec
6767
val l = (0 until 5000).map(_.toString).toList
6868
val fns = List[List[String] => Option[Long]](lp, rp, set)
6969
val tasks = fns map (fn => Future { fn(l) })
70-
val results = Await.result(Future.sequence(tasks), 20 seconds)
70+
val results = Await.result(Future.sequence(tasks), 60 seconds)
7171
results should equal(List(Some(5000), Some(5000), Some(1000)))
7272
}
7373
}

src/test/scala/com/redis/cluster/RedisClusterSpec.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class RedisClusterSpec extends FunSpec
111111
r.set("testkey1", "testvalue2")
112112
r.get("testkey1") should equal (Some("testvalue2"))
113113

114-
val nodename = r.hr.getNode(formattedKey("testkey1")).toString
114+
val nodename = r.hr.getNode(formattedKey("testkey1").toIndexedSeq).toString
115115

116116
//simulate the same value is duplicated to slave
117117
//for test, don't set to master, just to make sure the expected value is loaded from slave
@@ -137,7 +137,7 @@ class RedisClusterSpec extends FunSpec
137137
r.set("testkey1", "testvalue2")
138138
r.get("testkey1") should equal (Some("testvalue2"))
139139

140-
val nodename = r.hr.getNode(formattedKey("testkey1")).toString
140+
val nodename = r.hr.getNode(formattedKey("testkey1").toIndexedSeq).toString
141141

142142
//replaced master with slave on the same node
143143
r.removeServer(nodename)

src/test/scala/com/redis/cluster/RedisShardsSpec.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class RedisShardsSpec extends FunSpec
110110
r.set("testkey1", "testvalue2")
111111
r.get("testkey1") should equal (Some("testvalue2"))
112112

113-
val nodename = r.hr.getNode(formattedKey("testkey1")).toString
113+
val nodename = r.hr.getNode(formattedKey("testkey1").toIndexedSeq).toString
114114

115115
//simulate the same value is duplicated to slave
116116
//for test, don't set to master, just to make sure the expected value is loaded from slave
@@ -134,7 +134,7 @@ class RedisShardsSpec extends FunSpec
134134
r.set("testkey1", "testvalue2")
135135
r.get("testkey1") should equal (Some("testvalue2"))
136136

137-
val nodename = r.hr.getNode(formattedKey("testkey1")).toString
137+
val nodename = r.hr.getNode(formattedKey("testkey1").toIndexedSeq).toString
138138

139139
//replaced master with slave on the same node
140140
r.removeServer(nodename)

0 commit comments

Comments
 (0)