Hi,
It turned out this test case is not adding incompatible changes from the
componentType file. We were checking if the field is public upon the
injection of a property value. It was an interpretation of the Java A&A:
1349 Properties may also be injected via public setter methods even when the
@Property annotation is not
1350 present. However, the @Property annotation must be used in order to
inject a property onto a non-public
1351 field. In the case where there is no @Property annotation, the name of
the property is the same as the
1352 name of the field or setter.
See TUSCANY-2289 too.
I just fixed it by not checking if the field is public.
Thanks,
Raymond
--------------------------------------------------
From: "Kevin Williams" <[EMAIL PROTECTED]>
Sent: Thursday, June 12, 2008 10:38 AM
To: "Raymond Feng (JIRA)" <tuscany-dev@ws.apache.org>
Subject: Re: [jira] Commented: (TUSCANY-2383) Cannot define component
property with Component Type File
I may not fully understand your comment but it seems inconsistent to
support the provision of component type information via a type file
for service and reference elements but not for property elements.
In the test I have only removed the @Property annotation from the java
implementation and replaced it with an element in the Component Type
File.
On Thu, Jun 12, 2008 at 10:52 AM, Raymond Feng (JIRA)
<tuscany-dev@ws.apache.org> wrote:
[
https://issues.apache.org/jira/browse/TUSCANY-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604572#action_12604572 ]
Raymond Feng commented on TUSCANY-2383:
---------------------------------------
If the component is implemented in java, I think this is a grey area in
the spec. The spec says the configuration in the componentType should be
compatible with the result from the instrospection of implemention. Let's
say your purpose is to declare a property in the componentType file, then
it has to be associated to a field or setter in the java class. Is the
field/setter required to be protected or public? My understanding is that
we can use the componentType to provide a default value to a property,
but not "add" a new property if it doesn't exist in the impl class.
There are discussions on the ML about if we should use componentType to
redefine the service interface using interface.wsdl. I think these are in
the same area.
Cannot define component property with Component Type File
---------------------------------------------------------
Key: TUSCANY-2383
URL: https://issues.apache.org/jira/browse/TUSCANY-2383
Project: Tuscany
Issue Type: Bug
Components: Java SCA Core Runtime
Affects Versions: Java-SCA-Next
Reporter: Kevin Williams
Lines 450-451 of the Assembly spec:
The componentType element can contain Service elements, Reference
elements and Property elements.
I defined a test that inspects an injected property value. In the
initial version I defined the property using the @Property annotation.
I then tried replacing the annotation with an entry in a Component Type
File without success.
The test:
org.apache.tuscany.sca.vtest.assembly.ctypefile.CompomnentTypeFileTestCase.typeFile3
demonstrates this failure and is currently @Ignore(d)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.