[
https://issues.apache.org/jira/browse/TUSCANY-965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ignacio Silva-Lepe closed TUSCANY-965.
--------------------------------------
> Context Injection is not functioning
> ------------------------------------
>
> Key: TUSCANY-965
> URL: https://issues.apache.org/jira/browse/TUSCANY-965
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core, Java SCA Integration Tests
> Affects Versions: Java-SCA-M3
> Reporter: Lou Amodeo
> Fix For: Java-SCA-M3
>
>
> Appears that Contesxt injection when using setters and attributes is not
> working. In each case the context attribute is null.
> a) setter method
> package org.apache.tuscany.sca.test;
> import org.osoa.sca.CurrentCompositeContext;
> import org.osoa.sca.ServiceReference;
> import org.osoa.sca.annotations.Reference;
> import org.osoa.sca.annotations.Remotable;
> import org.osoa.sca.annotations.Scope;
> import org.osoa.sca.annotations.Service;
> import org.osoa.sca.annotations.Context;
> import org.osoa.sca.CompositeContext;
> import junit.framework.Assert;
> @Service(CallBackSetCallbackClient.class)
> public class CallBackSetCallbackClientImpl implements
> CallBackSetCallbackClient {
> @Reference
> protected CallBackSetCalbackService aCallBackService;
> @Reference
> protected CallBackSetCallbackCallback callBack;
>
> private CompositeContext context;
>
> @Context
> public void setContext(CompositeContext aContext)
> {
>
> context = aContext;
> }
>
> public void run() {
>
> if (context == null)
> System.out.println("Context is null");
>
> [INFO] [tuscany-itest:start {execution: start}]
> [INFO] Starting Tuscany...
> [INFO] [tuscany-itest:test {execution: test}]
> [INFO] Executing tests...
> Context is null
> b) attribute
> package org.apache.tuscany.sca.test;
> import org.osoa.sca.CurrentCompositeContext;
> import org.osoa.sca.ServiceReference;
> import org.osoa.sca.annotations.Reference;
> import org.osoa.sca.annotations.Remotable;
> import org.osoa.sca.annotations.Scope;
> import org.osoa.sca.annotations.Service;
> import org.osoa.sca.annotations.Context;
> import org.osoa.sca.CompositeContext;
> import junit.framework.Assert;
> @Service(CallBackSetCallbackClient.class)
> public class CallBackSetCallbackClientImpl implements
> CallBackSetCallbackClient {
> @Reference
> protected CallBackSetCalbackService aCallBackService;
> @Reference
> protected CallBackSetCallbackCallback callBack;
> @Context
> protected CompositeContext context;
>
> public void run() {
>
> if (context == null)
> System.out.println("Context is null");
>
> [WARNING] Unable to get resource from repository central
> (http://repo1.maven.or
> /maven2)
> [INFO] [tuscany-itest:start {execution: start}]
> [INFO] Starting Tuscany...
> [INFO] [tuscany-itest:test {execution: test}]
> [INFO] Executing tests...
> Context is null
--
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]