You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by kw...@apache.org on 2007/05/10 18:53:12 UTC
svn commit: r536936 - in /incubator/tuscany/java/sca/itest/extended-api/src:
main/java/org/apache/tuscany/sca/test/extended/impl/BasicServiceImpl.java
test/java/org/apache/tuscany/sca/test/extended/ServiceLocateTestCase.java
Author: kwilliams
Date: Thu May 10 09:53:11 2007
New Revision: 536936
URL: http://svn.apache.org/viewvc?view=rev&rev=536936
Log:
Converted test component to use domain.connect and domain.getService
Modified:
incubator/tuscany/java/sca/itest/extended-api/src/main/java/org/apache/tuscany/sca/test/extended/impl/BasicServiceImpl.java
incubator/tuscany/java/sca/itest/extended-api/src/test/java/org/apache/tuscany/sca/test/extended/ServiceLocateTestCase.java
Modified: incubator/tuscany/java/sca/itest/extended-api/src/main/java/org/apache/tuscany/sca/test/extended/impl/BasicServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/extended-api/src/main/java/org/apache/tuscany/sca/test/extended/impl/BasicServiceImpl.java?view=diff&rev=536936&r1=536935&r2=536936
==============================================================================
--- incubator/tuscany/java/sca/itest/extended-api/src/main/java/org/apache/tuscany/sca/test/extended/impl/BasicServiceImpl.java (original)
+++ incubator/tuscany/java/sca/itest/extended-api/src/main/java/org/apache/tuscany/sca/test/extended/impl/BasicServiceImpl.java Thu May 10 09:53:11 2007
@@ -18,6 +18,7 @@
*/
package org.apache.tuscany.sca.test.extended.impl;
+import org.apache.tuscany.host.embedded.SCADomain;
import org.apache.tuscany.sca.test.extended.BasicService;
import org.apache.tuscany.sca.test.extended.MathService;
import org.osoa.sca.ComponentContext;
@@ -35,11 +36,9 @@
}
public int delegateNegate(int theInt) {
-
- MathService service = context.getService(MathService.class, "MathServiceComponent");
-
+ SCADomain domain = SCADomain.connect("sca://local");
+ MathService service = domain.getService(MathService.class, "MathServiceComponent");
return service.negate(theInt);
-
}
Modified: incubator/tuscany/java/sca/itest/extended-api/src/test/java/org/apache/tuscany/sca/test/extended/ServiceLocateTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/extended-api/src/test/java/org/apache/tuscany/sca/test/extended/ServiceLocateTestCase.java?view=diff&rev=536936&r1=536935&r2=536936
==============================================================================
--- incubator/tuscany/java/sca/itest/extended-api/src/test/java/org/apache/tuscany/sca/test/extended/ServiceLocateTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/extended-api/src/test/java/org/apache/tuscany/sca/test/extended/ServiceLocateTestCase.java Thu May 10 09:53:11 2007
@@ -23,7 +23,6 @@
import org.apache.tuscany.host.embedded.SCADomain;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.osoa.sca.ServiceRuntimeException;
@@ -33,50 +32,29 @@
@Test
public void unmanagedLocateService() {
-
BasicService service = domain.getService(BasicService.class, "BasicServiceComponent");
-
assertEquals(-99, service.negate(99));
-
}
-
- //TODO: @Test this fails, how should it be done?
- @Ignore
@Test
public void managedLocateService() {
-
BasicService service = domain.getService(BasicService.class, "BasicServiceComponent");
-
assertEquals(-99, service.delegateNegate(99));
-
}
@Test(expected = ServiceRuntimeException.class)
public void badComponentName() {
-
domain.getService(BasicService.class, "IvalidComponentName");
-
}
@Before
public void init() throws Exception {
-
- // domain = SCADomain.newInstance("BasicService.composite");
-
- domain = SCADomain.newInstance("sca://local", ".", "BasicService.composite", "MathService.composite");
-
- // domain = SCADomain.newInstance( "http://localhost", ".", "BasicService.composite", "MathService.composite");
-
-
-
-
+ domain = SCADomain.newInstance("sca://local", ".", "BasicService.composite", "MathService.composite");
}
@After
public void destroy() throws Exception {
-
domain.close();
-
}
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org