diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-09 22:24:55 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-09 22:24:55 +0000 |
commit | 8c7f53c15bf5b2dc64d96e1bee8b1f8cc632d48a (patch) | |
tree | 7ea9c24be52993fc36a414df4a52b1e1c35c985e /java/sca/modules/extensibility-equinox/src/test | |
parent | a1bc5c955317ac6ba27cf44d4575dcdd0ffb654a (diff) |
Use bundle.getResources to discover services
Run the test case within OSGi
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@693637 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/extensibility-equinox/src/test')
2 files changed, 12 insertions, 2 deletions
diff --git a/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java b/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java index f4c0056c05..3126365748 100644 --- a/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java +++ b/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java @@ -42,7 +42,7 @@ import org.osgi.framework.BundleContext; /** * Test the Equinox service discoverer. * - * @version $Rev: $ $Date: $ + * @version $Rev$ $Date$ */ public class EquinoxServiceDiscovererTestCase { private static EquinoxServiceDiscoverer discoverer; @@ -133,10 +133,20 @@ public class EquinoxServiceDiscovererTestCase { @Test public void testDiscovery() { Set<ServiceDeclaration> descriptors = - discoverer.discover("org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory", false); + discoverer.discover("test.TestService", false); Assert.assertEquals(1, descriptors.size()); descriptors = discoverer.discover("notthere", false); Assert.assertEquals(0, descriptors.size()); } + @Test + public void testDiscoveryFirst() { + Set<ServiceDeclaration> descriptors = + discoverer.discover("test.TestService", true); + Assert.assertEquals(1, descriptors.size()); + descriptors = discoverer.discover("notthere", true); + Assert.assertEquals(0, descriptors.size()); + } + + } diff --git a/java/sca/modules/extensibility-equinox/src/test/resources/test-bundle.jar b/java/sca/modules/extensibility-equinox/src/test/resources/test-bundle.jar Binary files differindex a4dc54170e..afee051f61 100644 --- a/java/sca/modules/extensibility-equinox/src/test/resources/test-bundle.jar +++ b/java/sca/modules/extensibility-equinox/src/test/resources/test-bundle.jar |