You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Yang Lei (JIRA)" <tu...@ws.apache.org> on 2007/01/09 22:49:27 UTC
[jira] Commented: (TUSCANY-911) default value of property( anntated
with @Property) is set to null by default.
[ https://issues.apache.org/jira/browse/TUSCANY-911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463412 ]
Yang Lei commented on TUSCANY-911:
----------------------------------
The property defined:
@Property(name="location")
protected String location = "RTP";
@Property(name="year")
protected String year = "2006";
The scdl
<component name="MyService">
<implementation.java class="mysca.test.myservice.impl.MyServiceImpl"/>
</component>
The test case
public void testDefaultProperty()
{
assertEquals("RTP",myService.getLocation());
assertEquals("2006",myService.getYear());
}
myService = context.locateService(MyService.class, "MyService");
The test result:
testDefaultProperty(mysca.test.myservice.ComponentTest) Time elapsed: 0 sec <<< FAILURE!
junit.framework.ComparisonFailure: expected:<RTP> but was:<null>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals(Assert.java:87)
at mysca.test.myservice.ComponentTest.testDefaultProperty(ComponentTest.java:26)
The code is commited as part of the test cases.
> default value of property( anntated with @Property) is set to null by default.
> ------------------------------------------------------------------------------
>
> Key: TUSCANY-911
> URL: https://issues.apache.org/jira/browse/TUSCANY-911
> Project: Tuscany
> Issue Type: Bug
> Reporter: Yang Lei
> Assigned To: Raymond Feng
>
> I define@Property on the attribute. I give the property a default value in java class. However I noticed when I define Component with the implemenation.java, even though I did not override the property value, the value is always set to null. Is the behavior expected?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org