[
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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]