Test Assertions for the SCA_J Common Annotations and APIs Version 1.1 Specification

Committee Draft 01 / Public Review 01

19 July 2010

Specification URIs:

This Version:

http://docs.oasis-open.org/opencsa/sca-j/sca-j-caa-1.1-test-assertions-cd01.html

http://docs.oasis-open.org/opencsa/sca-j/sca-j-caa-1.1-test-assertions-cd01.odt

http://docs.oasis-open.org/opencsa/sca-j/sca-j-caa-1.1-test-assertions-cd01.pdf (Authoritative)

Previous Version:

N/A

Latest Version:

http://docs.oasis-open.org/opencsa/sca-j/sca-j-caa-1.1-test-assertions.html

http://docs.oasis-open.org/opencsa/sca-j/sca-j-caa-1.1-test-assertions.odt

http://docs.oasis-open.org/opencsa/sca-j/sca-j-caa-1.1-test-assertions.pdf (Authoritative)

Technical Committee:

OASIS Service Component Architecture / J (SCA-J) TC
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-j

Chair(s):

Mark Combellack           Avaya
David Booz                   IBM

Editor(s):

Mike Edwards,              IBM

Related Work:

This document is related to:

·     Service Component Architecture Java Common Annotations and APIs Specification Version 1.1
http://docs.oasis-open.org/opencsa/sca-j/sca-javacaa-1.1-spec-cd04.pdf

Declared XML Namespace(s):

None

Abstract:

This document defines the Test Assertions for the SCA J CAA specification.

The Test Assertions represent the testable items relating to the normative statements made in the SCA Java Common Annotations and APIs specification.  The Test Assertions provide a bridge between the normative statements in the specification and the conformance TestCases which are designed to check that an SCA runtime conforms to the requirements of the specification.

Status:

This document was last revised or approved by the OASIS Service Component Architecture / J (SCA-J) TC on the above date. The level of approval is also listed above. Check the “Latest Version” or “Latest Approved Version” location noted above for possible later revisions of this document.

Technical Committee members should send comments on this specification to the Technical Committee’s email list. Others should send comments to the Technical Committee by using the “Send A Comment” button on the Technical Committee’s web page at http://www.oasis-open.org/committees/sca-j/.

For information on whether any patents have been disclosed that may be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the Technical Committee web page (http://www.oasis-open.org/committees/sca-j/ipr.php.

The non-normative errata page for this specification is located at

http://www.oasis-open.org/committees/sca-j/j/

 

Notices

Copyright © OASIS® 2009, 2010. All Rights Reserved.

All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Committee Specification or OASIS Standard, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this specification.

OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this specification by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this specification. OASIS may include such claims on its website, but disclaims any obligation to do so.

OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Committee Specification or OASIS Standard, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.

The name "OASIS" is a trademarks of OASIS, the owner and developer of this specification, and should be used only to refer to the organization and its official outputs. OASIS welcomes reference to, and implementation and use of, specifications, while reserving the right to enforce its marks against misleading uses. Please see http://www.oasis-open.org/who/trademark.php for above guidance.

 

Table of Contents


 


1 Introduction..................................................................................................................................... 5

1.1 Example Test Assertion............................................................................................................. 5

1.2 Terminology.............................................................................................................................. 5

1.3 Normative References............................................................................................................... 6

1.4 Non-Normative References........................................................................................................ 6

2 Test Assertions................................................................................................................................ 7

2.1 Section 2.................................................................................................................................. 7

2.2 Section 3................................................................................................................................ 10

2.3 Section 4................................................................................................................................ 13

2.4 Section 7................................................................................................................................ 19

2.5 Section 8................................................................................................................................ 21

2.6 Section 9................................................................................................................................ 24

2.7 Section 10.............................................................................................................................. 42

2.8 Section 11.............................................................................................................................. 58

3 Cross Mapping of Conformance Statements to Assertions.............................................................. 64

4 Conformance................................................................................................................................. 71

Appendix A.Acknowledgments.......................................................................................................... 72

Appendix B.Revision History............................................................................................................. 73


 

1      Introduction

This document defines the Test Assertions for the SCA Java Common Annotations and APIs Specification Version 1.1.

The test assertions in this document follow the format defined in the OASIS Test Assertion Guidelines specification [TA-GUIDE].

1.1    Example Test Assertion

Test assertions are presented in a tabular format with rows corresponding to the entry types defined in [TA-GUIDE].

 

Assertion ID

JCA-TA-xxxx

Source

[JCAx00yy]

Target

<kitchenSink/> element of composite file

Prerequisites

The <kitchenSink/> element has a @drain attribute

Predicate

The @drain attribute value of the <kitchenSink/> element is a URI that identifies a portal into the drainage system of the Domain.

Prescription Level

Mandatory

Tags

kitchenSink drain Domain

 

Assertion ID: Is a unique ID for the test assertion. Its format starts with a 3 letter string that identifies the specification to which it relates - "JCA" is for the SCA Java Common Annotations and APIs specification.  This is followed by "-TA-" to indicate that this identifier is for a test assertion.  This is then followed by a unique 4 digit number.

Source: Is the identifier(s) of the normative statement(s) in the specification to which this assertion relates.

Target: Identifies the target which is addressed by this assertion.  This is typically some SCA document element, or other SCA artifact but possibly could identify an SCA runtime and its behaviour.

Prerequisites: Defines any prerquisites for this test assertion.  The prerequisites may be defined in terms of one or more other test assertions that must be true.

Predicate: The meat of the assertion - something that should evaluate to true or false for the given target.

Prescription Level: Mandatory (for MUST requirements) or Preferred (for SHOULD requirements) or Permitted (for MAY requirements).

Tags: Zero or more labels that may be attached to this test assertion - these tags can be used to group sets of assertions.

1.2    Terminology

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this specification are to be interpreted as described in IETF RFC 2119 [RFC 2119]

1.3    Normative References

[RFC 2119]              S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. IETF RFC 2119, March 1997.
http://www.ietf.org/rfc/rfc2119.txt.

[TA-GUIDE]             OASIS Committee Draft 04, Test Assertion Guidelines, February 2010. http://docs.oasis-open.org/tag/guidelines/v1.0/cd04/testassertionsguidelines-cd-04.pdf  

[JAVACAA]             OASIS Committee Draft 04, "Service Component Architecture SCA-J Common Annotations and APIs Specification Version 1.1", July 2010
http://docs.oasis-open.org/opencsa/sca-j/sca-javacaa-1.1-spec-cd04.pdf

1.4    Non-Normative References

N/A

2      Test Assertions

2.1    Section 2

 

Assertion ID

JCA-TA-2001

Source

[JCA20001]

Target

Java service marked remotable

Prerequisites

 

Predicate

Service does not use method overloading

Prescription Level

mandatory

Tags

"remotable" "overloading"

 

 

Assertion ID

JCA-TA-2002

Source

[JCA20002]

Target

Stateless scoped Java implementation instance

Prerequisites

 

Predicate

Implementation instance is dispatched on a single thread at one time

Prescription Level

mandatory

Tags

"stateless scope" "single thread"

 

 

Assertion ID

JCA-TA-2003

Source

[JCA20003]

Target

Stateless scoped Java implementation instance

Prerequisites

 

Predicate

Implementation instance is invoked once through one business method during the lifetime of the implementation instance

Prescription Level

mandatory

Tags

"stateless scope" "lifetime" "invocation"

 

 

Assertion ID

JCA-TA-2004

Source

[JCA20004]

Target

Domain level component implemented by a Java class marked "composite scope"

Prerequisites

 

Predicate

All clients of the component appear to interact with a single runtime instance of the implementation class

Prescription Level

mandatory

Tags

"composite scope" "invocation"

 

 

Assertion ID

JCA-TA-2005

Source

[JCA20005]

Target

Java implementation class marked with "composite scope" and with "eager initialization"

Prerequisites

Containing component is started

Predicate

The Java implementation class instance is created and initialized

Prescription Level

mandatory

Tags

"composite scope" "lifetime" "eager initialization"

 

 

Assertion ID

JCA-TA-2006

Source

[JCA20006]

Target

Method of Java implementation class with marked with @Init annotation

Prerequisites

Implementation instance is created

Predicate

Method is called

Prescription Level

mandatory

Tags

"composite scope" "lifetime" "initialization" "@Init"

 

 

Assertion ID

JCA-TA-2007

Source

[JCA20007]

Target

Instance of a Java implementation class marked "composite scope"

Prerequisites

Implementation class is used as a component implementation

Multiple invocations of services offered by the component are made, which overlap in time

Predicate

Multiple threads run in the single instance of the implementation class

Prescription Level

optional

Tags

"composite scope" "lifetime" "eager initialization"

 

Assertion ID

JCA-TA-2008

Source

[JCA20008]

Target

Java implementation class marked with "composite scope"

Prerequisites

Implementation class is used to implement a component nested inside a composite used to implement a domain level component

Component offers at least one service

Component has one or more clients for its service(s)

Predicate

Clients of the component appear to interact with a single instance of the implementation class

Prescription Level

mandatory

Tags

"composite scope" "nested component" "instance"

 

 

Assertion ID

JCA-TA-2009

Source

[JCA20009]

Target

Client invocation of a method of a service implementation

Prerequisites

Service method implementation marked "allows pass by reference"

Client reference proxy marked "allows pass by reference"

Client and service implementation run in the same JVM

Predicate

The invocation uses pass-by-reference call semantics for the input and response parameters

Prescription Level

optional

Tags

"allows pass by reference" "pass by reference" "local"

 

 

Assertion ID

JCA-TA-2010

Source

[JCA20010]

Target

Client invocation of a service implementation

Prerequisites

Service implementation method not marked "allows pass by reference"

Client and service implementation run in the same JVM

Predicate

The invocation uses pass-by-value semantics for the input and response parameters

Prescription Level

mandatory

Tags

"allows pass by reference" "pass by value "local"

 

 

Assertion ID

JCA-TA-2011

Source

[JCA20010]

Target

Client invocation of a service implementation

Prerequisites

Client reference is not marked "allows pass by reference"

Client and service implementation run in the same JVM

Predicate

The invocation uses pass-by-value semantics for the input and response parameters

Prescription Level

mandatory

Tags

"allows pass by reference" "pass by value "local"

 

 

 

2.2    Section 3

 

Assertion ID

JCA-TA-3001

Source

[JCA30001]

Target

@interface attribute of a <interface.java/> element

Prerequisites

 

Predicate

Value of @interface attribute is the fully qualified name of a Java interface class

Prescription Level

mandatory

Tags

"interface element" "interface attribute" "Java interface class"

 

 

Assertion ID

JCA-TA-3002

Source

[JCA30002]

Target

@callbackInterface attribute of <interface.java/> element

Prerequisites

interface.java element has a @callbackInterface attribute

Predicate

Value of @callbackInterface is the fully qualified name of a Java interface class

Prescription Level

mandatory

Tags

"interface element" "callbackInterface attribute" "Java interface class"

 

 

Assertion ID

JCA-TA-3003

Source

[JCA30003]

Target

@callbackInterface attribute of a <interface.java/> element

Prerequisites

interface.java element has a @callbackInterface attribute

Java interface class referenced by the @interface attribute contains a @Callback annotation which references a Java interface class

Predicate

Value of @callbackInterface attribute is the same Java interface class as the one referenced by the @Callback annotation of the Java interface class referenced by the @interface attribute

Prescription Level

mandatory

Tags

"interface element" "callbackInterface attribute" "Java interface class" "@Callback"

 

 

Assertion ID

JCA-TA-3004

Source

[JCA30004]

Target

<interface.java/> element

Prerequisites

 

Predicate

Conforms to the sca-interface-java.xsd schema

Prescription Level

mandatory

Tags

"interface element" "schema"

 

 

Assertion ID

JCA-TA-3005

Source

[JCA30005]

Target

@remotable attribute on <interface.java/> element

Prerequisites

Java interface class referenced by @interface attribute of interface.java element contains a @Remotable annotation

Predicate

@remotable attribute has the value "true"

Prescription Level

mandatory

Tags

"interface element" "remotable attribute" "Java interface class" "@Remotable"

 

 

Assertion ID

JCA-TA-3006

Source

[JCA30006]

Target

Java interface class referenced by @interface attribute of a <interface.java/> element

Prerequisites

 

Predicate

Java interface class does not contain any of the annotations: @AllowsPassByReference, @ComponentName, @Constructor, @Context, @Destroy, @EagerInit, @Init, @Intent, @Property, @Qualifier, @Reference, @Scope, @Service.

Prescription Level

mandatory

Tags

"interface element" "SCA annotations" "Java interface class"

 

 

Assertion ID

JCA-TA-3007

Source

[JCA30007]

Target

Java interface class referenced by @callbackInterface attribute of a <interface.java/> element

Prerequisites

 

Predicate

Java interface class does not contain any of the annotations: @AllowsPassByReference, @Callback, @ComponentName, @Constructor, @Context, @Destroy, @EagerInit, @Init, @Intent, @Property, @Qualifier, @Reference, @Scope, @Service.

Prescription Level

mandatory

Tags

"interface element" "SCA annotations" "Java interface class"

 

 

Assertion ID

JCA-TA-3008

Source

[JCA30009]

Target

2 java interface classes, A and B

Prerequisites

a) Interface classes A is compatible with interface class B, or is a compatible superset of B or is a compatible subset of B

b) One or more of the methods contained in A or in B is annotated with @OneWay

Predicate

Every method which is present in both interface A and in interface B and  which is annotated with @OneWay in either interface class is also annotated with @OneWay in the other interface class.

Prescription Level

mandatory

Tags

"interface classes" "@OneWay" "compatible"

 

Assertion ID

JCA-TA-3009

Source

[JCA30010]

Target

<interface.java/> element within a composite

Prerequisites

a) element references a Java class which contains a @WebService annotation or a @WebServiceProvider annotation

b) the annotation contains a non-empty wsdlLocation property pointing at a WSDL document

Predicate

<interface.java/> element is treated as if it were an <interface.wsdl/> element with an @interface attribute identifying the portType in the WSDL document mapped from the Java interface class and containing @requires and @policySets attributes equal to the @requires and @policySets attributes of the <interface.java/> element

Prescription Level

mandatory

Tags

"interface.java element" "@WebService" "@WebServiceProvider" "interface.wsdl element"

 

 

2.3    Section 4

 

Assertion ID

JCA-TA-4001

Source

[JCA40001]

Target

Constructor of Java component implementation class

Prerequisites

Component is at the start of the Constructing state of its lifecycle

Predicate

Constructor is invoked by the SCA runtime

Prescription Level

mandatory

Tags

"lifecycle" "constructing" "constructor"

 

 

Assertion ID

JCA-TA-4002

Source

[JCA40002]

Target

Constructor of Java component implementation class

Prerequisites

Constructor is invoked by the SCA runtime at the start of the Constructing state of its lifecycle

Predicate

Constructor references and properties are injected when the constructor is invoked

Prescription Level

mandatory

Tags

"lifecycle" "constructing" "constructor" "injection" "reference" "property"

 

 

Assertion ID

JCA-TA-4003

Source

[JCA40003]

Target

Java component implementation class in Constructing state

Prerequisites

Constructor method completes successfully

Predicate

Component implementation transitions to the Injecting state

Prescription Level

mandatory

Tags

"lifecycle" "constructing" "injecting" "transition"

 

Assertion ID

JCA-TA-4004

Source

[JCA40004]

Target

Java component implementation class in Constructing state

Prerequisites

Constructor method throws an exception

Predicate

Component implementation class is transitioned to the Terminating state

Prescription Level

mandatory

Tags

"lifecycle" "constructor" "exception" "terminating"

 

Assertion ID

JCA-TA-4005

Source

[JCA40005]

Target

Java component implementation class in Injecting state

Prerequisites

Implementation has one or more properties

Predicate

Properties are injected (via field or setter injection) before any other actions occur

Prescription Level

mandatory

Tags

"lifecycle" "injecting" "property"

 

Assertion ID

JCA-TA-4006

Source

[JCA40006]

Target

Java component implementation class in Injecting state

Prerequisites

Implementation has one or more references

Implementation has one or more properties

Predicate

References are injected (via field or setter injection) after properties have been injected

Prescription Level

mandatory

Tags

"lifecycle" "injecting" "reference"

 

 

Assertion ID

JCA-TA-4007

Source

[JCA40007]

Target

Java component implementation with one or more injected property / reference

Prerequisites

Implementation code does not use synchronization

Predicate

Injected properties and references are visible to the component implementation

Prescription Level

mandatory

Tags

"lifecycle" "injecting" "synchronization" "property" "reference"

 

Assertion ID

JCA-TA-4008

Source

[JCA40008]

Target

Java component implementation in injecting state

Prerequisites

Implementation has 1 or more service methods

Predicate

Service methods are not invoked

Prescription Level

mandatory

Tags

"lifecycle" "injecting" "service methods"

 

Assertion ID

JCA-TA-4009

Source

[JCA40009]

Target

Java component implementation in injecting state

Prerequisites

All properties and references have been injected

Predicate

Component implementation transitions to the Initializing state

Prescription Level

mandatory

Tags

"lifecycle" "injecting" "transition" "initializing"

 

Assertion ID

JCA-TA-4010

Source

[JCA40010]

Target

Java component implementation in injecting state

Prerequisites

Exception is thrown while a property or a reference is being injected

Predicate

Component implementation transitions to the Destroying state

Prescription Level

mandatory

Tags

"lifecycle" "injecting" "exception" "transition" "destroying"

 

Assertion ID

JCA-TA-4011

Source

[JCA40011]

Target

Java component implementation entering initializing state

Prerequisites

Implementation has a method annotated with @Init

Predicate

Method annotated with @Init is invoked

Prescription Level

mandatory

Tags

"lifecycle" "initializing" "@Init"

 

 

Assertion ID

JCA-TA-4012

Source

[JCA40012]

Target

Java component implementation in initializing state

Prerequisites

Implementation has an injected reference

Target of injected reference has not been initialized

Implementation invokes a method on the reference

Predicate

Implementation receives a ServiceUnavailableException

Prescription Level

mandatory

Tags

"lifecycle" "injecting" "exception" "reference" "uninitialized"

 

Assertion ID

JCA-TA-4013

Source

[JCA40013]

Target

Java component implementation in initializing state

Prerequisites

Implementation has 1 or more service methods

Predicate

Service methods are not invoked

Prescription Level

mandatory

Tags

"lifecycle" "injecting" "service" "invocation"

 

Assertion ID

JCA-TA-4014

Source

[JCA40014]

Target

Java component implementation in initializing state

Prerequisites

Invocation of method annotated with @Init completes successfully

Predicate

Component implementation transitions to the Running state

Prescription Level

mandatory

Tags

"lifecycle" "initializing" "transition" "running"

 

Assertion ID

JCA-TA-4015

Source

[JCA40015]

Target

Java component implementation in initializing state

Prerequisites

Exception is thrown by the component implementation

Predicate

Component implementation transitions to the Destroying state

Prescription Level

mandatory

Tags

"lifecycle" "initializing" "exception" "transition" "destroying"

 

Assertion ID

JCA-TA-4016

Source

[JCA40016]

Target

Java component implementation in running state

Prerequisites

Component has one or more service

Client component invokes one of the service operations

Predicate

Implementation service method corresponding to the operation is invoked

Prescription Level

mandatory

Tags

"lifecycle" "running" "service" "invocation" "method"

 

 

Assertion ID

JCA-TA-4017

Source

[JCA40017]

Target

Java component implementation in running state

Prerequisites

Implementation scope ends

Predicate

Component implementation transitions to the Destroying state

Prescription Level

mandatory

Tags

"lifecycle" "running" "scope ends" "transition" "destroying"

 

Assertion ID

JCA-TA-4018

Source

[JCA40018]

Target

Java component implementation entering Destroying state

Prerequisites

Implementation has a method annotated with @Destroy

Predicate

Method annotated with @Destroy is invoked

Prescription Level

mandatory

Tags

"lifecycle" "destroying" "@Destroy" "transition"

 

Assertion ID

JCA-TA-4019

Source

[JCA40019]

Target

Java component implementation in destroying state

Prerequisites

Implementation has an injected reference

Implementation invokes a method on the reference

Target of reference has already been destroyed

Predicate

Implementation receives an InvalidServiceException

Prescription Level

mandatory

Tags

"lifecycle" "destroying" "exception" "reference"

 

Assertion ID

JCA-TA-4020

Source

[JCA40020]

Target

Java component implementation in destroying state

Prerequisites

Implementation has one or more services

Client component invokes service operations

Predicate

Implementation service methods are not invoked

Prescription Level

mandatory

Tags

"lifecycle" "destroying" "service" "method" "invocation"

 

 

Assertion ID

JCA-TA-4021

Source

[JCA40021]

Target

Java component implementation in Destroying state

Prerequisites

Method with @Destroy annotation completes

Predicate

Component implementation transitions to terminated state

Prescription Level

mandatory

Tags

"lifecycle" "destroying" "@Destroy" "transition" "terminated"

 

Assertion ID

JCA-TA-4022

Source

[JCA40022]

Target

Java component implementation in Destroying state

Prerequisites

Method with @Destroy annotation throws an exception

Predicate

Component implementation transitions to the terminated state

Prescription Level

mandatory

Tags

"lifecycle" "destroying" "exception" "transition" "terminated" "@Destroy"

 

Assertion ID

JCA-TA-4023

Source

[JCA40023]

Target

Java component implementation is in Terminated state

Prerequisites

Component implementation has service

Client component invokes operations on a service

Predicate

Implementation service methods are not invoked

Prescription Level

mandatory

Tags

"lifecycle" "terminated" "service" "invocation"

 

Assertion ID

JCA-TA-4024

Source

[JCA40024]