This repository has been archived by the owner on Sep 18, 2021. It is now read-only.
forked from nkallen/Rowz
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stopping point; really hacky integration test infrastructure
- Loading branch information
Nick Kallen
committed
Apr 4, 2010
1 parent
1527072
commit 982ac13
Showing
10 changed files
with
105 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/test/scala/com/twitter/rowz/integration/RowzSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.twitter.rowz.integration | ||
|
||
import org.specs.Specification | ||
import com.twitter.xrayspecs.{Time, Eventually} | ||
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 { | ||
"Rowz" should { | ||
import Database._ | ||
Time.freeze() | ||
val state = Rowz(config, w3c, databaseFactory) | ||
val rowzService = state.rowzService | ||
|
||
doBefore { | ||
state.nameServer.rebuildSchema() | ||
val shard1 = new ShardInfo("com.twitter.rowz.SqlShard", "shard_1", "localhost") | ||
val shardId = state.nameServer.createShard(shard1) | ||
state.nameServer.setForwarding(new Forwarding(0, 0, shardId)) | ||
// state.nameServer.createShard(shard2) | ||
state.start() | ||
} | ||
|
||
"row create & read" in { | ||
println("1") | ||
val id = rowzService.create("row", Time.now.inSeconds) | ||
Thread.sleep(5.seconds.inMillis) | ||
println("2") | ||
rowzService.read(id) | ||
println("3") | ||
val row = rowzService.read(id) | ||
println("4") | ||
row.name mustEqual "row" | ||
println("5") | ||
rowzService.destroy(row, 1.second.fromNow.inSeconds) | ||
println("6") | ||
rowzService.read(id) must eventually(throwA[thrift.RowzException]) | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...scala/com/twitter/rowz/SqlShardSpec.scala → .../com/twitter/rowz/unit/SqlShardSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters