Merge branch 'master' of git://github.com/jboner/akka

This commit is contained in:
Hiram Chirino 2010-07-23 19:04:26 -04:00
commit e4c980b8f1
38 changed files with 62 additions and 77 deletions

View file

@ -7,9 +7,9 @@ package se.scalablesolutions.akka
import se.scalablesolutions.akka.serialization.Serializable
import sbinary._
import sbinary.Operations._
import sbinary.DefaultProtocol._
sealed abstract class TestMessage
case object Ping extends TestMessage
case object Pong extends TestMessage
case object OneWay extends TestMessage

View file

@ -5,7 +5,6 @@
package se.scalablesolutions.akka.actor
import org.scalatest.Spec
import org.scalatest.Assertions
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.BeforeAndAfterAll
import org.scalatest.junit.JUnitRunner

View file

@ -8,7 +8,6 @@ import com.google.inject.AbstractModule
import com.google.inject.Scopes
import org.scalatest.Spec
import org.scalatest.Assertions
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.BeforeAndAfterAll
import org.scalatest.junit.JUnitRunner
@ -18,7 +17,6 @@ import se.scalablesolutions.akka.config.Config
import se.scalablesolutions.akka.config.ActiveObjectConfigurator
import se.scalablesolutions.akka.config.JavaConfig._
import se.scalablesolutions.akka.dispatch._
import se.scalablesolutions.akka.dispatch.FutureTimeoutException
@RunWith(classOf[JUnitRunner])
class ActiveObjectGuiceConfiguratorSpec extends

View file

@ -4,7 +4,7 @@ import org.scalatest.Suite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.MustMatchers
import org.junit.{Before, After, Test}
import org.junit.Test
import java.util.concurrent.{ CountDownLatch, TimeUnit }
@RunWith(classOf[JUnitRunner])

View file

@ -1,10 +1,6 @@
package se.scalablesolutions.akka.actor
import se.scalablesolutions.akka.actor.Actor.transactor
import se.scalablesolutions.akka.stm.Transaction.Global.atomic
import se.scalablesolutions.akka.util.Logging
import Actor._
import org.scalatest.Suite
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.MustMatchers

View file

@ -5,17 +5,14 @@
package se.scalablesolutions.akka.actor
import org.scalatest.Spec
import org.scalatest.Assertions
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.BeforeAndAfterAll
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import se.scalablesolutions.akka.config.Config
import se.scalablesolutions.akka.config._
import se.scalablesolutions.akka.config.ActiveObjectConfigurator
import se.scalablesolutions.akka.config.JavaConfig._
import se.scalablesolutions.akka.actor._
@RunWith(classOf[JUnitRunner])
class DeclarativelySupervisedNestedTransactionalActiveObjectSpec extends

View file

@ -5,17 +5,14 @@
package se.scalablesolutions.akka.actor
import org.scalatest.Spec
import org.scalatest.Assertions
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.BeforeAndAfterAll
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import se.scalablesolutions.akka.config.Config
import se.scalablesolutions.akka.config._
import se.scalablesolutions.akka.config.ActiveObjectConfigurator
import se.scalablesolutions.akka.config.JavaConfig._
import se.scalablesolutions.akka.actor._
@RunWith(classOf[JUnitRunner])
class DeclarativelySupervisedTransactionalActiveObjectSpec extends

View file

@ -3,9 +3,9 @@ package se.scalablesolutions.akka.actor
import org.scalatest.junit.JUnitSuite
import org.junit.Test
import Actor._
import java.util.concurrent.TimeUnit
import org.multiverse.api.latches.StandardLatch
import Actor._
class ReceiveTimeoutSpec extends JUnitSuite {
@ -74,4 +74,4 @@ class ReceiveTimeoutSpec extends JUnitSuite {
assert(timeoutLatch.tryAwait(1, TimeUnit.SECONDS) == false)
}
}
}

View file

@ -84,4 +84,4 @@ class SchedulerSpec extends JUnitSuite {
// should be enough time for the ping countdown to recover and reach 6 pings
assert(pingLatch.await(4, TimeUnit.SECONDS))
}
}
}

View file

@ -6,7 +6,6 @@ package se.scalablesolutions.akka.actor
import se.scalablesolutions.akka.config.ScalaConfig._
import se.scalablesolutions.akka.config.OneForOneStrategy
import se.scalablesolutions.akka.dispatch.Dispatchers
import se.scalablesolutions.akka.{OneWay, Die, Ping}
import Actor._

View file

@ -1,9 +1,10 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.dispatch
import java.util.concurrent.{CountDownLatch, TimeUnit}
import org.scalatest.junit.JUnitSuite
import org.junit.Test
import se.scalablesolutions.akka.dispatch.Dispatchers
import se.scalablesolutions.akka.actor.Actor
import Actor._
object ExecutorBasedEventDrivenDispatcherActorSpec {

View file

@ -1,10 +1,10 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.dispatch
import org.scalatest.junit.JUnitSuite
import org.junit.Test
import se.scalablesolutions.akka.dispatch.Dispatchers
import org.scalatest.matchers.MustMatchers
import java.util.concurrent.CountDownLatch
import se.scalablesolutions.akka.actor.Actor
import Actor._
/**

View file

@ -1,4 +1,4 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.dispatch
import org.scalatest.matchers.MustMatchers
import org.scalatest.junit.JUnitSuite
@ -6,9 +6,10 @@ import org.scalatest.junit.JUnitSuite
import org.junit.Test
import se.scalablesolutions.akka.dispatch.Dispatchers
import Actor._
import java.util.concurrent.{TimeUnit, CountDownLatch}
import se.scalablesolutions.akka.actor.{IllegalActorStateException, Actor}
import Actor._
object ExecutorBasedEventDrivenWorkStealingDispatcherSpec {
val delayableActorDispatcher = Dispatchers.newExecutorBasedEventDrivenWorkStealingDispatcher("pooled-dispatcher")

View file

@ -1,11 +1,12 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.dispatch
import java.util.concurrent.{CountDownLatch, TimeUnit}
import org.scalatest.junit.JUnitSuite
import org.junit.Test
import Actor._
import se.scalablesolutions.akka.dispatch.Dispatchers
import se.scalablesolutions.akka.actor.Actor
import Actor._
object ReactorBasedSingleThreadEventDrivenDispatcherActorSpec {
class TestActor extends Actor {

View file

@ -1,10 +1,11 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.dispatch
import java.util.concurrent.{CountDownLatch, TimeUnit}
import org.scalatest.junit.JUnitSuite
import org.junit.Test
import se.scalablesolutions.akka.dispatch.Dispatchers
import se.scalablesolutions.akka.actor.Actor
import Actor._
object ReactorBasedThreadPoolEventDrivenDispatcherActorSpec {

View file

@ -1,10 +1,11 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.dispatch
import java.util.concurrent.{CountDownLatch, TimeUnit}
import org.scalatest.junit.JUnitSuite
import org.junit.Test
import se.scalablesolutions.akka.dispatch.Dispatchers
import se.scalablesolutions.akka.actor.Actor
import Actor._
object ThreadBasedActorSpec {

View file

@ -1,13 +1,12 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.remote
import java.util.concurrent.{CountDownLatch, TimeUnit}
import junit.framework.TestCase
import org.scalatest.junit.JUnitSuite
import org.junit.{Test, Before, After}
import se.scalablesolutions.akka.remote.{RemoteServer, RemoteClient}
import se.scalablesolutions.akka.dispatch.Dispatchers
import se.scalablesolutions.akka.actor.{ActorRef, Actor}
import Actor._
case class Send(actor: Actor)

View file

@ -2,20 +2,17 @@
* Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se>
*/
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.remote
import java.util.concurrent.{LinkedBlockingQueue, TimeUnit, BlockingQueue}
import se.scalablesolutions.akka.serialization.BinaryString
import se.scalablesolutions.akka.config.ScalaConfig._
import se.scalablesolutions.akka.config.Config
import se.scalablesolutions.akka.remote.{RemoteNode, RemoteServer, RemoteClient}
import se.scalablesolutions.akka.remote.{RemoteServer, RemoteClient}
import se.scalablesolutions.akka.OneWay
import se.scalablesolutions.akka.dispatch.Dispatchers
import Actor._
import org.scalatest.junit.JUnitSuite
import org.junit.Test
import org.junit.{Test, Before, After}
import se.scalablesolutions.akka.actor.{SupervisorFactory, Supervisor, ActorRef, Actor}
import Actor._
object Log {
val messageLog: BlockingQueue[String] = new LinkedBlockingQueue[String]

View file

@ -2,19 +2,16 @@
* Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se>
*/
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.remote
import org.scalatest.Spec
import org.scalatest.Assertions
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.BeforeAndAfterAll
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import org.junit.{Test, Before, After}
import se.scalablesolutions.akka.config.Config
import se.scalablesolutions.akka.config.ActiveObjectConfigurator
import se.scalablesolutions.akka.remote.{RemoteNode, RemoteServer, RemoteClient}
import se.scalablesolutions.akka.remote.{RemoteServer, RemoteClient}
object RemoteTransactionalActiveObjectSpec {
val HOSTNAME = "localhost"

View file

@ -1,4 +1,4 @@
package sample
package se.scalablesolutions.akka.actor.remote
import se.scalablesolutions.akka.actor.Actor
import se.scalablesolutions.akka.remote.{RemoteClient, RemoteNode}

View file

@ -1,12 +1,12 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.remote
import java.util.concurrent.{CountDownLatch, TimeUnit}
import org.scalatest.junit.JUnitSuite
import org.junit.{Test, Before, After}
import Actor._
import se.scalablesolutions.akka.remote.{RemoteServer, RemoteClient}
import se.scalablesolutions.akka.dispatch.Dispatchers
import se.scalablesolutions.akka.actor.{ActorRef, Actor}
import Actor._
object ServerInitiatedRemoteActorSpec {
val HOSTNAME = "localhost"
@ -52,8 +52,6 @@ object ServerInitiatedRemoteActorSpec {
class ServerInitiatedRemoteActorSpec extends JUnitSuite {
import ServerInitiatedRemoteActorSpec._
import se.scalablesolutions.akka.config.Config.config
private val unit = TimeUnit.MILLISECONDS
@Before
@ -84,7 +82,7 @@ class ServerInitiatedRemoteActorSpec extends JUnitSuite {
@Test
def shouldSendWithBang {
val actor = RemoteClient.actorFor(
"se.scalablesolutions.akka.actor.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorUnidirectional",
"se.scalablesolutions.akka.actor.remote.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorUnidirectional",
5000L,
HOSTNAME, PORT)
val result = actor ! "OneWay"
@ -95,7 +93,7 @@ class ServerInitiatedRemoteActorSpec extends JUnitSuite {
@Test
def shouldSendWithBangBangAndGetReply {
val actor = RemoteClient.actorFor(
"se.scalablesolutions.akka.actor.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorBidirectional",
"se.scalablesolutions.akka.actor.remote.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorBidirectional",
5000L,
HOSTNAME, PORT)
val result = actor !! "Hello"
@ -107,7 +105,7 @@ class ServerInitiatedRemoteActorSpec extends JUnitSuite {
def shouldSendWithBangAndGetReplyThroughSenderRef {
implicit val timeout = 500000000L
val actor = RemoteClient.actorFor(
"se.scalablesolutions.akka.actor.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorBidirectional",
"se.scalablesolutions.akka.actor.remote.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorBidirectional",
timeout,
HOSTNAME, PORT)
val sender = actorOf[RemoteActorSpecActorAsyncSender]
@ -122,7 +120,7 @@ class ServerInitiatedRemoteActorSpec extends JUnitSuite {
def shouldSendWithBangBangAndReplyWithException {
implicit val timeout = 500000000L
val actor = RemoteClient.actorFor(
"se.scalablesolutions.akka.actor.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorBidirectional",
"se.scalablesolutions.akka.actor.remote.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorBidirectional",
timeout,
HOSTNAME, PORT)
try {

View file

@ -1,6 +1,5 @@
package se.scalablesolutions.akka.routing
package se.scalablesolutions.akka.actor.routing
import se.scalablesolutions.akka.config.ScalaConfig._
import se.scalablesolutions.akka.actor.Actor
import se.scalablesolutions.akka.actor.Actor._
import se.scalablesolutions.akka.util.Logging
@ -9,12 +8,11 @@ import org.scalatest.Suite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.MustMatchers
import org.junit.{Before, After, Test}
import scala.collection.mutable.HashSet
import org.junit.Test
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.{CountDownLatch, TimeUnit}
import se.scalablesolutions.akka.routing._
@RunWith(classOf[JUnitRunner])
class RoutingSpec extends junit.framework.TestCase with Suite with MustMatchers with Logging {
@ -174,4 +172,4 @@ class RoutingSpec extends junit.framework.TestCase with Suite with MustMatchers
for(a <- List(t1,t2,d1,d2)) a.stop
}
}
}

View file

@ -1,12 +1,11 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.serialization
import java.util.concurrent.{CountDownLatch, TimeUnit}
import java.util.concurrent.TimeUnit
import org.scalatest.junit.JUnitSuite
import org.junit.{Test, Before, After}
import se.scalablesolutions.akka.remote.{RemoteServer, RemoteClient}
import se.scalablesolutions.akka.dispatch.Dispatchers
import se.scalablesolutions.akka.actor.{ProtobufProtocol, Actor}
import ProtobufProtocol.ProtobufPOJO
import Actor._

View file

@ -1,16 +1,15 @@
package se.scalablesolutions.akka.actor
package se.scalablesolutions.akka.actor.serialization
import Actor._
import org.scalatest.Spec
import org.scalatest.Assertions
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.BeforeAndAfterAll
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import com.google.protobuf.Message
import se.scalablesolutions.akka.actor._
import ActorSerialization._
import Actor._
@RunWith(classOf[JUnitRunner])
class SerializableTypeClassActorSpec extends

View file

@ -1,9 +1,7 @@
package se.scalablesolutions.akka.serialization
import junit.framework.TestCase
import org.scalatest.junit.JUnitSuite
import org.junit.{Test, Before, After}
import org.junit.Test
import scala.reflect.BeanInfo

View file

@ -5,13 +5,13 @@ import org.scalatest.matchers.ShouldMatchers
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import se.scalablesolutions.akka.actor.Actor._
import se.scalablesolutions.akka.stm.local._
@RunWith(classOf[JUnitRunner])
class RefSpec extends Spec with ShouldMatchers {
describe("A Ref") {
import local._
it("should optionally accept an initial value") {
val emptyRef = Ref[Int]
@ -153,4 +153,4 @@ class RefSpec extends Spec with ShouldMatchers {
optGreater2 should be(None)
}
}
}
}

View file

@ -4,7 +4,6 @@ import se.scalablesolutions.akka.actor.{Actor, Transactor}
import Actor._
import org.scalatest.Spec
import org.scalatest.Assertions
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.BeforeAndAfterAll
import org.scalatest.junit.JUnitRunner
@ -18,7 +17,7 @@ class StmSpec extends
describe("Local STM") {
it("should be able to do multiple consecutive atomic {..} statements") {
import local._
import se.scalablesolutions.akka.stm.local._
lazy val ref = Ref[Int]()
@ -37,7 +36,7 @@ class StmSpec extends
}
it("should be able to do nested atomic {..} statements") {
import local._
import se.scalablesolutions.akka.stm.local._
lazy val ref = Ref[Int]()
@ -59,7 +58,7 @@ class StmSpec extends
}
it("should roll back failing nested atomic {..} statements") {
import local._
import se.scalablesolutions.akka.stm.local._
lazy val ref = Ref[Int]()

View file

@ -0,0 +1,10 @@
package se.scalablesolutions.akka.actor.tickets
import org.scalatest.junit.JUnitSuite
import org.junit.Test
// Sample ticket spec
class Proof001Spec extends JUnitSuite {
@Test def thisFixesSomeSpecifiedBug = ()
}