Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
If the only tests in NanoGroovyBuilderTestCase were
testInstantiateBasicComponent() and
testInstantiateWithChildContainer() you'll notice that commenting out one or the other results in tests passing, yet both uncommented results in the second one failing.
There is some Groovy artefact bleeding from one run to another perhaps.
Activity
Kouhei Mori
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | NANO-91.patch [ 12369 ] |
Paul Hammant
made changes -
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] |
In my environment, testInstantiateWithChildContainer() always fails (commenting out testInstantiateBasicComponent() or not).
Testcase: testInstantiateWithChildContainer(org.nanocontainer.script.groovy.NanoGroovyBuilderTestCase): Caused an ERROR
org.nanocontainer.script.groovy.Xxx$B doesn't have any satisfiable constructors. Unsatisfiable dependencies: [[class org.nanocontainer.script.groovy.Xxx$A]]
org.picocontainer.defaults.UnsatisfiableDependenciesException: org.nanocontainer.script.groovy.Xxx$B doesn't have any satisfiable constructors. Unsatisfiable dependencies: [[class org.nanocontainer.script.groovy.Xxx$A]]
at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getGreediestSatisfiableConstructor(ConstructorInjectionComponentAdapter.java:138)
[snip]
It seems NanoContainerBuilder#createContainer does not set proper parent/child relationship between "parent" and "softPico".
When modified as:
Index: src/java/org/nanocontainer/script/groovy/NanoGroovyBuilder.java
===================================================================
RCS file: /scm/picocontainer/java/nanocontainer/src/java/org/nanocontainer/script/groovy/NanoGroovyBuilder.java,v
retrieving revision 1.6
diff -u -r1.6 NanoGroovyBuilder.java
src/java/org/nanocontainer/script/groovy/NanoGroovyBuilder.java 25 Jun 2004 13:40:15 -0000 1.6
+++ src/java/org/nanocontainer/script/groovy/NanoGroovyBuilder.java 26 Jun 2004 09:04:16 -0000
@@ -153,6 +153,7 @@
if (parent != null)
{ System.out.println("--> Setting parent"); + softPico.setParent(parent); parent.addChildContainer(softPico); }else {
System.out.println("--> Not Setting parent");
NanoGroovyBuilderTestCase run successfully.