NanoContainer
  1. NanoContainer
  2. NANO-91

Adjacent Groovy tests sem to interfere with each other.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      1

      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

        Hide
        Kouhei Mori added a comment -

        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.

        Show
        Kouhei Mori added a comment - 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.
        Kouhei Mori made changes -
        Field Original Value New Value
        Attachment NANO-91.patch [ 12369 ]
        Hide
        Paul Hammant added a comment -

        Think this has been solved now (the parantage issue), you try again for the 'adjacent' issue in your env ?

        • paul
        Show
        Paul Hammant added a comment - Think this has been solved now (the parantage issue), you try again for the 'adjacent' issue in your env ? paul
        Hide
        Paul Hammant added a comment -

        yes, is fixed now

        Show
        Paul Hammant added a comment - yes, is fixed now
        Paul Hammant made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Paul Hammant
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: