Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SBT build compatibility

  • Loading branch information...
commit 0b685552405647cc61bacb2ae15e7a5369a2432b 1 parent 5f7ec3f
Ed Ceaser authored
View
9 .gitignore
@@ -1,3 +1,10 @@
dist/*
-target/*
*.log
+target/
+.DS_Store
+kestrel/*
+*.hprof.txt
+lib_managed/
+src_managed/
+project/boot/
+project/plugins/project/
View
8 project/build.properties
@@ -0,0 +1,8 @@
+#Project properties
+#Sun Apr 18 19:24:43 PDT 2010
+project.organization=com.twitter
+project.name=Rowz
+sbt.version=0.7.3
+project.version=1.0
+build.scala.versions=2.7.7
+project.initialize=false
View
25 project/build/GlockProject.scala
@@ -0,0 +1,25 @@
+import sbt._
+import Process._
+import com.twitter.sbt.StandardProject
+
+
+class RowzProject(info: ProjectInfo) extends StandardProject(info) {
+ val asm = "asm" % "asm" % "1.5.3"
+ val cglib = "cglib" % "cglib" % "2.1_3"
+ val configgy = "net.lag" % "configgy" % "1.5.2"
+ val gizzard = "com.twitter" % "gizzard" % "1.0.1"
+ val hamcrest = "org.hamcrest" % "hamcrest-all" % "1.1"
+ val jmock = "org.jmock" % "jmock" % "2.4.0"
+ val kestrel = "net.lag" % "kestrel" % "1.2"
+ val mysqljdbc = "mysql" % "mysql-connector-java" % "5.1.6"
+ val objenesis = "org.objenesis" % "objenesis" % "1.1"
+ val ostrich = "com.twitter" % "ostrich" % "1.1.17"
+ val querulous = "com.twitter" % "querulous" % "1.1.4"
+ val slf4j = "org.slf4j" % "slf4j-jdk14" % "1.5.2"
+ val slf4jApi = "org.slf4j" % "slf4j-api" % "1.5.2"
+ val smile = "net.lag" % "smile" % "0.8.11"
+ val specs = "org.scala-tools.testing" % "specs" % "1.6.2.1"
+ val thrift = "thrift" % "libthrift" % "0.2.0"
+ val xrayspecs = "com.twitter" % "xrayspecs" % "1.0.7"
+ val log4j = "log4j" % "log4j" % "1.2.12"
+}
View
7 project/plugins/Plugins.scala
@@ -0,0 +1,7 @@
+import sbt._
+
+
+class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
+ val twitterNest = "com.twitter" at "http://www.lag.net/nest"
+ val defaultProject = "com.twitter" % "standard-project" % "0.5.5"
+}
View
15 src/test/scala/com/twitter/rowz/ConfiguredSpecification.scala
@@ -0,0 +1,15 @@
+package com.twitter.rowz
+
+import net.lag.configgy.Configgy
+import org.specs.Specification
+
+abstract class ConfiguredSpecification extends Specification {
+ try {
+ Configgy.configure("config/test.conf")
+ } catch {
+ case ex: Exception => ex.printStackTrace()
+ }
+
+ lazy val config = Configgy.config
+}
+
View
26 src/test/scala/com/twitter/rowz/Database.scala
@@ -11,20 +11,20 @@ import net.lag.logging.Logger
object Database {
val log = Logger.get
- val config = Configgy.config
- val w3c = new W3CStats(log, config.getList("rowz.w3c").toArray)
+ val conf = Configgy.config
+ val w3c = new W3CStats(log, conf.getList("rowz.w3c").toArray)
val databaseFactory = new MemoizingDatabaseFactory(new ApachePoolingDatabaseFactory(
- config("rowz.db.connection_pool.size_min").toInt,
- config("rowz.db.connection_pool.size_max").toInt,
- config("rowz.db.connection_pool.test_idle_msec").toLong.millis,
- config("rowz.db.connection_pool.max_wait").toLong.millis,
- config("rowz.db.connection_pool.test_on_borrow").toBoolean,
- config("rowz.db.connection_pool.min_evictable_idle_msec").toLong.millis))
+ conf("rowz.db.connection_pool.size_min").toInt,
+ conf("rowz.db.connection_pool.size_max").toInt,
+ conf("rowz.db.connection_pool.test_idle_msec").toLong.millis,
+ conf("rowz.db.connection_pool.max_wait").toLong.millis,
+ conf("rowz.db.connection_pool.test_on_borrow").toBoolean,
+ conf("rowz.db.connection_pool.min_evictable_idle_msec").toLong.millis))
val queryEvaluatorFactory = new StandardQueryEvaluatorFactory(databaseFactory, new SqlQueryFactory)
- config.getList("rowz.nameserver.hostnames").foreach { hostname =>
- val queryEvaluator = queryEvaluatorFactory(hostname, null, config("rowz.nameserver.username"), config("rowz.nameserver.password"))
- queryEvaluator.execute("DROP DATABASE IF EXISTS " + config("rowz.nameserver.name"))
- queryEvaluator.execute("CREATE DATABASE " + config("rowz.nameserver.name"))
+ conf.getList("rowz.nameserver.hostnames").foreach { hostname =>
+ val queryEvaluator = queryEvaluatorFactory(hostname, null, conf("rowz.nameserver.username"), conf("rowz.nameserver.password"))
+ queryEvaluator.execute("DROP DATABASE IF EXISTS " + conf("rowz.nameserver.name"))
+ queryEvaluator.execute("CREATE DATABASE " + conf("rowz.nameserver.name"))
}
-}
View
5 src/test/scala/com/twitter/rowz/integration/RowzSpec.scala
@@ -1,16 +1,15 @@
package com.twitter.rowz.integration
import com.twitter.gizzard.thrift.ShardManagerService
-import org.specs.Specification
import com.twitter.gizzard.scheduler.Priority
-import com.twitter.xrayspecs.{Time, Eventually}
+import com.twitter.xrayspecs.Time
import com.twitter.xrayspecs.TimeConversions._
import net.lag.logging.Logger
import com.twitter.gizzard.shards.ShardInfo
import com.twitter.gizzard.nameserver.Forwarding
-object RowzSpec extends Specification with Eventually {
+object RowzSpec extends ConfiguredSpecification {
"Rowz" should {
import Database._
Time.freeze()
View
5 src/test/scala/com/twitter/rowz/integration/ShardManagerSpec.scala
@@ -1,9 +1,8 @@
package com.twitter.rowz.integration
import com.twitter.gizzard.thrift.ShardManagerService
-import org.specs.Specification
import com.twitter.gizzard.scheduler.Priority
-import com.twitter.xrayspecs.{Time, Eventually}
+import com.twitter.xrayspecs.Time
import com.twitter.xrayspecs.TimeConversions._
import net.lag.logging.Logger
import com.twitter.gizzard.shards.ShardInfo
@@ -11,7 +10,7 @@ import com.twitter.gizzard.nameserver.Forwarding
import com.twitter.gizzard.thrift.conversions.ShardInfo._
-object ShardManagerSpec extends Specification with Eventually {
+object ShardManagerSpec extends ConfiguredSpecification {
"ShardManager" should {
import Database._
Time.freeze()
View
3  src/test/scala/com/twitter/rowz/unit/SqlShardSpec.scala
@@ -1,12 +1,11 @@
package com.twitter.rowz.unit
-import org.specs.Specification
import org.specs.mock.{ClassMocker, JMocker}
import com.twitter.xrayspecs.Time
import com.twitter.xrayspecs.TimeConversions._
import com.twitter.gizzard.shards.{ShardInfo, Busy}
-object SqlShard extends Specification with JMocker with ClassMocker {
+object SqlShard extends ConfiguredSpecification with JMocker with ClassMocker {
"SqlShard" should {
import Database._
Time.freeze()
Please sign in to comment.
Something went wrong with that request. Please try again.