diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-19 13:06:58 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-19 13:06:58 +0000 |
commit | 1f81a54d49573dc5d1470af8c6385af42ae8f56b (patch) | |
tree | b82fe8c898e60bec58e88f108a086fe7f1f27edb /branches/sca-java-1.x/vtest/assembly/component/src/test | |
parent | 82d1f5fe94c59df84a2474f015f2229b6a9c8665 (diff) |
TUSCANY-2675 Patch from Jun Guo to start adding assembly spec vtests. Thanks Jun Guo
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@718951 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/vtest/assembly/component/src/test')
-rw-r--r-- | branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java | 82 |
1 files changed, 81 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java b/branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java index de4fbe39ce..2d245d10a8 100644 --- a/branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java +++ b/branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java @@ -33,6 +33,7 @@ public class ComponentTestCase { private void initDomain(String compositePath) { System.out.println("Setting up"); + ServiceFinder.init(compositePath); } @@ -40,6 +41,8 @@ public class ComponentTestCase { System.out.println("Cleaning up"); ServiceFinder.cleanup(); } + + /** * Lines 92-96: @@ -72,7 +75,7 @@ public class ComponentTestCase { /** * Lines 142-143: * <p> - * name (required) – the name of the component. The name must be unique + * name (required) ?the name of the component. The name must be unique * across all the components in the composite. */ @Test(expected = ServiceRuntimeException.class) @@ -146,5 +149,82 @@ public class ComponentTestCase { cleanupDomain(); } + /** + * Lines 599-601: + * <p> + * ASM50001 + * <p> + * The @name attribute of a <service/> child element of a <componentType/> MUST + * be unique amongst the service elements of that <componentType/> + * + */ + @Test(expected=ServiceRuntimeException.class) + @Ignore("TUSCANY-2675") + public void ASM50001() throws Exception { + initDomain("nonuniqueservicenameincomponenttype.composite"); + AService service = ServiceFinder.getService(AService.class, "ABComponent/AService"); + Assert.assertEquals("OK", service.getState()); + cleanupDomain(); + } + + /** + * Lines 695-697: + * <p> + * ASM50002 + * <p> + * The @name attribute of a service element of a <component/> MUST be unique amongst + * the service elements of that <component/> + * + */ + @Test(expected=ServiceRuntimeException.class) + public void ASM50002() throws Exception { + initDomain("nonuniqueservicenameincomposite.composite"); + DService service = ServiceFinder.getService(DService.class, "CDComponent/CServiceImpl"); + Assert.assertEquals("hello", service.sayHello()); + cleanupDomain(); + } + + /** + * Lines 697-699: + * <p> + * ASM50003 + * <p> + * OSOA + * The @name attribute of a service element of a <component/> MUST match the + * @name attribute of a service element of the componentType of the <implementation/> child element of the component. + * <p> + * OASIS + * the name of the service has to match a name of a service defined by the implementation + * + */ + @Test(expected=ServiceRuntimeException.class) + public void ASM50003() throws Exception { + initDomain("notmatchofservicename.composite"); + DService service = ServiceFinder.getService(DService.class, "DComponent1/DService1"); + Assert.assertEquals("hello", service.sayHello()); + cleanupDomain(); + } + + /** + * Lines 709-715: + * <p> + * ASM50004 + * <p> + * If a <service/> element has an interface subelement specified, the interface MUST + * provide a compatible subset of the interface declared on the componentType of the + * implementation. + */ + @Test(expected=ServiceRuntimeException.class) + public void ASM50004() throws Exception { + //for this case, if you remove the method3() in the EEService + //the EEService will be a compatible subset of EService. + initDomain("notcompatibleinterface.composite"); + EEService service = ServiceFinder.getService(EEService.class, "EEComponent/EEService"); + Assert.assertEquals("method1", service.method1()); + cleanupDomain(); + } + + + } |