You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Shu Chao Wan <wa...@cn.ibm.com> on 2008/11/21 06:00:14 UTC
Question about conformance item ASM60004
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: wansc@cn.ibm.com
Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang
West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC
Re: Question about conformance item ASM60004
Posted by Simon Laws <si...@googlemail.com>.
On Tue, Nov 25, 2008 at 2:09 PM, Mike Edwards <
mike.edwards.inglenook@gmail.com> wrote:
> 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: wansc@cn.ibm.com Address: 3/F, Diamond Building, ZhongGuanCun
>> Software Park , Dongbeiwang West Road No.8, ShangDi, Haidian District,
>> Beijing 100193, PRC
>>
>
>
Absolutely ;-)
Simon
Re: Question about conformance item ASM60004
Posted by Mike Edwards <mi...@gmail.com>.
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: wansc@cn.ibm.com
> Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang
> West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC
Re: Question about conformance item ASM60004
Posted by Shuchao Wan <wa...@gmail.com>.
I got the following warning message:
WARNING: Promoted component service not found: Composite = {
http://assembly-tests}Assembly-non-service-promote-inner-Composite Service =
NoPromoteComponent
And I've submitted the patch in jira with tuscany-2689
https://issues.apache.org/jira/browse/TUSCANY-2689. The test case is
ASM60004
Thanks.
2008/11/25 Simon Laws <si...@googlemail.com>
>
>
> 2008/11/21 Shu Chao Wan <wa...@cn.ibm.com>
>
>
>> 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: wansc@cn.ibm.com
>> Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang
>> West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC
>
>
> Hi Susan
>
> It looks like this could be a problem. Was there an Error or Warning
> reported in the output when you ran the test? I suggest you submit the test
> on a JIRA and I (or someone) can take a look at it.
>
> Regards
>
> Simon
>
Re: Question about conformance item ASM60004
Posted by Simon Laws <si...@googlemail.com>.
2008/11/21 Shu Chao Wan <wa...@cn.ibm.com>
>
> 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: wansc@cn.ibm.com
> Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang
> West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC
Hi Susan
It looks like this could be a problem. Was there an Error or Warning
reported in the output when you ran the test? I suggest you submit the test
on a JIRA and I (or someone) can take a look at it.
Regards
Simon