Updated imports to use stm package objects
This commit is contained in:
parent
f3335ea11a
commit
79e54d1f00
7 changed files with 16 additions and 17 deletions
|
|
@ -16,9 +16,9 @@ class StmSpec extends
|
|||
ShouldMatchers with
|
||||
BeforeAndAfterAll {
|
||||
|
||||
describe("Transaction.Local") {
|
||||
describe("Local STM") {
|
||||
it("should be able to do multiple consecutive atomic {..} statements") {
|
||||
import Transaction.Local._
|
||||
import local._
|
||||
|
||||
lazy val ref = Ref[Int]()
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ class StmSpec extends
|
|||
}
|
||||
|
||||
it("should be able to do nested atomic {..} statements") {
|
||||
import Transaction.Local._
|
||||
import local._
|
||||
|
||||
lazy val ref = Ref[Int]()
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ class StmSpec extends
|
|||
}
|
||||
|
||||
it("should roll back failing nested atomic {..} statements") {
|
||||
import Transaction.Local._
|
||||
import local._
|
||||
|
||||
lazy val ref = Ref[Int]()
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ class StmSpec extends
|
|||
}
|
||||
}
|
||||
|
||||
describe("Transaction.Global") {
|
||||
describe("Global STM") {
|
||||
it("should be able to initialize with atomic {..} block inside actor constructor") {
|
||||
import GlobalTransactionVectorTestActor._
|
||||
try {
|
||||
|
|
@ -181,17 +181,17 @@ object GlobalTransactionVectorTestActor {
|
|||
}
|
||||
class GlobalTransactionVectorTestActor extends Actor {
|
||||
import GlobalTransactionVectorTestActor._
|
||||
import se.scalablesolutions.akka.stm.Transaction.Global
|
||||
import se.scalablesolutions.akka.stm.global._
|
||||
|
||||
private val vector: TransactionalVector[Int] = Global.atomic { TransactionalVector(1) }
|
||||
private val vector: TransactionalVector[Int] = atomic { TransactionalVector(1) }
|
||||
|
||||
def receive = {
|
||||
case Add(value) =>
|
||||
Global.atomic { vector + value}
|
||||
atomic { vector + value}
|
||||
self.reply(Success)
|
||||
|
||||
case Size =>
|
||||
val size = Global.atomic { vector.size }
|
||||
val size = atomic { vector.size }
|
||||
self.reply(size)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue