sca-j message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: [NEW ISSUE] Problems with testcases JCA_10013 & JCA_9016
- From: Mike Edwards <mike_edwards@uk.ibm.com>
- To: "OASIS Java" <sca-j@lists.oasis-open.org>
- Date: Tue, 24 Aug 2010 12:06:53 +0100
Target:
sca-j-caa-1.1-testcases-cd01.odt
Description:
JCA_10013
This test intends to check if the introspection
of a Java implementation is able to correctly handle a qualified form of
an intent annotation.
The class service1IntentQualifier
contains the following annotation:
@TestIntent6({"qual1"})
The problems with the test:
a) There is no policySet applied in
the composite to satisfy this intent and so the test will throw an exception
when it is not supposed to
b) The test will work whether or not
the qualified intent annotation is read correctly or not (assuming a policySet
is supplied)
JCA_9016
This has the following problems:
a) The properties validDomainURIString,
invalidDomainURIString are used in a constructor before they are
initialized
b) DomainURIs are not fixed and so need
to be configurable - this requires the value of validDomainURIString to
be settable by the SCA runtime owner
c) Currently, there is a reference in
the Service1SCAClientImpl
class that effectively refers to itself:
public
String validServiceName
= "TEST_JCA_9016Component1/Service1";
- this should correctly be "Component2/Service1"
to reference the other component in the composite file
Proposal:
JCA_10013
This test should be reorganized to be
a negative test.
testIntent6 is a qualified intent with
2 qualifiers which are mutually exclusive
The implementation has testIntent6.qual1
- so if the using component is changed to apply testIntent.qual2 to
the service then there should be an exception thrown
because of a clash of mutually exclusive
intents. This still requires there to be a policySet added to the
service to satisfy both intents. This must be added to the
definitions.xml file and then referenced
in the component.
a) Change to TEST_JCA_10013.composite:
<component
name="TEST_JCA_10013Component1">
<implementation.java
class="org.oasisopen.sca.test.service1IntentQualifier"/>
<!--
Service has testIntent6.qual2 attached which will conflict with the intent
testIntent6.qual1
which is annotated onto the service in the implementation
-->
<service
name="Service1"
requires="test:testIntent6.qual2"
policySets="test:PolicySet6">
<interface.java
interface="org.oasisopen.sca.test.Service1"/>
</service>
<property
name="serviceName">service1</property>
</component>
b) Add to definitions.xml in JCA_General_POJO
contribution:
<policySet
name="PolicySet6"
provides="test:testIntent6"
appliesTo="//binding.sca">
<intentMap
provides="test:testIntent6">
<qualifier
name="qual1">
<!-- This
policy intentionally left blank -->
</qualifier>
<qualifier
name="qual2">
<!-- This
policy intentionally left blank -->
</qualifier>
</intentMap>
</policySet>
c) Update to JCA_10013_TestCase
config.output[0]
=
"exception";
JCA_9016
a) Move the code that uses the validDomainURIString,
invalidDomainURIString properties
into an @Init method:
@Init
public
void
initialize() {
//
Set up the DomainURIs to use from the values of the related Properties
try
{
validDomainURI
= new
URI( validDomainURIString
);
invalidDomainURI
= new
URI( invalidDomainURIString
);
} catch
(Exception e) {
System.out.println("Received
exception creating Domain URIs: "
+ e.toString());
}
}
// end method initialize()
... this ensures that the property
values are already injected before use.
b) Modify the declaration of the component
in Test_JCA_9016.composite to make use of an entity reference:
<!--
Component which performs invocations of the SCAClient API -->
<component
name="TEST_JCA_9016Component1">
<implementation.java
class="org.oasisopen.sca.test.Service1SCAClientImpl"/>
<service
name="Service1">
<interface.java
interface="org.oasisopen.sca.test.Service1"/>
</service>
<property
name="serviceName">service1</property>
<!--
Valid & invalid Domain URIs for the SCAClient API tests -->
<property
name="validDomainURIString">&valid_domain_URI;</property>
<property
name="invalidDomainURIString">foo://RandomName</property>
</component>
... which requires adding a reference
to a DTD containing the entity declaration:
<!DOCTYPE
sca_javacaa SYSTEM
"sca_variables.dtd">
c) Add a sca_variables.dtd DTD file
to the contribution JCA_General_POJO
<!--
* This DTD forms
part of the SCA Java CAA Binding Test Suite.
* It declares a
number of XML Entities which are used in Entity References in some of the
* composites that
are artifacts used in the testcases.
*
* The values declared
in the Entity References are intended to reflect SCA runtime specific
* values for certain
aspects of the composites at runtime - in particular addresses of some
* services.
*
* It is permitted
- indeed it is expected - that an SCA runtime provider will MODIFY the
values
* declared for
the Entity References to match the values which would be expected when
running the
* SCA Java CAA
test suite against a given SCA runtime. The values held in the this
file are
* examples, derived
from running the test suite against the Apache Tuscany SCA
runtime.
-->
<!--
URI of a valid Domain URI as used by JCA_9016 -->
<!ENTITY
valid_domain_URI
"http://Domain1">
d) Fix the reference URI in Service1SCAClientImpl
implementation:
public
String validServiceName
= "TEST_JCA_9016Component2/Service1";
Yours, Mike.
Strategist - Emerging Technologies, SCA & SDO.
Co Chair OASIS SCA Assembly TC.
IBM Hursley Park, Mail Point 146, Winchester, SO21 2JN, Great Britain.
Phone & FAX: +44-1962-818014 Mobile: +44-7802-467431
Email: mike_edwards@uk.ibm.com
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]