Added TypedActor and TypedTransactor base classes.
Renamed ActiveObject factory object to TypedActor. Improved network protocol for TypedActor. Remote TypedActors now identified by UUID.
This commit is contained in:
parent
3f0fba4654
commit
add77029e0
84 changed files with 2278 additions and 1445 deletions
|
|
@ -11,14 +11,14 @@ import org.springframework.core.io.ResourceEditor
|
|||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
/**
|
||||
* Test for ActiveObjectFactoryBean
|
||||
* Test for TypedActorFactoryBean
|
||||
* @author michaelkober
|
||||
*/
|
||||
@RunWith(classOf[JUnitRunner])
|
||||
class ActiveObjectFactoryBeanTest extends Spec with ShouldMatchers {
|
||||
class TypedActorFactoryBeanTest extends Spec with ShouldMatchers {
|
||||
|
||||
describe("A ActiveObjectFactoryBean") {
|
||||
val bean = new ActiveObjectFactoryBean
|
||||
describe("A TypedActorFactoryBean") {
|
||||
val bean = new TypedActorFactoryBean
|
||||
it("should have java getters and setters for all properties") {
|
||||
bean.setTarget("java.lang.String")
|
||||
assert(bean.getTarget == "java.lang.String")
|
||||
|
|
@ -26,7 +26,7 @@ class ActiveObjectFactoryBeanTest extends Spec with ShouldMatchers {
|
|||
assert(bean.getTimeout == 1000)
|
||||
}
|
||||
|
||||
it("should create a remote active object when a host is set") {
|
||||
it("should create a remote typed actor when a host is set") {
|
||||
bean.setHost("some.host.com");
|
||||
assert(bean.isRemote)
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ class ActiveObjectFactoryBeanTest extends Spec with ShouldMatchers {
|
|||
assert(bean.hasInterface)
|
||||
}
|
||||
|
||||
it("should create an active object with dispatcher if dispatcher is set") {
|
||||
it("should create an typed actor with dispatcher if dispatcher is set") {
|
||||
val props = new DispatcherProperties()
|
||||
props.dispatcherType = "executor-based-event-driven"
|
||||
bean.setDispatcher(props);
|
||||
|
|
@ -49,7 +49,7 @@ class ActiveObjectFactoryBeanTest extends Spec with ShouldMatchers {
|
|||
}
|
||||
|
||||
it("should create a proxy of type ResourceEditor") {
|
||||
val bean = new ActiveObjectFactoryBean()
|
||||
val bean = new TypedActorFactoryBean()
|
||||
// we must have a java class here
|
||||
bean.setTarget("org.springframework.core.io.ResourceEditor")
|
||||
val entries = new PropertyEntries()
|
||||
|
|
@ -78,7 +78,7 @@ class ActiveObjectFactoryBeanTest extends Spec with ShouldMatchers {
|
|||
assert(pojoInf.gotApplicationContext)
|
||||
}
|
||||
|
||||
it("should stop the created active object when scope is singleton and the context is closed") {
|
||||
it("should stop the created typed actor when scope is singleton and the context is closed") {
|
||||
var ctx = new ClassPathXmlApplicationContext("appContext.xml");
|
||||
val target = ctx.getBean("bean-singleton").asInstanceOf[SampleBean]
|
||||
assert(!target.down)
|
||||
|
|
@ -86,7 +86,7 @@ class ActiveObjectFactoryBeanTest extends Spec with ShouldMatchers {
|
|||
assert(target.down)
|
||||
}
|
||||
|
||||
it("should not stop the created active object when scope is prototype and the context is closed") {
|
||||
it("should not stop the created typed actor when scope is prototype and the context is closed") {
|
||||
var ctx = new ClassPathXmlApplicationContext("appContext.xml");
|
||||
val target = ctx.getBean("bean-prototype").asInstanceOf[SampleBean]
|
||||
assert(!target.down)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue