Susan,

I think that we owe you some congratulations - your testcase found its first 
bug  ;-)

Yours,  Mike.

Shu Chao Wan wrote:

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