NPE when verifying conformance item ASM60006 in OASIS sepc
----------------------------------------------------------

                 Key: TUSCANY-2701
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2701
             Project: Tuscany
          Issue Type: Test
          Components: Java SCA Assembly Model
    Affects Versions: Java-SCA-1.3
            Reporter: Shu Chao Wan
            Priority: Minor


Conformance item 60006 says that, "The name of a composite <reference/> element 
MUST be unique across all the composite references in the composite."

According to the above description, I wrote a composite file inner.composite 
with two same composite  <reference/> element  "NonUniqueReference" within the 
composite. 
-----------------------
inner.composite
-----------------------
<composite ...>
     <service name="AService" promote="AComponent"/>
     <component name="AComponent">
             <reference name="b" />
             <reference name="c" />
     </component>
     <reference name="NonUniqueReference" promote="AComponent/b" />
     <reference name="NonUniqueReference" promote="AComponent/c" /> 
</composite>

And a outer composite file to use inner composite as the implementation of 
component.
-----------------------
outer.composite
-----------------------
<composite>
      <component name="TestNonUniqueReferenceComponent">
         <implementation.composite 
name="assembly-tests:Assembly-non-unique-reference-inner--Composite"/>
         <reference name="NonUniqueReference" target="BComponent"/>
         <reference name="NonUniqueReference" target="CComponent"/>     
     </component>

    <component name="BComponent">
        <implementation.java 
class="org.apache.tuscany.sca.vtest.assembly.composite.impl.BServiceImpl"/>
        <property name="someProperty">some b component value</property>
    </component>
    
    <component name="CComponent">
        <implementation.java 
class="org.apache.tuscany.sca.vtest.assembly.composite.impl.CServiceImpl"/>     
   
    </component>

</composite>

When I invoke two different methods from the component service AService, I got 
NullPointerException from one method invocation.
--------------
TestCase
--------------
        initDomain("nonuniquereference_outer.composite");
        AService service = ServiceFinder.getService(AService.class, 
"TestNonUniqueReferenceComponent/AService");
        service.getBProperty();
        service.getState();
        cleanupDomain();

Here is the detailed info about exception
-----------------------
Exception Trace
-----------------------
java.lang.NullPointerException
        at 
org.apache.tuscany.sca.vtest.assembly.composite.impl.AServiceImpl.getBProperty(AServiceImpl.java:43)
        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.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:132)
        at 
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
        at $Proxy9.getBProperty(Unknown Source)
        at 
org.apache.tuscany.sca.vtest.assembly.composite.CompositeTestCase.ASM60006(CompositeTestCase.java:209)
        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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
        at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
        at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)




-- 
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