#301 DI does not work in akka-spring when specifying an interface
This commit is contained in:
parent
7a155c70ba
commit
3e7980a466
6 changed files with 78 additions and 27 deletions
|
|
@ -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") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue