OuterTestCase in itest/recursive produces assertion failure
-----------------------------------------------------------

                 Key: TUSCANY-2484
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2484
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Assembly Model
    Affects Versions: Java-SCA-1.3
            Reporter: Simon Nash
            Priority: Critical
             Fix For: Java-SCA-1.3


With 1.3 RC1a, itest/recursive produces the following assertion failure:

Running test.OuterTestCase
20-Jul-2008 22:06:14 
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor 
read
WARNING: Element {http://schemas.xmlsoap.org/ws/2004/09/policy}Policy cannot be 
processed. ([row,col,system-id]: [36,9,"file:/F:/tuscany-1.3-rc1a/tuscany-sca-1.
3-src/itest/recursive/target/classes/policy/definitions.xml"])
20-Jul-2008 22:06:14 
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor
WARNING: Element {http://schemas.xmlsoap.org/ws/2004/09/policy}Policy cannot be 
processed. ([row,col,system-id]: [36,9,"file:/F:/tuscany-1.3-rc1a/tuscany-sca-1.
3-src/itest/recursive/target/classes/policy/definitions.xml"])
20-Jul-2008 22:06:14 
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor 
read
WARNING: Element {http://schemas.xmlsoap.org/ws/2004/09/policy}Policy cannot be 
processed. ([row,col,system-id]: [43,9,"file:/F:/tuscany-1.3-rc1a/tuscany-sca-1.
3-src/itest/recursive/target/classes/policy/definitions.xml"])
20-Jul-2008 22:06:14 
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor
WARNING: Element {http://schemas.xmlsoap.org/ws/2004/09/policy}Policy cannot be 
processed. ([row,col,system-id]: [43,9,"file:/F:/tuscany-1.3-rc1a/tuscany-sca-1.
3-src/itest/recursive/target/classes/policy/definitions.xml"])
uniSource: OuterSource
junit.framework.AssertionFailedError: null
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.assertTrue(Assert.java:20)
        at junit.framework.Assert.assertTrue(Assert.java:27)
        at test.OuterTestCase.test(OuterTestCase.java:44)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at 
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
        at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.294 sec
        at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
        at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
        at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)

The failure does not stop the build because of the following code in 
OuterTestCase.java:
    public void test() throws Exception {
        try {
            String result = aggregator.getAggregatedData();
            assertTrue(result.contains("InnerSource"));
            assertTrue(result.contains("OuterSource"));
            System.out.println(result);
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
The catch clause prints and swallows the exception and thus hides the failure 
from maven.

When running the same test case on 1.2, the failure does not occur and correct 
results are returned as follows:

Running test.OuterTestCase
20-Jul-2008 21:42:42 
org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl$1 problem
WARNING: Component reference uniSource has more than one wires
uniSource: OuterSource
multiSource: OuterSource, InnerSource
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.197 sec

When running this on 1.3, the line "multiSource: OuterSource, InnerSource" is 
not returned, and this causes the assertion failure.

This test case is testing promotion of an inner component reference with 
multiplicity > 1 and adding an additional wire at the outer promoted level.  
The failure with 1.3 indicates that this functionality has regressed because of 
some change between 1.2 and 1.3.  (I have some suspicions as to where this may 
be.)  This is a serious regression and I have marked this as a critical bug 
that needs to be fixed before releasing 1.3.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to