Refining Supervision API and remove AllForOne, OneForOne and replace with AllForOneStrategy, OneForOneStrategy etc

This commit is contained in:
Viktor Klang 2010-10-19 14:17:22 +02:00
parent 3af056f137
commit 470cd00ca6
23 changed files with 123 additions and 129 deletions

View file

@ -11,7 +11,7 @@ import ScalaDom._
import org.w3c.dom.Element
import org.springframework.beans.factory.support.BeanDefinitionBuilder
import se.scalablesolutions.akka.config.Supervision. {RestartStrategy, AllForOne}
import se.scalablesolutions.akka.config.Supervision. {FaultHandlingStrategy, AllForOneStrategy}
/**
* Test for SupervisionBeanDefinitionParser
@ -35,13 +35,11 @@ class SupervisionBeanDefinitionParserTest extends Spec with ShouldMatchers {
it("should parse the supervisor restart strategy") {
parser.parseSupervisor(createSupervisorElement, builder);
val strategy = builder.getBeanDefinition.getPropertyValues.getPropertyValue("restartStrategy").getValue.asInstanceOf[RestartStrategy]
val strategy = builder.getBeanDefinition.getPropertyValues.getPropertyValue("restartStrategy").getValue.asInstanceOf[FaultHandlingStrategy]
assert(strategy ne null)
assert(strategy.scheme match {
case AllForOne => true
case _ => false })
expect(3) { strategy.maxNrOfRetries }
expect(1000) { strategy.withinTimeRange }
assert(strategy.isInstanceOf[AllForOneStrategy])
expect(3) { strategy.asInstanceOf[AllForOneStrategy].maxNrOfRetries.get }
expect(1000) { strategy.asInstanceOf[AllForOneStrategy].withinTimeRange.get }
}
it("should parse the supervised typed actors") {