#301 DI does not work in akka-spring when specifying an interface

This commit is contained in:
Johan Rask 2010-07-06 11:49:30 +02:00
parent 7a155c70ba
commit 3e7980a466
6 changed files with 78 additions and 27 deletions

View file

@ -65,14 +65,15 @@ class ActiveObjectFactoryBeanTest extends Spec with ShouldMatchers {
assert(target.getSource === entry.value)
}
it("should create an application context and inject a string dependency") {
it("should create an application context and verify dependency injection") {
var ctx = new ClassPathXmlApplicationContext("appContext.xml");
val target:ResourceEditor = ctx.getBean("bean").asInstanceOf[ResourceEditor]
assert(target.getSource === "someString")
val sampleBean = ctx.getBean("sample").asInstanceOf[SampleBean];
Thread.sleep(300)
assert(sampleBean.gotApplicationContext)
val pojoInf = ctx.getBean("pojoInf").asInstanceOf[PojoInf];
println("pojoInf = " + pojoInf.getString)
assert(pojoInf.getString == "akka rocks")
assert(pojoInf.gotApplicationContext)
}
it("should stop the created active object when scope is singleton and the context is closed") {