Hey,

Here is a question about conformance item ASM60004 "A composite <service/> 
element's promote attribute MUST identify one of the component services 
within that composite."

In order to verify this item, I create the following composite file in 
which the value of promote attribute (NoPromoteComponent) is not any 
component service within that composite.
-------------------------------------------------------------------------
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
    xmlns:assembly-tests="http://assembly-tests";
        targetNamespace="http://assembly-tests";
        name="Assembly-non-unique-serviename-Composite">
    <service name="NoPromoteService" promote="NoPromoteComponent"/> 
    <component name="BComponent">
        <implementation.java class=
"org.apache.tuscany.sca.vtest.assembly.composite.impl.BServiceImpl"/>
        <property name="someProperty">some b component value</property>
    </component>
</composite>
-------------------------------------------------------------------------

When I running a testcase to invoke service NoPromoteService, I got a 
NullPointerException exception instead of a expected 
ServiceRuntimeException. 

-------------------------------------------------------------------------
java.lang.NullPointerException
        at 
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.getServiceReference(
DefaultSCADomain.java:574)
        at 
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.getService(
DefaultSCADomain.java:500)
        at 
org.apache.tuscany.sca.vtest.assembly.composite.ServiceFinder.getService(
ServiceFinder.java:52)
        at 
org.apache.tuscany.sca.vtest.assembly.composite.CompositeTestCase.ASM60004(
CompositeTestCase.java:118)
        at 
org.apache.tuscany.sca.vtest.assembly.composite.CompositeTestCase.main(
CompositeTestCase.java:254)
-------------------------------------------------------------------------

I looked into the file 
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain,and found that 
in the getServiceReference method there has the following statement, and 
the variable componentContext will be set as null after the statement has 
been executed. 
-------------------------------------------------------------------------
componentContext = 
(RuntimeComponent)compositeService.getPromotedComponent()).
getComponentContext();
-------------------------------------------------------------------------

Is there any problem with this case? Thanks for your help in advance!


Best Regards
Susan Wan (万淑超)
-------------------------
WebSphere Application Server System Verification Test, IBM China SoftWare 
Development Lab
Tel: 86-10-82453655 
E-mail: [EMAIL PROTECTED] 
Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang 
West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC

Reply via email to