Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 57493 Details for
Bug 161932
Use of internal packages in wsdm tooling tech preview
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
JUnit patch
JUnit-Patch.txt (text/plain), 340.61 KB, created by
Saurabh Dravid
on 2007-01-25 00:20:20 EST
(
hide
)
Description:
JUnit patch
Filename:
MIME Type:
Creator:
Saurabh Dravid
Created:
2007-01-25 00:20:20 EST
Size:
340.61 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.wsdm.tooling.editor.capability.test >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityNameCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityNameCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangeCapabilityNameCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityNameCommandTest.java 15 Sep 2006 15:20:21 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityNameCommandTest.java 22 Jan 2007 09:34:30 -0000 >@@ -31,82 +31,82 @@ > */ > public class ChangeCapabilityNameCommandTest extends OverviewCommandTestModel > { >- /** >- * Constructor for ChangeCapabilityNameCommandTest. >- * >- * @param name >- */ >- public ChangeCapabilityNameCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeCapabilityNameCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeCapabilityNameCommandTest = new HyadesTestSuite( >- "ChangeCapabilityNameCommandTest"); >- changeCapabilityNameCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C8E89291F2E4762C20D74B700FFB11DB"); >- >- changeCapabilityNameCommandTest >- .addTest(new ChangeCapabilityNameCommandTest( >- "testChangeCapabilityName")); >- >- return changeCapabilityNameCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangeCapabilityName >- * >- * @throws Exception >- */ >- public void testChangeCapabilityName() throws Exception >- { >- String newName = "MyAppServer"; >- ChangeCapabilityNameCommand command = new ChangeCapabilityNameCommand( >- capabilityDomain, newName); >- command.execute(); >- >- assertEquals(newName, capability.getName()); >- assertEquals(newName, definition.getQName().getLocalPart()); >- >- PortType pt = WsdlUtils.getPortType(definition); >- assertEquals(newName + "PortType", pt.getQName().getLocalPart()); >- >- String metaDataDescriptorName = newName + "Descriptor"; >- MetadataDescriptorType metaDescriptorType = metaDataDescriptor >- .getMetadataDescriptorType(); >- assertEquals(metaDataDescriptorName, metaDescriptorType.getName()); >- Attr descriptorAttribute = pt.getElement().getAttributeNodeNS( >- WsdmConstants.WSRMD_NS, WsdlUtils.METADATA_DESCRIPTOR_KEY); >- assertTrue(descriptorAttribute.getNodeValue().indexOf( >- metaDataDescriptorName) != -1); >- >- String rpElementName = newName + "Properties"; >- assertEquals(rpElementName, resourcePropertyElement.getName()); >- Attr rpElementAttribute = pt.getElement().getAttributeNodeNS( >- WsdmConstants.WSRP_NS, >- WsdlUtils.RESOURCE_PROPERTIES_ELEMENT_KEY); >- assertTrue(rpElementAttribute.getNodeValue().indexOf(rpElementName) != -1); >- } >+ /** >+ * Constructor for ChangeCapabilityNameCommandTest. >+ * >+ * @param name >+ */ >+ public ChangeCapabilityNameCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeCapabilityNameCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeCapabilityNameCommandTest = new HyadesTestSuite( >+ "ChangeCapabilityNameCommandTest"); >+ changeCapabilityNameCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C8E89291F2E4762C20D74B700FFB11DB"); >+ >+ changeCapabilityNameCommandTest >+ .addTest(new ChangeCapabilityNameCommandTest( >+ "testChangeCapabilityName")); >+ >+ return changeCapabilityNameCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangeCapabilityName >+ * >+ * @throws Exception >+ */ >+ public void testChangeCapabilityName() throws Exception >+ { >+ String newName = "MyAppServer"; >+ ChangeCapabilityNameCommand command = new ChangeCapabilityNameCommand( >+ capabilityDomain, newName); >+ command.execute(); >+ >+ assertEquals(newName, capability.getName()); >+ assertEquals(newName, definition.getQName().getLocalPart()); >+ >+ PortType pt = WsdlUtils.getPortType(definition); >+ assertEquals(newName + "PortType", pt.getQName().getLocalPart()); >+ >+ String metaDataDescriptorName = newName + "Descriptor"; >+ MetadataDescriptorType metaDescriptorType = metaDataDescriptor >+ .getMetadataDescriptorType(); >+ assertEquals(metaDataDescriptorName, metaDescriptorType.getName()); >+ Attr descriptorAttribute = pt.getElement().getAttributeNodeNS( >+ WsdmConstants.WSRMD_NS, WsdlUtils.METADATA_DESCRIPTOR_KEY); >+ assertTrue(descriptorAttribute.getNodeValue().indexOf( >+ metaDataDescriptorName) != -1); >+ >+ String rpElementName = newName + "Properties"; >+ assertEquals(rpElementName, resourcePropertyElement.getName()); >+ Attr rpElementAttribute = pt.getElement().getAttributeNodeNS( >+ WsdmConstants.WSRP_NS, >+ WsdlUtils.RESOURCE_PROPERTIES_ELEMENT_KEY); >+ assertTrue(rpElementAttribute.getNodeValue().indexOf(rpElementName) != -1); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityNamespaceCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityNamespaceCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangeCapabilityNamespaceCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityNamespaceCommandTest.java 15 Sep 2006 15:20:21 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityNamespaceCommandTest.java 22 Jan 2007 09:34:30 -0000 >@@ -31,130 +31,130 @@ > * <i>/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/overview/command/ChangeCapabilityNamespaceCommandTest.testsuite</i>. > */ > public class ChangeCapabilityNamespaceCommandTest extends >- OverviewCommandTestModel >+ OverviewCommandTestModel > { >- /** >- * Constructor for ChangeCapabilityNamespaceCommandTest. >- * >- * @param name >- */ >- >- private String oldNamespace; >- >- public ChangeCapabilityNamespaceCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeCapabilityNamespaceCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeCapabilityNamespaceCommandTest = new HyadesTestSuite( >- "ChangeCapabilityNamespaceCommandTest"); >- changeCapabilityNamespaceCommandTest.setArbiter( >- DefaultTestArbiter.INSTANCE).setId( >- "C8E89291F2E4762C1F54D4B00FFC11DB"); >- >- changeCapabilityNamespaceCommandTest >- .addTest(new ChangeCapabilityNamespaceCommandTest( >- "testChangeCapabilityNamespace")); >- >- return changeCapabilityNamespaceCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangeCapabilityNamespace >- * >- * @throws Exception >- */ >- public void testChangeCapabilityNamespace() throws Exception >- { >- oldNamespace = new String(definition.getTargetNamespace()); >- String newNamespace = "http://w3.ibm.com/appserver"; >- ChangeCapabilityNamespaceCommand command = new ChangeCapabilityNamespaceCommand( >- capabilityDomain, newNamespace); >- command.execute(); >- >- assertEquals(newNamespace, capability.getNamespace()); >- assertEquals(newNamespace, definition.getTargetNamespace()); >- assertEquals(newNamespace, propSchema.getTargetNamespace()); >- >- checkInsideWSDL(); >- checkInsideWSDLSchemas(); >- checkInsidePropertiesSchema(); >- checkInsideRMD(); >- } >- >- private void checkInsideWSDL() >- { >- String prefix = WsdlUtils.getPrefix(definition, oldNamespace); >- assertNull(prefix); >- } >- >- private void checkInsideWSDLSchemas() >- { >- XSDSchema[] schemas = WsdlUtils.getXSDSchemas(definition); >- assertNotNull(schemas); >- assertTrue(schemas.length > 0); >- >- for (int i = 0; i < schemas.length; i++) >- { >- checkInSchema(schemas[i]); >- } >- } >- >- private void checkInsidePropertiesSchema() >- { >- checkInSchema(propSchema); >- } >- >- private void checkInSchema(XSDSchema schema) >- { >- Map nsMap = schema.getQNamePrefixToNamespaceMap(); >- Iterator valueIt = nsMap.values().iterator(); >- while (valueIt.hasNext()) >- { >- String value = (String) valueIt.next(); >- if (value.equals(oldNamespace)) >- throw new AssertionFailedError( >- "Not able to change the namespace in schema -- " >- + schema.getTargetNamespace()); >- } >- } >- >- private void checkInsideRMD() >- { >- EMap map = metaDataDescriptor.getDocumentRoot().getXMLNSPrefixMap(); >- Iterator mapIt = map.iterator(); >- while (mapIt.hasNext()) >- { >- Object object = mapIt.next(); >- if (object instanceof EStringToStringMapEntryImpl) >- { >- EStringToStringMapEntryImpl entry = (EStringToStringMapEntryImpl) object; >- if (entry.getValue().equals(oldNamespace)) >- throw new AssertionFailedError( >- "Not able to change the namespace in rmd"); >- } >+ /** >+ * Constructor for ChangeCapabilityNamespaceCommandTest. >+ * >+ * @param name >+ */ >+ >+ private String oldNamespace; >+ >+ public ChangeCapabilityNamespaceCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeCapabilityNamespaceCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeCapabilityNamespaceCommandTest = new HyadesTestSuite( >+ "ChangeCapabilityNamespaceCommandTest"); >+ changeCapabilityNamespaceCommandTest.setArbiter( >+ DefaultTestArbiter.INSTANCE).setId( >+ "C8E89291F2E4762C1F54D4B00FFC11DB"); >+ >+ changeCapabilityNamespaceCommandTest >+ .addTest(new ChangeCapabilityNamespaceCommandTest( >+ "testChangeCapabilityNamespace")); >+ >+ return changeCapabilityNamespaceCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangeCapabilityNamespace >+ * >+ * @throws Exception >+ */ >+ public void testChangeCapabilityNamespace() throws Exception >+ { >+ oldNamespace = new String(definition.getTargetNamespace()); >+ String newNamespace = "http://w3.ibm.com/appserver"; >+ ChangeCapabilityNamespaceCommand command = new ChangeCapabilityNamespaceCommand( >+ capabilityDomain, newNamespace); >+ command.execute(); >+ >+ assertEquals(newNamespace, capability.getNamespace()); >+ assertEquals(newNamespace, definition.getTargetNamespace()); >+ assertEquals(newNamespace, propSchema.getTargetNamespace()); >+ >+ checkInsideWSDL(); >+ checkInsideWSDLSchemas(); >+ checkInsidePropertiesSchema(); >+ checkInsideRMD(); >+ } >+ >+ private void checkInsideWSDL() >+ { >+ String prefix = WsdlUtils.getPrefix(definition, oldNamespace); >+ assertNull(prefix); >+ } >+ >+ private void checkInsideWSDLSchemas() >+ { >+ XSDSchema[] schemas = WsdlUtils.getXSDSchemas(definition); >+ assertNotNull(schemas); >+ assertTrue(schemas.length > 0); >+ >+ for (int i = 0; i < schemas.length; i++) >+ { >+ checkInSchema(schemas[i]); >+ } >+ } >+ >+ private void checkInsidePropertiesSchema() >+ { >+ checkInSchema(propSchema); >+ } >+ >+ private void checkInSchema(XSDSchema schema) >+ { >+ Map nsMap = schema.getQNamePrefixToNamespaceMap(); >+ Iterator valueIt = nsMap.values().iterator(); >+ while (valueIt.hasNext()) >+ { >+ String value = (String) valueIt.next(); >+ if (value.equals(oldNamespace)) >+ throw new AssertionFailedError( >+ "Not able to change the namespace in schema -- " >+ + schema.getTargetNamespace()); >+ } >+ } >+ >+ private void checkInsideRMD() >+ { >+ EMap map = metaDataDescriptor.getDocumentRoot().getXMLNSPrefixMap(); >+ Iterator mapIt = map.iterator(); >+ while (mapIt.hasNext()) >+ { >+ Object object = mapIt.next(); >+ if (object instanceof EStringToStringMapEntryImpl) >+ { >+ EStringToStringMapEntryImpl entry = (EStringToStringMapEntryImpl) object; >+ if (entry.getValue().equals(oldNamespace)) >+ throw new AssertionFailedError( >+ "Not able to change the namespace in rmd"); >+ } >+ } > } >- } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/AllOverviewCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/AllOverviewCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 AllOverviewCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/AllOverviewCommandTest.java 15 Sep 2006 15:20:21 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/AllOverviewCommandTest.java 22 Jan 2007 09:34:29 -0000 >@@ -24,56 +24,56 @@ > */ > public class AllOverviewCommandTest extends HyadesTestCase > { >- /** >- * Constructor for AllOverviewCommandTest. >- * >- * @param name >- */ >- public AllOverviewCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AllOverviewCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite allOverviewCommandTest = new HyadesTestSuite( >- "AllOverviewCommandTest"); >- allOverviewCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C8E89291F2E4762C045BB3700FFE11DB"); >- >- allOverviewCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeCapabilityNameCommandTest.class)); >- >- allOverviewCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeCapabilityNamespaceCommandTest.class)); >- >- allOverviewCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeCapabilityDescriptionCommandTest_1.class)); >- >- allOverviewCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeCapabilityDescriptionCommandTest_2.class)); >- >- allOverviewCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeCapabilityDescriptionCommandTest_3.class)); >- return allOverviewCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >+ /** >+ * Constructor for AllOverviewCommandTest. >+ * >+ * @param name >+ */ >+ public AllOverviewCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>AllOverviewCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite allOverviewCommandTest = new HyadesTestSuite( >+ "AllOverviewCommandTest"); >+ allOverviewCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C8E89291F2E4762C045BB3700FFE11DB"); >+ >+ allOverviewCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeCapabilityNameCommandTest.class)); >+ >+ allOverviewCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeCapabilityNamespaceCommandTest.class)); >+ >+ allOverviewCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeCapabilityDescriptionCommandTest_1.class)); >+ >+ allOverviewCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeCapabilityDescriptionCommandTest_2.class)); >+ >+ allOverviewCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeCapabilityDescriptionCommandTest_3.class)); >+ return allOverviewCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/OverviewCommandTestModel.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/OverviewCommandTestModel.java,v >retrieving revision 1.1 >diff -u -r1.1 OverviewCommandTestModel.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/OverviewCommandTestModel.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/OverviewCommandTestModel.java 22 Jan 2007 09:34:30 -0000 >@@ -17,14 +17,14 @@ > > public class OverviewCommandTestModel extends CapabilityTestModel > { >- public OverviewCommandTestModel(String name) >- { >- this(name, Activator.PLUGIN_ID + "/" >- + "testfiles/capability/command/overview/MyDescription_1.mcap"); >- } >+ public OverviewCommandTestModel(String name) >+ { >+ this(name, Activator.PLUGIN_ID + "/" >+ + "testfiles/capability/command/overview/MyDescription_1.mcap"); >+ } > >- public OverviewCommandTestModel(String name, String CapabilityIFilePath) >- { >- super(name, CapabilityIFilePath); >- } >+ public OverviewCommandTestModel(String name, String CapabilityIFilePath) >+ { >+ super(name, CapabilityIFilePath); >+ } > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_3.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_3.java,v >retrieving revision 1.1 >diff -u -r1.1 ChangeCapabilityDescriptionCommandTest_3.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_3.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_3.java 22 Jan 2007 09:34:30 -0000 >@@ -21,6 +21,7 @@ > import org.eclipse.tptp.wsdm.tooling.editor.capability.command.overview.internal.ChangeCapabilityDescriptionCommand; > import org.eclipse.tptp.wsdm.tooling.editor.capability.test.Activator; > import org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils; >+import org.eclipse.wst.wsdl.Definition; > import org.eclipse.xsd.XSDAnnotation; > import org.eclipse.xsd.XSDSchema; > >@@ -30,96 +31,96 @@ > * <i>/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/overview/command/ChangeCapabilityDescriptionCommandTest_3.testsuite</i>. > */ > public class ChangeCapabilityDescriptionCommandTest_3 extends >- OverviewCommandTestModel >+ OverviewCommandTestModel > { >- /** >- * Constructor for ChangeCapabilityDescriptionCommandTest_3. >- * >- * @param name >- */ >- public ChangeCapabilityDescriptionCommandTest_3(String name) >- { >- super(name, Activator.PLUGIN_ID + "/" >- + "testfiles/capability/command/overview/MyDescription_3.mcap"); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeCapabilityDescriptionCommandTest_3</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeCapabilityDescriptionCommandTest_3 = new HyadesTestSuite( >- "ChangeCapabilityDescriptionCommandTest_3"); >- changeCapabilityDescriptionCommandTest_3.setArbiter( >- DefaultTestArbiter.INSTANCE).setId( >- "C448865E2C0E25D8ED46319043DF11DB"); >- >- changeCapabilityDescriptionCommandTest_3 >- .addTest(new ChangeCapabilityDescriptionCommandTest_3( >- "testChangeCapabilityDescription")); >- >- return changeCapabilityDescriptionCommandTest_3; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * When XSD annotations exists but its an empty element. This should >- * create new description node inside it >- * >- * @throws Exception >- */ >- public void testChangeCapabilityDescription() throws Exception >- { >- String newDescription = "TOMCAT capability"; >- >- // There should be one XSD annotation in WSDL schema and it should be >- // empty element >- XSDSchema tnsSchema = WsdlUtils.createOrFindSchema(capabilityDomain >- .getDefinition(), capabilityDomain.getDefinition() >- .getTargetNamespace()); >- List annotations = tnsSchema.getAnnotations(); >- assertNotNull(annotations); >- assertEquals(1, annotations.size()); >- XSDAnnotation annotation = (XSDAnnotation) annotations.get(0); >- assertFalse(annotation.getElement().hasChildNodes()); >- >- // Change the description >- ChangeCapabilityDescriptionCommand command = new ChangeCapabilityDescriptionCommand( >- capabilityDomain, newDescription); >- command.execute(); >- >- // Verify the changes >- assertNotNull(capabilityDomain.getDescriptionNode()); >- assertEquals(newDescription, capabilityDomain.getDescriptionNode() >- .getData()); >- assertEquals(newDescription, capabilityDomain.getCapability() >- .getDescription()); >- >- // Verify that it has created new element in XSD annotation >- XSDSchema schema = WsdlUtils.getSchema( >- capabilityDomain.getDefinition(), capabilityDomain >- .getDefinition().getTargetNamespace()); >- List newAnnotations = schema.getAnnotations(); >- assertNotNull(newAnnotations); >- assertEquals(1, newAnnotations.size()); >- >- annotation = (XSDAnnotation) annotations.get(0); >- assertTrue(annotation.getElement().hasChildNodes()); >- } >+ /** >+ * Constructor for ChangeCapabilityDescriptionCommandTest_3. >+ * >+ * @param name >+ */ >+ public ChangeCapabilityDescriptionCommandTest_3(String name) >+ { >+ super(name, Activator.PLUGIN_ID + "/" >+ + "testfiles/capability/command/overview/MyDescription_3.mcap"); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeCapabilityDescriptionCommandTest_3</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeCapabilityDescriptionCommandTest_3 = new HyadesTestSuite( >+ "ChangeCapabilityDescriptionCommandTest_3"); >+ changeCapabilityDescriptionCommandTest_3.setArbiter( >+ DefaultTestArbiter.INSTANCE).setId( >+ "C448865E2C0E25D8ED46319043DF11DB"); >+ >+ changeCapabilityDescriptionCommandTest_3 >+ .addTest(new ChangeCapabilityDescriptionCommandTest_3( >+ "testChangeCapabilityDescription")); >+ >+ return changeCapabilityDescriptionCommandTest_3; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * When XSD annotations exists but its an empty element. This should create >+ * new description node inside it >+ * >+ * @throws Exception >+ */ >+ public void testChangeCapabilityDescription() throws Exception >+ { >+ String newDescription = "TOMCAT capability"; >+ >+ // There should be one XSD annotation in WSDL schema and it should be >+ // empty element >+ Definition definition = capabilityDomain.getCapability() >+ .getDefinition(); >+ XSDSchema tnsSchema = WsdlUtils.createOrFindSchema(definition, >+ definition.getTargetNamespace()); >+ List annotations = tnsSchema.getAnnotations(); >+ assertNotNull(annotations); >+ assertEquals(1, annotations.size()); >+ XSDAnnotation annotation = (XSDAnnotation) annotations.get(0); >+ assertFalse(annotation.getElement().hasChildNodes()); >+ >+ // Change the description >+ ChangeCapabilityDescriptionCommand command = new ChangeCapabilityDescriptionCommand( >+ capabilityDomain, newDescription); >+ command.execute(); >+ >+ // Verify the changes >+ assertNotNull(capabilityDomain.getDescriptionNode()); >+ assertEquals(newDescription, capabilityDomain.getDescriptionNode() >+ .getData()); >+ assertEquals(newDescription, capabilityDomain.getCapability() >+ .getDescription()); >+ >+ // Verify that it has created new element in XSD annotation >+ XSDSchema schema = WsdlUtils.getSchema(definition, definition >+ .getTargetNamespace()); >+ List newAnnotations = schema.getAnnotations(); >+ assertNotNull(newAnnotations); >+ assertEquals(1, newAnnotations.size()); >+ >+ annotation = (XSDAnnotation) annotations.get(0); >+ assertTrue(annotation.getElement().hasChildNodes()); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_1.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_1.java,v >retrieving revision 1.1 >diff -u -r1.1 ChangeCapabilityDescriptionCommandTest_1.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_1.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_1.java 22 Jan 2007 09:34:29 -0000 >@@ -25,73 +25,73 @@ > * <i>/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/overview/command/ChangeCapabilityDescriptionCommandTest_1.testsuite</i>. > */ > public class ChangeCapabilityDescriptionCommandTest_1 extends >- OverviewCommandTestModel >+ OverviewCommandTestModel > { >- /** >- * Constructor for ChangeCapabilityDescriptionCommandTest_1. >- * >- * @param name >- */ >- public ChangeCapabilityDescriptionCommandTest_1(String name) >- { >- super(name, Activator.PLUGIN_ID + "/" >- + "testfiles/capability/command/overview/MyDescription_1.mcap"); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeCapabilityDescriptionCommandTest_1</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeCapabilityDescriptionCommandTest_1 = new HyadesTestSuite( >- "ChangeCapabilityDescriptionCommandTest_1"); >- changeCapabilityDescriptionCommandTest_1.setArbiter( >- DefaultTestArbiter.INSTANCE).setId( >- "C448865E2C0E25D849A80E0043DF11DB"); >- >- changeCapabilityDescriptionCommandTest_1 >- .addTest(new ChangeCapabilityDescriptionCommandTest_1( >- "testChangeCapabilityDescription")); >- >- return changeCapabilityDescriptionCommandTest_1; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * When description node exists in wsdl targetnamespace schema, So >- * change the user information element value >- * >- * @throws Exception >- */ >- public void testChangeCapabilityDescription() throws Exception >- { >- String newDescription = "Server capability"; >- >- ChangeCapabilityDescriptionCommand command = new ChangeCapabilityDescriptionCommand( >- capabilityDomain, newDescription); >- command.execute(); >- >- // Verify the changes >- assertNotNull(capabilityDomain.getDescriptionNode()); >- assertEquals(newDescription, capabilityDomain.getDescriptionNode() >- .getData()); >- assertEquals(newDescription, capabilityDomain.getCapability() >- .getDescription()); >- } >+ /** >+ * Constructor for ChangeCapabilityDescriptionCommandTest_1. >+ * >+ * @param name >+ */ >+ public ChangeCapabilityDescriptionCommandTest_1(String name) >+ { >+ super(name, Activator.PLUGIN_ID + "/" >+ + "testfiles/capability/command/overview/MyDescription_1.mcap"); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeCapabilityDescriptionCommandTest_1</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeCapabilityDescriptionCommandTest_1 = new HyadesTestSuite( >+ "ChangeCapabilityDescriptionCommandTest_1"); >+ changeCapabilityDescriptionCommandTest_1.setArbiter( >+ DefaultTestArbiter.INSTANCE).setId( >+ "C448865E2C0E25D849A80E0043DF11DB"); >+ >+ changeCapabilityDescriptionCommandTest_1 >+ .addTest(new ChangeCapabilityDescriptionCommandTest_1( >+ "testChangeCapabilityDescription")); >+ >+ return changeCapabilityDescriptionCommandTest_1; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * When description node exists in wsdl targetnamespace schema, So change >+ * the user information element value >+ * >+ * @throws Exception >+ */ >+ public void testChangeCapabilityDescription() throws Exception >+ { >+ String newDescription = "Server capability"; >+ >+ ChangeCapabilityDescriptionCommand command = new ChangeCapabilityDescriptionCommand( >+ capabilityDomain, newDescription); >+ command.execute(); >+ >+ // Verify the changes >+ assertNotNull(capabilityDomain.getDescriptionNode()); >+ assertEquals(newDescription, capabilityDomain.getDescriptionNode() >+ .getData()); >+ assertEquals(newDescription, capabilityDomain.getCapability() >+ .getDescription()); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_2.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_2.java,v >retrieving revision 1.1 >diff -u -r1.1 ChangeCapabilityDescriptionCommandTest_2.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_2.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/overview/ChangeCapabilityDescriptionCommandTest_2.java 22 Jan 2007 09:34:29 -0000 >@@ -21,6 +21,7 @@ > import org.eclipse.tptp.wsdm.tooling.editor.capability.command.overview.internal.ChangeCapabilityDescriptionCommand; > import org.eclipse.tptp.wsdm.tooling.editor.capability.test.Activator; > import org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils; >+import org.eclipse.wst.wsdl.Definition; > import org.eclipse.xsd.XSDAnnotation; > import org.eclipse.xsd.XSDSchema; > >@@ -30,94 +31,93 @@ > * <i>/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/overview/command/ChangeCapabilityDescriptionCommandTest_2.testsuite</i>. > */ > public class ChangeCapabilityDescriptionCommandTest_2 extends >- OverviewCommandTestModel >+ OverviewCommandTestModel > { >- /** >- * Constructor for ChangeCapabilityDescriptionCommandTest_2. >- * >- * @param name >- */ >- public ChangeCapabilityDescriptionCommandTest_2(String name) >- { >- super(name, Activator.PLUGIN_ID + "/" >- + "testfiles/capability/command/overview/MyDescription_2.mcap"); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeCapabilityDescriptionCommandTest_2</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeCapabilityDescriptionCommandTest_2 = new HyadesTestSuite( >- "ChangeCapabilityDescriptionCommandTest_2"); >- changeCapabilityDescriptionCommandTest_2.setArbiter( >- DefaultTestArbiter.INSTANCE).setId( >- "C448865E2C0E25D85B5644F043DF11DB"); >- >- changeCapabilityDescriptionCommandTest_2 >- .addTest(new ChangeCapabilityDescriptionCommandTest_2( >- "testChangeCapabilityDescription")); >- >- return changeCapabilityDescriptionCommandTest_2; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * When wsdl targetnamespace schema exists, but no XSD annotations >- * exists. This should create new XSD annotation and add a new >- * description node >- * >- * @throws Exception >- */ >- public void testChangeCapabilityDescription() throws Exception >- { >- String newDescription = "WAS capability"; >- >- // There should be no XSD annotation in WSDL schema >- XSDSchema tnsSchema = WsdlUtils.createOrFindSchema(capabilityDomain >- .getDefinition(), capabilityDomain.getDefinition() >- .getTargetNamespace()); >- List annotations = tnsSchema.getAnnotations(); >- assertNotNull(annotations); >- assertEquals(0, annotations.size()); >- >- // Change the description >- ChangeCapabilityDescriptionCommand command = new ChangeCapabilityDescriptionCommand( >- capabilityDomain, newDescription); >- command.execute(); >- >- // Verify the changes >- assertNotNull(capabilityDomain.getDescriptionNode()); >- assertEquals(newDescription, capabilityDomain.getDescriptionNode() >- .getData()); >- assertEquals(newDescription, capabilityDomain.getCapability() >- .getDescription()); >- >- // Verify that it has created new XSD annotation to the schema >- XSDSchema schema = WsdlUtils.getSchema( >- capabilityDomain.getDefinition(), capabilityDomain >- .getDefinition().getTargetNamespace()); >- List newAnnotations = schema.getAnnotations(); >- assertNotNull(newAnnotations); >- assertEquals(1, newAnnotations.size()); >- >- XSDAnnotation annotation = (XSDAnnotation) annotations.get(0); >- assertTrue(annotation.getElement().hasChildNodes()); >- } >+ /** >+ * Constructor for ChangeCapabilityDescriptionCommandTest_2. >+ * >+ * @param name >+ */ >+ public ChangeCapabilityDescriptionCommandTest_2(String name) >+ { >+ super(name, Activator.PLUGIN_ID + "/" >+ + "testfiles/capability/command/overview/MyDescription_2.mcap"); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeCapabilityDescriptionCommandTest_2</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeCapabilityDescriptionCommandTest_2 = new HyadesTestSuite( >+ "ChangeCapabilityDescriptionCommandTest_2"); >+ changeCapabilityDescriptionCommandTest_2.setArbiter( >+ DefaultTestArbiter.INSTANCE).setId( >+ "C448865E2C0E25D85B5644F043DF11DB"); >+ >+ changeCapabilityDescriptionCommandTest_2 >+ .addTest(new ChangeCapabilityDescriptionCommandTest_2( >+ "testChangeCapabilityDescription")); >+ >+ return changeCapabilityDescriptionCommandTest_2; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * When wsdl targetnamespace schema exists, but no XSD annotations exists. >+ * This should create new XSD annotation and add a new description node >+ * >+ * @throws Exception >+ */ >+ public void testChangeCapabilityDescription() throws Exception >+ { >+ String newDescription = "WAS capability"; >+ >+ // There should be no XSD annotation in WSDL schema >+ Definition definition = capabilityDomain.getCapability() >+ .getDefinition(); >+ XSDSchema tnsSchema = WsdlUtils.createOrFindSchema(definition, >+ definition.getTargetNamespace()); >+ List annotations = tnsSchema.getAnnotations(); >+ assertNotNull(annotations); >+ assertEquals(0, annotations.size()); >+ >+ // Change the description >+ ChangeCapabilityDescriptionCommand command = new ChangeCapabilityDescriptionCommand( >+ capabilityDomain, newDescription); >+ command.execute(); >+ >+ // Verify the changes >+ assertNotNull(capabilityDomain.getDescriptionNode()); >+ assertEquals(newDescription, capabilityDomain.getDescriptionNode() >+ .getData()); >+ assertEquals(newDescription, capabilityDomain.getCapability() >+ .getDescription()); >+ >+ // Verify that it has created new XSD annotation to the schema >+ XSDSchema schema = WsdlUtils.getSchema(definition, definition >+ .getTargetNamespace()); >+ List newAnnotations = schema.getAnnotations(); >+ assertNotNull(newAnnotations); >+ assertEquals(1, newAnnotations.size()); >+ >+ XSDAnnotation annotation = (XSDAnnotation) annotations.get(0); >+ assertTrue(annotation.getElement().hasChildNodes()); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/ChangeTopicNameCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/ChangeTopicNameCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ChangeTopicNameCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/ChangeTopicNameCommandTest.java 15 Sep 2006 15:20:24 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/ChangeTopicNameCommandTest.java 22 Jan 2007 09:34:32 -0000 >@@ -25,55 +25,55 @@ > */ > public class ChangeTopicNameCommandTest extends HyadesTestCase > { >- /** >- * Constructor for ChangeTopicNameCommandTest. >- * >- * @param name >- */ >- public ChangeTopicNameCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeTopicNameCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeTopicNameCommandTest = new HyadesTestSuite( >- "ChangeTopicNameCommandTest"); >- changeTopicNameCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C254CB80544979D7F9EDC96042F611DB"); >- >- changeTopicNameCommandTest.addTest(new ChangeTopicNameCommandTest( >- "testChangeTopicName")); >- >- return changeTopicNameCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangeTopicName >- * >- * @throws Exception >- */ >- public void testChangeTopicName() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for ChangeTopicNameCommandTest. >+ * >+ * @param name >+ */ >+ public ChangeTopicNameCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeTopicNameCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeTopicNameCommandTest = new HyadesTestSuite( >+ "ChangeTopicNameCommandTest"); >+ changeTopicNameCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C254CB80544979D7F9EDC96042F611DB"); >+ >+ changeTopicNameCommandTest.addTest(new ChangeTopicNameCommandTest( >+ "testChangeTopicName")); >+ >+ return changeTopicNameCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangeTopicName >+ * >+ * @throws Exception >+ */ >+ public void testChangeTopicName() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/RemoveTopicCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/RemoveTopicCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 RemoveTopicCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/RemoveTopicCommandTest.java 15 Sep 2006 15:20:24 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/RemoveTopicCommandTest.java 22 Jan 2007 09:34:32 -0000 >@@ -24,55 +24,55 @@ > */ > public class RemoveTopicCommandTest extends HyadesTestCase > { >- /** >- * Constructor for RemoveTopicCommandTest. >- * >- * @param name >- */ >- public RemoveTopicCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>RemoveTopicCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite removeTopicCommandTest = new HyadesTestSuite( >- "RemoveTopicCommandTest"); >- removeTopicCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D70C13051042F711DB"); >- >- removeTopicCommandTest.addTest(new RemoveTopicCommandTest( >- "testRemoveTopic")); >- >- return removeTopicCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testRemoveTopic >- * >- * @throws Exception >- */ >- public void testRemoveTopic() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for RemoveTopicCommandTest. >+ * >+ * @param name >+ */ >+ public RemoveTopicCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>RemoveTopicCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite removeTopicCommandTest = new HyadesTestSuite( >+ "RemoveTopicCommandTest"); >+ removeTopicCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D70C13051042F711DB"); >+ >+ removeTopicCommandTest.addTest(new RemoveTopicCommandTest( >+ "testRemoveTopic")); >+ >+ return removeTopicCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testRemoveTopic >+ * >+ * @throws Exception >+ */ >+ public void testRemoveTopic() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/RemoveTopicNamespaceCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/RemoveTopicNamespaceCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 RemoveTopicNamespaceCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/RemoveTopicNamespaceCommandTest.java 15 Sep 2006 15:20:24 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/RemoveTopicNamespaceCommandTest.java 22 Jan 2007 09:34:32 -0000 >@@ -25,56 +25,56 @@ > */ > public class RemoveTopicNamespaceCommandTest extends HyadesTestCase > { >- /** >- * Constructor for RemoveTopicNamespaceCommandTest. >- * >- * @param name >- */ >- public RemoveTopicNamespaceCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>RemoveTopicNamespaceCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite removeTopicNamespaceCommandTest = new HyadesTestSuite( >- "RemoveTopicNamespaceCommandTest"); >- removeTopicNamespaceCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C254CB80544979D71D4A103042F711DB"); >- >- removeTopicNamespaceCommandTest >- .addTest(new RemoveTopicNamespaceCommandTest( >- "testRemoveTopicNamespace")); >- >- return removeTopicNamespaceCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testRemoveTopicNamespace >- * >- * @throws Exception >- */ >- public void testRemoveTopicNamespace() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for RemoveTopicNamespaceCommandTest. >+ * >+ * @param name >+ */ >+ public RemoveTopicNamespaceCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>RemoveTopicNamespaceCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite removeTopicNamespaceCommandTest = new HyadesTestSuite( >+ "RemoveTopicNamespaceCommandTest"); >+ removeTopicNamespaceCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C254CB80544979D71D4A103042F711DB"); >+ >+ removeTopicNamespaceCommandTest >+ .addTest(new RemoveTopicNamespaceCommandTest( >+ "testRemoveTopicNamespace")); >+ >+ return removeTopicNamespaceCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testRemoveTopicNamespace >+ * >+ * @throws Exception >+ */ >+ public void testRemoveTopicNamespace() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AddRootTopicCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AddRootTopicCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 AddRootTopicCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AddRootTopicCommandTest.java 15 Sep 2006 15:20:24 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AddRootTopicCommandTest.java 22 Jan 2007 09:34:32 -0000 >@@ -24,55 +24,55 @@ > */ > public class AddRootTopicCommandTest extends HyadesTestCase > { >- /** >- * Constructor for AddRootTopicCommandTest. >- * >- * @param name >- */ >- public AddRootTopicCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AddRootTopicCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite addRootTopicCommandTest = new HyadesTestSuite( >- "AddRootTopicCommandTest"); >- addRootTopicCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D7E3D644E042F611DB"); >- >- addRootTopicCommandTest.addTest(new AddRootTopicCommandTest( >- "testAddRootTopic")); >- >- return addRootTopicCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testAddRootTopic >- * >- * @throws Exception >- */ >- public void testAddRootTopic() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for AddRootTopicCommandTest. >+ * >+ * @param name >+ */ >+ public AddRootTopicCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>AddRootTopicCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite addRootTopicCommandTest = new HyadesTestSuite( >+ "AddRootTopicCommandTest"); >+ addRootTopicCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D7E3D644E042F611DB"); >+ >+ addRootTopicCommandTest.addTest(new AddRootTopicCommandTest( >+ "testAddRootTopic")); >+ >+ return addRootTopicCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testAddRootTopic >+ * >+ * @throws Exception >+ */ >+ public void testAddRootTopic() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AllTopicCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AllTopicCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 AllTopicCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AllTopicCommandTest.java 15 Sep 2006 15:20:24 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AllTopicCommandTest.java 22 Jan 2007 09:34:32 -0000 >@@ -25,56 +25,56 @@ > */ > public class AllTopicCommandTest extends HyadesTestCase > { >- /** >- * Constructor for AllTopicCommandTest. >- * >- * @param name >- */ >- public AllTopicCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AllTopicCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite allTopicCommandTest = new HyadesTestSuite( >- "AllTopicCommandTest"); >- allTopicCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D73FBFA08042F711DB"); >- >- allTopicCommandTest.addTest(HyadesJUnitRunner >- .getTest(AddChildTopicCommandTest.class)); >- >- allTopicCommandTest.addTest(HyadesJUnitRunner >- .getTest(AddRootTopicCommandTest.class)); >- >- allTopicCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeTopicNameCommandTest.class)); >- >- allTopicCommandTest.addTest(HyadesJUnitRunner >- .getTest(RemoveTopicCommandTest.class)); >- >- allTopicCommandTest.addTest(HyadesJUnitRunner >- .getTest(RemoveTopicNamespaceCommandTest.class)); >- return allTopicCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >+ /** >+ * Constructor for AllTopicCommandTest. >+ * >+ * @param name >+ */ >+ public AllTopicCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the <b>AllTopicCommandTest</b> >+ * definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite allTopicCommandTest = new HyadesTestSuite( >+ "AllTopicCommandTest"); >+ allTopicCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D73FBFA08042F711DB"); >+ >+ allTopicCommandTest.addTest(HyadesJUnitRunner >+ .getTest(AddChildTopicCommandTest.class)); >+ >+ allTopicCommandTest.addTest(HyadesJUnitRunner >+ .getTest(AddRootTopicCommandTest.class)); >+ >+ allTopicCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeTopicNameCommandTest.class)); >+ >+ allTopicCommandTest.addTest(HyadesJUnitRunner >+ .getTest(RemoveTopicCommandTest.class)); >+ >+ allTopicCommandTest.addTest(HyadesJUnitRunner >+ .getTest(RemoveTopicNamespaceCommandTest.class)); >+ return allTopicCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AddChildTopicCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AddChildTopicCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 AddChildTopicCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AddChildTopicCommandTest.java 15 Sep 2006 15:20:24 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/topic/AddChildTopicCommandTest.java 22 Jan 2007 09:34:32 -0000 >@@ -24,55 +24,55 @@ > */ > public class AddChildTopicCommandTest extends HyadesTestCase > { >- /** >- * Constructor for AddChildTopicCommandTest. >- * >- * @param name >- */ >- public AddChildTopicCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AddChildTopicCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite addChildTopicCommandTest = new HyadesTestSuite( >- "AddChildTopicCommandTest"); >- addChildTopicCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D7CF7A04F042F611DB"); >- >- addChildTopicCommandTest.addTest(new AddChildTopicCommandTest( >- "testAddChildTopic")); >- >- return addChildTopicCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testAddChildTopic >- * >- * @throws Exception >- */ >- public void testAddChildTopic() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for AddChildTopicCommandTest. >+ * >+ * @param name >+ */ >+ public AddChildTopicCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>AddChildTopicCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite addChildTopicCommandTest = new HyadesTestSuite( >+ "AddChildTopicCommandTest"); >+ addChildTopicCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D7CF7A04F042F611DB"); >+ >+ addChildTopicCommandTest.addTest(new AddChildTopicCommandTest( >+ "testAddChildTopic")); >+ >+ return addChildTopicCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testAddChildTopic >+ * >+ * @throws Exception >+ */ >+ public void testAddChildTopic() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/TopicSpace2MetaDataDescriptorTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/TopicSpace2MetaDataDescriptorTest.java,v >retrieving revision 1.1 >diff -u -r1.1 TopicSpace2MetaDataDescriptorTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/TopicSpace2MetaDataDescriptorTest.java 15 Sep 2006 15:20:23 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/TopicSpace2MetaDataDescriptorTest.java 22 Jan 2007 09:34:35 -0000 >@@ -24,8 +24,8 @@ > import org.eclipse.tptp.wsdm.tooling.editor.capability.internal.CapabilityDomain; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Capability; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Topic; >+import org.eclipse.tptp.wsdm.tooling.model.capabilities.impl.TopicSpace2MetaDataDescriptor; > import org.eclipse.tptp.wsdm.tooling.model.metadataDescriptor.DocumentRoot; >-import org.eclipse.tptp.wsdm.tooling.util.internal.TopicSpace2MetaDataDescriptor; > > /** > * Generated code for the test suite <b>TopicSpace2MetaDataDescriptorTest</b> >@@ -34,147 +34,147 @@ > */ > public class TopicSpace2MetaDataDescriptorTest extends UtilsCapabilityTestModel > { >- /** >- * Constructor for TopicSpace2MetaDataDescriptorTest. >- * >- * @param name >- */ >- public TopicSpace2MetaDataDescriptorTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>TopicSpace2MetaDataDescriptorTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite topicSpace2MetaDataDescriptorTest = new HyadesTestSuite( >- "TopicSpace2MetaDataDescriptorTest"); >- topicSpace2MetaDataDescriptorTest.setArbiter( >- DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D7B4D2261042FA11DB"); >- >- topicSpace2MetaDataDescriptorTest >- .addTest(new TopicSpace2MetaDataDescriptorTest( >- "testGetTopicExpressions_1")); >- >- topicSpace2MetaDataDescriptorTest >- .addTest(new TopicSpace2MetaDataDescriptorTest( >- "testGetTopicExpressions_2")); >- >- return topicSpace2MetaDataDescriptorTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * This method will creates topic expressions for topicspaces. Since >- * TopicExpression property will not available in RMD, it will create it >- * in RMD file. >- * >- * @throws Exception >- */ >- public void testGetTopicExpressions_1() throws Exception >- { >- DocumentRoot root = capabilityDomain.getMetaDataDescriptor() >- .getDocumentRoot(); >- Capability capability = capabilityDomain.getCapability(); >- >- EMap nsMap = root.getXMLNSPrefixMap(); >- List topicSpaces = createTopicSpaces(capabilityDomain); >- TopicSpace2MetaDataDescriptor topic2Metadata = new TopicSpace2MetaDataDescriptor( >- nsMap, topicSpaces); >- >- // TODO Verify the created expressions >- String[] expressions = topic2Metadata.getTopicExpressions(); >- >- } >- >- /** >- * This method will creates topic expressions for topicspaces. >- * >- * @throws Exception >- */ >- public void testGetTopicExpressions_2() throws Exception >- { >- DocumentRoot root = capabilityDomain.getMetaDataDescriptor() >- .getDocumentRoot(); >- Capability capability = capabilityDomain.getCapability(); >- >- EMap nsMap = root.getXMLNSPrefixMap(); >- List topicSpaces = createTopicSpaces(capabilityDomain); >- TopicSpace2MetaDataDescriptor topic2Metadata = new TopicSpace2MetaDataDescriptor( >- nsMap, topicSpaces); >- >- // TODO Verify the created expressions >- String[] expressions = topic2Metadata.getTopicExpressions(); >- } >- >- private List createTopicSpaces(CapabilityDomain capabilityDomain) >- { >- createStartTopicSpace(capabilityDomain); >- createStopTopicSpace(capabilityDomain); >- return capabilityDomain.getCapability().getTopicSpaces(); >- } >- >- private void createStartTopicSpace(CapabilityDomain capabilityDomain) >- { >- Topic rootTopic = getStartServerRootTopic(); >- AddRootTopicCommand command = new AddRootTopicCommand(capabilityDomain, >- "http://start.org", rootTopic); >- command.execute(); >- } >- >- private void createStopTopicSpace(CapabilityDomain capabilityDomain) >- { >- Topic rootTopic = getStopServerRootTopic(); >- AddRootTopicCommand command = new AddRootTopicCommand(capabilityDomain, >- "http://stop.org", rootTopic); >- command.execute(); >- } >- >- private Topic getStartServerRootTopic() >- { >- Topic rootTopic = TestUtils.createNewTopic("StartServer"); >- Topic childTopic = getStartDataResourceChildTopic(); >- AddChildTopicCommand command = new AddChildTopicCommand(rootTopic, >- childTopic); >- command.execute(); >- return rootTopic; >- } >- >- private Topic getStartDataResourceChildTopic() >- { >- return TestUtils.createNewTopic("StartDataResource"); >- } >- >- private Topic getStopServerRootTopic() >- { >- Topic rootTopic = TestUtils.createNewTopic("StopServer"); >- Topic childTopic = getStopDataResourceChildTopic(); >- AddChildTopicCommand command = new AddChildTopicCommand(rootTopic, >- childTopic); >- command.execute(); >- return rootTopic; >- } >- >- private Topic getStopDataResourceChildTopic() >- { >- return TestUtils.createNewTopic("StopDataResource"); >- } >+ /** >+ * Constructor for TopicSpace2MetaDataDescriptorTest. >+ * >+ * @param name >+ */ >+ public TopicSpace2MetaDataDescriptorTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>TopicSpace2MetaDataDescriptorTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite topicSpace2MetaDataDescriptorTest = new HyadesTestSuite( >+ "TopicSpace2MetaDataDescriptorTest"); >+ topicSpace2MetaDataDescriptorTest.setArbiter( >+ DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D7B4D2261042FA11DB"); >+ >+ topicSpace2MetaDataDescriptorTest >+ .addTest(new TopicSpace2MetaDataDescriptorTest( >+ "testGetTopicExpressions_1")); >+ >+ topicSpace2MetaDataDescriptorTest >+ .addTest(new TopicSpace2MetaDataDescriptorTest( >+ "testGetTopicExpressions_2")); >+ >+ return topicSpace2MetaDataDescriptorTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * This method will creates topic expressions for topicspaces. Since >+ * TopicExpression property will not available in RMD, it will create it in >+ * RMD file. >+ * >+ * @throws Exception >+ */ >+ public void testGetTopicExpressions_1() throws Exception >+ { >+ DocumentRoot root = capabilityDomain.getCapability().getMetadata() >+ .getDocumentRoot(); >+ Capability capability = capabilityDomain.getCapability(); >+ >+ EMap nsMap = root.getXMLNSPrefixMap(); >+ List topicSpaces = createTopicSpaces(capabilityDomain); >+ TopicSpace2MetaDataDescriptor topic2Metadata = new TopicSpace2MetaDataDescriptor( >+ nsMap, topicSpaces); >+ >+ // TODO Verify the created expressions >+ String[] expressions = topic2Metadata.getTopicExpressions(); >+ >+ } >+ >+ /** >+ * This method will creates topic expressions for topicspaces. >+ * >+ * @throws Exception >+ */ >+ public void testGetTopicExpressions_2() throws Exception >+ { >+ DocumentRoot root = capabilityDomain.getCapability().getMetadata() >+ .getDocumentRoot(); >+ Capability capability = capabilityDomain.getCapability(); >+ >+ EMap nsMap = root.getXMLNSPrefixMap(); >+ List topicSpaces = createTopicSpaces(capabilityDomain); >+ TopicSpace2MetaDataDescriptor topic2Metadata = new TopicSpace2MetaDataDescriptor( >+ nsMap, topicSpaces); >+ >+ // TODO Verify the created expressions >+ String[] expressions = topic2Metadata.getTopicExpressions(); >+ } >+ >+ private List createTopicSpaces(CapabilityDomain capabilityDomain) >+ { >+ createStartTopicSpace(capabilityDomain); >+ createStopTopicSpace(capabilityDomain); >+ return capabilityDomain.getCapability().getTopicSpaces(); >+ } >+ >+ private void createStartTopicSpace(CapabilityDomain capabilityDomain) >+ { >+ Topic rootTopic = getStartServerRootTopic(); >+ AddRootTopicCommand command = new AddRootTopicCommand(capabilityDomain, >+ "http://start.org", rootTopic); >+ command.execute(); >+ } >+ >+ private void createStopTopicSpace(CapabilityDomain capabilityDomain) >+ { >+ Topic rootTopic = getStopServerRootTopic(); >+ AddRootTopicCommand command = new AddRootTopicCommand(capabilityDomain, >+ "http://stop.org", rootTopic); >+ command.execute(); >+ } >+ >+ private Topic getStartServerRootTopic() >+ { >+ Topic rootTopic = TestUtils.createNewTopic("StartServer"); >+ Topic childTopic = getStartDataResourceChildTopic(); >+ AddChildTopicCommand command = new AddChildTopicCommand(rootTopic, >+ childTopic); >+ command.execute(); >+ return rootTopic; >+ } >+ >+ private Topic getStartDataResourceChildTopic() >+ { >+ return TestUtils.createNewTopic("StartDataResource"); >+ } >+ >+ private Topic getStopServerRootTopic() >+ { >+ Topic rootTopic = TestUtils.createNewTopic("StopServer"); >+ Topic childTopic = getStopDataResourceChildTopic(); >+ AddChildTopicCommand command = new AddChildTopicCommand(rootTopic, >+ childTopic); >+ command.execute(); >+ return rootTopic; >+ } >+ >+ private Topic getStopDataResourceChildTopic() >+ { >+ return TestUtils.createNewTopic("StopDataResource"); >+ } > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/UtilsCapabilityTestModel.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/UtilsCapabilityTestModel.java,v >retrieving revision 1.1 >diff -u -r1.1 UtilsCapabilityTestModel.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/UtilsCapabilityTestModel.java 15 Sep 2006 15:20:23 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/UtilsCapabilityTestModel.java 22 Jan 2007 09:34:35 -0000 >@@ -18,43 +18,43 @@ > > public class UtilsCapabilityTestModel extends CapabilityTestModel > { >- protected String CAPABILITY_NAME = "AppServer"; >+ protected String CAPABILITY_NAME = "AppServer"; > >- protected String CAPABILITY_NAMESPACE = "http://w3.ibm.com/"; >+ protected String CAPABILITY_NAMESPACE = "http://w3.ibm.com/"; > >- protected String PROPERTY_NAMESPACE = "http://w3.ibm.com/"; >+ protected String PROPERTY_NAMESPACE = "http://w3.ibm.com/"; > >- protected String[] PROPERTY_NAMES = new String[] { "home", >- "connectionPool", "TopicExpression" }; >+ protected String[] PROPERTY_NAMES = new String[] { "home", >+ "connectionPool", "TopicExpression" }; > >- protected String[] PROPERTY_TYPES = new String[] { "string", "int", >- "TopicExpressionType" }; >+ protected String[] PROPERTY_TYPES = new String[] { "string", "int", >+ "TopicExpressionType" }; > >- protected int[] MIN_OCCURS = new int[] { 1, 5, 0 }; >+ protected int[] MIN_OCCURS = new int[] { 1, 5, 0 }; > >- protected int[] MAX_OCCURS = new int[] { 1, 10, 0 }; >+ protected int[] MAX_OCCURS = new int[] { 1, 10, 0 }; > >- protected String[] OPERATION_NAMES = new String[] { "startServer", >- "stopServer", "startApplication", "stopApplication" }; >+ protected String[] OPERATION_NAMES = new String[] { "startServer", >+ "stopServer", "startApplication", "stopApplication" }; > >- protected String[] MODIFIABILITY = new String[] { MetaDataUtils.READ_ONLY, >- MetaDataUtils.WRITABLE, MetaDataUtils.READ_ONLY }; >+ protected String[] MODIFIABILITY = new String[] { MetaDataUtils.READ_ONLY, >+ MetaDataUtils.WRITABLE, MetaDataUtils.READ_ONLY }; > >- protected String[] MUTABILITY = new String[] { MetaDataUtils.CONSTANT, >- MetaDataUtils.MUTABLE, MetaDataUtils.MUTABLE }; >+ protected String[] MUTABILITY = new String[] { MetaDataUtils.CONSTANT, >+ MetaDataUtils.MUTABLE, MetaDataUtils.MUTABLE }; > >- protected String[] OPERATION_RETURN_TYPES = new String[] { "anyType", >- "anyType", "boolean", "boolean" }; >+ protected String[] OPERATION_RETURN_TYPES = new String[] { "anyType", >+ "anyType", "boolean", "boolean" }; > >- public UtilsCapabilityTestModel(String name) >- { >- this(name, Activator.PLUGIN_ID + "/" >- + "testfiles/capability/util/AppServer.mcap"); >- } >+ public UtilsCapabilityTestModel(String name) >+ { >+ this(name, Activator.PLUGIN_ID + "/" >+ + "testfiles/capability/util/AppServer.mcap"); >+ } > >- public UtilsCapabilityTestModel(String name, String CapabilityIFilePath) >- { >- super(name, CapabilityIFilePath); >- } >+ public UtilsCapabilityTestModel(String name, String CapabilityIFilePath) >+ { >+ super(name, CapabilityIFilePath); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/WSDLUtilsTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/WSDLUtilsTest.java,v >retrieving revision 1.2 >diff -u -r1.2 WSDLUtilsTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/WSDLUtilsTest.java 15 Sep 2006 15:20:23 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/WSDLUtilsTest.java 22 Jan 2007 09:34:36 -0000 >@@ -31,231 +31,231 @@ > */ > public class WSDLUtilsTest extends WSDLTestModel > { >- /** >- * Constructor for WsdlUtilsTest. >- * >- * @param name >- */ >- public WSDLUtilsTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the <b>WsdlUtilsTest</b> >- * definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite WsdlUtilsTest = new HyadesTestSuite("WsdlUtilsTest"); >- WsdlUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "EA3D854DD553CFEDB4436C0017F711DB"); >- >- WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetWSDLOperation")); >- WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetPortType")); >- WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetOperationName")); >- WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetSchema")); >- WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetXSDSchemas")); >- WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetNamespace")); >- WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetPrefix")); >- WsdlUtilsTest.addTest(new WSDLUtilsTest("testIsNamespaceDefined")); >- WsdlUtilsTest >- .addTest(new WSDLUtilsTest("testGetTargetNamespacePrefix")); >- >- return WsdlUtilsTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testGetWSDLOperation >- * >- * @throws Exception >- */ >- public void testGetWSDLOperation() throws Exception >- { >- Operation[] operations = WsdlUtils >- .getWSDLOperation(ware_house_front_defintion); >- assertNotNull(operations); >- assertEquals(OPERATION_NAMES.length, operations.length); >- >- for (int i = 0; i < OPERATION_NAMES.length; i++) >- { >- String opName = WsdlUtils.getOperationName(operations[i]); >- assertEquals(OPERATION_NAMES[i], opName); >- } >- } >- >- /** >- * testGetPortType >- * >- * @throws Exception >- */ >- public void testGetPortType() throws Exception >- { >- PortType portType = WsdlUtils.getPortType(ware_house_front_defintion); >- assertNotNull(portType); >- QName qname = portType.getQName(); >- String nsURI = qname.getNamespaceURI(); >- String portName = qname.getLocalPart(); >- assertEquals(TARGET_NS, nsURI); >- assertEquals(PORT_TYPE_NAME, portName); >- >- List operations = portType.getEOperations(); >- assertNotNull(operations); >- assertEquals(OPERATION_NAMES.length, operations.size()); >- } >- >- /** >- * testGetOperationName >- * >- * @throws Exception >- */ >- public void testGetOperationName() throws Exception >- { >- Operation[] operations = WsdlUtils >- .getWSDLOperation(ware_house_front_defintion); >- assertNotNull(operations); >- assertEquals(OPERATION_NAMES.length, operations.length); >- >- for (int i = 0; i < OPERATION_NAMES.length; i++) >- { >- String opName = WsdlUtils.getOperationName(operations[i]); >- assertEquals(OPERATION_NAMES[i], opName); >- } >- } >- >- /** >- * testGetSchema >- * >- * @throws Exception >- */ >- public void testGetSchema() throws Exception >- { >- for (int i = 0; i < XSD_SCHEMAS_DEFINED.length; i++) >- { >- XSDSchema schema = WsdlUtils.getSchema(ware_house_front_defintion, >- XSD_SCHEMAS_DEFINED[i]); >- assertNotNull(schema); >- assertEquals(XSD_SCHEMAS_DEFINED[i], schema.getTargetNamespace()); >- } >- >- String unknownSchema = "http://w3.ibm.com/unknownschema"; >- XSDSchema schema = WsdlUtils.getSchema(ware_house_front_defintion, >- unknownSchema); >- assertNull(schema); >- } >- >- /** >- * testGetXSDSchemas >- * >- * @throws Exception >- */ >- public void testGetXSDSchemas() throws Exception >- { >- XSDSchema[] schemas = WsdlUtils >- .getXSDSchemas(ware_house_front_defintion); >- assertNotNull(schemas); >- assertEquals(XSD_SCHEMAS_DEFINED.length, schemas.length); >- >- for (int i = 0; i < XSD_SCHEMAS_DEFINED.length; i++) >- { >- XSDSchema schema = schemas[i]; >- assertEquals(XSD_SCHEMAS_DEFINED[i], schema.getTargetNamespace()); >- } >- } >- >- /** >- * testGetNamespace >- * >- * @throws Exception >- */ >- public void testGetNamespace() throws Exception >- { >- for (int i = 0; i < NAMESPACE_DEFINED.length; i++) >- { >- String prefix = NAMESPACE_DEFINED[i][0]; >- String ns = NAMESPACE_DEFINED[i][1]; >- String resultNS = WsdlUtils.getNamespace( >- ware_house_front_defintion, prefix); >- assertNotNull(resultNS); >- assertEquals(ns, resultNS); >- } >- >- String unknownPrefix = "Unknown"; >- String resultNS = WsdlUtils.getNamespace(ware_house_front_defintion, >- unknownPrefix); >- assertNull(resultNS); >- } >- >- /** >- * testGetPrefix >- * >- * @throws Exception >- */ >- public void testGetPrefix() throws Exception >- { >- for (int i = 0; i < NAMESPACE_DEFINED.length; i++) >- { >- String prefix = NAMESPACE_DEFINED[i][0]; >- String ns = NAMESPACE_DEFINED[i][1]; >- String resultPrefix = WsdlUtils.getPrefix( >- ware_house_front_defintion, ns); >- assertNotNull(resultPrefix); >- assertEquals(prefix, resultPrefix); >- } >- >- String unknonNS = "http://w3.ibm.com/unknown"; >- String prefix = WsdlUtils.getPrefix(ware_house_front_defintion, >- unknonNS); >- assertNull(prefix); >- } >- >- /** >- * testIsNamespaceDefined >- * >- * @throws Exception >- */ >- public void testIsNamespaceDefined() throws Exception >- { >- for (int i = 0; i < NAMESPACE_DEFINED.length; i++) >- { >- String ns = NAMESPACE_DEFINED[i][1]; >- boolean defined = WsdlUtils.isNamespaceDefined( >- ware_house_front_defintion, ns); >- assertEquals(true, defined); >- } >- >- String unknonNS = "http://w3.ibm.com/unknown"; >- boolean defined = WsdlUtils.isNamespaceDefined( >- ware_house_front_defintion, unknonNS); >- assertEquals(false, defined); >- } >- >- /** >- * testGetTargetNamespacePrefix >- * >- * @throws Exception >- */ >- public void testGetTargetNamespacePrefix() throws Exception >- { >- String prefix = WsdlUtils >- .getTargetNamespacePrefix(ware_house_front_defintion); >- assertNotNull(prefix); >- assertEquals(TARGET_NS_PREFIX, prefix); >- } >+ /** >+ * Constructor for WsdlUtilsTest. >+ * >+ * @param name >+ */ >+ public WSDLUtilsTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the <b>WsdlUtilsTest</b> >+ * definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite WsdlUtilsTest = new HyadesTestSuite("WsdlUtilsTest"); >+ WsdlUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "EA3D854DD553CFEDB4436C0017F711DB"); >+ >+ WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetWSDLOperation")); >+ WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetPortType")); >+ WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetOperationName")); >+ WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetSchema")); >+ WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetXSDSchemas")); >+ WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetNamespace")); >+ WsdlUtilsTest.addTest(new WSDLUtilsTest("testGetPrefix")); >+ WsdlUtilsTest.addTest(new WSDLUtilsTest("testIsNamespaceDefined")); >+ WsdlUtilsTest >+ .addTest(new WSDLUtilsTest("testGetTargetNamespacePrefix")); >+ >+ return WsdlUtilsTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testGetWSDLOperation >+ * >+ * @throws Exception >+ */ >+ public void testGetWSDLOperation() throws Exception >+ { >+ Operation[] operations = WsdlUtils >+ .getWSDLOperation(ware_house_front_defintion); >+ assertNotNull(operations); >+ assertEquals(OPERATION_NAMES.length, operations.length); >+ >+ for (int i = 0; i < OPERATION_NAMES.length; i++) >+ { >+ String opName = WsdlUtils.getOperationName(operations[i]); >+ assertEquals(OPERATION_NAMES[i], opName); >+ } >+ } >+ >+ /** >+ * testGetPortType >+ * >+ * @throws Exception >+ */ >+ public void testGetPortType() throws Exception >+ { >+ PortType portType = WsdlUtils.getPortType(ware_house_front_defintion); >+ assertNotNull(portType); >+ QName qname = portType.getQName(); >+ String nsURI = qname.getNamespaceURI(); >+ String portName = qname.getLocalPart(); >+ assertEquals(TARGET_NS, nsURI); >+ assertEquals(PORT_TYPE_NAME, portName); >+ >+ List operations = portType.getEOperations(); >+ assertNotNull(operations); >+ assertEquals(OPERATION_NAMES.length, operations.size()); >+ } >+ >+ /** >+ * testGetOperationName >+ * >+ * @throws Exception >+ */ >+ public void testGetOperationName() throws Exception >+ { >+ Operation[] operations = WsdlUtils >+ .getWSDLOperation(ware_house_front_defintion); >+ assertNotNull(operations); >+ assertEquals(OPERATION_NAMES.length, operations.length); >+ >+ for (int i = 0; i < OPERATION_NAMES.length; i++) >+ { >+ String opName = WsdlUtils.getOperationName(operations[i]); >+ assertEquals(OPERATION_NAMES[i], opName); >+ } >+ } >+ >+ /** >+ * testGetSchema >+ * >+ * @throws Exception >+ */ >+ public void testGetSchema() throws Exception >+ { >+ for (int i = 0; i < XSD_SCHEMAS_DEFINED.length; i++) >+ { >+ XSDSchema schema = WsdlUtils.getSchema(ware_house_front_defintion, >+ XSD_SCHEMAS_DEFINED[i]); >+ assertNotNull(schema); >+ assertEquals(XSD_SCHEMAS_DEFINED[i], schema.getTargetNamespace()); >+ } >+ >+ String unknownSchema = "http://w3.ibm.com/unknownschema"; >+ XSDSchema schema = WsdlUtils.getSchema(ware_house_front_defintion, >+ unknownSchema); >+ assertNull(schema); >+ } >+ >+ /** >+ * testGetXSDSchemas >+ * >+ * @throws Exception >+ */ >+ public void testGetXSDSchemas() throws Exception >+ { >+ XSDSchema[] schemas = WsdlUtils >+ .getXSDSchemas(ware_house_front_defintion); >+ assertNotNull(schemas); >+ assertEquals(XSD_SCHEMAS_DEFINED.length, schemas.length); >+ >+ for (int i = 0; i < XSD_SCHEMAS_DEFINED.length; i++) >+ { >+ XSDSchema schema = schemas[i]; >+ assertEquals(XSD_SCHEMAS_DEFINED[i], schema.getTargetNamespace()); >+ } >+ } >+ >+ /** >+ * testGetNamespace >+ * >+ * @throws Exception >+ */ >+ public void testGetNamespace() throws Exception >+ { >+ for (int i = 0; i < NAMESPACE_DEFINED.length; i++) >+ { >+ String prefix = NAMESPACE_DEFINED[i][0]; >+ String ns = NAMESPACE_DEFINED[i][1]; >+ String resultNS = WsdlUtils.getNamespace( >+ ware_house_front_defintion, prefix); >+ assertNotNull(resultNS); >+ assertEquals(ns, resultNS); >+ } >+ >+ String unknownPrefix = "Unknown"; >+ String resultNS = WsdlUtils.getNamespace(ware_house_front_defintion, >+ unknownPrefix); >+ assertNull(resultNS); >+ } >+ >+ /** >+ * testGetPrefix >+ * >+ * @throws Exception >+ */ >+ public void testGetPrefix() throws Exception >+ { >+ for (int i = 0; i < NAMESPACE_DEFINED.length; i++) >+ { >+ String prefix = NAMESPACE_DEFINED[i][0]; >+ String ns = NAMESPACE_DEFINED[i][1]; >+ String resultPrefix = WsdlUtils.getPrefix( >+ ware_house_front_defintion, ns); >+ assertNotNull(resultPrefix); >+ assertEquals(prefix, resultPrefix); >+ } >+ >+ String unknonNS = "http://w3.ibm.com/unknown"; >+ String prefix = WsdlUtils.getPrefix(ware_house_front_defintion, >+ unknonNS); >+ assertNull(prefix); >+ } >+ >+ /** >+ * testIsNamespaceDefined >+ * >+ * @throws Exception >+ */ >+ public void testIsNamespaceDefined() throws Exception >+ { >+ for (int i = 0; i < NAMESPACE_DEFINED.length; i++) >+ { >+ String ns = NAMESPACE_DEFINED[i][1]; >+ boolean defined = WsdlUtils.isNamespaceDefined( >+ ware_house_front_defintion, ns); >+ assertEquals(true, defined); >+ } >+ >+ String unknonNS = "http://w3.ibm.com/unknown"; >+ boolean defined = WsdlUtils.isNamespaceDefined( >+ ware_house_front_defintion, unknonNS); >+ assertEquals(false, defined); >+ } >+ >+ /** >+ * testGetTargetNamespacePrefix >+ * >+ * @throws Exception >+ */ >+ public void testGetTargetNamespacePrefix() throws Exception >+ { >+ String prefix = WsdlUtils >+ .getTargetNamespacePrefix(ware_house_front_defintion); >+ assertNotNull(prefix); >+ assertEquals(TARGET_NS_PREFIX, prefix); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/ValidationTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/ValidationTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ValidationTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/ValidationTest.java 15 Sep 2006 15:20:23 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/ValidationTest.java 22 Jan 2007 09:34:35 -0000 >@@ -24,75 +24,75 @@ > */ > public class ValidationTest extends HyadesTestCase > { >- /** >- * Constructor for ValidationTest. >- * >- * @param name >- */ >- public ValidationTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the <b>ValidationTest</b> >- * definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite validationTest = new HyadesTestSuite("ValidationTest"); >- validationTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D73CAB3F2042F811DB"); >- >- validationTest.addTest(new ValidationTest("testIsNamespace")); >- validationTest.addTest(new ValidationTest("testIsNCName")); >- validationTest.addTest(new ValidationTest("testIsQName")); >- >- return validationTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testIsNamespace >- * >- * @throws Exception >- */ >- public void testIsNamespace() throws Exception >- { >- // Enter your code here >- } >- >- /** >- * testIsNCName >- * >- * @throws Exception >- */ >- public void testIsNCName() throws Exception >- { >- // Enter your code here >- } >- >- /** >- * testIsQName >- * >- * @throws Exception >- */ >- public void testIsQName() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for ValidationTest. >+ * >+ * @param name >+ */ >+ public ValidationTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the <b>ValidationTest</b> >+ * definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite validationTest = new HyadesTestSuite("ValidationTest"); >+ validationTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D73CAB3F2042F811DB"); >+ >+ validationTest.addTest(new ValidationTest("testIsNamespace")); >+ validationTest.addTest(new ValidationTest("testIsNCName")); >+ validationTest.addTest(new ValidationTest("testIsQName")); >+ >+ return validationTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testIsNamespace >+ * >+ * @throws Exception >+ */ >+ public void testIsNamespace() throws Exception >+ { >+ // Enter your code here >+ } >+ >+ /** >+ * testIsNCName >+ * >+ * @throws Exception >+ */ >+ public void testIsNCName() throws Exception >+ { >+ // Enter your code here >+ } >+ >+ /** >+ * testIsQName >+ * >+ * @throws Exception >+ */ >+ public void testIsQName() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/XSDUtilsTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/XSDUtilsTest.java,v >retrieving revision 1.2 >diff -u -r1.2 XSDUtilsTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/XSDUtilsTest.java 15 Sep 2006 15:20:23 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/XSDUtilsTest.java 22 Jan 2007 09:34:36 -0000 >@@ -28,177 +28,177 @@ > */ > public class XSDUtilsTest extends XSDTestModel > { >- /** >- * Constructor for XSDUtilsTest. >- * >- * @param name >- */ >- public XSDUtilsTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the <b>XsdUtilsTest</b> >- * definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite XsdUtilsTest = new HyadesTestSuite("XsdUtilsTest"); >- XsdUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "EA3D854DD553CFEDDE801AE017F711DB"); >- >- XsdUtilsTest.addTest(new XSDUtilsTest("testGetName")); >- XsdUtilsTest.addTest(new XSDUtilsTest("testSetName")); >- XsdUtilsTest.addTest(new XSDUtilsTest("testGetType")); >- XsdUtilsTest.addTest(new XSDUtilsTest("testIsImportNSExists")); >- XsdUtilsTest.addTest(new XSDUtilsTest( >- "testGetXSDElementDeclarationOfName")); >- XsdUtilsTest.addTest(new XSDUtilsTest("testHasIncludeXSD")); >- XsdUtilsTest.addTest(new XSDUtilsTest("testGetXSDInclude")); >- >- return XsdUtilsTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testGetName >- * >- * @throws Exception >- */ >- public void testGetName() throws Exception >- { >- List features = XsdUtils.getXSDFeatureList(web_application_schema); >- assertNotNull(features); >- assertEquals(WEB_APP_ELEMENT_NAMES.length, features.size()); >- >- for (int i = 0; i < features.size(); i++) >- { >- XSDFeature feature = (XSDFeature) features.get(i); >- String name = XsdUtils.getName(feature); >- assertEquals(WEB_APP_ELEMENT_NAMES[i], name); >- } >- >- } >- >- /** >- * testSetName >- * >- * @throws Exception >- */ >- public void testSetName() throws Exception >- { >- List features = XsdUtils.getXSDFeatureList(web_application_schema); >- assertNotNull(features); >- assertEquals(WEB_APP_ELEMENT_NAMES.length, features.size()); >- >- XSDFeature feature = (XSDFeature) features.get(3); >- String oldName = new String(XsdUtils.getName(feature)); >- String newName = "NewElement"; >- XsdUtils.setName(feature, newName); >- >- XSDElementDeclaration oldElement = XsdUtils >- .getXSDElementDeclarationOfName(web_application_schema, oldName); >- assertNull(oldElement); >- >- XSDElementDeclaration newElement = XsdUtils >- .getXSDElementDeclarationOfName(web_application_schema, newName); >- assertNotNull(newElement); >- assertEquals(feature, newElement); >- } >- >- /** >- * testGetType >- * >- * @throws Exception >- */ >- public void testGetType() throws Exception >- { >- List features = XsdUtils.getXSDFeatureList(web_application_schema); >- assertNotNull(features); >- assertEquals(WEB_APP_ELEMENT_NAMES.length, features.size()); >- >- for (int i = 0; i < features.size(); i++) >- { >- XSDFeature feature = (XSDFeature) features.get(i); >- String type = XsdUtils.getType(feature); >- assertEquals(WEB_APP_ELEMENT_TYPES[i], type); >- } >- } >- >- /** >- * testIsImportNSExists >- * >- * @throws Exception >- */ >- public void testIsImportNSExists() throws Exception >- { >- for (int i = 0; i < IMPORTED_NS.length; i++) >- { >- boolean isExist = XsdUtils.isImportNSExists(web_application_schema, >- IMPORTED_NS[i]); >- assertEquals(true, isExist); >- } >- >- String unknownNS = "http://w3.ibm.com/unknown"; >- boolean isExist = XsdUtils.isImportNSExists(web_application_schema, >- unknownNS); >- assertEquals(false, isExist); >- } >- >- /** >- * testGetXSDElementDeclarationOfName >- * >- * @throws Exception >- */ >- public void testGetXSDElementDeclarationOfName() throws Exception >- { >- List features = XsdUtils.getXSDFeatureList(web_application_schema); >- assertNotNull(features); >- assertEquals(WEB_APP_ELEMENT_NAMES.length, features.size()); >- >- for (int i = 0; i < features.size(); i++) >- { >- XSDFeature feature = (XSDFeature) features.get(i); >- XSDElementDeclaration element = XsdUtils >- .getXSDElementDeclarationOfName(web_application_schema, >- WEB_APP_ELEMENT_NAMES[i]); >- assertEquals(feature, element); >- } >- } >- >- /** >- * testHasIncludeXSD >- * >- * @throws Exception >- */ >- public void testHasIncludeXSD() throws Exception >- { >- // Enter your code here >- } >- >- /** >- * testGetXSDInclude >- * >- * @throws Exception >- */ >- public void testGetXSDInclude() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for XSDUtilsTest. >+ * >+ * @param name >+ */ >+ public XSDUtilsTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the <b>XsdUtilsTest</b> >+ * definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite XsdUtilsTest = new HyadesTestSuite("XsdUtilsTest"); >+ XsdUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "EA3D854DD553CFEDDE801AE017F711DB"); >+ >+ XsdUtilsTest.addTest(new XSDUtilsTest("testGetName")); >+ XsdUtilsTest.addTest(new XSDUtilsTest("testSetName")); >+ XsdUtilsTest.addTest(new XSDUtilsTest("testGetType")); >+ XsdUtilsTest.addTest(new XSDUtilsTest("testIsImportNSExists")); >+ XsdUtilsTest.addTest(new XSDUtilsTest( >+ "testGetXSDElementDeclarationOfName")); >+ XsdUtilsTest.addTest(new XSDUtilsTest("testHasIncludeXSD")); >+ XsdUtilsTest.addTest(new XSDUtilsTest("testGetXSDInclude")); >+ >+ return XsdUtilsTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testGetName >+ * >+ * @throws Exception >+ */ >+ public void testGetName() throws Exception >+ { >+ List features = XsdUtils.getXSDFeatureList(web_application_schema); >+ assertNotNull(features); >+ assertEquals(WEB_APP_ELEMENT_NAMES.length, features.size()); >+ >+ for (int i = 0; i < features.size(); i++) >+ { >+ XSDFeature feature = (XSDFeature) features.get(i); >+ String name = XsdUtils.getName(feature); >+ assertEquals(WEB_APP_ELEMENT_NAMES[i], name); >+ } >+ >+ } >+ >+ /** >+ * testSetName >+ * >+ * @throws Exception >+ */ >+ public void testSetName() throws Exception >+ { >+ List features = XsdUtils.getXSDFeatureList(web_application_schema); >+ assertNotNull(features); >+ assertEquals(WEB_APP_ELEMENT_NAMES.length, features.size()); >+ >+ XSDFeature feature = (XSDFeature) features.get(3); >+ String oldName = new String(XsdUtils.getName(feature)); >+ String newName = "NewElement"; >+ XsdUtils.setName(feature, newName); >+ >+ XSDElementDeclaration oldElement = XsdUtils >+ .getXSDElementDeclarationOfName(web_application_schema, oldName); >+ assertNull(oldElement); >+ >+ XSDElementDeclaration newElement = XsdUtils >+ .getXSDElementDeclarationOfName(web_application_schema, newName); >+ assertNotNull(newElement); >+ assertEquals(feature, newElement); >+ } >+ >+ /** >+ * testGetType >+ * >+ * @throws Exception >+ */ >+ public void testGetType() throws Exception >+ { >+ List features = XsdUtils.getXSDFeatureList(web_application_schema); >+ assertNotNull(features); >+ assertEquals(WEB_APP_ELEMENT_NAMES.length, features.size()); >+ >+ for (int i = 0; i < features.size(); i++) >+ { >+ XSDFeature feature = (XSDFeature) features.get(i); >+ String type = XsdUtils.getType(feature); >+ assertEquals(WEB_APP_ELEMENT_TYPES[i], type); >+ } >+ } >+ >+ /** >+ * testIsImportNSExists >+ * >+ * @throws Exception >+ */ >+ public void testIsImportNSExists() throws Exception >+ { >+ for (int i = 0; i < IMPORTED_NS.length; i++) >+ { >+ boolean isExist = XsdUtils.isImportNSExists(web_application_schema, >+ IMPORTED_NS[i]); >+ assertEquals(true, isExist); >+ } >+ >+ String unknownNS = "http://w3.ibm.com/unknown"; >+ boolean isExist = XsdUtils.isImportNSExists(web_application_schema, >+ unknownNS); >+ assertEquals(false, isExist); >+ } >+ >+ /** >+ * testGetXSDElementDeclarationOfName >+ * >+ * @throws Exception >+ */ >+ public void testGetXSDElementDeclarationOfName() throws Exception >+ { >+ List features = XsdUtils.getXSDFeatureList(web_application_schema); >+ assertNotNull(features); >+ assertEquals(WEB_APP_ELEMENT_NAMES.length, features.size()); >+ >+ for (int i = 0; i < features.size(); i++) >+ { >+ XSDFeature feature = (XSDFeature) features.get(i); >+ XSDElementDeclaration element = XsdUtils >+ .getXSDElementDeclarationOfName(web_application_schema, >+ WEB_APP_ELEMENT_NAMES[i]); >+ assertEquals(feature, element); >+ } >+ } >+ >+ /** >+ * testHasIncludeXSD >+ * >+ * @throws Exception >+ */ >+ public void testHasIncludeXSD() throws Exception >+ { >+ // Enter your code here >+ } >+ >+ /** >+ * testGetXSDInclude >+ * >+ * @throws Exception >+ */ >+ public void testGetXSDInclude() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/Definition2CapabilityTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/Definition2CapabilityTest.java,v >retrieving revision 1.2 >diff -u -r1.2 Definition2CapabilityTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/Definition2CapabilityTest.java 15 Sep 2006 15:20:23 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/Definition2CapabilityTest.java 22 Jan 2007 09:34:34 -0000 >@@ -15,7 +15,6 @@ > > import junit.framework.Test; > >-import org.eclipse.emf.ecore.xml.type.internal.QName; > import org.eclipse.hyades.test.common.junit.DefaultTestArbiter; > import org.eclipse.hyades.test.common.junit.HyadesTestSuite; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Property; >@@ -32,163 +31,162 @@ > */ > public class Definition2CapabilityTest extends UtilsCapabilityTestModel > { >- /** >- * Constructor for Definition2CapabilityTest. >- * >- * @param name >- */ >- >- public Definition2CapabilityTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>Definition2CapabilityTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite definition2CapabilityTest = new HyadesTestSuite( >- "Definition2CapabilityTest"); >- definition2CapabilityTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("EFF2985B4634B8E38994F84017E611DB"); >- >- definition2CapabilityTest.addTest(new Definition2CapabilityTest( >- "testGetCapabilityInfo")); >- definition2CapabilityTest.addTest(new Definition2CapabilityTest( >- "testGetCapabilityProperties")); >- definition2CapabilityTest.addTest(new Definition2CapabilityTest( >- "testGetPropertyMetadata")); >- definition2CapabilityTest.addTest(new Definition2CapabilityTest( >- "testGetCapabilityOperation")); >- definition2CapabilityTest.addTest(new Definition2CapabilityTest( >- "testGetCapabilityTopics")); >- >- return definition2CapabilityTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testGetCapabilityInfo >- * >- * @throws Exception >- */ >- public void testGetCapabilityInfo() throws Exception >- { >- String capName = capabilityDomain.getCapability().getName(); >- String namespace = capabilityDomain.getCapability().getNamespace(); >- assertEquals(CAPABILITY_NAME, capName); >- assertEquals(CAPABILITY_NAMESPACE, namespace); >- } >- >- /** >- * testGetCapabilityProperties >- * >- * @throws Exception >- */ >- public void testGetCapabilityProperties() throws Exception >- { >- List properties = capabilityDomain.getCapability().getProperties(); >- assertNotNull(properties); >- assertEquals(PROPERTY_NAMES.length, properties.size()); >- for (int i = 0; i < properties.size(); i++) >- { >- Object object = properties.get(i); >- assertNotNull(object); >- assertTrue(object instanceof Property); >- Property property = (Property) object; >- XSDElementDeclaration element = property.getElement(); >- assertNotNull(element); >- String elementNS = element.getTargetNamespace(); >- String propName = XsdUtils.getName(element); >- String propType = XsdUtils.getType(element); >- assertEquals(PROPERTY_NAMES[i], propName); >- assertEquals(PROPERTY_TYPES[i], propType); >- } >- } >- >- /** >- * testGetPropertyMetadata >- * >- * @throws Exception >- */ >- public void testGetPropertyMetadata() throws Exception >- { >- List properties = capabilityDomain.getCapability().getProperties(); >- assertNotNull(properties); >- assertEquals(PROPERTY_NAMES.length, properties.size()); >- for (int i = 0; i < properties.size(); i++) >- { >- Object object = properties.get(i); >- assertNotNull(object); >- assertTrue(object instanceof Property); >- Property property = (Property) object; >- PropertyType metadata = property.getMetaData(); >- assertNotNull(metadata); >- QName qname = (QName) metadata.getName(); >- String propName = qname.getLocalPart(); >- String ns = qname.getNamespaceURI(); >- String mutability = metadata.getMutability().getLiteral(); >- String modifiability = metadata.getModifiability().getLiteral(); >- assertEquals(PROPERTY_NAMES[i], propName); >- assertEquals(MUTABILITY[i], mutability); >- assertEquals(MODIFIABILITY[i], modifiability); >- >- // TODO Check for CapabilityName, ValidValues, StaticValues, >- // Metrics etc. >- } >- } >- >- /** >- * testGetCapabilityOperation >- * >- * @throws Exception >- */ >- public void testGetCapabilityOperation() throws Exception >- { >- List operations = capabilityDomain.getCapability().getOperations(); >- assertNotNull(operations); >- assertEquals(OPERATION_NAMES.length, operations.size()); >- for (int i = 0; i < operations.size(); i++) >- { >- Object object = operations.get(i); >- assertNotNull(object); >- assertTrue(object instanceof Operation); >- Operation operation = (Operation) object; >- String opName = WsdlUtils.getOperationName(operation); >- XSDElementDeclaration returnTypeDeclaration = WsdlUtils >- .getReturnTypeElement(operation); >- String returnType = XsdUtils.getType(returnTypeDeclaration); >- assertEquals(OPERATION_NAMES[i], opName); >- assertEquals(OPERATION_RETURN_TYPES[i], returnType); >- >- // TODO Write the code for paramater checking >- } >- } >- >- /** >- * testGetCapabilityTopics >- * >- * @throws Exception >- */ >- public void testGetCapabilityTopics() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for Definition2CapabilityTest. >+ * >+ * @param name >+ */ >+ >+ public Definition2CapabilityTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>Definition2CapabilityTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite definition2CapabilityTest = new HyadesTestSuite( >+ "Definition2CapabilityTest"); >+ definition2CapabilityTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("EFF2985B4634B8E38994F84017E611DB"); >+ >+ definition2CapabilityTest.addTest(new Definition2CapabilityTest( >+ "testGetCapabilityInfo")); >+ definition2CapabilityTest.addTest(new Definition2CapabilityTest( >+ "testGetCapabilityProperties")); >+ definition2CapabilityTest.addTest(new Definition2CapabilityTest( >+ "testGetPropertyMetadata")); >+ definition2CapabilityTest.addTest(new Definition2CapabilityTest( >+ "testGetCapabilityOperation")); >+ definition2CapabilityTest.addTest(new Definition2CapabilityTest( >+ "testGetCapabilityTopics")); >+ >+ return definition2CapabilityTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testGetCapabilityInfo >+ * >+ * @throws Exception >+ */ >+ public void testGetCapabilityInfo() throws Exception >+ { >+ String capName = capabilityDomain.getCapability().getName(); >+ String namespace = capabilityDomain.getCapability().getNamespace(); >+ assertEquals(CAPABILITY_NAME, capName); >+ assertEquals(CAPABILITY_NAMESPACE, namespace); >+ } >+ >+ /** >+ * testGetCapabilityProperties >+ * >+ * @throws Exception >+ */ >+ public void testGetCapabilityProperties() throws Exception >+ { >+ List properties = capabilityDomain.getCapability().getProperties(); >+ assertNotNull(properties); >+ assertEquals(PROPERTY_NAMES.length, properties.size()); >+ for (int i = 0; i < properties.size(); i++) >+ { >+ Object object = properties.get(i); >+ assertNotNull(object); >+ assertTrue(object instanceof Property); >+ Property property = (Property) object; >+ XSDElementDeclaration element = property.getElement(); >+ assertNotNull(element); >+ String elementNS = element.getTargetNamespace(); >+ String propName = XsdUtils.getName(element); >+ String propType = XsdUtils.getType(element); >+ assertEquals(PROPERTY_NAMES[i], propName); >+ assertEquals(PROPERTY_TYPES[i], propType); >+ } >+ } >+ >+ /** >+ * testGetPropertyMetadata >+ * >+ * @throws Exception >+ */ >+ public void testGetPropertyMetadata() throws Exception >+ { >+ List properties = capabilityDomain.getCapability().getProperties(); >+ assertNotNull(properties); >+ assertEquals(PROPERTY_NAMES.length, properties.size()); >+ for (int i = 0; i < properties.size(); i++) >+ { >+ Object object = properties.get(i); >+ assertNotNull(object); >+ assertTrue(object instanceof Property); >+ Property property = (Property) object; >+ PropertyType metadata = property.getMetaData(); >+ assertNotNull(metadata); >+ String qname = metadata.getName(); >+ String propName = TestUtils.extractName(qname); >+ String mutability = metadata.getMutability().getLiteral(); >+ String modifiability = metadata.getModifiability().getLiteral(); >+ assertEquals(PROPERTY_NAMES[i], propName); >+ assertEquals(MUTABILITY[i], mutability); >+ assertEquals(MODIFIABILITY[i], modifiability); >+ >+ // TODO Check for CapabilityName, ValidValues, StaticValues, >+ // Metrics etc. >+ } >+ } >+ >+ /** >+ * testGetCapabilityOperation >+ * >+ * @throws Exception >+ */ >+ public void testGetCapabilityOperation() throws Exception >+ { >+ List operations = capabilityDomain.getCapability().getOperations(); >+ assertNotNull(operations); >+ assertEquals(OPERATION_NAMES.length, operations.size()); >+ for (int i = 0; i < operations.size(); i++) >+ { >+ Object object = operations.get(i); >+ assertNotNull(object); >+ assertTrue(object instanceof Operation); >+ Operation operation = (Operation) object; >+ String opName = WsdlUtils.getOperationName(operation); >+ XSDElementDeclaration returnTypeDeclaration = WsdlUtils >+ .getReturnTypeElement(operation); >+ String returnType = XsdUtils.getType(returnTypeDeclaration); >+ assertEquals(OPERATION_NAMES[i], opName); >+ assertEquals(OPERATION_RETURN_TYPES[i], returnType); >+ >+ // TODO Write the code for paramater checking >+ } >+ } >+ >+ /** >+ * testGetCapabilityTopics >+ * >+ * @throws Exception >+ */ >+ public void testGetCapabilityTopics() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/MetaDataUtilsTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/MetaDataUtilsTest.java,v >retrieving revision 1.2 >diff -u -r1.2 MetaDataUtilsTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/MetaDataUtilsTest.java 15 Sep 2006 15:20:23 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/MetaDataUtilsTest.java 22 Jan 2007 09:34:34 -0000 >@@ -17,11 +17,8 @@ > > import org.eclipse.hyades.test.common.junit.DefaultTestArbiter; > import org.eclipse.hyades.test.common.junit.HyadesTestSuite; >-import org.eclipse.tptp.wsdm.tooling.editor.capability.internal.FormMetric; > import org.eclipse.tptp.wsdm.tooling.editor.capability.model.test.RMDTestModel; > import org.eclipse.tptp.wsdm.tooling.editor.capability.util.internal.MetaDataUtils; >-import org.eclipse.tptp.wsdm.tooling.model.capabilities.CapabilitiesFactory; >-import org.eclipse.tptp.wsdm.tooling.model.capabilities.Property; > import org.eclipse.tptp.wsdm.tooling.model.metadataDescriptor.PropertyType; > > /** >@@ -30,212 +27,161 @@ > */ > public class MetaDataUtilsTest extends RMDTestModel > { >- /** >- * Constructor for MetaDataUtilsTest. >- * >- * @param name >- */ >- public MetaDataUtilsTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the <b>MetaDataUtilsTest</b> >- * definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite metaDataUtilsTest = new HyadesTestSuite( >- "MetaDataUtilsTest"); >- metaDataUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "EA3D854DD553CFED9107305017F711DB"); >- >- metaDataUtilsTest >- .addTest(new MetaDataUtilsTest("testGetModifiability")); >- metaDataUtilsTest.addTest(new MetaDataUtilsTest("testGetMutability")); >- metaDataUtilsTest.addTest(new MetaDataUtilsTest("testGetValidValues")); >- metaDataUtilsTest.addTest(new MetaDataUtilsTest("testGetStaticValues")); >- metaDataUtilsTest.addTest(new MetaDataUtilsTest( >- "testHasMetricsCapability")); >- metaDataUtilsTest.addTest(new MetaDataUtilsTest("testGetMetric")); >- >- return metaDataUtilsTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testGetModifiability >- * >- * @throws Exception >- */ >- public void testGetModifiability() throws Exception >- { >- List propertyTypes = metaDescriptor.getProperty(); >- assertNotNull(propertyTypes); >- assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >- >- PropertyType homeProperty = (PropertyType) propertyTypes.get(0); >- String modifiability = MetaDataUtils.getModifiability(homeProperty); >- assertNotNull(modifiability); >- assertEquals(home_metadata.modifiability, modifiability); >- >- PropertyType connectionPoolProperty = (PropertyType) propertyTypes >- .get(1); >- modifiability = MetaDataUtils.getModifiability(connectionPoolProperty); >- assertNotNull(modifiability); >- assertEquals(connectionPool_metadata.modifiability, modifiability); >- } >- >- /** >- * testGetMutability >- * >- * @throws Exception >- */ >- public void testGetMutability() throws Exception >- { >- List propertyTypes = metaDescriptor.getProperty(); >- assertNotNull(propertyTypes); >- assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >- >- PropertyType homeProperty = (PropertyType) propertyTypes.get(0); >- String mutability = MetaDataUtils.getMutability(homeProperty); >- assertNotNull(mutability); >- assertEquals(home_metadata.mutability, mutability); >- >- PropertyType connectionPoolProperty = (PropertyType) propertyTypes >- .get(1); >- mutability = MetaDataUtils.getMutability(connectionPoolProperty); >- assertNotNull(mutability); >- assertEquals(connectionPool_metadata.mutability, mutability); >- } >- >- /** >- * testGetValidValues >- * >- * @throws Exception >- */ >- public void testGetValidValues() throws Exception >- { >- List propertyTypes = metaDescriptor.getProperty(); >- assertNotNull(propertyTypes); >- assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >- >- PropertyType homeProperty = (PropertyType) propertyTypes.get(0); >- Object[] validValues = MetaDataUtils.getValidValues(homeProperty >- .getValidValues()); >- assertNotNull(validValues); >- for (int i = 0; i < home_metadata.validValues.length; i++) >- { >- Object expected = home_metadata.validValues[i]; >- assertEquals(expected, validValues[i]); >- } >- >- PropertyType connectionPoolProperty = (PropertyType) propertyTypes >- .get(1); >- validValues = MetaDataUtils.getValidValues(connectionPoolProperty >- .getValidValues()); >- assertNotNull(validValues); >- for (int i = 0; i < connectionPool_metadata.validValues.length; i++) >- { >- Object expected = connectionPool_metadata.validValues[i]; >- assertEquals(expected, validValues[i]); >- } >- } >- >- /** >- * testGetStaticValues >- * >- * @throws Exception >- */ >- public void testGetStaticValues() throws Exception >- { >- List propertyTypes = metaDescriptor.getProperty(); >- assertNotNull(propertyTypes); >- assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >- >- PropertyType homeProperty = (PropertyType) propertyTypes.get(0); >- Object[] staticValues = MetaDataUtils.getStaticValues(homeProperty >- .getStaticValues()); >- assertNotNull(staticValues); >- for (int i = 0; i < home_metadata.staticValues.length; i++) >- { >- Object expected = home_metadata.staticValues[i]; >- assertEquals(expected, staticValues[i]); >- } >- >- PropertyType connectionPoolProperty = (PropertyType) propertyTypes >- .get(1); >- staticValues = MetaDataUtils.getStaticValues(connectionPoolProperty >- .getStaticValues()); >- assertNotNull(staticValues); >- for (int i = 0; i < connectionPool_metadata.staticValues.length; i++) >- { >- Object expected = connectionPool_metadata.staticValues[i]; >- assertEquals(expected, staticValues[i]); >- } >- } >- >- /** >- * testHasMetricsCapability >- * >- * @throws Exception >- */ >- public void testHasMetricsCapability() throws Exception >- { >- List propertyTypes = metaDescriptor.getProperty(); >- assertNotNull(propertyTypes); >- assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >- >- PropertyType homeProperty = (PropertyType) propertyTypes.get(0); >- boolean hasMetric = MetaDataUtils.hasMetricsCapability(homeProperty); >- assertEquals(home_metadata.hasMetric, hasMetric); >- >- PropertyType connectionPoolProperty = (PropertyType) propertyTypes >- .get(1); >- hasMetric = MetaDataUtils.hasMetricsCapability(connectionPoolProperty); >- assertEquals(connectionPool_metadata.hasMetric, hasMetric); >- } >- >- /** >- * testGetMetric >- * >- * @throws Exception >- */ >- public void testGetMetric() throws Exception >- { >- List propertyTypes = metaDescriptor.getProperty(); >- assertNotNull(propertyTypes); >- assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >- >- PropertyType connectionPoolProperty = (PropertyType) propertyTypes >- .get(1); >- Property property = CapabilitiesFactory.eINSTANCE.createProperty(); >- property.setMetaData(connectionPoolProperty); >- FormMetric metric = MetaDataUtils.getMetric(null, property); >- assertNotNull(metric); >- assertEquals(connectionPool_metadata.metric.changeType, metric >- .getCType()); >- assertEquals(connectionPool_metadata.metric.timeScope, metric >- .getTScope()); >- assertEquals(connectionPool_metadata.metric.gatheringTime, metric >- .getGTime()); >- assertEquals(connectionPool_metadata.metric.calculationInterval, metric >- .getCInterval()); >- } >+ /** >+ * Constructor for MetaDataUtilsTest. >+ * >+ * @param name >+ */ >+ public MetaDataUtilsTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the <b>MetaDataUtilsTest</b> >+ * definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite metaDataUtilsTest = new HyadesTestSuite( >+ "MetaDataUtilsTest"); >+ metaDataUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "EA3D854DD553CFED9107305017F711DB"); >+ >+ metaDataUtilsTest >+ .addTest(new MetaDataUtilsTest("testGetModifiability")); >+ metaDataUtilsTest.addTest(new MetaDataUtilsTest("testGetMutability")); >+ metaDataUtilsTest.addTest(new MetaDataUtilsTest("testGetValidValues")); >+ metaDataUtilsTest.addTest(new MetaDataUtilsTest("testGetStaticValues")); >+ >+ return metaDataUtilsTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testGetModifiability >+ * >+ * @throws Exception >+ */ >+ public void testGetModifiability() throws Exception >+ { >+ List propertyTypes = metaDescriptor.getProperty(); >+ assertNotNull(propertyTypes); >+ assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >+ >+ PropertyType homeProperty = (PropertyType) propertyTypes.get(0); >+ String modifiability = MetaDataUtils.getModifiability(homeProperty); >+ assertNotNull(modifiability); >+ assertEquals(home_metadata.modifiability, modifiability); >+ >+ PropertyType connectionPoolProperty = (PropertyType) propertyTypes >+ .get(1); >+ modifiability = MetaDataUtils.getModifiability(connectionPoolProperty); >+ assertNotNull(modifiability); >+ assertEquals(connectionPool_metadata.modifiability, modifiability); >+ } >+ >+ /** >+ * testGetMutability >+ * >+ * @throws Exception >+ */ >+ public void testGetMutability() throws Exception >+ { >+ List propertyTypes = metaDescriptor.getProperty(); >+ assertNotNull(propertyTypes); >+ assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >+ >+ PropertyType homeProperty = (PropertyType) propertyTypes.get(0); >+ String mutability = MetaDataUtils.getMutability(homeProperty); >+ assertNotNull(mutability); >+ assertEquals(home_metadata.mutability, mutability); >+ >+ PropertyType connectionPoolProperty = (PropertyType) propertyTypes >+ .get(1); >+ mutability = MetaDataUtils.getMutability(connectionPoolProperty); >+ assertNotNull(mutability); >+ assertEquals(connectionPool_metadata.mutability, mutability); >+ } >+ >+ /** >+ * testGetValidValues >+ * >+ * @throws Exception >+ */ >+ public void testGetValidValues() throws Exception >+ { >+ List propertyTypes = metaDescriptor.getProperty(); >+ assertNotNull(propertyTypes); >+ assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >+ >+ PropertyType homeProperty = (PropertyType) propertyTypes.get(0); >+ Object[] validValues = MetaDataUtils.getValidValues(homeProperty >+ .getValidValues()); >+ assertNotNull(validValues); >+ for (int i = 0; i < home_metadata.validValues.length; i++) >+ { >+ Object expected = home_metadata.validValues[i]; >+ assertEquals(expected, validValues[i]); >+ } >+ >+ PropertyType connectionPoolProperty = (PropertyType) propertyTypes >+ .get(1); >+ validValues = MetaDataUtils.getValidValues(connectionPoolProperty >+ .getValidValues()); >+ assertNotNull(validValues); >+ for (int i = 0; i < connectionPool_metadata.validValues.length; i++) >+ { >+ Object expected = connectionPool_metadata.validValues[i]; >+ assertEquals(expected, validValues[i]); >+ } >+ } >+ >+ /** >+ * testGetStaticValues >+ * >+ * @throws Exception >+ */ >+ public void testGetStaticValues() throws Exception >+ { >+ List propertyTypes = metaDescriptor.getProperty(); >+ assertNotNull(propertyTypes); >+ assertEquals(NO_OF_PROPERTIES, propertyTypes.size()); >+ >+ PropertyType homeProperty = (PropertyType) propertyTypes.get(0); >+ Object[] staticValues = MetaDataUtils.getStaticValues(homeProperty >+ .getStaticValues()); >+ assertNotNull(staticValues); >+ for (int i = 0; i < home_metadata.staticValues.length; i++) >+ { >+ Object expected = home_metadata.staticValues[i]; >+ assertEquals(expected, staticValues[i]); >+ } >+ >+ PropertyType connectionPoolProperty = (PropertyType) propertyTypes >+ .get(1); >+ staticValues = MetaDataUtils.getStaticValues(connectionPoolProperty >+ .getStaticValues()); >+ assertNotNull(staticValues); >+ for (int i = 0; i < connectionPool_metadata.staticValues.length; i++) >+ { >+ Object expected = connectionPool_metadata.staticValues[i]; >+ assertEquals(expected, staticValues[i]); >+ } >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/TestUtils.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/TestUtils.java,v >retrieving revision 1.3 >diff -u -r1.3 TestUtils.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/TestUtils.java 2 Jan 2007 13:33:05 -0000 1.3 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/TestUtils.java 22 Jan 2007 09:34:35 -0000 >@@ -24,13 +24,13 @@ > import org.eclipse.tptp.wsdm.tooling.editor.capability.pages.operation.internal.InputParameter; > import org.eclipse.tptp.wsdm.tooling.editor.capability.pages.property.internal.DataType; > import org.eclipse.tptp.wsdm.tooling.editor.capability.pages.property.internal.DataTypesCollection; >+import org.eclipse.tptp.wsdm.tooling.model.capabilities.CapabilitiesFactory; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Capability; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Property; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Topic; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.TopicSpace; > import org.eclipse.tptp.wsdm.tooling.model.metadataDescriptor.PropertyType; > import org.eclipse.tptp.wsdm.tooling.util.internal.EclipseUtils; >-import org.eclipse.tptp.wsdm.tooling.util.internal.TopicUtils; > import org.eclipse.tptp.wsdm.tooling.util.internal.XsdUtils; > import org.eclipse.wst.wsdl.Definition; > import org.eclipse.wst.wsdl.Fault; >@@ -46,114 +46,129 @@ > public class TestUtils > { > >- public static XSDElementDeclaration createNewProperty() >- { >- DataTypesCollection instance = DataTypesCollection.getInstance(); >- DataType stringType = instance.getDataType("string"); >- XSDElementDeclaration newProperty = XSDFactory.eINSTANCE >- .createXSDElementDeclaration(); >- newProperty.setName("dummy"); >- newProperty.setTypeDefinition(stringType.getTypeDefinition()); >- return newProperty; >- } >- >- public static DataType getDataType(String typeName) >- { >- DataTypesCollection instance = DataTypesCollection.getInstance(); >- DataType dataType = instance.getDataType(typeName); >- return dataType; >- } >- >- public static List getComplexTypes(String xsdFilePath) >- { >- IFile xsdFile = null; >- try >- { >- xsdFile = EclipseUtils.getIFile(xsdFilePath); >- } catch (CoreException e) >- { >- throw new AssertionFailedError( >- "Not able to find the file in workspace -- " + xsdFilePath); >- } >- XSDSchema schema = XsdUtils.getSchema(xsdFile); >- if (schema == null) >- throw new AssertionFailedError( >- "Not able to get XSDSchema object from file -- " >- + xsdFilePath); >- return schema.getTypeDefinitions(); >- } >- >- public static XSDElementDeclaration[] getXSDElementDeclarations( >- XSDSchema schema) >- { >- return (XSDElementDeclaration[]) schema.getElementDeclarations() >- .toArray(new XSDElementDeclaration[0]); >- } >- >- public static Operation createNewOperation(Definition definition) >- { >- NewTestOperation testOperation = new NewTestOperation(definition); >- return testOperation.getOperation(); >- } >- >- public static Fault createNewException(Definition definition, >- Operation operation) >- { >- NewTestException testException = new NewTestException(definition, >- operation); >- return testException.getFault(); >- } >- >- public static InputParameter createNewParameter(String paramName, >- DataType dataType) >- { >- NewTestParameter testParameter = new NewTestParameter(paramName, >- dataType); >- return testParameter.getParameter(); >- } >- >- public static PropertyType getPropertyType(Capability capability, QName name) >- { >- List properties = capability.getProperties(); >- for (int i = 0; i < properties.size(); i++) >- { >- Property property = (Property) properties.get(i); >- PropertyType metadata = property.getMetaData(); >- if (metadata.getName().equals(name)) >- return metadata; >- } >- return null; >- } >- >- public static PropertyType getPropertyType(Capability capability, >- String name) >- { >- List properties = capability.getProperties(); >- for (int i = 0; i < properties.size(); i++) >- { >- Property property = (Property) properties.get(i); >- PropertyType metadata = property.getMetaData(); >- QName qname = (QName) metadata.getName(); >- if (qname.getLocalPart().equals(name)) >- return metadata; >- } >- return null; >- } >- >- public static Topic createNewTopic(String topicName) >- { >- Topic topic = TopicUtils.createNewTopic(); >- topic.setName(topicName); >- return topic; >- } >- >- public static TopicSpace createNewTopicSpace(String topicSpaceName, >- String topicSpaceNamespace) >- { >- TopicSpace topicSpace = TopicUtils.createNewTopicSpace(); >- topicSpace.setName(topicSpaceName); >- topicSpace.setNamespace(topicSpaceNamespace); >- return topicSpace; >- } >+ public static XSDElementDeclaration createNewProperty() >+ { >+ DataTypesCollection instance = DataTypesCollection.getInstance(); >+ DataType stringType = instance.getDataType("string"); >+ XSDElementDeclaration newProperty = XSDFactory.eINSTANCE >+ .createXSDElementDeclaration(); >+ newProperty.setName("dummy"); >+ newProperty.setTypeDefinition(stringType.getTypeDefinition()); >+ return newProperty; >+ } >+ >+ public static DataType getDataType(String typeName) >+ { >+ DataTypesCollection instance = DataTypesCollection.getInstance(); >+ DataType dataType = instance.getDataType(typeName); >+ return dataType; >+ } >+ >+ public static List getComplexTypes(String xsdFilePath) >+ { >+ IFile xsdFile = null; >+ try >+ { >+ xsdFile = EclipseUtils.getIFile(xsdFilePath); >+ } catch (CoreException e) >+ { >+ throw new AssertionFailedError( >+ "Not able to find the file in workspace -- " + xsdFilePath); >+ } >+ XSDSchema schema = XsdUtils.getSchema(xsdFile); >+ if (schema == null) >+ throw new AssertionFailedError( >+ "Not able to get XSDSchema object from file -- " >+ + xsdFilePath); >+ return schema.getTypeDefinitions(); >+ } >+ >+ public static XSDElementDeclaration[] getXSDElementDeclarations( >+ XSDSchema schema) >+ { >+ return (XSDElementDeclaration[]) schema.getElementDeclarations() >+ .toArray(new XSDElementDeclaration[0]); >+ } >+ >+ public static Operation createNewOperation(Definition definition) >+ { >+ NewTestOperation testOperation = new NewTestOperation(definition); >+ return testOperation.getOperation(); >+ } >+ >+ public static Fault createNewException(Definition definition, >+ Operation operation) >+ { >+ NewTestException testException = new NewTestException(definition, >+ operation); >+ return testException.getFault(); >+ } >+ >+ public static InputParameter createNewParameter(String paramName, >+ DataType dataType) >+ { >+ NewTestParameter testParameter = new NewTestParameter(paramName, >+ dataType); >+ return testParameter.getParameter(); >+ } >+ >+ public static PropertyType getPropertyType(Capability capability, QName name) >+ { >+ List properties = capability.getProperties(); >+ for (int i = 0; i < properties.size(); i++) >+ { >+ Property property = (Property) properties.get(i); >+ PropertyType metadata = property.getMetaData(); >+ if (metadata.getName().equals(name)) >+ return metadata; >+ } >+ return null; >+ } >+ >+ public static PropertyType getPropertyType(Capability capability, >+ String propQName) >+ { >+ List properties = capability.getProperties(); >+ for (int i = 0; i < properties.size(); i++) >+ { >+ Property property = (Property) properties.get(i); >+ PropertyType metadata = property.getMetaData(); >+ String propName = metadata.getName(); >+ if (propName.equals(propQName)) >+ return metadata; >+ } >+ return null; >+ } >+ >+ public static Topic createNewTopic(String topicName) >+ { >+ Topic topic = CapabilitiesFactory.eINSTANCE.createTopic(); >+ topic.setName(topicName); >+ return topic; >+ } >+ >+ public static TopicSpace createNewTopicSpace(String topicSpaceName, >+ String topicSpaceNamespace) >+ { >+ TopicSpace topicSpace = CapabilitiesFactory.eINSTANCE >+ .createTopicSpace(); >+ topicSpace.setName(topicSpaceName); >+ topicSpace.setNamespace(topicSpaceNamespace); >+ return topicSpace; >+ } >+ >+ public static String extractPrefix(String str) >+ { >+ if (str == null || str.trim().equals("") || str.indexOf(':') == -1) >+ return null; >+ return str.substring(0, str.indexOf(':')); >+ } >+ >+ public static String extractName(String str) >+ { >+ if (str == null || str.trim().equals("") || str.indexOf(':') == -1) >+ return null; >+ return str.substring(str.indexOf(':') + 1); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/PropertyMetaDataDescriptorTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/PropertyMetaDataDescriptorTest.java,v >retrieving revision 1.1 >diff -u -r1.1 PropertyMetaDataDescriptorTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/PropertyMetaDataDescriptorTest.java 15 Sep 2006 15:20:23 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/PropertyMetaDataDescriptorTest.java 22 Jan 2007 09:34:35 -0000 >@@ -28,227 +28,226 @@ > */ > public class PropertyMetaDataDescriptorTest extends UtilsCapabilityTestModel > { >- /** >- * Constructor for PropertyMetaDataDescriptorTest. >- * >- * @param name >- */ >- public PropertyMetaDataDescriptorTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>PropertyMetaDataDescriptorTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite propertyMetaDataDescriptorTest = new HyadesTestSuite( >- "PropertyMetaDataDescriptorTest"); >- propertyMetaDataDescriptorTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C254CB80544979D7FA9C155042F711DB"); >- >- propertyMetaDataDescriptorTest >- .addTest(new PropertyMetaDataDescriptorTest( >- "testCreateNewPropertyType")); >- propertyMetaDataDescriptorTest >- .addTest(new PropertyMetaDataDescriptorTest( >- "testCreateTopicExpressionProperty")); >- propertyMetaDataDescriptorTest >- .addTest(new PropertyMetaDataDescriptorTest( >- "testGetOrCreatePrefix")); >- propertyMetaDataDescriptorTest >- .addTest(new PropertyMetaDataDescriptorTest("testGetPrefix")); >- propertyMetaDataDescriptorTest >- .addTest(new PropertyMetaDataDescriptorTest( >- "testGetPropertyMetadata")); >- propertyMetaDataDescriptorTest >- .addTest(new PropertyMetaDataDescriptorTest( >- "testGetPropertyTypes")); >- propertyMetaDataDescriptorTest >- .addTest(new PropertyMetaDataDescriptorTest( >- "testGetTopicExpressionProperty")); >- propertyMetaDataDescriptorTest >- .addTest(new PropertyMetaDataDescriptorTest( >- "testGetTopicspaces")); >- propertyMetaDataDescriptorTest >- .addTest(new PropertyMetaDataDescriptorTest( >- "testSaveTopicspaces")); >- >- return propertyMetaDataDescriptorTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testCreateNewPropertyType >- * >- * @throws Exception >- */ >- public void testCreateNewPropertyType() throws Exception >- { >- int oldPropSize = metaDataDescriptor.getMetadataDescriptorType() >- .getProperty().size(); >- >- // Create new property type >- PropertyType propertyType = metaDataDescriptor.createNewPropertyType(); >- >- // Verify new property type >- assertNotNull(propertyType); >- int newPropSize = metaDataDescriptor.getMetadataDescriptorType() >- .getProperty().size(); >- assertEquals(oldPropSize + 1, newPropSize); >- } >- >- /** >- * testCreateTopicExpressionProperty >- * >- * @throws Exception >- */ >- public void testCreateTopicExpressionProperty() throws Exception >- { >- int oldPropSize = metaDataDescriptor.getMetadataDescriptorType() >- .getProperty().size(); >- >- // Create topicExpressionProperty >- PropertyType topicExpressionProperty = metaDataDescriptor >- .createTopicExpressionProperty(); >- >- // Verify topicExpressionProperty >- assertNotNull(topicExpressionProperty); >- assertEquals(ModifiabilityType.READ_ONLY_LITERAL, >- topicExpressionProperty.getModifiability()); >- assertEquals(MutabilityType.MUTABLE_LITERAL, topicExpressionProperty >- .getMutability()); >- int newPropSize = metaDataDescriptor.getMetadataDescriptorType() >- .getProperty().size(); >- assertEquals(oldPropSize + 1, newPropSize); >- } >- >- /** >- * testGetOrCreatePrefix >- * >- * @throws Exception >- */ >- public void testGetOrCreatePrefix() throws Exception >- { >- // Create a non-existing namespace >- String namespace = "http://www.test.org"; >- assertNull(metaDataDescriptor.getPrefix(namespace)); >- >- String newPrefix = metaDataDescriptor.getOrCreatePrefix(namespace); >- >- // Verify that it has created new prefix >- String prefix = metaDataDescriptor.getPrefix(namespace); >- assertEquals(newPrefix, prefix); >- } >- >- /** >- * testGetPrefix >- * >- * @throws Exception >- */ >- public void testGetPrefix() throws Exception >- { >- String namespace = WsdmConstants.MUWS_P1_NS; >- String prefix = metaDataDescriptor.getPrefix(namespace); >- assertEquals("muws-p1", prefix); >- } >- >- /** >- * testGetPropertyMetadata >- * >- * @throws Exception >- */ >- public void testGetPropertyMetadata() throws Exception >- { >- String name = PROPERTY_NAMES[0]; >- PropertyType metadata = metaDataDescriptor.getPropertyMetadata(name, >- capability.getNamespace()); >- >- // Verify it >- assertNotNull(metadata); >- >- // TODO Verify the modifiability and mutability >- } >- >- /** >- * testGetPropertyTypes >- * >- * @throws Exception >- */ >- public void testGetPropertyTypes() throws Exception >- { >- PropertyType[] propertyTypes = metaDataDescriptor.getPropertyTypes(); >- >- // Verify it >- assertNotNull(propertyTypes); >- >- // TODO Chek the size for it >- } >- >- /** >- * testGetTopicExpressionProperty >- * >- * @throws Exception >- */ >- public void testGetTopicExpressionProperty() throws Exception >- { >- // TODO Get the DocumentRoot, Capability >- /* >- * DocumentRoot root_1 = null; Capability capability_1 = null; >- * >- * PropertyMetaDataDescriptor metadataDescriptor_1 = new >- * PropertyMetaDataDescriptor(root_1, capability_1); >- * // For one file it should be null PropertyType topicExpression_1 = >- * metadataDescriptor_1.getTopicExpressionProperty(); >- * assertNull(topicExpression_1); >- * // TODO Get the DocumentRoot, Capability DocumentRoot root_2 = null; >- * Capability capability_2 = null; >- * >- * PropertyMetaDataDescriptor metadataDescriptor_2 = new >- * PropertyMetaDataDescriptor(root_2, capability_2); >- * // For another file it should not be null PropertyType >- * topicExpression_2 = >- * metadataDescriptor_2.getTopicExpressionProperty(); >- * assertNotNull(topicExpression_2); >- */ >- } >- >- /** >- * testGetTopicspaces >- * >- * @throws Exception >- */ >- public void testGetTopicspaces() throws Exception >- { >- // We are already doing the same test in >- // MetaDataDescriptor2TopicSpaceTest >- } >- >- /** >- * testSaveTopicspaces >- * >- * @throws Exception >- */ >- public void testSaveTopicspaces() throws Exception >- { >- // We are already doing the same test in >- // TopicSpace2MetaDataDescriptorTest >- } >+ /** >+ * Constructor for PropertyMetaDataDescriptorTest. >+ * >+ * @param name >+ */ >+ public PropertyMetaDataDescriptorTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>PropertyMetaDataDescriptorTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite propertyMetaDataDescriptorTest = new HyadesTestSuite( >+ "PropertyMetaDataDescriptorTest"); >+ propertyMetaDataDescriptorTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C254CB80544979D7FA9C155042F711DB"); >+ >+ propertyMetaDataDescriptorTest >+ .addTest(new PropertyMetaDataDescriptorTest( >+ "testCreateNewPropertyType")); >+ propertyMetaDataDescriptorTest >+ .addTest(new PropertyMetaDataDescriptorTest( >+ "testCreateTopicExpressionProperty")); >+ propertyMetaDataDescriptorTest >+ .addTest(new PropertyMetaDataDescriptorTest( >+ "testGetOrCreatePrefix")); >+ propertyMetaDataDescriptorTest >+ .addTest(new PropertyMetaDataDescriptorTest("testGetPrefix")); >+ propertyMetaDataDescriptorTest >+ .addTest(new PropertyMetaDataDescriptorTest( >+ "testGetPropertyMetadata")); >+ propertyMetaDataDescriptorTest >+ .addTest(new PropertyMetaDataDescriptorTest( >+ "testGetPropertyTypes")); >+ propertyMetaDataDescriptorTest >+ .addTest(new PropertyMetaDataDescriptorTest( >+ "testGetTopicExpressionProperty")); >+ propertyMetaDataDescriptorTest >+ .addTest(new PropertyMetaDataDescriptorTest( >+ "testGetTopicspaces")); >+ propertyMetaDataDescriptorTest >+ .addTest(new PropertyMetaDataDescriptorTest( >+ "testSaveTopicspaces")); >+ >+ return propertyMetaDataDescriptorTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testCreateNewPropertyType >+ * >+ * @throws Exception >+ */ >+ public void testCreateNewPropertyType() throws Exception >+ { >+ int oldPropSize = metaDataDescriptor.getMetadataDescriptorType() >+ .getProperty().size(); >+ >+ // Create new property type >+ PropertyType propertyType = metaDataDescriptor.createNewPropertyType(); >+ >+ // Verify new property type >+ assertNotNull(propertyType); >+ int newPropSize = metaDataDescriptor.getMetadataDescriptorType() >+ .getProperty().size(); >+ assertEquals(oldPropSize + 1, newPropSize); >+ } >+ >+ /** >+ * testCreateTopicExpressionProperty >+ * >+ * @throws Exception >+ */ >+ public void testCreateTopicExpressionProperty() throws Exception >+ { >+ int oldPropSize = metaDataDescriptor.getMetadataDescriptorType() >+ .getProperty().size(); >+ >+ // Create topicExpressionProperty >+ PropertyType topicExpressionProperty = metaDataDescriptor >+ .createTopicExpressionProperty(); >+ >+ // Verify topicExpressionProperty >+ assertNotNull(topicExpressionProperty); >+ assertEquals(ModifiabilityType.READ_ONLY_LITERAL, >+ topicExpressionProperty.getModifiability()); >+ assertEquals(MutabilityType.MUTABLE_LITERAL, topicExpressionProperty >+ .getMutability()); >+ int newPropSize = metaDataDescriptor.getMetadataDescriptorType() >+ .getProperty().size(); >+ assertEquals(oldPropSize + 1, newPropSize); >+ } >+ >+ /** >+ * testGetOrCreatePrefix >+ * >+ * @throws Exception >+ */ >+ public void testGetOrCreatePrefix() throws Exception >+ { >+ // Create a non-existing namespace >+ String namespace = "http://www.test.org"; >+ assertNull(metaDataDescriptor.getPrefix(namespace)); >+ >+ String newPrefix = metaDataDescriptor.getOrCreatePrefix(namespace); >+ >+ // Verify that it has created new prefix >+ String prefix = metaDataDescriptor.getPrefix(namespace); >+ assertEquals(newPrefix, prefix); >+ } >+ >+ /** >+ * testGetPrefix >+ * >+ * @throws Exception >+ */ >+ public void testGetPrefix() throws Exception >+ { >+ String namespace = WsdmConstants.MUWS_P1_NS; >+ String prefix = metaDataDescriptor.getPrefix(namespace); >+ assertEquals("muws-p1", prefix); >+ } >+ >+ /** >+ * testGetPropertyMetadata >+ * >+ * @throws Exception >+ */ >+ public void testGetPropertyMetadata() throws Exception >+ { >+ String name = PROPERTY_NAMES[0]; >+ PropertyType metadata = metaDataDescriptor.getPropertyMetadata(name, >+ capability.getNamespace()); >+ >+ // Verify it >+ assertNotNull(metadata); >+ >+ // TODO Verify the modifiability and mutability >+ } >+ >+ /** >+ * testGetPropertyTypes >+ * >+ * @throws Exception >+ */ >+ public void testGetPropertyTypes() throws Exception >+ { >+ PropertyType[] propertyTypes = metaDataDescriptor.getPropertyTypes(); >+ >+ // Verify it >+ assertNotNull(propertyTypes); >+ >+ // TODO Chek the size for it >+ } >+ >+ /** >+ * testGetTopicExpressionProperty >+ * >+ * @throws Exception >+ */ >+ public void testGetTopicExpressionProperty() throws Exception >+ { >+ // TODO Get the DocumentRoot, Capability >+ /* >+ * DocumentRoot root_1 = null; Capability capability_1 = null; >+ * >+ * PropertyMetaDataDescriptor metadataDescriptor_1 = new >+ * PropertyMetaDataDescriptor(root_1, capability_1); // For one file it >+ * should be null PropertyType topicExpression_1 = >+ * metadataDescriptor_1.getTopicExpressionProperty(); >+ * assertNull(topicExpression_1); // TODO Get the DocumentRoot, >+ * Capability DocumentRoot root_2 = null; Capability capability_2 = >+ * null; >+ * >+ * PropertyMetaDataDescriptor metadataDescriptor_2 = new >+ * PropertyMetaDataDescriptor(root_2, capability_2); // For another file >+ * it should not be null PropertyType topicExpression_2 = >+ * metadataDescriptor_2.getTopicExpressionProperty(); >+ * assertNotNull(topicExpression_2); >+ */ >+ } >+ >+ /** >+ * testGetTopicspaces >+ * >+ * @throws Exception >+ */ >+ public void testGetTopicspaces() throws Exception >+ { >+ // We are already doing the same test in >+ // MetaDataDescriptor2TopicSpaceTest >+ } >+ >+ /** >+ * testSaveTopicspaces >+ * >+ * @throws Exception >+ */ >+ public void testSaveTopicspaces() throws Exception >+ { >+ // We are already doing the same test in >+ // TopicSpace2MetaDataDescriptorTest >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/CapUtilsTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/CapUtilsTest.java,v >retrieving revision 1.3 >diff -u -r1.3 CapUtilsTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/CapUtilsTest.java 2 Jan 2007 13:33:05 -0000 1.3 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/CapUtilsTest.java 22 Jan 2007 09:34:34 -0000 >@@ -31,234 +31,236 @@ > */ > public class CapUtilsTest extends UtilsCapabilityTestModel > { >- /** >- * Constructor for CapUtilsTest. >- * >- * @param name >- */ >- public CapUtilsTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the <b>CapUtilsTest</b> >- * definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite capUtilsTest = new HyadesTestSuite("CapUtilsTest"); >- capUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "EA3D854DD553CFED15CFD1E017F111DB"); >- >- capUtilsTest.addTest(new CapUtilsTest("testGetMinOccurs")); >- capUtilsTest.addTest(new CapUtilsTest("testGetMaxOccurs")); >- capUtilsTest.addTest(new CapUtilsTest("testGetInstancesOfProperty")); >- capUtilsTest.addTest(new CapUtilsTest("testGetInstancesOfOperation")); >- capUtilsTest.addTest(new CapUtilsTest("testGetInstancesOfParameter")); >- capUtilsTest.addTest(new CapUtilsTest("testValidateJavaIdentifier")); >- capUtilsTest.addTest(new CapUtilsTest("testGetName")); >- capUtilsTest.addTest(new CapUtilsTest("testIsOperationNameConflicted")); >- >- return capUtilsTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testGetMinOccurs >- * >- * @throws Exception >- */ >- public void testGetMinOccurs() throws Exception >- { >- List properties = capabilityDomain.getCapability().getProperties(); >- assertNotNull(properties); >- assertEquals(PROPERTY_NAMES.length, properties.size()); >- for (int i = 0; i < properties.size(); i++) >- { >- Object object = properties.get(i); >- assertNotNull(object); >- assertTrue(object instanceof Property); >- Property property = (Property) object; >- XSDElementDeclaration element = property.getElement(); >- assertNotNull(element); >- int minoccurs = CapUtils.getMinOccurs(resourcePropertyElement, >- element); >- assertEquals(MIN_OCCURS[i], minoccurs); >- } >- } >- >- /** >- * testGetMaxOccurs >- * >- * @throws Exception >- */ >- public void testGetMaxOccurs() throws Exception >- { >- List properties = capabilityDomain.getCapability().getProperties(); >- assertNotNull(properties); >- assertEquals(PROPERTY_NAMES.length, properties.size()); >- for (int i = 0; i < properties.size(); i++) >- { >- Object object = properties.get(i); >- assertNotNull(object); >- assertTrue(object instanceof Property); >- Property property = (Property) object; >- XSDElementDeclaration element = property.getElement(); >- assertNotNull(element); >- int maxoccurs = CapUtils.getMaxOccurs(resourcePropertyElement, >- element); >- assertEquals(MAX_OCCURS[i], maxoccurs); >- } >- } >- >- /** >- * testGetInstancesOfProperty >- * >- * @throws Exception >- */ >- public void testGetInstancesOfProperty() throws Exception >- { >- List properties = capabilityDomain.getCapability().getProperties(); >- assertNotNull(properties); >- assertEquals(PROPERTY_NAMES.length, properties.size()); >- for (int i = 0; i < properties.size(); i++) >- { >- Object object = properties.get(i); >- assertNotNull(object); >- assertTrue(object instanceof Property); >- Property property = (Property) object; >- XSDElementDeclaration element = property.getElement(); >- String propName = XsdUtils.getName(element); >- Capability model = capabilityDomain.getCapability(); >- int instances = CapUtils.getInstancesOfProperty(model, propName); >- assertEquals(1, instances); >- } >- >- String unknownProperty = "UNKNOWN"; >- Capability model = capabilityDomain.getCapability(); >- int instances = CapUtils.getInstancesOfProperty(model, unknownProperty); >- assertEquals(0, instances); >- } >- >- /** >- * testGetInstancesOfOperation >- * >- * @throws Exception >- */ >- public void testGetInstancesOfOperation() throws Exception >- { >- List operations = capabilityDomain.getCapability().getOperations(); >- assertNotNull(operations); >- assertEquals(OPERATION_NAMES.length, operations.size()); >- for (int i = 0; i < operations.size(); i++) >- { >- Object object = operations.get(i); >- assertNotNull(object); >- assertTrue(object instanceof Operation); >- Operation operation = (Operation) object; >- String opName = WsdlUtils.getOperationName(operation); >- Capability model = capabilityDomain.getCapability(); >- int instances = CapUtils.getInstancesOfOperation(model, opName); >- assertEquals(1, instances); >- } >- >- String unknownOperation = "UNKNOWN"; >- Capability model = capabilityDomain.getCapability(); >- int instances = CapUtils.getInstancesOfOperation(model, >- unknownOperation); >- assertEquals(0, instances); >- } >- >- /** >- * testGetInstancesOfParameter >- * >- * @throws Exception >- */ >- public void testGetInstancesOfParameter() throws Exception >- { >- List operations = capabilityDomain.getCapability().getOperations(); >- assertNotNull(operations); >- assertEquals(OPERATION_NAMES.length, operations.size()); >- >- Operation startServer = (Operation) operations.get(0); >- int instances = CapUtils.getInstancesOfParameter(startServer, >- "ServerName"); >- assertEquals(0, instances); >- >- Operation startApplication = (Operation) operations.get(2); >- instances = CapUtils.getInstancesOfParameter(startApplication, >- "appName"); >- assertEquals(1, instances); >- } >- >- /** >- * testValidateJavaIdentifier >- * >- * @throws Exception >- */ >- public void testValidateJavaIdentifier() throws Exception >- { >- String name = ""; >- String validate = CapUtils.validateJavaIdentifier(name); >- assertTrue(validate.indexOf("Empty name") != -1); >- >- name = "2home"; >- validate = CapUtils.validateJavaIdentifier(name); >- assertTrue(validate.indexOf("Invalid name:") != -1); >- >- name = "if"; >- validate = CapUtils.validateJavaIdentifier(name); >- assertTrue(validate.indexOf("Java keyword") != -1); >- >- name = "home"; >- validate = CapUtils.validateJavaIdentifier(name); >- assertNull(validate); >- } >- >- /** >- * testGetName >- * >- * @throws Exception >- */ >- public void testGetName() throws Exception >- { >- List properties = capabilityDomain.getCapability().getProperties(); >- assertNotNull(properties); >- assertEquals(PROPERTY_NAMES.length, properties.size()); >- for (int i = 0; i < properties.size(); i++) >- { >- Object object = properties.get(i); >- assertNotNull(object); >- assertTrue(object instanceof Property); >- Property property = (Property) object; >- String propName = CapUtils.getName(property); >- assertEquals(PROPERTY_NAMES[i], propName); >+ /** >+ * Constructor for CapUtilsTest. >+ * >+ * @param name >+ */ >+ public CapUtilsTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the <b>CapUtilsTest</b> >+ * definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite capUtilsTest = new HyadesTestSuite("CapUtilsTest"); >+ capUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "EA3D854DD553CFED15CFD1E017F111DB"); >+ >+ capUtilsTest.addTest(new CapUtilsTest("testGetMinOccurs")); >+ capUtilsTest.addTest(new CapUtilsTest("testGetMaxOccurs")); >+ capUtilsTest.addTest(new CapUtilsTest("testGetInstancesOfProperty")); >+ capUtilsTest.addTest(new CapUtilsTest("testGetInstancesOfOperation")); >+ capUtilsTest.addTest(new CapUtilsTest("testGetInstancesOfParameter")); >+ capUtilsTest.addTest(new CapUtilsTest("testValidateJavaIdentifier")); >+ capUtilsTest.addTest(new CapUtilsTest("testGetName")); >+ capUtilsTest.addTest(new CapUtilsTest("testIsOperationNameConflicted")); >+ >+ return capUtilsTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testGetMinOccurs >+ * >+ * @throws Exception >+ */ >+ public void testGetMinOccurs() throws Exception >+ { >+ List properties = capabilityDomain.getCapability().getProperties(); >+ assertNotNull(properties); >+ assertEquals(PROPERTY_NAMES.length, properties.size()); >+ for (int i = 0; i < properties.size(); i++) >+ { >+ Object object = properties.get(i); >+ assertNotNull(object); >+ assertTrue(object instanceof Property); >+ Property property = (Property) object; >+ XSDElementDeclaration element = property.getElement(); >+ assertNotNull(element); >+ int minoccurs = CapUtils.getMinOccurs(resourcePropertyElement, >+ element); >+ assertEquals(MIN_OCCURS[i], minoccurs); >+ } >+ } >+ >+ /** >+ * testGetMaxOccurs >+ * >+ * @throws Exception >+ */ >+ public void testGetMaxOccurs() throws Exception >+ { >+ List properties = capabilityDomain.getCapability().getProperties(); >+ assertNotNull(properties); >+ assertEquals(PROPERTY_NAMES.length, properties.size()); >+ for (int i = 0; i < properties.size(); i++) >+ { >+ Object object = properties.get(i); >+ assertNotNull(object); >+ assertTrue(object instanceof Property); >+ Property property = (Property) object; >+ XSDElementDeclaration element = property.getElement(); >+ assertNotNull(element); >+ int maxoccurs = CapUtils.getMaxOccurs(resourcePropertyElement, >+ element); >+ assertEquals(MAX_OCCURS[i], maxoccurs); >+ } >+ } >+ >+ /** >+ * testGetInstancesOfProperty >+ * >+ * @throws Exception >+ */ >+ public void testGetInstancesOfProperty() throws Exception >+ { >+ List properties = capabilityDomain.getCapability().getProperties(); >+ assertNotNull(properties); >+ assertEquals(PROPERTY_NAMES.length, properties.size()); >+ for (int i = 0; i < properties.size(); i++) >+ { >+ Object object = properties.get(i); >+ assertNotNull(object); >+ assertTrue(object instanceof Property); >+ Property property = (Property) object; >+ XSDElementDeclaration element = property.getElement(); >+ String propName = XsdUtils.getName(element); >+ Capability model = capabilityDomain.getCapability(); >+ int instances = CapUtils.getInstancesOfProperty(model, propName); >+ assertEquals(1, instances); >+ } >+ >+ String unknownProperty = "UNKNOWN"; >+ Capability model = capabilityDomain.getCapability(); >+ int instances = CapUtils.getInstancesOfProperty(model, unknownProperty); >+ assertEquals(0, instances); >+ } >+ >+ /** >+ * testGetInstancesOfOperation >+ * >+ * @throws Exception >+ */ >+ public void testGetInstancesOfOperation() throws Exception >+ { >+ List operations = capabilityDomain.getCapability().getOperations(); >+ assertNotNull(operations); >+ assertEquals(OPERATION_NAMES.length, operations.size()); >+ for (int i = 0; i < operations.size(); i++) >+ { >+ Object object = operations.get(i); >+ assertNotNull(object); >+ assertTrue(object instanceof Operation); >+ Operation operation = (Operation) object; >+ String opName = WsdlUtils.getOperationName(operation); >+ Capability model = capabilityDomain.getCapability(); >+ int instances = CapUtils.getInstancesOfOperation(model, opName); >+ assertEquals(1, instances); >+ } >+ >+ String unknownOperation = "UNKNOWN"; >+ Capability model = capabilityDomain.getCapability(); >+ int instances = CapUtils.getInstancesOfOperation(model, >+ unknownOperation); >+ assertEquals(0, instances); >+ } >+ >+ /** >+ * testGetInstancesOfParameter >+ * >+ * @throws Exception >+ */ >+ public void testGetInstancesOfParameter() throws Exception >+ { >+ List operations = capabilityDomain.getCapability().getOperations(); >+ assertNotNull(operations); >+ assertEquals(OPERATION_NAMES.length, operations.size()); >+ >+ Operation startServer = (Operation) operations.get(0); >+ int instances = CapUtils.getInstancesOfParameter(startServer, >+ "ServerName"); >+ assertEquals(0, instances); >+ >+ Operation startApplication = (Operation) operations.get(2); >+ instances = CapUtils.getInstancesOfParameter(startApplication, >+ "appName"); >+ assertEquals(1, instances); >+ } >+ >+ /** >+ * testValidateJavaIdentifier >+ * >+ * @throws Exception >+ */ >+ public void testValidateJavaIdentifier() throws Exception >+ { >+ String name = ""; >+ String validate = CapUtils.validateJavaIdentifier(name); >+ assertTrue(validate.indexOf("Empty name") != -1); >+ >+ name = "2home"; >+ validate = CapUtils.validateJavaIdentifier(name); >+ assertTrue(validate.indexOf("Invalid name:") != -1); >+ >+ name = "if"; >+ validate = CapUtils.validateJavaIdentifier(name); >+ assertTrue(validate.indexOf("Java keyword") != -1); >+ >+ name = "home"; >+ validate = CapUtils.validateJavaIdentifier(name); >+ assertNull(validate); >+ } >+ >+ /** >+ * testGetName >+ * >+ * @throws Exception >+ */ >+ public void testGetName() throws Exception >+ { >+ List properties = capabilityDomain.getCapability().getProperties(); >+ assertNotNull(properties); >+ assertEquals(PROPERTY_NAMES.length, properties.size()); >+ for (int i = 0; i < properties.size(); i++) >+ { >+ Object object = properties.get(i); >+ assertNotNull(object); >+ assertTrue(object instanceof Property); >+ Property property = (Property) object; >+ String propName = CapUtils.getName(property); >+ assertEquals(PROPERTY_NAMES[i], propName); >+ } > } >- } > > /** > * testIsOperationNameConflicted >+ * > * @throws Exception > */ >- public void testIsOperationNameConflicted() throws Exception { >+ public void testIsOperationNameConflicted() throws Exception >+ { > boolean conflicted = CapUtils.isOperationNameConflicted("shutdown"); > assertTrue(conflicted); >- >+ > conflicted = CapUtils.isOperationNameConflicted("foo"); > assertFalse(conflicted); > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/MetaDataDescriptor2TopicSpaceTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/MetaDataDescriptor2TopicSpaceTest.java,v >retrieving revision 1.1 >diff -u -r1.1 MetaDataDescriptor2TopicSpaceTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/MetaDataDescriptor2TopicSpaceTest.java 15 Sep 2006 15:20:23 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/MetaDataDescriptor2TopicSpaceTest.java 22 Jan 2007 09:34:34 -0000 >@@ -28,109 +28,110 @@ > */ > public class MetaDataDescriptor2TopicSpaceTest extends UtilsCapabilityTestModel > { >- /** >- * Constructor for MetaDataDescriptor2TopicSpaceTest. >- * >- * @param name >- */ >- public MetaDataDescriptor2TopicSpaceTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>MetaDataDescriptor2TopicSpaceTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite metaDataDescriptor2TopicSpaceTest = new HyadesTestSuite( >- "MetaDataDescriptor2TopicSpaceTest"); >- metaDataDescriptor2TopicSpaceTest.setArbiter( >- DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D7DBCC0D6042F711DB"); >- >- metaDataDescriptor2TopicSpaceTest >- .addTest(new MetaDataDescriptor2TopicSpaceTest( >- "testGetTopicspaces")); >- >- return metaDataDescriptor2TopicSpaceTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testGetTopicspaces >- * >- * @throws Exception >- */ >- public void testGetTopicspaces() throws Exception >- { >- List topicSpaces = metaDataDescriptor.getTopicSpaces(); >- >- assertNotNull(topicSpaces); >- assertEquals(2, topicSpaces.size()); >- >- verifyStartTopicNamespace(topicSpaces); >- >- verifyStopTopicNamespace(topicSpaces); >- } >- >- private void verifyStartTopicNamespace(List topicSpaces) >- { >- TopicSpace startTopicSpace = (TopicSpace) topicSpaces.get(0); >- assertEquals("http://start.org", startTopicSpace.getNamespace()); >- >- List startTopicSpaceRootTopicsList = startTopicSpace.getRootTopics(); >- assertNotNull(startTopicSpaceRootTopicsList); >- assertEquals(1, startTopicSpaceRootTopicsList.size()); >- >- Topic startServerTopic = (Topic) startTopicSpaceRootTopicsList.get(0); >- assertNull(startServerTopic.getParent()); >- assertEquals("StartServer", startServerTopic.getName()); >- >- List startServerTopicChildList = startServerTopic.getChildren(); >- assertNotNull(startServerTopicChildList); >- assertEquals(1, startServerTopicChildList.size()); >- >- Topic startDataResourceTopic = (Topic) startServerTopicChildList.get(0); >- assertEquals(startServerTopic, startDataResourceTopic.getParent()); >- assertEquals("StartDataResource", startDataResourceTopic.getName()); >- } >- >- private void verifyStopTopicNamespace(List topicSpaces) >- { >- TopicSpace stopTopicSpace = (TopicSpace) topicSpaces.get(1); >- assertEquals("http://stop.org", stopTopicSpace.getNamespace()); >- >- List stopTopicSpaceRootTopicsList = stopTopicSpace.getRootTopics(); >- assertNotNull(stopTopicSpaceRootTopicsList); >- assertEquals(1, stopTopicSpaceRootTopicsList.size()); >- >- Topic stopServerTopic = (Topic) stopTopicSpaceRootTopicsList.get(0); >- assertNull(stopServerTopic.getParent()); >- assertEquals("StopServer", stopServerTopic.getName()); >- >- List stopServerTopicChildList = stopServerTopic.getChildren(); >- assertNotNull(stopServerTopicChildList); >- assertEquals(1, stopServerTopicChildList.size()); >- >- Topic stopDataResourceTopic = (Topic) stopServerTopicChildList.get(0); >- assertEquals(stopServerTopic, stopDataResourceTopic.getParent()); >- assertEquals("StopDataResource", stopDataResourceTopic.getName()); >- } >+ /** >+ * Constructor for MetaDataDescriptor2TopicSpaceTest. >+ * >+ * @param name >+ */ >+ public MetaDataDescriptor2TopicSpaceTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>MetaDataDescriptor2TopicSpaceTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite metaDataDescriptor2TopicSpaceTest = new HyadesTestSuite( >+ "MetaDataDescriptor2TopicSpaceTest"); >+ metaDataDescriptor2TopicSpaceTest.setArbiter( >+ DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D7DBCC0D6042F711DB"); >+ >+ metaDataDescriptor2TopicSpaceTest >+ .addTest(new MetaDataDescriptor2TopicSpaceTest( >+ "testGetTopicspaces")); >+ >+ return metaDataDescriptor2TopicSpaceTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testGetTopicspaces >+ * >+ * @throws Exception >+ */ >+ public void testGetTopicspaces() throws Exception >+ { >+ metaDataDescriptor.loadTopicSpaces(); >+ List topicSpaces = capability.getTopicSpaces(); >+ >+ assertNotNull(topicSpaces); >+ assertEquals(2, topicSpaces.size()); >+ >+ verifyStartTopicNamespace(topicSpaces); >+ >+ verifyStopTopicNamespace(topicSpaces); >+ } >+ >+ private void verifyStartTopicNamespace(List topicSpaces) >+ { >+ TopicSpace startTopicSpace = (TopicSpace) topicSpaces.get(0); >+ assertEquals("http://start.org", startTopicSpace.getNamespace()); >+ >+ List startTopicSpaceRootTopicsList = startTopicSpace.getRootTopics(); >+ assertNotNull(startTopicSpaceRootTopicsList); >+ assertEquals(1, startTopicSpaceRootTopicsList.size()); >+ >+ Topic startServerTopic = (Topic) startTopicSpaceRootTopicsList.get(0); >+ assertNull(startServerTopic.getParent()); >+ assertEquals("StartServer", startServerTopic.getName()); >+ >+ List startServerTopicChildList = startServerTopic.getChildren(); >+ assertNotNull(startServerTopicChildList); >+ assertEquals(1, startServerTopicChildList.size()); >+ >+ Topic startDataResourceTopic = (Topic) startServerTopicChildList.get(0); >+ assertEquals(startServerTopic, startDataResourceTopic.getParent()); >+ assertEquals("StartDataResource", startDataResourceTopic.getName()); >+ } >+ >+ private void verifyStopTopicNamespace(List topicSpaces) >+ { >+ TopicSpace stopTopicSpace = (TopicSpace) topicSpaces.get(1); >+ assertEquals("http://stop.org", stopTopicSpace.getNamespace()); >+ >+ List stopTopicSpaceRootTopicsList = stopTopicSpace.getRootTopics(); >+ assertNotNull(stopTopicSpaceRootTopicsList); >+ assertEquals(1, stopTopicSpaceRootTopicsList.size()); >+ >+ Topic stopServerTopic = (Topic) stopTopicSpaceRootTopicsList.get(0); >+ assertNull(stopServerTopic.getParent()); >+ assertEquals("StopServer", stopServerTopic.getName()); >+ >+ List stopServerTopicChildList = stopServerTopic.getChildren(); >+ assertNotNull(stopServerTopicChildList); >+ assertEquals(1, stopServerTopicChildList.size()); >+ >+ Topic stopDataResourceTopic = (Topic) stopServerTopicChildList.get(0); >+ assertEquals(stopServerTopic, stopDataResourceTopic.getParent()); >+ assertEquals("StopDataResource", stopDataResourceTopic.getName()); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/EclipseUtilsTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/EclipseUtilsTest.java,v >retrieving revision 1.1 >diff -u -r1.1 EclipseUtilsTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/EclipseUtilsTest.java 15 Sep 2006 15:20:23 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/EclipseUtilsTest.java 22 Jan 2007 09:34:34 -0000 >@@ -24,65 +24,65 @@ > */ > public class EclipseUtilsTest extends HyadesTestCase > { >- /** >- * Constructor for EclipseUtilsTest. >- * >- * @param name >- */ >- public EclipseUtilsTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the <b>EclipseUtilsTest</b> >- * definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite eclipseUtilsTest = new HyadesTestSuite( >- "EclipseUtilsTest"); >- eclipseUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D7BE50E71042F711DB"); >- >- eclipseUtilsTest.addTest(new EclipseUtilsTest("testGetRelativePath")); >- eclipseUtilsTest.addTest(new EclipseUtilsTest("testReplaceAll")); >- >- return eclipseUtilsTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testGetRelativePath >- * >- * @throws Exception >- */ >- public void testGetRelativePath() throws Exception >- { >- // Enter your code here >- } >- >- /** >- * testReplaceAll >- * >- * @throws Exception >- */ >- public void testReplaceAll() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for EclipseUtilsTest. >+ * >+ * @param name >+ */ >+ public EclipseUtilsTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the <b>EclipseUtilsTest</b> >+ * definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite eclipseUtilsTest = new HyadesTestSuite( >+ "EclipseUtilsTest"); >+ eclipseUtilsTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D7BE50E71042F711DB"); >+ >+ eclipseUtilsTest.addTest(new EclipseUtilsTest("testGetRelativePath")); >+ eclipseUtilsTest.addTest(new EclipseUtilsTest("testReplaceAll")); >+ >+ return eclipseUtilsTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testGetRelativePath >+ * >+ * @throws Exception >+ */ >+ public void testGetRelativePath() throws Exception >+ { >+ // Enter your code here >+ } >+ >+ /** >+ * testReplaceAll >+ * >+ * @throws Exception >+ */ >+ public void testReplaceAll() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/test/util/AllUtilTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/test/util/AllUtilTest.java,v >retrieving revision 1.2 >diff -u -r1.2 AllUtilTest.java >--- src/org/eclipse/tptp/wsdm/tooling/test/util/AllUtilTest.java 15 Sep 2006 15:20:23 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/test/util/AllUtilTest.java 22 Jan 2007 09:34:33 -0000 >@@ -24,64 +24,64 @@ > */ > public class AllUtilTest extends HyadesTestCase > { >- /** >- * Constructor for AllUtilTest. >- * >- * @param name >- */ >- public AllUtilTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the <b>AllUtilTest</b> >- * definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite allUtilTest = new HyadesTestSuite("AllUtilTest"); >- allUtilTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "EFF2985B4634B8E3F213E31017E911DB"); >- >- allUtilTest.addTest(HyadesJUnitRunner.getTest(CapUtilsTest.class)); >- >- allUtilTest.addTest(HyadesJUnitRunner >- .getTest(Definition2CapabilityTest.class)); >- >- allUtilTest.addTest(HyadesJUnitRunner.getTest(EclipseUtilsTest.class)); >- >- allUtilTest.addTest(HyadesJUnitRunner >- .getTest(MetaDataDescriptor2TopicSpaceTest.class)); >- >- allUtilTest.addTest(HyadesJUnitRunner.getTest(MetaDataUtilsTest.class)); >- >- allUtilTest.addTest(HyadesJUnitRunner >- .getTest(PropertyMetaDataDescriptorTest.class)); >- >- allUtilTest.addTest(HyadesJUnitRunner >- .getTest(TopicSpace2MetaDataDescriptorTest.class)); >- >- allUtilTest.addTest(HyadesJUnitRunner.getTest(ValidationTest.class)); >- >- allUtilTest.addTest(HyadesJUnitRunner.getTest(WSDLUtilsTest.class)); >- >- allUtilTest.addTest(HyadesJUnitRunner.getTest(XSDUtilsTest.class)); >- return allUtilTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >+ /** >+ * Constructor for AllUtilTest. >+ * >+ * @param name >+ */ >+ public AllUtilTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the <b>AllUtilTest</b> >+ * definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite allUtilTest = new HyadesTestSuite("AllUtilTest"); >+ allUtilTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "EFF2985B4634B8E3F213E31017E911DB"); >+ >+ allUtilTest.addTest(HyadesJUnitRunner.getTest(CapUtilsTest.class)); >+ >+ allUtilTest.addTest(HyadesJUnitRunner >+ .getTest(Definition2CapabilityTest.class)); >+ >+ allUtilTest.addTest(HyadesJUnitRunner.getTest(EclipseUtilsTest.class)); >+ >+ allUtilTest.addTest(HyadesJUnitRunner >+ .getTest(MetaDataDescriptor2TopicSpaceTest.class)); >+ >+ allUtilTest.addTest(HyadesJUnitRunner.getTest(MetaDataUtilsTest.class)); >+ >+ allUtilTest.addTest(HyadesJUnitRunner >+ .getTest(PropertyMetaDataDescriptorTest.class)); >+ >+ allUtilTest.addTest(HyadesJUnitRunner >+ .getTest(TopicSpace2MetaDataDescriptorTest.class)); >+ >+ allUtilTest.addTest(HyadesJUnitRunner.getTest(ValidationTest.class)); >+ >+ allUtilTest.addTest(HyadesJUnitRunner.getTest(WSDLUtilsTest.class)); >+ >+ allUtilTest.addTest(HyadesJUnitRunner.getTest(XSDUtilsTest.class)); >+ return allUtilTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/test/Activator.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/test/Activator.java,v >retrieving revision 1.2 >diff -u -r1.2 Activator.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/test/Activator.java 15 Sep 2006 15:20:25 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/test/Activator.java 22 Jan 2007 09:34:33 -0000 >@@ -20,49 +20,49 @@ > public class Activator extends Plugin > { > >- // The plug-in ID >- public static final String PLUGIN_ID = "org.eclipse.tptp.wsdm.tooling.editor.capability.test"; >+ // The plug-in ID >+ public static final String PLUGIN_ID = "org.eclipse.tptp.wsdm.tooling.editor.capability.test"; > >- // The shared instance >- private static Activator plugin; >+ // The shared instance >+ private static Activator plugin; > >- /** >- * The constructor >- */ >- public Activator() >- { >- plugin = this; >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) >- */ >- public void start(BundleContext context) throws Exception >- { >- super.start(context); >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) >- */ >- public void stop(BundleContext context) throws Exception >- { >- plugin = null; >- super.stop(context); >- } >- >- /** >- * Returns the shared instance >- * >- * @return the shared instance >- */ >- public static Activator getDefault() >- { >- return plugin; >- } >+ /** >+ * The constructor >+ */ >+ public Activator() >+ { >+ plugin = this; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) >+ */ >+ public void start(BundleContext context) throws Exception >+ { >+ super.start(context); >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) >+ */ >+ public void stop(BundleContext context) throws Exception >+ { >+ plugin = null; >+ super.stop(context); >+ } >+ >+ /** >+ * Returns the shared instance >+ * >+ * @return the shared instance >+ */ >+ public static Activator getDefault() >+ { >+ return plugin; >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeOperationReturnTypeCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeOperationReturnTypeCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangeOperationReturnTypeCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeOperationReturnTypeCommandTest.java 15 Sep 2006 15:20:21 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeOperationReturnTypeCommandTest.java 22 Jan 2007 09:34:28 -0000 >@@ -32,77 +32,77 @@ > * <i>/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/operation/command/ChangeOperationReturnTypeCommandTest.testsuite</i>. > */ > public class ChangeOperationReturnTypeCommandTest extends >- OperationCommandTestModel >+ OperationCommandTestModel > { >- /** >- * Constructor for ChangeOperationReturnTypeCommandTest. >- * >- * @param name >- */ >- public ChangeOperationReturnTypeCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeOperationReturnTypeCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeOperationReturnTypeCommandTest = new HyadesTestSuite( >- "ChangeOperationReturnTypeCommandTest"); >- changeOperationReturnTypeCommandTest.setArbiter( >- DefaultTestArbiter.INSTANCE).setId( >- "C8E89291F2E4762C8F95A9C0100611DB"); >- >- changeOperationReturnTypeCommandTest >- .addTest(new ChangeOperationReturnTypeCommandTest( >- "testChangeOperationReturnType")); >- >- return changeOperationReturnTypeCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangeOperationReturnType >- * >- * @throws Exception >- */ >- public void testChangeOperationReturnType() throws Exception >- { >- List opList = capability.getOperations(); >- int totalOperations = opList.size(); >- assertNotNull(opList); >- assertTrue(totalOperations > 0); >- Object object = opList.get(0); >- assertTrue(object instanceof Operation); >- Operation operation = (Operation) object; >- DataType intDataType = TestUtils.getDataType("int"); >- String newType = new String(intDataType.getTypeName()); >- >- ChangeOperationReturnTypeCommand command = new ChangeOperationReturnTypeCommand( >- operation, intDataType); >- command.execute(); >- >- XSDElementDeclaration returnTypeDeclaration = WsdlUtils >- .getReturnTypeElement(operation); >- assertNotNull(returnTypeDeclaration); >- assertEquals(newType, XsdUtils.getType(returnTypeDeclaration)); >- } >+ /** >+ * Constructor for ChangeOperationReturnTypeCommandTest. >+ * >+ * @param name >+ */ >+ public ChangeOperationReturnTypeCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeOperationReturnTypeCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeOperationReturnTypeCommandTest = new HyadesTestSuite( >+ "ChangeOperationReturnTypeCommandTest"); >+ changeOperationReturnTypeCommandTest.setArbiter( >+ DefaultTestArbiter.INSTANCE).setId( >+ "C8E89291F2E4762C8F95A9C0100611DB"); >+ >+ changeOperationReturnTypeCommandTest >+ .addTest(new ChangeOperationReturnTypeCommandTest( >+ "testChangeOperationReturnType")); >+ >+ return changeOperationReturnTypeCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangeOperationReturnType >+ * >+ * @throws Exception >+ */ >+ public void testChangeOperationReturnType() throws Exception >+ { >+ List opList = capability.getOperations(); >+ int totalOperations = opList.size(); >+ assertNotNull(opList); >+ assertTrue(totalOperations > 0); >+ Object object = opList.get(0); >+ assertTrue(object instanceof Operation); >+ Operation operation = (Operation) object; >+ DataType intDataType = TestUtils.getDataType("int"); >+ String newType = new String(intDataType.getTypeName()); >+ >+ ChangeOperationReturnTypeCommand command = new ChangeOperationReturnTypeCommand( >+ operation, intDataType); >+ command.execute(); >+ >+ XSDElementDeclaration returnTypeDeclaration = WsdlUtils >+ .getReturnTypeElement(operation); >+ assertNotNull(returnTypeDeclaration); >+ assertEquals(newType, XsdUtils.getType(returnTypeDeclaration)); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddOperationCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddOperationCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 AddOperationCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddOperationCommandTest.java 15 Sep 2006 15:20:21 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddOperationCommandTest.java 22 Jan 2007 09:34:27 -0000 >@@ -26,68 +26,68 @@ > */ > public class AddOperationCommandTest extends OperationCommandTestModel > { >- /** >- * Constructor for AddOperationCommandTest. >- * >- * @param name >- */ >- public AddOperationCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AddOperationCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite addOperationCommandTest = new HyadesTestSuite( >- "AddOperationCommandTest"); >- addOperationCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C8E89291F2E4762CE5C63C20100011DB"); >- >- addOperationCommandTest.addTest(new AddOperationCommandTest( >- "testAddOperation")); >- >- return addOperationCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testAddOperation >- * >- * @throws Exception >- */ >- public void testAddOperation() throws Exception >- { >- int totalOperations = WsdlUtils.getWSDLOperation(definition).length; >- Operation newOperation = TestUtils.createNewOperation(definition); >- newOperation.setName("foo"); >- AddOperationCommand command = new AddOperationCommand(capabilityDomain, >- newOperation); >- command.execute(); >- >- int newTotalOperations = WsdlUtils.getWSDLOperation(definition).length; >- assertTrue(newTotalOperations == totalOperations + 1); >- >- Operation operation = WsdlUtils.getWSDLOperation(definition)[newTotalOperations - 1]; >- assertEquals("foo", operation.getName()); >- // TODO Check for Input, Output, Message and Part >- } >+ /** >+ * Constructor for AddOperationCommandTest. >+ * >+ * @param name >+ */ >+ public AddOperationCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>AddOperationCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite addOperationCommandTest = new HyadesTestSuite( >+ "AddOperationCommandTest"); >+ addOperationCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C8E89291F2E4762CE5C63C20100011DB"); >+ >+ addOperationCommandTest.addTest(new AddOperationCommandTest( >+ "testAddOperation")); >+ >+ return addOperationCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testAddOperation >+ * >+ * @throws Exception >+ */ >+ public void testAddOperation() throws Exception >+ { >+ int totalOperations = WsdlUtils.getWSDLOperation(definition).length; >+ Operation newOperation = TestUtils.createNewOperation(definition); >+ newOperation.setName("foo"); >+ AddOperationCommand command = new AddOperationCommand(capabilityDomain, >+ newOperation); >+ command.execute(); >+ >+ int newTotalOperations = WsdlUtils.getWSDLOperation(definition).length; >+ assertTrue(newTotalOperations == totalOperations + 1); >+ >+ Operation operation = WsdlUtils.getWSDLOperation(definition)[newTotalOperations - 1]; >+ assertEquals("foo", operation.getName()); >+ // TODO Check for Input, Output, Message and Part >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AllOperationCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AllOperationCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 AllOperationCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AllOperationCommandTest.java 15 Sep 2006 15:20:21 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AllOperationCommandTest.java 22 Jan 2007 09:34:28 -0000 >@@ -24,68 +24,68 @@ > */ > public class AllOperationCommandTest extends HyadesTestCase > { >- /** >- * Constructor for AllOperationCommandTest. >- * >- * @param name >- */ >- public AllOperationCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AllOperationCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite allOperationCommandTest = new HyadesTestSuite( >- "AllOperationCommandTest"); >- allOperationCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C8E89291F2E4762CE3965FA0100711DB"); >- >- allOperationCommandTest.addTest(HyadesJUnitRunner >- .getTest(AddExceptionCommandTest.class)); >- >- allOperationCommandTest.addTest(HyadesJUnitRunner >- .getTest(AddOperationCommandTest.class)); >- >- allOperationCommandTest.addTest(HyadesJUnitRunner >- .getTest(AddParameterCommandTest.class)); >- >- allOperationCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeInputParamTypeCommandTest.class)); >- >- allOperationCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeOperationNameCommandTest.class)); >- >- allOperationCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeOperationReturnTypeCommandTest.class)); >- >- allOperationCommandTest.addTest(HyadesJUnitRunner >- .getTest(RemoveExceptionCommandTest.class)); >- >- allOperationCommandTest.addTest(HyadesJUnitRunner >- .getTest(RemoveOperationCommandTest.class)); >- >- allOperationCommandTest.addTest(HyadesJUnitRunner >- .getTest(RemoveParameterCommandTest.class)); >- return allOperationCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >+ /** >+ * Constructor for AllOperationCommandTest. >+ * >+ * @param name >+ */ >+ public AllOperationCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>AllOperationCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite allOperationCommandTest = new HyadesTestSuite( >+ "AllOperationCommandTest"); >+ allOperationCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C8E89291F2E4762CE3965FA0100711DB"); >+ >+ allOperationCommandTest.addTest(HyadesJUnitRunner >+ .getTest(AddExceptionCommandTest.class)); >+ >+ allOperationCommandTest.addTest(HyadesJUnitRunner >+ .getTest(AddOperationCommandTest.class)); >+ >+ allOperationCommandTest.addTest(HyadesJUnitRunner >+ .getTest(AddParameterCommandTest.class)); >+ >+ allOperationCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeInputParamTypeCommandTest.class)); >+ >+ allOperationCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeOperationNameCommandTest.class)); >+ >+ allOperationCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeOperationReturnTypeCommandTest.class)); >+ >+ allOperationCommandTest.addTest(HyadesJUnitRunner >+ .getTest(RemoveExceptionCommandTest.class)); >+ >+ allOperationCommandTest.addTest(HyadesJUnitRunner >+ .getTest(RemoveOperationCommandTest.class)); >+ >+ allOperationCommandTest.addTest(HyadesJUnitRunner >+ .getTest(RemoveParameterCommandTest.class)); >+ return allOperationCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddExceptionCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddExceptionCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 AddExceptionCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddExceptionCommandTest.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddExceptionCommandTest.java 22 Jan 2007 09:34:27 -0000 >@@ -30,87 +30,87 @@ > */ > public class AddExceptionCommandTest extends OperationCommandTestModel > { >- /** >- * Constructor for AddExceptionCommandTest. >- * >- * @param name >- */ >- public AddExceptionCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AddExceptionCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite addExceptionCommandTest = new HyadesTestSuite( >- "AddExceptionCommandTest"); >- addExceptionCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D7AFA330D042F511DB"); >- >- addExceptionCommandTest.addTest(new AddExceptionCommandTest( >- "testAddException")); >- >- return addExceptionCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testAddException >- * >- * @throws Exception >- */ >- public void testAddException() throws Exception >- { >- Operation operation = getOperation(START_SERVER_OPERATION_NAME); >- >- // If Base Fault already there then return >- java.util.List faultElements = WsdlUtils >- .getOperationFaultElements(operation); >- for (int i = 0; i < faultElements.size(); i++) >+ /** >+ * Constructor for AddExceptionCommandTest. >+ * >+ * @param name >+ */ >+ public AddExceptionCommandTest(String name) > { >- XSDElementDeclaration faultElement = (XSDElementDeclaration) faultElements >- .get(i); >- String type = WsdlUtils.getFaultType(faultElement); >- if ("BaseFaultType".equals(type)) >- { >- throw new AssertionFailedError( >- "Base Fault already existing in operation " >- + operation.getName()); >- } >+ super(name); > } > >- Fault newException = TestUtils >- .createNewException(definition, operation); >- AddExceptionCommand command = new AddExceptionCommand(capabilityDomain, >- operation, newException); >- command.execute(); >- >- // Verify that new fault properly added >- faultElements = WsdlUtils.getOperationFaultElements(operation); >- assertNotNull(faultElements); >- assertTrue(faultElements.size() > 0); >- XSDElementDeclaration faultElement = (XSDElementDeclaration) faultElements >- .get(faultElements.size() - 1); >- String type = WsdlUtils.getFaultType(faultElement); >- assertEquals("BaseFaultType", type); >- } >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>AddExceptionCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite addExceptionCommandTest = new HyadesTestSuite( >+ "AddExceptionCommandTest"); >+ addExceptionCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D7AFA330D042F511DB"); >+ >+ addExceptionCommandTest.addTest(new AddExceptionCommandTest( >+ "testAddException")); >+ >+ return addExceptionCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testAddException >+ * >+ * @throws Exception >+ */ >+ public void testAddException() throws Exception >+ { >+ Operation operation = getOperation(START_SERVER_OPERATION_NAME); >+ >+ // If Base Fault already there then return >+ java.util.List faultElements = WsdlUtils >+ .getOperationFaultElements(operation); >+ for (int i = 0; i < faultElements.size(); i++) >+ { >+ XSDElementDeclaration faultElement = (XSDElementDeclaration) faultElements >+ .get(i); >+ String type = WsdlUtils.getFaultType(faultElement); >+ if ("BaseFaultType".equals(type)) >+ { >+ throw new AssertionFailedError( >+ "Base Fault already existing in operation " >+ + operation.getName()); >+ } >+ } >+ >+ Fault newException = TestUtils >+ .createNewException(definition, operation); >+ AddExceptionCommand command = new AddExceptionCommand(capabilityDomain, >+ operation, newException); >+ command.execute(); >+ >+ // Verify that new fault properly added >+ faultElements = WsdlUtils.getOperationFaultElements(operation); >+ assertNotNull(faultElements); >+ assertTrue(faultElements.size() > 0); >+ XSDElementDeclaration faultElement = (XSDElementDeclaration) faultElements >+ .get(faultElements.size() - 1); >+ String type = WsdlUtils.getFaultType(faultElement); >+ assertEquals("BaseFaultType", type); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveParameterCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveParameterCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 RemoveParameterCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveParameterCommandTest.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveParameterCommandTest.java 22 Jan 2007 09:34:29 -0000 >@@ -32,98 +32,98 @@ > */ > public class RemoveParameterCommandTest extends OperationCommandTestModel > { >- /** >- * Constructor for RemoveParameterCommandTest. >- * >- * @param name >- */ >- public RemoveParameterCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>RemoveParameterCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite removeParameterCommandTest = new HyadesTestSuite( >- "RemoveParameterCommandTest"); >- removeParameterCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C254CB80544979D715E181D042F611DB"); >- >- removeParameterCommandTest.addTest(new RemoveParameterCommandTest( >- "testRemoveParameter")); >- >- return removeParameterCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testRemoveParameter >- * >- * @throws Exception >- */ >- public void testRemoveParameter() throws Exception >- { >- Operation operation = getOperation(DEPLOY_APP_OPERATION_NAME); >- >- XSDElementDeclaration oldParams[] = WsdlUtils >- .getOperationParams(operation); >- assertNotNull(oldParams); >- assertEquals(2, oldParams.length); >- >- String typeName = XsdUtils.getType(oldParams[0]); >- DataType dataType = new DataType(typeName, oldParams[0] >- .getTypeDefinition()); >- String param_1_name = XsdUtils.getName(oldParams[0]); >- InputParameter param_1 = new InputParameter(oldParams[0], dataType); >- >- RemoveParameterCommand command_1 = new RemoveParameterCommand( >- operation, param_1); >- command_1.execute(); >- >- // Verify that Param_1 got removed and another param is still in XSD >- // Model group >- oldParams = WsdlUtils.getOperationParams(operation); >- assertNotNull(oldParams); >- assertEquals(1, oldParams.length); >- String param_2_name = XsdUtils.getName(oldParams[0]); >- assertNotSame(param_2_name, param_1_name); >- >- // Now remove another param >- typeName = XsdUtils.getType(oldParams[0]); >- dataType = new DataType(typeName, oldParams[0].getTypeDefinition()); >- InputParameter param_2 = new InputParameter(oldParams[0], dataType); >- >- RemoveParameterCommand command_2 = new RemoveParameterCommand( >- operation, param_2); >- command_2.execute(); >- >- // Verify that Param_1 got removed and XSD Model group is removed >- oldParams = WsdlUtils.getOperationParams(operation); >- assertNotNull(oldParams); >- assertEquals(0, oldParams.length); >- >- Part part_0 = (Part) operation.getEInput().getEMessage().getEParts() >- .get(0); >- XSDElementDeclaration element = part_0.getElementDeclaration(); >- assertNull(element.getAnonymousTypeDefinition()); >- } >+ /** >+ * Constructor for RemoveParameterCommandTest. >+ * >+ * @param name >+ */ >+ public RemoveParameterCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>RemoveParameterCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite removeParameterCommandTest = new HyadesTestSuite( >+ "RemoveParameterCommandTest"); >+ removeParameterCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C254CB80544979D715E181D042F611DB"); >+ >+ removeParameterCommandTest.addTest(new RemoveParameterCommandTest( >+ "testRemoveParameter")); >+ >+ return removeParameterCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testRemoveParameter >+ * >+ * @throws Exception >+ */ >+ public void testRemoveParameter() throws Exception >+ { >+ Operation operation = getOperation(DEPLOY_APP_OPERATION_NAME); >+ >+ XSDElementDeclaration oldParams[] = WsdlUtils >+ .getOperationParams(operation); >+ assertNotNull(oldParams); >+ assertEquals(2, oldParams.length); >+ >+ String typeName = XsdUtils.getType(oldParams[0]); >+ DataType dataType = new DataType(typeName, oldParams[0] >+ .getTypeDefinition()); >+ String param_1_name = XsdUtils.getName(oldParams[0]); >+ InputParameter param_1 = new InputParameter(oldParams[0], dataType); >+ >+ RemoveParameterCommand command_1 = new RemoveParameterCommand( >+ operation, param_1); >+ command_1.execute(); >+ >+ // Verify that Param_1 got removed and another param is still in XSD >+ // Model group >+ oldParams = WsdlUtils.getOperationParams(operation); >+ assertNotNull(oldParams); >+ assertEquals(1, oldParams.length); >+ String param_2_name = XsdUtils.getName(oldParams[0]); >+ assertNotSame(param_2_name, param_1_name); >+ >+ // Now remove another param >+ typeName = XsdUtils.getType(oldParams[0]); >+ dataType = new DataType(typeName, oldParams[0].getTypeDefinition()); >+ InputParameter param_2 = new InputParameter(oldParams[0], dataType); >+ >+ RemoveParameterCommand command_2 = new RemoveParameterCommand( >+ operation, param_2); >+ command_2.execute(); >+ >+ // Verify that Param_1 got removed and XSD Model group is removed >+ oldParams = WsdlUtils.getOperationParams(operation); >+ assertNotNull(oldParams); >+ assertEquals(0, oldParams.length); >+ >+ Part part_0 = (Part) operation.getEInput().getEMessage().getEParts() >+ .get(0); >+ XSDElementDeclaration element = part_0.getElementDeclaration(); >+ assertNull(element.getAnonymousTypeDefinition()); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeInputParamTypeCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeInputParamTypeCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ChangeInputParamTypeCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeInputParamTypeCommandTest.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeInputParamTypeCommandTest.java 22 Jan 2007 09:34:28 -0000 >@@ -24,57 +24,57 @@ > */ > public class ChangeInputParamTypeCommandTest extends OperationCommandTestModel > { >- /** >- * Constructor for ChangeInputParamTypeCommandTest. >- * >- * @param name >- */ >- public ChangeInputParamTypeCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeInputParamTypeCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeInputParamTypeCommandTest = new HyadesTestSuite( >- "ChangeInputParamTypeCommandTest"); >- changeInputParamTypeCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C254CB80544979D7E8566B4042F511DB"); >- >- changeInputParamTypeCommandTest >- .addTest(new ChangeInputParamTypeCommandTest( >- "testChangeInputParamType")); >- >- return changeInputParamTypeCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangeInputParamType >- * >- * @throws Exception >- */ >- public void testChangeInputParamType() throws Exception >- { >- // Enter your code here >- } >+ /** >+ * Constructor for ChangeInputParamTypeCommandTest. >+ * >+ * @param name >+ */ >+ public ChangeInputParamTypeCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeInputParamTypeCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeInputParamTypeCommandTest = new HyadesTestSuite( >+ "ChangeInputParamTypeCommandTest"); >+ changeInputParamTypeCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C254CB80544979D7E8566B4042F511DB"); >+ >+ changeInputParamTypeCommandTest >+ .addTest(new ChangeInputParamTypeCommandTest( >+ "testChangeInputParamType")); >+ >+ return changeInputParamTypeCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangeInputParamType >+ * >+ * @throws Exception >+ */ >+ public void testChangeInputParamType() throws Exception >+ { >+ // Enter your code here >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveOperationCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveOperationCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 RemoveOperationCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveOperationCommandTest.java 15 Sep 2006 15:20:21 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveOperationCommandTest.java 22 Jan 2007 09:34:29 -0000 >@@ -29,80 +29,80 @@ > */ > public class RemoveOperationCommandTest extends OperationCommandTestModel > { >- /** >- * Constructor for RemoveOperationCommandTest. >- * >- * @param name >- */ >- public RemoveOperationCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>RemoveOperationCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite removeOperationCommandTest = new HyadesTestSuite( >- "RemoveOperationCommandTest"); >- removeOperationCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C8E89291F2E4762CE8D08E90100311DB"); >- >- removeOperationCommandTest.addTest(new RemoveOperationCommandTest( >- "testRemoveOperation")); >- >- return removeOperationCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testRemoveOperation >- * >- * @throws Exception >- */ >- public void testRemoveOperation() throws Exception >- { >- int totalOperations = capability.getOperations().size(); >- List opList = capability.getOperations(); >- assertNotNull(opList); >- assertTrue(totalOperations > 0); >- Object object = opList.get(0); >- assertTrue(object instanceof Operation); >- Operation operation = (Operation) object; >- String opName = new String(operation.getName()); >- >- RemoveOperationCommand command = new RemoveOperationCommand( >- capabilityDomain, operation); >- command.execute(); >+ /** >+ * Constructor for RemoveOperationCommandTest. >+ * >+ * @param name >+ */ >+ public RemoveOperationCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>RemoveOperationCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite removeOperationCommandTest = new HyadesTestSuite( >+ "RemoveOperationCommandTest"); >+ removeOperationCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C8E89291F2E4762CE8D08E90100311DB"); >+ >+ removeOperationCommandTest.addTest(new RemoveOperationCommandTest( >+ "testRemoveOperation")); >+ >+ return removeOperationCommandTest; >+ } > >- int newTotalOperations = WsdlUtils.getWSDLOperation(definition).length; >- assertTrue(newTotalOperations == totalOperations - 1); >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } > >- Operation[] operations = WsdlUtils.getWSDLOperation(definition); >- for (int i = 0; i < operations.length; i++) >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception > { >- if (operations[i].getName().equals(opName)) >- throw new AssertionFailedError("Operation " + opName >- + " not removed properly"); > } > >- // TODO Check for Input, Output, Message and Part >- } >+ /** >+ * testRemoveOperation >+ * >+ * @throws Exception >+ */ >+ public void testRemoveOperation() throws Exception >+ { >+ int totalOperations = capability.getOperations().size(); >+ List opList = capability.getOperations(); >+ assertNotNull(opList); >+ assertTrue(totalOperations > 0); >+ Object object = opList.get(0); >+ assertTrue(object instanceof Operation); >+ Operation operation = (Operation) object; >+ String opName = new String(operation.getName()); >+ >+ RemoveOperationCommand command = new RemoveOperationCommand( >+ capabilityDomain, operation); >+ command.execute(); >+ >+ int newTotalOperations = WsdlUtils.getWSDLOperation(definition).length; >+ assertTrue(newTotalOperations == totalOperations - 1); >+ >+ Operation[] operations = WsdlUtils.getWSDLOperation(definition); >+ for (int i = 0; i < operations.length; i++) >+ { >+ if (operations[i].getName().equals(opName)) >+ throw new AssertionFailedError("Operation " + opName >+ + " not removed properly"); >+ } >+ >+ // TODO Check for Input, Output, Message and Part >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/OperationCommandTestModel.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/OperationCommandTestModel.java,v >retrieving revision 1.1 >diff -u -r1.1 OperationCommandTestModel.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/OperationCommandTestModel.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/OperationCommandTestModel.java 22 Jan 2007 09:34:29 -0000 >@@ -22,46 +22,46 @@ > > public class OperationCommandTestModel extends CapabilityTestModel > { >- protected String START_SERVER_OPERATION_NAME = "startServer"; >+ protected String START_SERVER_OPERATION_NAME = "startServer"; > >- protected String START_APP_OPERATION_NAME = "startApp"; >+ protected String START_APP_OPERATION_NAME = "startApp"; > >- protected String DEPLOY_APP_OPERATION_NAME = "deployApp"; >+ protected String DEPLOY_APP_OPERATION_NAME = "deployApp"; > >- protected String STOP_APP_OPERATION_NAME = "stopApp"; >+ protected String STOP_APP_OPERATION_NAME = "stopApp"; > >- protected String STOP_SERVER_OPERATION_NAME = "stopServer"; >- >- public OperationCommandTestModel(String name) >- { >- this(name, Activator.PLUGIN_ID + "/" >- + "testfiles/capability/command/operation/Server.mcap"); >- } >- >- public OperationCommandTestModel(String name, String CapabilityIFilePath) >- { >- super(name, CapabilityIFilePath); >- } >- >- protected Operation getOperation(String operationName) >- { >- List operationList = capability.getOperations(); >- if (operationList == null || operationList.size() == 0) >- throw new AssertionFailedError( >- "No operations found in capability file -- " >- + CAPABILITY_FILE_PATH); >- Operation operation = null; >- for (int i = 0; i < operationList.size(); i++) >+ protected String STOP_SERVER_OPERATION_NAME = "stopServer"; >+ >+ public OperationCommandTestModel(String name) >+ { >+ this(name, Activator.PLUGIN_ID + "/" >+ + "testfiles/capability/command/operation/Server.mcap"); >+ } >+ >+ public OperationCommandTestModel(String name, String CapabilityIFilePath) >+ { >+ super(name, CapabilityIFilePath); >+ } >+ >+ protected Operation getOperation(String operationName) > { >- operation = (Operation) operationList.get(i); >- if (operationName.equals(operation.getName())) >- break; >+ List operationList = capability.getOperations(); >+ if (operationList == null || operationList.size() == 0) >+ throw new AssertionFailedError( >+ "No operations found in capability file -- " >+ + CAPABILITY_FILE_PATH); >+ Operation operation = null; >+ for (int i = 0; i < operationList.size(); i++) >+ { >+ operation = (Operation) operationList.get(i); >+ if (operationName.equals(operation.getName())) >+ break; >+ } >+ if (operation == null) >+ throw new AssertionFailedError("No operations found by name " >+ + operationName + " in capability file -- " >+ + CAPABILITY_FILE_PATH); >+ return operation; > } >- if (operation == null) >- throw new AssertionFailedError("No operations found by name " >- + operationName + " in capability file -- " >- + CAPABILITY_FILE_PATH); >- return operation; >- } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestParameter.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestParameter.java,v >retrieving revision 1.1 >diff -u -r1.1 NewTestParameter.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestParameter.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestParameter.java 22 Jan 2007 09:34:29 -0000 >@@ -20,26 +20,26 @@ > > public class NewTestParameter > { >- private String _paramName; >+ private String _paramName; > >- private DataType _dataType; >+ private DataType _dataType; > >- public NewTestParameter(String paramName, DataType dataType) >- { >- _paramName = paramName; >- _dataType = dataType; >- } >- >- public InputParameter getParameter() >- { >- XSDElementDeclaration _element = XSDFactory.eINSTANCE >- .createXSDElementDeclaration(); >- _element.setName(_paramName); >+ public NewTestParameter(String paramName, DataType dataType) >+ { >+ _paramName = paramName; >+ _dataType = dataType; >+ } >+ >+ public InputParameter getParameter() >+ { >+ XSDElementDeclaration _element = XSDFactory.eINSTANCE >+ .createXSDElementDeclaration(); >+ _element.setName(_paramName); > >- XSDTypeDefinition newType = _dataType.getTypeDefinition(); >- _element.setTypeDefinition(newType); >+ XSDTypeDefinition newType = _dataType.getTypeDefinition(); >+ _element.setTypeDefinition(newType); > >- return new InputParameter(_element, _dataType); >- } >+ return new InputParameter(_element, _dataType); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddParameterCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddParameterCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 AddParameterCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddParameterCommandTest.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/AddParameterCommandTest.java 22 Jan 2007 09:34:28 -0000 >@@ -37,226 +37,226 @@ > */ > public class AddParameterCommandTest extends OperationCommandTestModel > { >- /** >- * Constructor for AddParameterCommandTest. >- * >- * @param name >- */ >- public AddParameterCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AddParameterCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite addParameterCommandTest = new HyadesTestSuite( >- "AddParameterCommandTest"); >- addParameterCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C254CB80544979D7CEB7E2E042F511DB"); >- >- addParameterCommandTest.addTest(new AddParameterCommandTest( >- "testAddParameter_1")); >- addParameterCommandTest.addTest(new AddParameterCommandTest( >- "testAddParameter_2")); >- addParameterCommandTest.addTest(new AddParameterCommandTest( >- "testAddParameter_3")); >- addParameterCommandTest.addTest(new AddParameterCommandTest( >- "testAddParameter_4")); >- >- return addParameterCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * Some of the input parameter may be defined as<br> >- * <br> >- * >- * < element name="port" type="int"/ ><br> >- * <br> >- * >- * So if we add a new parameter we have to move this existing paramater >- * into XSDModelGroup element reference Such as<br> >- * <br> >- * >- * < element name="port" > <br> >- * < complexType > <br> >- * < sequence > <br> >- * < element name="port" type="int"/ > <br> >- * < element name="conntype" type="string"/ > <br> >- * < /sequence > <br> >- * < /complexType > <br> >- * < /element > <br> >- * >- * @throws Exception >- */ >- public void testAddParameter_1() throws Exception >- { >- Operation operation = getOperation(START_APP_OPERATION_NAME); >- XSDElementDeclaration[] oldParams = WsdlUtils >- .getOperationParams(operation); >- assertNotNull(oldParams); >- assertTrue(oldParams.length > 0); >- XSDElementDeclaration lastParam = oldParams[oldParams.length - 1]; >- >- String paramName = "serverHome"; >- DataType dataType = TestUtils.getDataType("string"); >- InputParameter param = TestUtils >- .createNewParameter(paramName, dataType); >- >- AddParameterCommand command = new AddParameterCommand(operation, param); >- command.execute(); >- >- // Verify the new parameter >- XSDElementDeclaration[] newParams = WsdlUtils >- .getOperationParams(operation); >- assertNotNull(newParams); >- assertEquals(oldParams.length + 1, newParams.length); >- >- XSDElementDeclaration newParam = newParams[newParams.length - 1]; >- assertEquals(param.getXSDElementDeclaration(), newParam); >- >- // Verify Existing param moved to the XSD model group >- XSDElementDeclaration existingParam = newParams[newParams.length - 2]; >- assertEquals(lastParam.getName(), existingParam.getName()); >- assertEquals(lastParam.getTargetNamespace(), existingParam >- .getTargetNamespace()); >- assertEquals(lastParam.getSchema(), existingParam.getSchema()); >- } >- >- /** >- * This will test that new parameter is added to the existing XSD model >- * group. >- * >- * @throws Exception >- */ >- public void testAddParameter_2() throws Exception >- { >- Operation operation = getOperation(DEPLOY_APP_OPERATION_NAME); >- XSDElementDeclaration[] oldParams = WsdlUtils >- .getOperationParams(operation); >- assertNotNull(oldParams); >- assertTrue(oldParams.length > 0); >- >- String paramName = "jvmHome"; >- DataType dataType = TestUtils.getDataType("string"); >- InputParameter param = TestUtils >- .createNewParameter(paramName, dataType); >- >- AddParameterCommand command = new AddParameterCommand(operation, param); >- command.execute(); >- >- // Verify the new parameter >- XSDElementDeclaration[] newParams = WsdlUtils >- .getOperationParams(operation); >- assertNotNull(newParams); >- assertEquals(oldParams.length + 1, newParams.length); >- >- XSDElementDeclaration newParam = newParams[newParams.length - 1]; >- assertEquals(param.getXSDElementDeclaration(), newParam); >- } >- >- /** >- * This will test that new parameter addition action should create new >- * XSD model group. >- * >- * @throws Exception >- */ >- public void testAddParameter_3() throws Exception >- { >- Operation operation = getOperation(STOP_SERVER_OPERATION_NAME); >- XSDElementDeclaration[] oldParams = WsdlUtils >- .getOperationParams(operation); >- assertNotNull(oldParams); >- assertEquals(0, oldParams.length); >- >- String paramName = "serverVersion"; >- DataType dataType = TestUtils.getDataType("int"); >- InputParameter param = TestUtils >- .createNewParameter(paramName, dataType); >- >- AddParameterCommand command = new AddParameterCommand(operation, param); >- command.execute(); >- >- // Verify the new parameter >- XSDElementDeclaration[] newParams = WsdlUtils >- .getOperationParams(operation); >- assertNotNull(newParams); >- assertEquals(oldParams.length + 1, newParams.length); >- >- XSDElementDeclaration newParam = newParams[newParams.length - 1]; >- assertEquals(param.getXSDElementDeclaration(), newParam); >- } >- >- /** >- * This will create a new parameter by passing the Complex data type. >- * >- * @throws Exception >- */ >- public void testAddParameter_4() throws Exception >- { >- Operation operation = getOperation(DEPLOY_APP_OPERATION_NAME); >- XSDElementDeclaration[] oldParams = WsdlUtils >- .getOperationParams(operation); >- assertNotNull(oldParams); >- >- String paramName = "jvmVersion"; >- // Get the complex type from some XSD >- String xsdFilePath = Activator.PLUGIN_ID + "/" >- + "testfiles/xsd/common.xsd"; >- List complexTypes = TestUtils.getComplexTypes(xsdFilePath); >- assertNotNull(complexTypes); >- assertTrue(complexTypes.size() > 0); >- XSDTypeDefinition complexType = (XSDTypeDefinition) complexTypes.get(0); >- String typeName = XsdUtils.getType(complexType); >- >- DataType dataType = new DataType(typeName, complexType); >- InputParameter param = TestUtils >- .createNewParameter(paramName, dataType); >- >- AddParameterCommand command = new AddParameterCommand(operation, param); >- command.execute(); >- >- // Verify the new parameter >- XSDElementDeclaration[] newParams = WsdlUtils >- .getOperationParams(operation); >- assertNotNull(newParams); >- assertEquals(oldParams.length + 1, newParams.length); >- >- XSDElementDeclaration newParam = newParams[newParams.length - 1]; >- assertEquals(param.getXSDElementDeclaration(), newParam); >- >- // Verify the import element >- String typeNS = newParam.getTypeDefinition().getTargetNamespace(); >- XSDImport[] imports = XsdUtils.getAllXSDImports(newParam.getSchema()); >- assertNotNull(imports); >- assertTrue(imports.length > 0); >- boolean found = false; >- for (int i = 0; i < imports.length; i++) >- { >- if (imports[i].getNamespace().equals(typeNS)) >- found = true; >- } >- if (!found) >- throw new AssertionFailedError( >- "XSD Import element not added while adding new parameter " >- + "which has complex kind of data type"); >- } >+ /** >+ * Constructor for AddParameterCommandTest. >+ * >+ * @param name >+ */ >+ public AddParameterCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>AddParameterCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite addParameterCommandTest = new HyadesTestSuite( >+ "AddParameterCommandTest"); >+ addParameterCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C254CB80544979D7CEB7E2E042F511DB"); >+ >+ addParameterCommandTest.addTest(new AddParameterCommandTest( >+ "testAddParameter_1")); >+ addParameterCommandTest.addTest(new AddParameterCommandTest( >+ "testAddParameter_2")); >+ addParameterCommandTest.addTest(new AddParameterCommandTest( >+ "testAddParameter_3")); >+ addParameterCommandTest.addTest(new AddParameterCommandTest( >+ "testAddParameter_4")); >+ >+ return addParameterCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * Some of the input parameter may be defined as<br> >+ * <br> >+ * >+ * < element name="port" type="int"/ ><br> >+ * <br> >+ * >+ * So if we add a new parameter we have to move this existing paramater into >+ * XSDModelGroup element reference Such as<br> >+ * <br> >+ * >+ * < element name="port" > <br> >+ * < complexType > <br> >+ * < sequence > <br> >+ * < element name="port" type="int"/ > <br> >+ * < element name="conntype" type="string"/ > <br> >+ * < /sequence > <br> >+ * < /complexType > <br> >+ * < /element > <br> >+ * >+ * @throws Exception >+ */ >+ public void testAddParameter_1() throws Exception >+ { >+ Operation operation = getOperation(START_APP_OPERATION_NAME); >+ XSDElementDeclaration[] oldParams = WsdlUtils >+ .getOperationParams(operation); >+ assertNotNull(oldParams); >+ assertTrue(oldParams.length > 0); >+ XSDElementDeclaration lastParam = oldParams[oldParams.length - 1]; >+ >+ String paramName = "serverHome"; >+ DataType dataType = TestUtils.getDataType("string"); >+ InputParameter param = TestUtils >+ .createNewParameter(paramName, dataType); >+ >+ AddParameterCommand command = new AddParameterCommand(operation, param); >+ command.execute(); >+ >+ // Verify the new parameter >+ XSDElementDeclaration[] newParams = WsdlUtils >+ .getOperationParams(operation); >+ assertNotNull(newParams); >+ assertEquals(oldParams.length + 1, newParams.length); >+ >+ XSDElementDeclaration newParam = newParams[newParams.length - 1]; >+ assertEquals(param.getXSDElementDeclaration(), newParam); >+ >+ // Verify Existing param moved to the XSD model group >+ XSDElementDeclaration existingParam = newParams[newParams.length - 2]; >+ assertEquals(lastParam.getName(), existingParam.getName()); >+ assertEquals(lastParam.getTargetNamespace(), existingParam >+ .getTargetNamespace()); >+ assertEquals(lastParam.getSchema(), existingParam.getSchema()); >+ } >+ >+ /** >+ * This will test that new parameter is added to the existing XSD model >+ * group. >+ * >+ * @throws Exception >+ */ >+ public void testAddParameter_2() throws Exception >+ { >+ Operation operation = getOperation(DEPLOY_APP_OPERATION_NAME); >+ XSDElementDeclaration[] oldParams = WsdlUtils >+ .getOperationParams(operation); >+ assertNotNull(oldParams); >+ assertTrue(oldParams.length > 0); >+ >+ String paramName = "jvmHome"; >+ DataType dataType = TestUtils.getDataType("string"); >+ InputParameter param = TestUtils >+ .createNewParameter(paramName, dataType); >+ >+ AddParameterCommand command = new AddParameterCommand(operation, param); >+ command.execute(); >+ >+ // Verify the new parameter >+ XSDElementDeclaration[] newParams = WsdlUtils >+ .getOperationParams(operation); >+ assertNotNull(newParams); >+ assertEquals(oldParams.length + 1, newParams.length); >+ >+ XSDElementDeclaration newParam = newParams[newParams.length - 1]; >+ assertEquals(param.getXSDElementDeclaration(), newParam); >+ } >+ >+ /** >+ * This will test that new parameter addition action should create new XSD >+ * model group. >+ * >+ * @throws Exception >+ */ >+ public void testAddParameter_3() throws Exception >+ { >+ Operation operation = getOperation(STOP_SERVER_OPERATION_NAME); >+ XSDElementDeclaration[] oldParams = WsdlUtils >+ .getOperationParams(operation); >+ assertNotNull(oldParams); >+ assertEquals(0, oldParams.length); >+ >+ String paramName = "serverVersion"; >+ DataType dataType = TestUtils.getDataType("int"); >+ InputParameter param = TestUtils >+ .createNewParameter(paramName, dataType); >+ >+ AddParameterCommand command = new AddParameterCommand(operation, param); >+ command.execute(); >+ >+ // Verify the new parameter >+ XSDElementDeclaration[] newParams = WsdlUtils >+ .getOperationParams(operation); >+ assertNotNull(newParams); >+ assertEquals(oldParams.length + 1, newParams.length); >+ >+ XSDElementDeclaration newParam = newParams[newParams.length - 1]; >+ assertEquals(param.getXSDElementDeclaration(), newParam); >+ } >+ >+ /** >+ * This will create a new parameter by passing the Complex data type. >+ * >+ * @throws Exception >+ */ >+ public void testAddParameter_4() throws Exception >+ { >+ Operation operation = getOperation(DEPLOY_APP_OPERATION_NAME); >+ XSDElementDeclaration[] oldParams = WsdlUtils >+ .getOperationParams(operation); >+ assertNotNull(oldParams); >+ >+ String paramName = "jvmVersion"; >+ // Get the complex type from some XSD >+ String xsdFilePath = Activator.PLUGIN_ID + "/" >+ + "testfiles/xsd/common.xsd"; >+ List complexTypes = TestUtils.getComplexTypes(xsdFilePath); >+ assertNotNull(complexTypes); >+ assertTrue(complexTypes.size() > 0); >+ XSDTypeDefinition complexType = (XSDTypeDefinition) complexTypes.get(0); >+ String typeName = XsdUtils.getType(complexType); >+ >+ DataType dataType = new DataType(typeName, complexType); >+ InputParameter param = TestUtils >+ .createNewParameter(paramName, dataType); >+ >+ AddParameterCommand command = new AddParameterCommand(operation, param); >+ command.execute(); >+ >+ // Verify the new parameter >+ XSDElementDeclaration[] newParams = WsdlUtils >+ .getOperationParams(operation); >+ assertNotNull(newParams); >+ assertEquals(oldParams.length + 1, newParams.length); >+ >+ XSDElementDeclaration newParam = newParams[newParams.length - 1]; >+ assertEquals(param.getXSDElementDeclaration(), newParam); >+ >+ // Verify the import element >+ String typeNS = newParam.getTypeDefinition().getTargetNamespace(); >+ XSDImport[] imports = XsdUtils.getAllXSDImports(newParam.getSchema()); >+ assertNotNull(imports); >+ assertTrue(imports.length > 0); >+ boolean found = false; >+ for (int i = 0; i < imports.length; i++) >+ { >+ if (imports[i].getNamespace().equals(typeNS)) >+ found = true; >+ } >+ if (!found) >+ throw new AssertionFailedError( >+ "XSD Import element not added while adding new parameter " >+ + "which has complex kind of data type"); >+ } > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeOperationNameCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeOperationNameCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangeOperationNameCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeOperationNameCommandTest.java 15 Sep 2006 15:20:21 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/ChangeOperationNameCommandTest.java 22 Jan 2007 09:34:28 -0000 >@@ -29,77 +29,77 @@ > */ > public class ChangeOperationNameCommandTest extends OperationCommandTestModel > { >- /** >- * Constructor for ChangeOperationNameCommandTest. >- * >- * @param name >- */ >- public ChangeOperationNameCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeOperationNameCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeOperationNameCommandTest = new HyadesTestSuite( >- "ChangeOperationNameCommandTest"); >- changeOperationNameCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C8E89291F2E4762C91E35FC0100511DB"); >- >- changeOperationNameCommandTest >- .addTest(new ChangeOperationNameCommandTest( >- "testChangeOperationName")); >- >- return changeOperationNameCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangeOperationName >- * >- * @throws Exception >- */ >- public void testChangeOperationName() throws Exception >- { >- List opList = capability.getOperations(); >- int totalOperations = opList.size(); >- assertNotNull(opList); >- assertTrue(totalOperations > 0); >- Object object = opList.get(0); >- assertTrue(object instanceof Operation); >- Operation operation = (Operation) object; >- String oldOpName = new String(operation.getName()); >- String newOpName = new String("Bar"); >- >- ChangeOperationNameCommand command = new ChangeOperationNameCommand( >- operation, newOpName); >- command.execute(); >+ /** >+ * Constructor for ChangeOperationNameCommandTest. >+ * >+ * @param name >+ */ >+ public ChangeOperationNameCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeOperationNameCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeOperationNameCommandTest = new HyadesTestSuite( >+ "ChangeOperationNameCommandTest"); >+ changeOperationNameCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C8E89291F2E4762C91E35FC0100511DB"); >+ >+ changeOperationNameCommandTest >+ .addTest(new ChangeOperationNameCommandTest( >+ "testChangeOperationName")); >+ >+ return changeOperationNameCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } > >- Operation[] operations = WsdlUtils.getWSDLOperation(definition); >- for (int i = 0; i < operations.length; i++) >+ /** >+ * testChangeOperationName >+ * >+ * @throws Exception >+ */ >+ public void testChangeOperationName() throws Exception > { >- if (operations[i].getName().equals(oldOpName)) >- throw new AssertionFailedError("Operation name " + oldOpName >- + " not changed properly"); >+ List opList = capability.getOperations(); >+ int totalOperations = opList.size(); >+ assertNotNull(opList); >+ assertTrue(totalOperations > 0); >+ Object object = opList.get(0); >+ assertTrue(object instanceof Operation); >+ Operation operation = (Operation) object; >+ String oldOpName = new String(operation.getName()); >+ String newOpName = new String("Bar"); >+ >+ ChangeOperationNameCommand command = new ChangeOperationNameCommand( >+ operation, newOpName); >+ command.execute(); >+ >+ Operation[] operations = WsdlUtils.getWSDLOperation(definition); >+ for (int i = 0; i < operations.length; i++) >+ { >+ if (operations[i].getName().equals(oldOpName)) >+ throw new AssertionFailedError("Operation name " + oldOpName >+ + " not changed properly"); >+ } > } >- } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveExceptionCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveExceptionCommandTest.java,v >retrieving revision 1.1 >diff -u -r1.1 RemoveExceptionCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveExceptionCommandTest.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/RemoveExceptionCommandTest.java 22 Jan 2007 09:34:29 -0000 >@@ -30,76 +30,76 @@ > */ > public class RemoveExceptionCommandTest extends OperationCommandTestModel > { >- /** >- * Constructor for RemoveExceptionCommandTest. >- * >- * @param name >- */ >- public RemoveExceptionCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>RemoveExceptionCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite removeExceptionCommandTest = new HyadesTestSuite( >- "RemoveExceptionCommandTest"); >- removeExceptionCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C254CB80544979D7FF7F38B042F511DB"); >- >- removeExceptionCommandTest.addTest(new RemoveExceptionCommandTest( >- "testRemoveException")); >- >- return removeExceptionCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testRemoveException >- * >- * @throws Exception >- */ >- public void testRemoveException() throws Exception >- { >- Operation operation = getOperation(STOP_SERVER_OPERATION_NAME); >- >- List faultList = operation.getEFaults(); >- assertNotNull(faultList); >- assertTrue(faultList.size() > 0); >- int oldFaultSizes = faultList.size(); >- >- Fault fault = (Fault) faultList.get(0); >- Message faultMessage = fault.getEMessage(); >- >- RemoveExceptionCommand command = new RemoveExceptionCommand( >- capabilityDomain, operation, fault); >- command.execute(); >- >- // Verify its removed properly >- List newFaultList = operation.getEFaults(); >- assertNotNull(newFaultList); >- assertEquals(oldFaultSizes - 1, newFaultList.size()); >- >- int index = capabilityDomain.getDefinition().getEMessages().indexOf( >- faultMessage); >- assertEquals(-1, index); >- } >+ /** >+ * Constructor for RemoveExceptionCommandTest. >+ * >+ * @param name >+ */ >+ public RemoveExceptionCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>RemoveExceptionCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite removeExceptionCommandTest = new HyadesTestSuite( >+ "RemoveExceptionCommandTest"); >+ removeExceptionCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C254CB80544979D7FF7F38B042F511DB"); >+ >+ removeExceptionCommandTest.addTest(new RemoveExceptionCommandTest( >+ "testRemoveException")); >+ >+ return removeExceptionCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testRemoveException >+ * >+ * @throws Exception >+ */ >+ public void testRemoveException() throws Exception >+ { >+ Operation operation = getOperation(STOP_SERVER_OPERATION_NAME); >+ >+ List faultList = operation.getEFaults(); >+ assertNotNull(faultList); >+ assertTrue(faultList.size() > 0); >+ int oldFaultSizes = faultList.size(); >+ >+ Fault fault = (Fault) faultList.get(0); >+ Message faultMessage = fault.getEMessage(); >+ >+ RemoveExceptionCommand command = new RemoveExceptionCommand( >+ capabilityDomain, operation, fault); >+ command.execute(); >+ >+ // Verify its removed properly >+ List newFaultList = operation.getEFaults(); >+ assertNotNull(newFaultList); >+ assertEquals(oldFaultSizes - 1, newFaultList.size()); >+ >+ int index = capabilityDomain.getCapability().getDefinition() >+ .getEMessages().indexOf(faultMessage); >+ assertEquals(-1, index); >+ } > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestOperation.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 NewTestOperation.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestOperation.java 15 Sep 2006 15:20:21 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestOperation.java 22 Jan 2007 09:34:28 -0000 >@@ -34,136 +34,136 @@ > public class NewTestOperation > { > >- private XSDSchema typesSchema; >+ private XSDSchema typesSchema; > >- private Definition definition; >+ private Definition definition; > >- public NewTestOperation(Definition definition) >- { >- this.definition = definition; >- this.typesSchema = WsdlUtils.getSchema(definition, definition >- .getTargetNamespace()); >- } >- >- public Operation getOperation() >- { >- Operation operation = WSDLFactory.eINSTANCE.createOperation(); >- operation.setName("Food"); >- operation.setEnclosingDefinition(definition); >- >- Input input = prepareOperationInput(); >- operation.setEInput(input); >- >- Output output = prepareOperationOutput(); >- operation.setEOutput(output); >- >- prepareFaultNS(); >- Fault fault = prepareOperationFault(); >- operation.addFault(fault); >- >- return operation; >- } >- >- private void prepareFaultNS() >- { >- String faultNS = "http://docs.oasis-open.org/wsrf/bf-2"; >- if (WsdlUtils.isNamespaceDefined(definition, faultNS)) >- return; >- definition.addNamespace("wsrf-bf", faultNS); >- } >- >- private Input prepareOperationInput() >- { >- Message inputMessage = prepareInputMessage(); >- >- Input input = WSDLFactory.eINSTANCE.createInput(); >- input.setName("FoodRequest"); >- input.setEnclosingDefinition(definition); >- input.setMessage(inputMessage); >- return input; >- } >- >- private Output prepareOperationOutput() >- { >- Message outputMessage = prepareOutputMessage(); >- >- Output output = WSDLFactory.eINSTANCE.createOutput(); >- output.setName("FoodResponse"); >- output.setEnclosingDefinition(definition); >- output.setMessage(outputMessage); >- return output; >- } >- >- private Fault prepareOperationFault() >- { >- Fault fault = WSDLFactory.eINSTANCE.createFault(); >- fault.setName("FoodFault"); >- fault.setEnclosingDefinition(definition); >- Message faultMessage = prepareFaultMessage(); >- fault.setMessage(faultMessage); >- return fault; >- } >- >- private Message prepareInputMessage() >- { >- XSDElementDeclaration inputParamHolderElement = TestUtils >- .createNewProperty(); >- return prepareMessage("FoodRequest", inputParamHolderElement); >- } >- >- private Message prepareOutputMessage() >- { >- XSDElementDeclaration outputParamHolderElement = TestUtils >- .createNewProperty(); >- return prepareMessage("FoodResponse", outputParamHolderElement); >- } >- >- private Message prepareFaultMessage() >- { >- XSDElementDeclaration faultElement = prepareFaultElement(); >- return prepareMessage("FoodFault", faultElement); >- } >- >- private Message prepareMessage(String name, >- XSDElementDeclaration elementDeclaration) >- { >- >- Part part = WSDLFactory.eINSTANCE.createPart(); >- part.setName(name); >- part.setElementName(new QName(elementDeclaration.getTargetNamespace(), >- elementDeclaration.getName())); >- part.setEnclosingDefinition(definition); >- ((PartImpl) part).reconcileReferences(false); >- >- Message message = WSDLFactory.eINSTANCE.createMessage(); >- message.setQName(new QName(definition.getTargetNamespace(), name)); >- message.setEnclosingDefinition(definition); >- message.addPart(part); >- definition.addMessage(message); >- >- return message; >- } >- >- private XSDElementDeclaration prepareFaultElement() >- { >- XSDElementDeclaration faultElement = XSDFactory.eINSTANCE >- .createXSDElementDeclaration(); >- faultElement.setName("FoodFault"); >- typesSchema.getContents().add(faultElement); >- >- XSDComplexTypeDefinition complexTypeDefinition = XSDFactory.eINSTANCE >- .createXSDComplexTypeDefinition(); >- complexTypeDefinition >- .setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL); >- XSDSimpleTypeDefinition simpleTypeDef = XSDFactory.eINSTANCE >- .createXSDSimpleTypeDefinition(); >- simpleTypeDef.setName("BaseFaultType"); >- simpleTypeDef >- .setTargetNamespace("http://docs.oasis-open.org/wsrf/bf-2"); >- complexTypeDefinition.setBaseTypeDefinition(simpleTypeDef); >- >- faultElement.setAnonymousTypeDefinition(complexTypeDefinition); >- return faultElement; >- } >+ public NewTestOperation(Definition definition) >+ { >+ this.definition = definition; >+ this.typesSchema = WsdlUtils.getSchema(definition, definition >+ .getTargetNamespace()); >+ } >+ >+ public Operation getOperation() >+ { >+ Operation operation = WSDLFactory.eINSTANCE.createOperation(); >+ operation.setName("Food"); >+ operation.setEnclosingDefinition(definition); >+ >+ Input input = prepareOperationInput(); >+ operation.setEInput(input); >+ >+ Output output = prepareOperationOutput(); >+ operation.setEOutput(output); >+ >+ prepareFaultNS(); >+ Fault fault = prepareOperationFault(); >+ operation.addFault(fault); >+ >+ return operation; >+ } >+ >+ private void prepareFaultNS() >+ { >+ String faultNS = "http://docs.oasis-open.org/wsrf/bf-2"; >+ if (WsdlUtils.isNamespaceDefined(definition, faultNS)) >+ return; >+ definition.addNamespace("wsrf-bf", faultNS); >+ } >+ >+ private Input prepareOperationInput() >+ { >+ Message inputMessage = prepareInputMessage(); >+ >+ Input input = WSDLFactory.eINSTANCE.createInput(); >+ input.setName("FoodRequest"); >+ input.setEnclosingDefinition(definition); >+ input.setMessage(inputMessage); >+ return input; >+ } >+ >+ private Output prepareOperationOutput() >+ { >+ Message outputMessage = prepareOutputMessage(); >+ >+ Output output = WSDLFactory.eINSTANCE.createOutput(); >+ output.setName("FoodResponse"); >+ output.setEnclosingDefinition(definition); >+ output.setMessage(outputMessage); >+ return output; >+ } >+ >+ private Fault prepareOperationFault() >+ { >+ Fault fault = WSDLFactory.eINSTANCE.createFault(); >+ fault.setName("FoodFault"); >+ fault.setEnclosingDefinition(definition); >+ Message faultMessage = prepareFaultMessage(); >+ fault.setMessage(faultMessage); >+ return fault; >+ } >+ >+ private Message prepareInputMessage() >+ { >+ XSDElementDeclaration inputParamHolderElement = TestUtils >+ .createNewProperty(); >+ return prepareMessage("FoodRequest", inputParamHolderElement); >+ } >+ >+ private Message prepareOutputMessage() >+ { >+ XSDElementDeclaration outputParamHolderElement = TestUtils >+ .createNewProperty(); >+ return prepareMessage("FoodResponse", outputParamHolderElement); >+ } >+ >+ private Message prepareFaultMessage() >+ { >+ XSDElementDeclaration faultElement = prepareFaultElement(); >+ return prepareMessage("FoodFault", faultElement); >+ } >+ >+ private Message prepareMessage(String name, >+ XSDElementDeclaration elementDeclaration) >+ { >+ >+ Part part = WSDLFactory.eINSTANCE.createPart(); >+ part.setName(name); >+ part.setElementName(new QName(elementDeclaration.getTargetNamespace(), >+ elementDeclaration.getName())); >+ part.setEnclosingDefinition(definition); >+ ((PartImpl) part).reconcileReferences(false); >+ >+ Message message = WSDLFactory.eINSTANCE.createMessage(); >+ message.setQName(new QName(definition.getTargetNamespace(), name)); >+ message.setEnclosingDefinition(definition); >+ message.addPart(part); >+ definition.addMessage(message); >+ >+ return message; >+ } >+ >+ private XSDElementDeclaration prepareFaultElement() >+ { >+ XSDElementDeclaration faultElement = XSDFactory.eINSTANCE >+ .createXSDElementDeclaration(); >+ faultElement.setName("FoodFault"); >+ typesSchema.getContents().add(faultElement); >+ >+ XSDComplexTypeDefinition complexTypeDefinition = XSDFactory.eINSTANCE >+ .createXSDComplexTypeDefinition(); >+ complexTypeDefinition >+ .setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL); >+ XSDSimpleTypeDefinition simpleTypeDef = XSDFactory.eINSTANCE >+ .createXSDSimpleTypeDefinition(); >+ simpleTypeDef.setName("BaseFaultType"); >+ simpleTypeDef >+ .setTargetNamespace("http://docs.oasis-open.org/wsrf/bf-2"); >+ complexTypeDefinition.setBaseTypeDefinition(simpleTypeDef); >+ >+ faultElement.setAnonymousTypeDefinition(complexTypeDefinition); >+ return faultElement; >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestException.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestException.java,v >retrieving revision 1.1 >diff -u -r1.1 NewTestException.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestException.java 15 Sep 2006 15:20:21 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/NewTestException.java 22 Jan 2007 09:34:28 -0000 >@@ -31,67 +31,67 @@ > > public class NewTestException > { >- private Definition _definition; >+ private Definition _definition; > >- private Operation _operation; >+ private Operation _operation; > >- public NewTestException(Definition definition, Operation operation) >- { >- _definition = definition; >- _operation = operation; >- } >- >- public Fault getFault() >- { >- return createBaseFaultFault(); >- } >- >- private Fault createBaseFaultFault() >- { >- Fault fault = WSDLFactory.eINSTANCE.createFault(); >- fault.setName(_operation.getName() + "Fault"); >- fault.setEnclosingDefinition(_definition); >- >- Message faultMessage = WSDLFactory.eINSTANCE.createMessage(); >- faultMessage.setQName(new QName(_definition.getTargetNamespace(), >- _operation.getName() + "Fault")); >- faultMessage.setEnclosingDefinition(_definition); >- >- Part faultPart = WSDLFactory.eINSTANCE.createPart(); >- faultPart.setName(_operation.getName() + "Fault"); >- faultPart.setEnclosingDefinition(_definition); >- XSDElementDeclaration faultElement = createBaseFaultElement(); >- faultPart.setElementDeclaration(faultElement); >- >- faultMessage.addPart(faultPart); >- >- fault.setEMessage(faultMessage); >- >- return fault; >- } >- >- private XSDElementDeclaration createBaseFaultElement() >- { >- XSDSchema typesSchema = WsdlUtils.getSchema(_definition, _definition >- .getTargetNamespace()); >- >- XSDElementDeclaration faultElement = XSDFactory.eINSTANCE >- .createXSDElementDeclaration(); >- faultElement.setName(_operation.getName() + "Fault"); >- typesSchema.getContents().add(faultElement); >- >- XSDComplexTypeDefinition complexTypeDefinition = XSDFactory.eINSTANCE >- .createXSDComplexTypeDefinition(); >- complexTypeDefinition >- .setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL); >- XSDSimpleTypeDefinition simpleTypeDef = XSDFactory.eINSTANCE >- .createXSDSimpleTypeDefinition(); >- simpleTypeDef.setName("BaseFaultType"); >- simpleTypeDef.setTargetNamespace(WsdmConstants.WSBF_NS); >- complexTypeDefinition.setBaseTypeDefinition(simpleTypeDef); >- >- faultElement.setAnonymousTypeDefinition(complexTypeDefinition); >- return faultElement; >- } >+ public NewTestException(Definition definition, Operation operation) >+ { >+ _definition = definition; >+ _operation = operation; >+ } >+ >+ public Fault getFault() >+ { >+ return createBaseFaultFault(); >+ } >+ >+ private Fault createBaseFaultFault() >+ { >+ Fault fault = WSDLFactory.eINSTANCE.createFault(); >+ fault.setName(_operation.getName() + "Fault"); >+ fault.setEnclosingDefinition(_definition); >+ >+ Message faultMessage = WSDLFactory.eINSTANCE.createMessage(); >+ faultMessage.setQName(new QName(_definition.getTargetNamespace(), >+ _operation.getName() + "Fault")); >+ faultMessage.setEnclosingDefinition(_definition); >+ >+ Part faultPart = WSDLFactory.eINSTANCE.createPart(); >+ faultPart.setName(_operation.getName() + "Fault"); >+ faultPart.setEnclosingDefinition(_definition); >+ XSDElementDeclaration faultElement = createBaseFaultElement(); >+ faultPart.setElementDeclaration(faultElement); >+ >+ faultMessage.addPart(faultPart); >+ >+ fault.setEMessage(faultMessage); >+ >+ return fault; >+ } >+ >+ private XSDElementDeclaration createBaseFaultElement() >+ { >+ XSDSchema typesSchema = WsdlUtils.getSchema(_definition, _definition >+ .getTargetNamespace()); >+ >+ XSDElementDeclaration faultElement = XSDFactory.eINSTANCE >+ .createXSDElementDeclaration(); >+ faultElement.setName(_operation.getName() + "Fault"); >+ typesSchema.getContents().add(faultElement); >+ >+ XSDComplexTypeDefinition complexTypeDefinition = XSDFactory.eINSTANCE >+ .createXSDComplexTypeDefinition(); >+ complexTypeDefinition >+ .setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL); >+ XSDSimpleTypeDefinition simpleTypeDef = XSDFactory.eINSTANCE >+ .createXSDSimpleTypeDefinition(); >+ simpleTypeDef.setName("BaseFaultType"); >+ simpleTypeDef.setTargetNamespace(WsdmConstants.WSBF_NS); >+ complexTypeDefinition.setBaseTypeDefinition(simpleTypeDef); >+ >+ faultElement.setAnonymousTypeDefinition(complexTypeDefinition); >+ return faultElement; >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyTypeCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyTypeCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangePropertyTypeCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyTypeCommandTest.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyTypeCommandTest.java 22 Jan 2007 09:34:31 -0000 >@@ -28,67 +28,67 @@ > */ > public class ChangePropertyTypeCommandTest extends PropertyCommandTestModel > { >- /** >- * Constructor for ChangePropertyTypeCommandTest. >- * >- * @param name >- */ >- public ChangePropertyTypeCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangePropertyTypeCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changePropertyTypeCommandTest = new HyadesTestSuite( >- "ChangePropertyTypeCommandTest"); >- changePropertyTypeCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C8E89291F2E4762CF6038DB00FEF11DB"); >- >- changePropertyTypeCommandTest >- .addTest(new ChangePropertyTypeCommandTest( >- "testChangePropertyType")); >- >- return changePropertyTypeCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangePropertyType >- * >- * @throws Exception >- */ >- public void testChangePropertyType() throws Exception >- { >- Property property = (Property) capability.getProperties().get(0); >- DataType newDataType = TestUtils.getDataType("int"); >- String newType = newDataType.getTypeName(); >- >- ChangePropertyTypeCommand command = new ChangePropertyTypeCommand( >- capabilityDomain, property, newDataType); >- command.execute(); >+ /** >+ * Constructor for ChangePropertyTypeCommandTest. >+ * >+ * @param name >+ */ >+ public ChangePropertyTypeCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangePropertyTypeCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changePropertyTypeCommandTest = new HyadesTestSuite( >+ "ChangePropertyTypeCommandTest"); >+ changePropertyTypeCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C8E89291F2E4762CF6038DB00FEF11DB"); >+ >+ changePropertyTypeCommandTest >+ .addTest(new ChangePropertyTypeCommandTest( >+ "testChangePropertyType")); >+ >+ return changePropertyTypeCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangePropertyType >+ * >+ * @throws Exception >+ */ >+ public void testChangePropertyType() throws Exception >+ { >+ Property property = (Property) capability.getProperties().get(0); >+ DataType newDataType = TestUtils.getDataType("int"); >+ String newType = newDataType.getTypeName(); >+ >+ ChangePropertyTypeCommand command = new ChangePropertyTypeCommand( >+ capabilityDomain, property, newDataType); >+ command.execute(); > >- String changedType = XsdUtils.getType(property.getElement()); >- assertEquals(newType, changedType); >+ String changedType = XsdUtils.getType(property.getElement()); >+ assertEquals(newType, changedType); > >- } >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyNameCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyNameCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangePropertyNameCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyNameCommandTest.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyNameCommandTest.java 22 Jan 2007 09:34:31 -0000 >@@ -27,78 +27,78 @@ > */ > public class ChangePropertyNameCommandTest extends PropertyCommandTestModel > { >- /** >- * Constructor for ChangePropertyNameCommandTest. >- * >- * @param name >- */ >- public ChangePropertyNameCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangePropertyNameCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changePropertyNameCommandTest = new HyadesTestSuite( >- "ChangePropertyNameCommandTest"); >- changePropertyNameCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C8E89291F2E4762CE093B7B00FEB11DB"); >- >- changePropertyNameCommandTest >- .addTest(new ChangePropertyNameCommandTest( >- "testChangePropertyName")); >- >- return changePropertyNameCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangePropertyName >- * >- * @throws Exception >- */ >- public void testChangePropertyName() throws Exception >- { >- Property property = (Property) capability.getProperties().get(0); >- XSDElementDeclaration propertyRef = getPropertyRef(property >- .getElement()); >- String oldName = new String(XsdUtils.getName(property.getElement())); >- String newName = "newProperty"; >- >- ChangePropertyNameCommand command = new ChangePropertyNameCommand( >- capabilityDomain, property, newName); >- command.execute(); >- >- XSDElementDeclaration oldProperty = XsdUtils >- .getXSDElementDeclarationOfName(propSchema, oldName); >- assertNull(oldProperty); >- >- XSDElementDeclaration changedProperty = XsdUtils >- .getXSDElementDeclarationOfName(propSchema, newName); >- assertNotNull(changedProperty); >- assertEquals(changedProperty.getName(), newName); >- >- XSDElementDeclaration changedPropertyResolvedElement = propertyRef >- .getResolvedElementDeclaration(); >- assertEquals(changedProperty, changedPropertyResolvedElement); >+ /** >+ * Constructor for ChangePropertyNameCommandTest. >+ * >+ * @param name >+ */ >+ public ChangePropertyNameCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangePropertyNameCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changePropertyNameCommandTest = new HyadesTestSuite( >+ "ChangePropertyNameCommandTest"); >+ changePropertyNameCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C8E89291F2E4762CE093B7B00FEB11DB"); >+ >+ changePropertyNameCommandTest >+ .addTest(new ChangePropertyNameCommandTest( >+ "testChangePropertyName")); >+ >+ return changePropertyNameCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangePropertyName >+ * >+ * @throws Exception >+ */ >+ public void testChangePropertyName() throws Exception >+ { >+ Property property = (Property) capability.getProperties().get(0); >+ XSDElementDeclaration propertyRef = getPropertyRef(property >+ .getElement()); >+ String oldName = new String(XsdUtils.getName(property.getElement())); >+ String newName = "newProperty"; >+ >+ ChangePropertyNameCommand command = new ChangePropertyNameCommand( >+ capabilityDomain, property, newName); >+ command.execute(); >+ >+ XSDElementDeclaration oldProperty = XsdUtils >+ .getXSDElementDeclarationOfName(propSchema, oldName); >+ assertNull(oldProperty); >+ >+ XSDElementDeclaration changedProperty = XsdUtils >+ .getXSDElementDeclarationOfName(propSchema, newName); >+ assertNotNull(changedProperty); >+ assertEquals(changedProperty.getName(), newName); >+ >+ XSDElementDeclaration changedPropertyResolvedElement = propertyRef >+ .getResolvedElementDeclaration(); >+ assertEquals(changedProperty, changedPropertyResolvedElement); > >- } >+ } > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangeModifiabilityCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangeModifiabilityCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangeModifiabilityCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangeModifiabilityCommandTest.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangeModifiabilityCommandTest.java 22 Jan 2007 09:34:30 -0000 >@@ -15,7 +15,6 @@ > > import junit.framework.Test; > >-import org.eclipse.emf.ecore.xml.type.internal.QName; > import org.eclipse.hyades.test.common.junit.DefaultTestArbiter; > import org.eclipse.hyades.test.common.junit.HyadesTestSuite; > import org.eclipse.tptp.wsdm.tooling.editor.capability.command.property.internal.ChangeModifiabilityCommand; >@@ -32,77 +31,77 @@ > */ > public class ChangeModifiabilityCommandTest extends PropertyCommandTestModel > { >- /** >- * Constructor for ChangeModifiabilityCommandTest. >- * >- * @param name >- */ >- public ChangeModifiabilityCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeModifiabilityCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeModifiabilityCommandTest = new HyadesTestSuite( >- "ChangeModifiabilityCommandTest"); >- changeModifiabilityCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C8E89291F2E4762C34F48DF00FF811DB"); >- >- changeModifiabilityCommandTest >- .addTest(new ChangeModifiabilityCommandTest( >- "testChangeModifiability")); >- >- return changeModifiabilityCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangeModifiability >- * >- * @throws Exception >- */ >- public void testChangeModifiability() throws Exception >- { >- List properties = capability.getProperties(); >- assertNotNull(properties); >- assertTrue(properties.size() > 0); >- Object object = properties.get(0); >- assertTrue(object instanceof Property); >- Property property = (Property) object; >- PropertyType metadata = property.getMetaData(); >- assertNotNull(metadata.getModifiability()); >- assertEquals(MetaDataUtils.READ_ONLY, metadata.getModifiability() >- .getLiteral()); >- QName propName = (QName) metadata.getName(); >- >- ChangeModifiabilityCommand command = new ChangeModifiabilityCommand( >- capabilityDomain, property, MetaDataUtils.WRITABLE); >- command.execute(); >- >- PropertyType changedMetadata = TestUtils.getPropertyType(capability, >- propName); >- assertNotNull(changedMetadata); >- assertEquals(MetaDataUtils.WRITABLE, changedMetadata.getModifiability() >- .getLiteral()); >+ /** >+ * Constructor for ChangeModifiabilityCommandTest. >+ * >+ * @param name >+ */ >+ public ChangeModifiabilityCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeModifiabilityCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeModifiabilityCommandTest = new HyadesTestSuite( >+ "ChangeModifiabilityCommandTest"); >+ changeModifiabilityCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C8E89291F2E4762C34F48DF00FF811DB"); >+ >+ changeModifiabilityCommandTest >+ .addTest(new ChangeModifiabilityCommandTest( >+ "testChangeModifiability")); >+ >+ return changeModifiabilityCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangeModifiability >+ * >+ * @throws Exception >+ */ >+ public void testChangeModifiability() throws Exception >+ { >+ List properties = capability.getProperties(); >+ assertNotNull(properties); >+ assertTrue(properties.size() > 0); >+ Object object = properties.get(0); >+ assertTrue(object instanceof Property); >+ Property property = (Property) object; >+ PropertyType metadata = property.getMetaData(); >+ assertNotNull(metadata.getModifiability()); >+ assertEquals(MetaDataUtils.READ_ONLY, metadata.getModifiability() >+ .getLiteral()); >+ String propName = metadata.getName(); >+ >+ ChangeModifiabilityCommand command = new ChangeModifiabilityCommand( >+ capabilityDomain, property, MetaDataUtils.WRITABLE); >+ command.execute(); >+ >+ PropertyType changedMetadata = TestUtils.getPropertyType(capability, >+ propName); >+ assertNotNull(changedMetadata); >+ assertEquals(MetaDataUtils.WRITABLE, changedMetadata.getModifiability() >+ .getLiteral()); > >- } >+ } > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/RemovePropertyCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/RemovePropertyCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 RemovePropertyCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/RemovePropertyCommandTest.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/RemovePropertyCommandTest.java 22 Jan 2007 09:34:31 -0000 >@@ -29,83 +29,83 @@ > */ > public class RemovePropertyCommandTest extends PropertyCommandTestModel > { >- /** >- * Constructor for RemovePropertyCommandTest. >- * >- * @param name >- */ >- public RemovePropertyCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>RemovePropertyCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite removePropertyCommandTest = new HyadesTestSuite( >- "RemovePropertyCommandTest"); >- removePropertyCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C8E89291F2E4762CC48CE9400FE811DB"); >- >- removePropertyCommandTest.addTest(new RemovePropertyCommandTest( >- "testRemoveProperty")); >- >- return removePropertyCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testRemoveProperty >- * >- * @throws Exception >- */ >- public void testRemoveProperty() throws Exception >- { >- XSDElementDeclaration[] oldWSDLProperties = CapUtils >- .getResolvedProperties(definition, resourcePropertyElement); >- XSDElementDeclaration[] oldXSDProperties = TestUtils >- .getXSDElementDeclarations(propSchema); >- Property property = (Property) capability.getProperties().get(0); >- String propName = new String(XsdUtils.getName(property.getElement())); >- >- RemovePropertyCommand command = new RemovePropertyCommand( >- capabilityDomain, property); >- command.execute(); >- >- XSDElementDeclaration[] newWSDLProperties = CapUtils >- .getResolvedProperties(definition, resourcePropertyElement); >- XSDElementDeclaration[] newXSDProperties = TestUtils >- .getXSDElementDeclarations(propSchema); >- >- assertNotNull(definition); >- assertNotNull(resourcePropertyElement); >- assertNotNull(propSchema); >- assertTrue(newWSDLProperties.length == oldWSDLProperties.length - 1); >- assertTrue(newXSDProperties.length == oldXSDProperties.length - 1); >- >- XSDElementDeclaration deletedProp = XsdUtils >- .getXSDElementDeclarationOfName(propSchema, propName); >- assertNull(deletedProp); >- XSDElementDeclaration propRef = getPropertyRef(property.getElement()); >- assertNull(propRef); >+ /** >+ * Constructor for RemovePropertyCommandTest. >+ * >+ * @param name >+ */ >+ public RemovePropertyCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>RemovePropertyCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite removePropertyCommandTest = new HyadesTestSuite( >+ "RemovePropertyCommandTest"); >+ removePropertyCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C8E89291F2E4762CC48CE9400FE811DB"); >+ >+ removePropertyCommandTest.addTest(new RemovePropertyCommandTest( >+ "testRemoveProperty")); >+ >+ return removePropertyCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testRemoveProperty >+ * >+ * @throws Exception >+ */ >+ public void testRemoveProperty() throws Exception >+ { >+ XSDElementDeclaration[] oldWSDLProperties = CapUtils >+ .getResolvedProperties(definition, resourcePropertyElement); >+ XSDElementDeclaration[] oldXSDProperties = TestUtils >+ .getXSDElementDeclarations(propSchema); >+ Property property = (Property) capability.getProperties().get(0); >+ String propName = new String(XsdUtils.getName(property.getElement())); >+ >+ RemovePropertyCommand command = new RemovePropertyCommand( >+ capabilityDomain, property); >+ command.execute(); >+ >+ XSDElementDeclaration[] newWSDLProperties = CapUtils >+ .getResolvedProperties(definition, resourcePropertyElement); >+ XSDElementDeclaration[] newXSDProperties = TestUtils >+ .getXSDElementDeclarations(propSchema); >+ >+ assertNotNull(definition); >+ assertNotNull(resourcePropertyElement); >+ assertNotNull(propSchema); >+ assertTrue(newWSDLProperties.length == oldWSDLProperties.length - 1); >+ assertTrue(newXSDProperties.length == oldXSDProperties.length - 1); >+ >+ XSDElementDeclaration deletedProp = XsdUtils >+ .getXSDElementDeclarationOfName(propSchema, propName); >+ assertNull(deletedProp); >+ XSDElementDeclaration propRef = getPropertyRef(property.getElement()); >+ assertNull(propRef); > >- } >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyNameMetaDataCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyNameMetaDataCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangePropertyNameMetaDataCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyNameMetaDataCommandTest.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyNameMetaDataCommandTest.java 22 Jan 2007 09:34:31 -0000 >@@ -15,7 +15,6 @@ > > import junit.framework.Test; > >-import org.eclipse.emf.ecore.xml.type.internal.QName; > import org.eclipse.hyades.test.common.junit.DefaultTestArbiter; > import org.eclipse.hyades.test.common.junit.HyadesTestSuite; > import org.eclipse.tptp.wsdm.tooling.editor.capability.command.property.internal.ChangePropertyNameMetaDataCommand; >@@ -30,80 +29,78 @@ > * > */ > public class ChangePropertyNameMetaDataCommandTest extends >- PropertyCommandTestModel >+ PropertyCommandTestModel > { >- /** >- * Constructor for ChangePropertyNameMetaDataCommandTest. >- * >- * @param name >- */ >- public ChangePropertyNameMetaDataCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangePropertyNameMetaDataCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changePropertyNameMetaDataCommandTest = new HyadesTestSuite( >- "ChangePropertyNameMetaDataCommandTest"); >- changePropertyNameMetaDataCommandTest.setArbiter( >- DefaultTestArbiter.INSTANCE).setId( >- "C8E89291F2E4762CA3FD9CC00FF611DB"); >- >- changePropertyNameMetaDataCommandTest >- .addTest(new ChangePropertyNameMetaDataCommandTest( >- "testChangePropertyNameMetaData")); >- >- return changePropertyNameMetaDataCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangePropertyNameMetaData >- * >- * @throws Exception >- */ >- public void testChangePropertyNameMetaData() throws Exception >- { >- List properties = capability.getProperties(); >- assertNotNull(properties); >- assertTrue(properties.size() > 0); >- Object object = properties.get(0); >- assertTrue(object instanceof Property); >- Property property = (Property) object; >- PropertyType metadata = property.getMetaData(); >- assertNotNull(metadata.getName()); >- QName propName = (QName) metadata.getName(); >- QName oldPropName = new QName(propName.getNamespaceURI(), propName >- .getLocalPart(), propName.getPrefix()); >- String newPropertyName = "dummy"; >- >- ChangePropertyNameMetaDataCommand command = new ChangePropertyNameMetaDataCommand( >- capabilityDomain, property, newPropertyName); >- command.execute(); >- >- assertNull(TestUtils.getPropertyType(capability, oldPropName >- .getLocalPart())); >- assertNotNull(TestUtils.getPropertyType(capability, newPropertyName)); >+ /** >+ * Constructor for ChangePropertyNameMetaDataCommandTest. >+ * >+ * @param name >+ */ >+ public ChangePropertyNameMetaDataCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangePropertyNameMetaDataCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changePropertyNameMetaDataCommandTest = new HyadesTestSuite( >+ "ChangePropertyNameMetaDataCommandTest"); >+ changePropertyNameMetaDataCommandTest.setArbiter( >+ DefaultTestArbiter.INSTANCE).setId( >+ "C8E89291F2E4762CA3FD9CC00FF611DB"); >+ >+ changePropertyNameMetaDataCommandTest >+ .addTest(new ChangePropertyNameMetaDataCommandTest( >+ "testChangePropertyNameMetaData")); >+ >+ return changePropertyNameMetaDataCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangePropertyNameMetaData >+ * >+ * @throws Exception >+ */ >+ public void testChangePropertyNameMetaData() throws Exception >+ { >+ List properties = capability.getProperties(); >+ assertNotNull(properties); >+ assertTrue(properties.size() > 0); >+ Object object = properties.get(0); >+ assertTrue(object instanceof Property); >+ Property property = (Property) object; >+ PropertyType metadata = property.getMetaData(); >+ assertNotNull(metadata.getName()); >+ String propQName = metadata.getName(); >+ String oldPropQName = new String(propQName); >+ String newPropertyName = "dummy"; >+ >+ ChangePropertyNameMetaDataCommand command = new ChangePropertyNameMetaDataCommand( >+ capabilityDomain, property, newPropertyName); >+ command.execute(); > >- } >+ assertNull(TestUtils.getPropertyType(capability, oldPropQName)); >+ assertNotNull(TestUtils.getPropertyType(capability, newPropertyName)); >+ >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/PropertyCommandTestModel.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/PropertyCommandTestModel.java,v >retrieving revision 1.1 >diff -u -r1.1 PropertyCommandTestModel.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/PropertyCommandTestModel.java 15 Sep 2006 15:20:22 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/PropertyCommandTestModel.java 22 Jan 2007 09:34:31 -0000 >@@ -17,15 +17,15 @@ > > public class PropertyCommandTestModel extends CapabilityTestModel > { >- public PropertyCommandTestModel(String name) >- { >- this(name, Activator.PLUGIN_ID + "/" >- + "testfiles/capability/command/property/AppServer.mcap"); >- } >+ public PropertyCommandTestModel(String name) >+ { >+ this(name, Activator.PLUGIN_ID + "/" >+ + "testfiles/capability/command/property/AppServer.mcap"); >+ } > >- public PropertyCommandTestModel(String name, String CapabilityIFilePath) >- { >- super(name, CapabilityIFilePath); >- } >+ public PropertyCommandTestModel(String name, String CapabilityIFilePath) >+ { >+ super(name, CapabilityIFilePath); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/AllPropertyCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/AllPropertyCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 AllPropertyCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/AllPropertyCommandTest.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/AllPropertyCommandTest.java 22 Jan 2007 09:34:30 -0000 >@@ -24,66 +24,66 @@ > */ > public class AllPropertyCommandTest extends HyadesTestCase > { >- /** >- * Constructor for AllPropertyCommandTest. >- * >- * @param name >- */ >- public AllPropertyCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AllPropertyCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite allPropertyCommandTest = new HyadesTestSuite( >- "AllPropertyCommandTest"); >- allPropertyCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C8E89291F2E4762C427C86B00FEB11DB"); >- >- allPropertyCommandTest.addTest(HyadesJUnitRunner >- .getTest(AddPropertyCommandTest.class)); >- >- allPropertyCommandTest.addTest(HyadesJUnitRunner >- .getTest(RemovePropertyCommandTest.class)); >- >- allPropertyCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangePropertyNameCommandTest.class)); >- >- allPropertyCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangePropertyTypeCommandTest.class)); >- >- allPropertyCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangePropertyCardinalityCommandTest.class)); >- >- allPropertyCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangePropertyNameMetaDataCommandTest.class)); >- >- allPropertyCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeModifiabilityCommandTest.class)); >- >- allPropertyCommandTest.addTest(HyadesJUnitRunner >- .getTest(ChangeMutabilityCommandTest.class)); >- >- return allPropertyCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >+ /** >+ * Constructor for AllPropertyCommandTest. >+ * >+ * @param name >+ */ >+ public AllPropertyCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>AllPropertyCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite allPropertyCommandTest = new HyadesTestSuite( >+ "AllPropertyCommandTest"); >+ allPropertyCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C8E89291F2E4762C427C86B00FEB11DB"); >+ >+ allPropertyCommandTest.addTest(HyadesJUnitRunner >+ .getTest(AddPropertyCommandTest.class)); >+ >+ allPropertyCommandTest.addTest(HyadesJUnitRunner >+ .getTest(RemovePropertyCommandTest.class)); >+ >+ allPropertyCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangePropertyNameCommandTest.class)); >+ >+ allPropertyCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangePropertyTypeCommandTest.class)); >+ >+ allPropertyCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangePropertyCardinalityCommandTest.class)); >+ >+ allPropertyCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangePropertyNameMetaDataCommandTest.class)); >+ >+ allPropertyCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeModifiabilityCommandTest.class)); >+ >+ allPropertyCommandTest.addTest(HyadesJUnitRunner >+ .getTest(ChangeMutabilityCommandTest.class)); >+ >+ return allPropertyCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyCardinalityCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyCardinalityCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangePropertyCardinalityCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyCardinalityCommandTest.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangePropertyCardinalityCommandTest.java 22 Jan 2007 09:34:31 -0000 >@@ -26,75 +26,75 @@ > * <i>/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/property/command/ChangePropertyCardinalityCommandTest.testsuite</i>. > */ > public class ChangePropertyCardinalityCommandTest extends >- PropertyCommandTestModel >+ PropertyCommandTestModel > { >- /** >- * Constructor for ChangePropertyCardinalityCommandTest. >- * >- * @param name >- */ >- public ChangePropertyCardinalityCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangePropertyCardinalityCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changePropertyCardinalityCommandTest = new HyadesTestSuite( >- "ChangePropertyCardinalityCommandTest"); >- changePropertyCardinalityCommandTest.setArbiter( >- DefaultTestArbiter.INSTANCE).setId( >- "C8E89291F2E4762CF90DC3A00FF311DB"); >- >- changePropertyCardinalityCommandTest >- .addTest(new ChangePropertyCardinalityCommandTest( >- "testChangePropertyCardinality")); >- >- return changePropertyCardinalityCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangePropertyCardinality >- * >- * @throws Exception >- */ >- public void testChangePropertyCardinality() throws Exception >- { >- Property property = (Property) capability.getProperties().get(0); >- int minoccurs = 5; >- int maxoccurs = 10; >- >- ChangePropertyCardinalityCommand command = new ChangePropertyCardinalityCommand( >- capabilityDomain, property, minoccurs, maxoccurs); >- command.execute(); >- >- XSDElementDeclaration propertyRef = getPropertyRef(property >- .getElement()); >- assertNotNull(propertyRef); >- assertTrue(propertyRef.eContainer() instanceof XSDParticle); >- XSDParticle xsdParticle = (XSDParticle) propertyRef.eContainer(); >- assertEquals(minoccurs, xsdParticle.getMinOccurs()); >- assertEquals(maxoccurs, xsdParticle.getMaxOccurs()); >+ /** >+ * Constructor for ChangePropertyCardinalityCommandTest. >+ * >+ * @param name >+ */ >+ public ChangePropertyCardinalityCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangePropertyCardinalityCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changePropertyCardinalityCommandTest = new HyadesTestSuite( >+ "ChangePropertyCardinalityCommandTest"); >+ changePropertyCardinalityCommandTest.setArbiter( >+ DefaultTestArbiter.INSTANCE).setId( >+ "C8E89291F2E4762CF90DC3A00FF311DB"); >+ >+ changePropertyCardinalityCommandTest >+ .addTest(new ChangePropertyCardinalityCommandTest( >+ "testChangePropertyCardinality")); >+ >+ return changePropertyCardinalityCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangePropertyCardinality >+ * >+ * @throws Exception >+ */ >+ public void testChangePropertyCardinality() throws Exception >+ { >+ Property property = (Property) capability.getProperties().get(0); >+ int minoccurs = 5; >+ int maxoccurs = 10; >+ >+ ChangePropertyCardinalityCommand command = new ChangePropertyCardinalityCommand( >+ capabilityDomain, property, minoccurs, maxoccurs); >+ command.execute(); >+ >+ XSDElementDeclaration propertyRef = getPropertyRef(property >+ .getElement()); >+ assertNotNull(propertyRef); >+ assertTrue(propertyRef.eContainer() instanceof XSDParticle); >+ XSDParticle xsdParticle = (XSDParticle) propertyRef.eContainer(); >+ assertEquals(minoccurs, xsdParticle.getMinOccurs()); >+ assertEquals(maxoccurs, xsdParticle.getMaxOccurs()); > >- } >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangeMutabilityCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangeMutabilityCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangeMutabilityCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangeMutabilityCommandTest.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/ChangeMutabilityCommandTest.java 22 Jan 2007 09:34:31 -0000 >@@ -15,7 +15,6 @@ > > import junit.framework.Test; > >-import org.eclipse.emf.ecore.xml.type.internal.QName; > import org.eclipse.hyades.test.common.junit.DefaultTestArbiter; > import org.eclipse.hyades.test.common.junit.HyadesTestSuite; > import org.eclipse.tptp.wsdm.tooling.editor.capability.command.property.internal.ChangeMutabilityCommand; >@@ -31,76 +30,76 @@ > */ > public class ChangeMutabilityCommandTest extends PropertyCommandTestModel > { >- /** >- * Constructor for ChangeMutabilityCommandTest. >- * >- * @param name >- */ >- public ChangeMutabilityCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>ChangeMutabilityCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite changeMutabilityCommandTest = new HyadesTestSuite( >- "ChangeMutabilityCommandTest"); >- changeMutabilityCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >- .setId("C8E89291F2E4762C6FB72AF00FF911DB"); >- >- changeMutabilityCommandTest.addTest(new ChangeMutabilityCommandTest( >- "testChangeMutability")); >- >- return changeMutabilityCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testChangeMutability >- * >- * @throws Exception >- */ >- public void testChangeMutability() throws Exception >- { >- List properties = capability.getProperties(); >- assertNotNull(properties); >- assertTrue(properties.size() > 0); >- Object object = properties.get(0); >- assertTrue(object instanceof Property); >- Property property = (Property) object; >- PropertyType metadata = property.getMetaData(); >- assertNotNull(metadata.getMutability()); >- assertEquals(MetaDataUtils.CONSTANT, metadata.getMutability() >- .getLiteral()); >- QName propName = (QName) metadata.getName(); >- >- ChangeMutabilityCommand command = new ChangeMutabilityCommand( >- capabilityDomain, property, MetaDataUtils.MUTABLE); >- command.execute(); >- >- PropertyType changedMetadata = TestUtils.getPropertyType(capability, >- propName); >- assertNotNull(changedMetadata); >- assertEquals(MetaDataUtils.MUTABLE, changedMetadata.getMutability() >- .getLiteral()); >- } >+ /** >+ * Constructor for ChangeMutabilityCommandTest. >+ * >+ * @param name >+ */ >+ public ChangeMutabilityCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>ChangeMutabilityCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite changeMutabilityCommandTest = new HyadesTestSuite( >+ "ChangeMutabilityCommandTest"); >+ changeMutabilityCommandTest.setArbiter(DefaultTestArbiter.INSTANCE) >+ .setId("C8E89291F2E4762C6FB72AF00FF911DB"); >+ >+ changeMutabilityCommandTest.addTest(new ChangeMutabilityCommandTest( >+ "testChangeMutability")); >+ >+ return changeMutabilityCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testChangeMutability >+ * >+ * @throws Exception >+ */ >+ public void testChangeMutability() throws Exception >+ { >+ List properties = capability.getProperties(); >+ assertNotNull(properties); >+ assertTrue(properties.size() > 0); >+ Object object = properties.get(0); >+ assertTrue(object instanceof Property); >+ Property property = (Property) object; >+ PropertyType metadata = property.getMetaData(); >+ assertNotNull(metadata.getMutability()); >+ assertEquals(MetaDataUtils.CONSTANT, metadata.getMutability() >+ .getLiteral()); >+ String propName = metadata.getName(); >+ >+ ChangeMutabilityCommand command = new ChangeMutabilityCommand( >+ capabilityDomain, property, MetaDataUtils.MUTABLE); >+ command.execute(); >+ >+ PropertyType changedMetadata = TestUtils.getPropertyType(capability, >+ propName); >+ assertNotNull(changedMetadata); >+ assertEquals(MetaDataUtils.MUTABLE, changedMetadata.getMutability() >+ .getLiteral()); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/AddPropertyCommandTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/AddPropertyCommandTest.java,v >retrieving revision 1.2 >diff -u -r1.2 AddPropertyCommandTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/AddPropertyCommandTest.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/property/AddPropertyCommandTest.java 22 Jan 2007 09:34:30 -0000 >@@ -27,84 +27,84 @@ > */ > public class AddPropertyCommandTest extends PropertyCommandTestModel > { >- /** >- * Constructor for AddPropertyCommandTest. >- * >- * @param name >- */ >- public AddPropertyCommandTest(String name) >- { >- super(name); >- } >- >- /** >- * Returns the JUnit test suite that implements the >- * <b>AddPropertyCommandTest</b> definition. >- */ >- public static Test suite() >- { >- HyadesTestSuite addPropertyCommandTest = new HyadesTestSuite( >- "AddPropertyCommandTest"); >- addPropertyCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >- "C8E89291F2E4762CE3CFC6500FDF11DB"); >- >- addPropertyCommandTest.addTest(new AddPropertyCommandTest( >- "testAddProperty")); >- >- return addPropertyCommandTest; >- } >- >- /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- super.setUp(); >- } >- >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >- >- /** >- * testAddProperty >- * >- * @throws Exception >- */ >- public void testAddProperty() throws Exception >- { >- XSDElementDeclaration[] oldWSDLProperties = CapUtils >- .getResolvedProperties(definition, resourcePropertyElement); >- XSDElementDeclaration newProperty = TestUtils.createNewProperty(); >- newProperty.setName("dummy"); >- XSDElementDeclaration[] oldXSDProperties = TestUtils >- .getXSDElementDeclarations(propSchema); >- >- AddPropertyCommand command = new AddPropertyCommand(capabilityDomain, >- newProperty); >- command.execute(); >- >- XSDElementDeclaration[] newWSDLProperties = CapUtils >- .getResolvedProperties(definition, resourcePropertyElement); >- XSDElementDeclaration[] newXSDProperties = TestUtils >- .getXSDElementDeclarations(propSchema); >- >- assertNotNull(definition); >- assertNotNull(resourcePropertyElement); >- assertNotNull(propSchema); >- assertTrue(newWSDLProperties.length == oldWSDLProperties.length + 1); >- assertTrue(newXSDProperties.length == oldXSDProperties.length + 1); >- >- XSDElementDeclaration newProp = XsdUtils >- .getXSDElementDeclarationOfName(propSchema, "dummy"); >- assertTrue(newProperty.equals(newProp)); >+ /** >+ * Constructor for AddPropertyCommandTest. >+ * >+ * @param name >+ */ >+ public AddPropertyCommandTest(String name) >+ { >+ super(name); >+ } >+ >+ /** >+ * Returns the JUnit test suite that implements the >+ * <b>AddPropertyCommandTest</b> definition. >+ */ >+ public static Test suite() >+ { >+ HyadesTestSuite addPropertyCommandTest = new HyadesTestSuite( >+ "AddPropertyCommandTest"); >+ addPropertyCommandTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "C8E89291F2E4762CE3CFC6500FDF11DB"); >+ >+ addPropertyCommandTest.addTest(new AddPropertyCommandTest( >+ "testAddProperty")); >+ >+ return addPropertyCommandTest; >+ } >+ >+ /** >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ super.setUp(); >+ } >+ >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } >+ >+ /** >+ * testAddProperty >+ * >+ * @throws Exception >+ */ >+ public void testAddProperty() throws Exception >+ { >+ XSDElementDeclaration[] oldWSDLProperties = CapUtils >+ .getResolvedProperties(definition, resourcePropertyElement); >+ XSDElementDeclaration newProperty = TestUtils.createNewProperty(); >+ newProperty.setName("dummy"); >+ XSDElementDeclaration[] oldXSDProperties = TestUtils >+ .getXSDElementDeclarations(propSchema); >+ >+ AddPropertyCommand command = new AddPropertyCommand(capabilityDomain, >+ newProperty); >+ command.execute(); >+ >+ XSDElementDeclaration[] newWSDLProperties = CapUtils >+ .getResolvedProperties(definition, resourcePropertyElement); >+ XSDElementDeclaration[] newXSDProperties = TestUtils >+ .getXSDElementDeclarations(propSchema); >+ >+ assertNotNull(definition); >+ assertNotNull(resourcePropertyElement); >+ assertNotNull(propSchema); >+ assertTrue(newWSDLProperties.length == oldWSDLProperties.length + 1); >+ assertTrue(newXSDProperties.length == oldXSDProperties.length + 1); >+ >+ XSDElementDeclaration newProp = XsdUtils >+ .getXSDElementDeclarationOfName(propSchema, "dummy"); >+ assertTrue(newProperty.equals(newProp)); > >- XSDElementDeclaration propRef = getPropertyRef(newProperty); >- assertNotNull(propRef); >+ XSDElementDeclaration propRef = getPropertyRef(newProperty); >+ assertNotNull(propRef); > >- } >+ } > > } >Index: junit/capability/overview/command/ChangeCapabilityDescriptionCommandTest_2.testsuite >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/overview/command/ChangeCapabilityDescriptionCommandTest_2.testsuite,v >retrieving revision 1.1 >diff -u -r1.1 ChangeCapabilityDescriptionCommandTest_2.testsuite >Binary files /tmp/cvsyVivid and ChangeCapabilityDescriptionCommandTest_2.testsuite differ >Index: junit/capability/overview/command/ChangeCapabilityDescriptionCommandTest_3.testsuite >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/overview/command/ChangeCapabilityDescriptionCommandTest_3.testsuite,v >retrieving revision 1.1 >diff -u -r1.1 ChangeCapabilityDescriptionCommandTest_3.testsuite >Binary files /tmp/cvs0NmP7Y and ChangeCapabilityDescriptionCommandTest_3.testsuite differ >Index: junit/capability/overview/command/ChangeCapabilityDescriptionCommandTest_1.testsuite >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/overview/command/ChangeCapabilityDescriptionCommandTest_1.testsuite,v >retrieving revision 1.1 >diff -u -r1.1 ChangeCapabilityDescriptionCommandTest_1.testsuite >Binary files /tmp/cvspDjrXK and ChangeCapabilityDescriptionCommandTest_1.testsuite differ >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/AllCapabilityTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/AllCapabilityTest.java,v >retrieving revision 1.3 >diff -u -r1.3 AllCapabilityTest.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/AllCapabilityTest.java 14 Dec 2006 12:18:25 -0000 1.3 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/AllCapabilityTest.java 22 Jan 2007 09:34:27 -0000 >@@ -28,42 +28,55 @@ > */ > public class AllCapabilityTest extends HyadesTestCase > { >- /** >- * Constructor for AllCapabilityTest. >- * >- * @param name >- */ >- public AllCapabilityTest(String name) >- { >- super(name); >- } >+ /** >+ * Constructor for AllCapabilityTest. >+ * >+ * @param name >+ */ >+ public AllCapabilityTest(String name) >+ { >+ super(name); >+ } > >- /** >- * Returns the JUnit test suite that implements the <b>AllCapabilityTest</b> definition. >+ /** >+ * Returns the JUnit test suite that implements the <b>AllCapabilityTest</b> >+ * definition. > */ >- public static Test suite() { >- HyadesTestSuite allCapabilityTest = new HyadesTestSuite("AllCapabilityTest"); >- allCapabilityTest.setArbiter(DefaultTestArbiter.INSTANCE).setId("D814DB9B58140B8C8745B9E0100B11DB"); >- allCapabilityTest.addTest(((HyadesTestSuite) AllUtilTest.suite()).setTestInvocationId("C448865E2C0E25D871F8ADE043EB11DB")); >- allCapabilityTest.addTest(((HyadesTestSuite) AllOverviewCommandTest.suite()).setTestInvocationId("C70A87B1CB5BD6B9D307683043F811DB")); >- allCapabilityTest.addTest(((HyadesTestSuite) AllPropertyCommandTest.suite()).setTestInvocationId("C70A87B1CB5BD6B9D30D82B043F811DB")); >- allCapabilityTest.addTest(((HyadesTestSuite) AllOperationCommandTest.suite()).setTestInvocationId("C70A87B1CB5BD6B9D2F825FD43F811DB")); >- allCapabilityTest.addTest(((HyadesTestSuite) AllTopicCommandTest.suite()).setTestInvocationId("C70A87B1CB5BD6B9D3139D4343F811DB")); >+ public static Test suite() >+ { >+ HyadesTestSuite allCapabilityTest = new HyadesTestSuite( >+ "AllCapabilityTest"); >+ allCapabilityTest.setArbiter(DefaultTestArbiter.INSTANCE).setId( >+ "D814DB9B58140B8C8745B9E0100B11DB"); >+ allCapabilityTest.addTest(((HyadesTestSuite) AllUtilTest.suite()) >+ .setTestInvocationId("C448865E2C0E25D871F8ADE043EB11DB")); >+ allCapabilityTest.addTest(((HyadesTestSuite) AllOverviewCommandTest >+ .suite()) >+ .setTestInvocationId("C70A87B1CB5BD6B9D307683043F811DB")); >+ allCapabilityTest.addTest(((HyadesTestSuite) AllPropertyCommandTest >+ .suite()) >+ .setTestInvocationId("C70A87B1CB5BD6B9D30D82B043F811DB")); >+ allCapabilityTest.addTest(((HyadesTestSuite) AllOperationCommandTest >+ .suite()) >+ .setTestInvocationId("C70A87B1CB5BD6B9D2F825FD43F811DB")); >+ allCapabilityTest.addTest(((HyadesTestSuite) AllTopicCommandTest >+ .suite()) >+ .setTestInvocationId("C70A87B1CB5BD6B9D3139D4343F811DB")); > return allCapabilityTest; > } > > /** >- * @see junit.framework.TestCase#setUp() >- */ >- protected void setUp() throws Exception >- { >- } >+ * @see junit.framework.TestCase#setUp() >+ */ >+ protected void setUp() throws Exception >+ { >+ } > >- /** >- * @see junit.framework.TestCase#tearDown() >- */ >- protected void tearDown() throws Exception >- { >- } >+ /** >+ * @see junit.framework.TestCase#tearDown() >+ */ >+ protected void tearDown() throws Exception >+ { >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/NullReportCapabilityValidator.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/NullReportCapabilityValidator.java,v >retrieving revision 1.1 >diff -u -r1.1 NullReportCapabilityValidator.java >--- src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/NullReportCapabilityValidator.java 15 Sep 2006 15:20:25 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/NullReportCapabilityValidator.java 22 Jan 2007 09:34:36 -0000 >@@ -21,21 +21,21 @@ > public class NullReportCapabilityValidator implements ICapabilityValidator > { > >- public IValidationReport validateRMD(Definition definition, >- DocumentRoot root) >- { >- return new NullReport(); >- } >+ public IValidationReport validateRMD(Definition definition, >+ DocumentRoot root) >+ { >+ return new NullReport(); >+ } > >- public IValidationReport validateWSDL(Definition definition) >- { >- return new NullReport(); >- } >+ public IValidationReport validateWSDL(Definition definition) >+ { >+ return new NullReport(); >+ } > >- public IValidationReport validateXSD(Definition definition, >- XSDSchema properySchema) >- { >- return new NullReport(); >- } >+ public IValidationReport validateXSD(Definition definition, >+ XSDSchema properySchema) >+ { >+ return new NullReport(); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/AllNullReportCapabilityValidator.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/AllNullReportCapabilityValidator.java,v >retrieving revision 1.1 >diff -u -r1.1 AllNullReportCapabilityValidator.java >--- src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/AllNullReportCapabilityValidator.java 15 Sep 2006 15:20:25 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/AllNullReportCapabilityValidator.java 22 Jan 2007 09:34:36 -0000 >@@ -21,21 +21,21 @@ > public class AllNullReportCapabilityValidator implements ICapabilityValidator > { > >- public IValidationReport validateRMD(Definition definition, >- DocumentRoot root) >- { >- return null; >- } >+ public IValidationReport validateRMD(Definition definition, >+ DocumentRoot root) >+ { >+ return null; >+ } > >- public IValidationReport validateWSDL(Definition definition) >- { >- return null; >- } >+ public IValidationReport validateWSDL(Definition definition) >+ { >+ return null; >+ } > >- public IValidationReport validateXSD(Definition definition, >- XSDSchema properySchema) >- { >- return null; >- } >+ public IValidationReport validateXSD(Definition definition, >+ XSDSchema properySchema) >+ { >+ return null; >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/WSDLNullReportCapabilityValidator.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/WSDLNullReportCapabilityValidator.java,v >retrieving revision 1.1 >diff -u -r1.1 WSDLNullReportCapabilityValidator.java >--- src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/WSDLNullReportCapabilityValidator.java 15 Sep 2006 15:20:25 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/WSDLNullReportCapabilityValidator.java 22 Jan 2007 09:34:36 -0000 >@@ -22,21 +22,21 @@ > public class WSDLNullReportCapabilityValidator implements ICapabilityValidator > { > >- public IValidationReport validateRMD(Definition definition, >- DocumentRoot root) >- { >- return new EmptyValidationReport(); >- } >+ public IValidationReport validateRMD(Definition definition, >+ DocumentRoot root) >+ { >+ return new EmptyValidationReport(); >+ } > >- public IValidationReport validateWSDL(Definition definition) >- { >- return null; >- } >+ public IValidationReport validateWSDL(Definition definition) >+ { >+ return null; >+ } > >- public IValidationReport validateXSD(Definition definition, >- XSDSchema properySchema) >- { >- return new EmptyValidationReport(); >- } >+ public IValidationReport validateXSD(Definition definition, >+ XSDSchema properySchema) >+ { >+ return new EmptyValidationReport(); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/NullReport.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/NullReport.java,v >retrieving revision 1.1 >diff -u -r1.1 NullReport.java >--- src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/NullReport.java 15 Sep 2006 15:20:25 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/NullReport.java 22 Jan 2007 09:34:36 -0000 >@@ -18,37 +18,37 @@ > public class NullReport implements IValidationReport > { > >- public void addValidationMessage(IValidationMessage message) >- { >- } >- >- public void addValidationReport(IValidationReport report) >- { >- } >- >- public IValidationMessage[] getErrorMessages() >- { >- return null; >- } >- >- public IValidationMessage[] getValidationMessages() >- { >- return null; >- } >- >- public IValidationMessage[] getWarningMessages() >- { >- return null; >- } >- >- public boolean hasErrors() >- { >- return false; >- } >- >- public boolean hasWarnings() >- { >- return false; >- } >+ public void addValidationMessage(IValidationMessage message) >+ { >+ } >+ >+ public void addValidationReport(IValidationReport report) >+ { >+ } >+ >+ public IValidationMessage[] getErrorMessages() >+ { >+ return null; >+ } >+ >+ public IValidationMessage[] getValidationMessages() >+ { >+ return null; >+ } >+ >+ public IValidationMessage[] getWarningMessages() >+ { >+ return null; >+ } >+ >+ public boolean hasErrors() >+ { >+ return false; >+ } >+ >+ public boolean hasWarnings() >+ { >+ return false; >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/RMDNullReportCapabilityValidator.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/RMDNullReportCapabilityValidator.java,v >retrieving revision 1.1 >diff -u -r1.1 RMDNullReportCapabilityValidator.java >--- src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/RMDNullReportCapabilityValidator.java 15 Sep 2006 15:20:25 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/RMDNullReportCapabilityValidator.java 22 Jan 2007 09:34:36 -0000 >@@ -22,21 +22,21 @@ > public class RMDNullReportCapabilityValidator implements ICapabilityValidator > { > >- public IValidationReport validateRMD(Definition definition, >- DocumentRoot root) >- { >- return null; >- } >+ public IValidationReport validateRMD(Definition definition, >+ DocumentRoot root) >+ { >+ return null; >+ } > >- public IValidationReport validateWSDL(Definition definition) >- { >- return new EmptyValidationReport(); >- } >+ public IValidationReport validateWSDL(Definition definition) >+ { >+ return new EmptyValidationReport(); >+ } > >- public IValidationReport validateXSD(Definition definition, >- XSDSchema properySchema) >- { >- return new EmptyValidationReport(); >- } >+ public IValidationReport validateXSD(Definition definition, >+ XSDSchema properySchema) >+ { >+ return new EmptyValidationReport(); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/CustomReportCapabilityValidator.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/CustomReportCapabilityValidator.java,v >retrieving revision 1.1 >diff -u -r1.1 CustomReportCapabilityValidator.java >--- src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/CustomReportCapabilityValidator.java 15 Sep 2006 15:20:25 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/CustomReportCapabilityValidator.java 22 Jan 2007 09:34:36 -0000 >@@ -24,42 +24,42 @@ > public class CustomReportCapabilityValidator implements ICapabilityValidator > { > >- public IValidationReport validateRMD(Definition definition, >- DocumentRoot root) >- { >- return getCustomReport(); >- } >+ public IValidationReport validateRMD(Definition definition, >+ DocumentRoot root) >+ { >+ return getCustomReport(); >+ } > >- public IValidationReport validateWSDL(Definition definition) >- { >- return getCustomReport(); >- } >+ public IValidationReport validateWSDL(Definition definition) >+ { >+ return getCustomReport(); >+ } > >- public IValidationReport validateXSD(Definition definition, >- XSDSchema properySchema) >- { >- return getCustomReport(); >- } >+ public IValidationReport validateXSD(Definition definition, >+ XSDSchema properySchema) >+ { >+ return getCustomReport(); >+ } > >- private IValidationReport getCustomReport() >- { >- EmptyValidationReport report = new EmptyValidationReport(); >- // Creating Null message, High severity >- EmptyValidationMessage message_1 = new EmptyValidationMessage(null, >- IValidationMessage.SEV_HIGH); >- report.addValidationMessage(message_1); >- // Creating Null message, Low severity >- EmptyValidationMessage message_2 = new EmptyValidationMessage(null, >- IValidationMessage.SEV_LOW); >- report.addValidationMessage(message_2); >- // Creating Null message, Unknown severity >- EmptyValidationMessage message_3 = new EmptyValidationMessage(null, 10); >- report.addValidationMessage(message_3); >- // Creating some message, Unknown severity >- EmptyValidationMessage message_4 = new EmptyValidationMessage( >- "Unresolved Location", 10); >- report.addValidationMessage(message_4); >- return report; >- } >+ private IValidationReport getCustomReport() >+ { >+ EmptyValidationReport report = new EmptyValidationReport(); >+ // Creating Null message, High severity >+ EmptyValidationMessage message_1 = new EmptyValidationMessage(null, >+ IValidationMessage.SEV_HIGH); >+ report.addValidationMessage(message_1); >+ // Creating Null message, Low severity >+ EmptyValidationMessage message_2 = new EmptyValidationMessage(null, >+ IValidationMessage.SEV_LOW); >+ report.addValidationMessage(message_2); >+ // Creating Null message, Unknown severity >+ EmptyValidationMessage message_3 = new EmptyValidationMessage(null, 10); >+ report.addValidationMessage(message_3); >+ // Creating some message, Unknown severity >+ EmptyValidationMessage message_4 = new EmptyValidationMessage( >+ "Unresolved Location", 10); >+ report.addValidationMessage(message_4); >+ return report; >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/XSDNullReportCapabilityValidator.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/XSDNullReportCapabilityValidator.java,v >retrieving revision 1.1 >diff -u -r1.1 XSDNullReportCapabilityValidator.java >--- src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/XSDNullReportCapabilityValidator.java 15 Sep 2006 15:20:25 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/XSDNullReportCapabilityValidator.java 22 Jan 2007 09:34:36 -0000 >@@ -22,21 +22,21 @@ > public class XSDNullReportCapabilityValidator implements ICapabilityValidator > { > >- public IValidationReport validateRMD(Definition definition, >- DocumentRoot root) >- { >- return new EmptyValidationReport(); >- } >+ public IValidationReport validateRMD(Definition definition, >+ DocumentRoot root) >+ { >+ return new EmptyValidationReport(); >+ } > >- public IValidationReport validateWSDL(Definition definition) >- { >- return new EmptyValidationReport(); >- } >+ public IValidationReport validateWSDL(Definition definition) >+ { >+ return new EmptyValidationReport(); >+ } > >- public IValidationReport validateXSD(Definition definition, >- XSDSchema properySchema) >- { >- return null; >- } >+ public IValidationReport validateXSD(Definition definition, >+ XSDSchema properySchema) >+ { >+ return null; >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/ValidReportCapabilityValidator.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/ValidReportCapabilityValidator.java,v >retrieving revision 1.1 >diff -u -r1.1 ValidReportCapabilityValidator.java >--- src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/ValidReportCapabilityValidator.java 15 Sep 2006 15:20:25 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/validation/capability/test/ValidReportCapabilityValidator.java 22 Jan 2007 09:34:36 -0000 >@@ -24,51 +24,51 @@ > public class ValidReportCapabilityValidator implements ICapabilityValidator > { > >- public IValidationReport validateRMD(Definition definition, >- DocumentRoot root) >- { >- EmptyValidationReport report = new EmptyValidationReport(); >- >- EmptyValidationMessage message_1 = new EmptyValidationMessage( >- "High severity rmd test message", IValidationMessage.SEV_HIGH); >- EmptyValidationMessage message_2 = new EmptyValidationMessage( >- "Low severity rmd test message", IValidationMessage.SEV_LOW); >- >- report.addValidationMessage(message_1); >- report.addValidationMessage(message_2); >- >- return report; >- } >- >- public IValidationReport validateWSDL(Definition definition) >- { >- EmptyValidationReport report = new EmptyValidationReport(); >- >- EmptyValidationMessage message_1 = new EmptyValidationMessage( >- "High severity wsdl test message", IValidationMessage.SEV_HIGH); >- EmptyValidationMessage message_2 = new EmptyValidationMessage( >- "Low severity wsdl test message", IValidationMessage.SEV_LOW); >- >- report.addValidationMessage(message_1); >- report.addValidationMessage(message_2); >- >- return report; >- } >- >- public IValidationReport validateXSD(Definition definition, >- XSDSchema propertySchema) >- { >- EmptyValidationReport report = new EmptyValidationReport(); >- >- EmptyValidationMessage message_1 = new EmptyValidationMessage( >- "High severity xsd test message", IValidationMessage.SEV_HIGH); >- EmptyValidationMessage message_2 = new EmptyValidationMessage( >- "Low severity xsd test message", IValidationMessage.SEV_LOW); >+ public IValidationReport validateRMD(Definition definition, >+ DocumentRoot root) >+ { >+ EmptyValidationReport report = new EmptyValidationReport(); >+ >+ EmptyValidationMessage message_1 = new EmptyValidationMessage( >+ "High severity rmd test message", IValidationMessage.SEV_HIGH); >+ EmptyValidationMessage message_2 = new EmptyValidationMessage( >+ "Low severity rmd test message", IValidationMessage.SEV_LOW); >+ >+ report.addValidationMessage(message_1); >+ report.addValidationMessage(message_2); >+ >+ return report; >+ } >+ >+ public IValidationReport validateWSDL(Definition definition) >+ { >+ EmptyValidationReport report = new EmptyValidationReport(); >+ >+ EmptyValidationMessage message_1 = new EmptyValidationMessage( >+ "High severity wsdl test message", IValidationMessage.SEV_HIGH); >+ EmptyValidationMessage message_2 = new EmptyValidationMessage( >+ "Low severity wsdl test message", IValidationMessage.SEV_LOW); >+ >+ report.addValidationMessage(message_1); >+ report.addValidationMessage(message_2); >+ >+ return report; >+ } >+ >+ public IValidationReport validateXSD(Definition definition, >+ XSDSchema propertySchema) >+ { >+ EmptyValidationReport report = new EmptyValidationReport(); >+ >+ EmptyValidationMessage message_1 = new EmptyValidationMessage( >+ "High severity xsd test message", IValidationMessage.SEV_HIGH); >+ EmptyValidationMessage message_2 = new EmptyValidationMessage( >+ "Low severity xsd test message", IValidationMessage.SEV_LOW); > >- report.addValidationMessage(message_1); >- report.addValidationMessage(message_2); >+ report.addValidationMessage(message_1); >+ report.addValidationMessage(message_2); > >- return report; >- } >+ return report; >+ } > > } >Index: junit/capability/operation/command/AddParameterCommandTest.testsuite >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/operation/command/AddParameterCommandTest.testsuite,v >retrieving revision 1.1 >diff -u -r1.1 AddParameterCommandTest.testsuite >Binary files /tmp/cvsv51q8w and AddParameterCommandTest.testsuite differ >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/XSDTestModel.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/XSDTestModel.java,v >retrieving revision 1.2 >diff -u -r1.2 XSDTestModel.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/XSDTestModel.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/XSDTestModel.java 22 Jan 2007 09:34:33 -0000 >@@ -25,48 +25,48 @@ > public class XSDTestModel extends HyadesTestCase > { > >- protected String XSD_FILE_PATH = Activator.PLUGIN_ID + "/" >- + "testfiles/xsd/webapplication.xsd"; >+ protected String XSD_FILE_PATH = Activator.PLUGIN_ID + "/" >+ + "testfiles/xsd/webapplication.xsd"; > >- protected XSDSchema web_application_schema; >+ protected XSDSchema web_application_schema; > >- protected String[] WEB_APP_ELEMENT_NAMES = new String[] { "WebApp", >- "ContextParam", "Servlet", "ServletMapping", "SessionConfig", >- "MimeMapping", "WelcomeFileList", "ErrorPage", "TagLibRef", >- "SecurityConstraint", "WebResourceCollection", "AuthConstraint", >- "UserDataConstraint", "LoginConfig", "FormLoginConfig", >- "InitParam", "WebType", "ServletType", "JSPType", "URLPatternType", >- "RoleNameType", "WelcomeFile", "ExceptionTypeErrorPage", >- "ErrorCodeErrorPage", "FilterMapping", "Filter", >- "LocalEncodingMappingList", "LocalEncodingMapping", >- "HTTPMethodType" }; >- >- protected String[] WEB_APP_ELEMENT_TYPES = new String[] { "WebApp", >- "ContextParam", "Servlet", "ServletMapping", "SessionConfig", >- "MimeMapping", "WelcomeFileList", "ErrorPage", "TagLibRef", >- "SecurityConstraint", "WebResourceCollection", "AuthConstraint", >- "UserDataConstraint", "LoginConfig", "FormLoginConfig", >- "InitParam", "WebType", "ServletType", "JSPType", "URLPatternType", >- "RoleNameType", "WelcomeFile", "ExceptionTypeErrorPage", >- "ErrorCodeErrorPage", "FilterMapping", "Filter", >- "LocalEncodingMappingList", "LocalEncodingMapping", >- "HTTPMethodType" }; >- >- protected String[] IMPORTED_NS = new String[] { "java.xmi", "jsp.xmi", >- "common.xmi", "http://www.omg.org/XMI" }; >- >- public XSDTestModel(String name) >- { >- super(name); >- } >- >- protected void setUp() throws Exception >- { >- IFile web_app_xsd_file = EclipseUtils.getIFile(XSD_FILE_PATH); >- assertNotNull(web_app_xsd_file); >- >- web_application_schema = XsdUtils.getSchema(web_app_xsd_file); >- assertNotNull(web_application_schema); >- } >+ protected String[] WEB_APP_ELEMENT_NAMES = new String[] { "WebApp", >+ "ContextParam", "Servlet", "ServletMapping", "SessionConfig", >+ "MimeMapping", "WelcomeFileList", "ErrorPage", "TagLibRef", >+ "SecurityConstraint", "WebResourceCollection", "AuthConstraint", >+ "UserDataConstraint", "LoginConfig", "FormLoginConfig", >+ "InitParam", "WebType", "ServletType", "JSPType", "URLPatternType", >+ "RoleNameType", "WelcomeFile", "ExceptionTypeErrorPage", >+ "ErrorCodeErrorPage", "FilterMapping", "Filter", >+ "LocalEncodingMappingList", "LocalEncodingMapping", >+ "HTTPMethodType" }; >+ >+ protected String[] WEB_APP_ELEMENT_TYPES = new String[] { "WebApp", >+ "ContextParam", "Servlet", "ServletMapping", "SessionConfig", >+ "MimeMapping", "WelcomeFileList", "ErrorPage", "TagLibRef", >+ "SecurityConstraint", "WebResourceCollection", "AuthConstraint", >+ "UserDataConstraint", "LoginConfig", "FormLoginConfig", >+ "InitParam", "WebType", "ServletType", "JSPType", "URLPatternType", >+ "RoleNameType", "WelcomeFile", "ExceptionTypeErrorPage", >+ "ErrorCodeErrorPage", "FilterMapping", "Filter", >+ "LocalEncodingMappingList", "LocalEncodingMapping", >+ "HTTPMethodType" }; >+ >+ protected String[] IMPORTED_NS = new String[] { "java.xmi", "jsp.xmi", >+ "common.xmi", "http://www.omg.org/XMI" }; >+ >+ public XSDTestModel(String name) >+ { >+ super(name); >+ } >+ >+ protected void setUp() throws Exception >+ { >+ IFile web_app_xsd_file = EclipseUtils.getIFile(XSD_FILE_PATH); >+ assertNotNull(web_app_xsd_file); >+ >+ web_application_schema = XsdUtils.getSchema(web_app_xsd_file); >+ assertNotNull(web_application_schema); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/WSDLTestModel.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/WSDLTestModel.java,v >retrieving revision 1.2 >diff -u -r1.2 WSDLTestModel.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/WSDLTestModel.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/WSDLTestModel.java 22 Jan 2007 09:34:33 -0000 >@@ -25,46 +25,46 @@ > public class WSDLTestModel extends HyadesTestCase > { > >- protected String WSDL_FILE_PATH = Activator.PLUGIN_ID + "/" >- + "testfiles/wsdl/WarehouseFront.wsdl"; >+ protected String WSDL_FILE_PATH = Activator.PLUGIN_ID + "/" >+ + "testfiles/wsdl/WarehouseFront.wsdl"; > >- protected Definition ware_house_front_defintion; >+ protected Definition ware_house_front_defintion; > >- protected String TARGET_NS = "http://ejb.warehouse.samples.websphere.ibm.com"; >+ protected String TARGET_NS = "http://ejb.warehouse.samples.websphere.ibm.com"; > >- protected String TARGET_NS_PREFIX = "impl"; >+ protected String TARGET_NS_PREFIX = "impl"; > >- protected String PORT_TYPE_NAME = "WarehouseFront_SEI"; >- >- protected String[][] NAMESPACE_DEFINED = new String[][] { >- { "impl", "http://ejb.warehouse.samples.websphere.ibm.com" }, >- { "tns2", "http://xml.apache.org/xml-soap" }, >- { "tns3", "http://beans.greenhouse.samples.websphere.ibm.com" }, >- { "wsdl", "http://schemas.xmlsoap.org/wsdl/" }, >- { "wsdlsoap", "http://schemas.xmlsoap.org/wsdl/soap/" }, >- { "xsd", "http://www.w3.org/2001/XMLSchema" } }; >- >- protected String[] XSD_SCHEMAS_DEFINED = new String[] { >- "http://xml.apache.org/xml-soap", >- "http://ejb.warehouse.samples.websphere.ibm.com", >- "http://beans.greenhouse.samples.websphere.ibm.com" }; >- >- protected String[] OPERATION_NAMES = new String[] { "startOrder", >- "receiveItems" }; >- >- public WSDLTestModel(String name) >- { >- super(name); >- } >- >- protected void setUp() throws Exception >- { >- IFile ware_house_front_xsd_file = EclipseUtils.getIFile(WSDL_FILE_PATH); >- assertNotNull(ware_house_front_xsd_file); >- >- ware_house_front_defintion = WsdlUtils >- .getWSDLDefinition(ware_house_front_xsd_file); >- assertNotNull(ware_house_front_defintion); >- } >+ protected String PORT_TYPE_NAME = "WarehouseFront_SEI"; >+ >+ protected String[][] NAMESPACE_DEFINED = new String[][] { >+ { "impl", "http://ejb.warehouse.samples.websphere.ibm.com" }, >+ { "tns2", "http://xml.apache.org/xml-soap" }, >+ { "tns3", "http://beans.greenhouse.samples.websphere.ibm.com" }, >+ { "wsdl", "http://schemas.xmlsoap.org/wsdl/" }, >+ { "wsdlsoap", "http://schemas.xmlsoap.org/wsdl/soap/" }, >+ { "xsd", "http://www.w3.org/2001/XMLSchema" } }; >+ >+ protected String[] XSD_SCHEMAS_DEFINED = new String[] { >+ "http://xml.apache.org/xml-soap", >+ "http://ejb.warehouse.samples.websphere.ibm.com", >+ "http://beans.greenhouse.samples.websphere.ibm.com" }; >+ >+ protected String[] OPERATION_NAMES = new String[] { "startOrder", >+ "receiveItems" }; >+ >+ public WSDLTestModel(String name) >+ { >+ super(name); >+ } >+ >+ protected void setUp() throws Exception >+ { >+ IFile ware_house_front_xsd_file = EclipseUtils.getIFile(WSDL_FILE_PATH); >+ assertNotNull(ware_house_front_xsd_file); >+ >+ ware_house_front_defintion = WsdlUtils >+ .getWSDLDefinition(ware_house_front_xsd_file); >+ assertNotNull(ware_house_front_defintion); >+ } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/CapabilityTestModel.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/CapabilityTestModel.java,v >retrieving revision 1.2 >diff -u -r1.2 CapabilityTestModel.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/CapabilityTestModel.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/CapabilityTestModel.java 22 Jan 2007 09:34:32 -0000 >@@ -20,9 +20,9 @@ > import org.eclipse.tptp.wsdm.tooling.editor.capability.internal.CapabilityDomain; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Capability; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Property; >+import org.eclipse.tptp.wsdm.tooling.model.capabilities.impl.MetadataDescriptor; > import org.eclipse.tptp.wsdm.tooling.util.internal.Definition2Capability; > import org.eclipse.tptp.wsdm.tooling.util.internal.EclipseUtils; >-import org.eclipse.tptp.wsdm.tooling.util.internal.PropertyMetaDataDescriptor; > import org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils; > import org.eclipse.tptp.wsdm.tooling.util.internal.XsdUtils; > import org.eclipse.wst.wsdl.Definition; >@@ -38,98 +38,96 @@ > public class CapabilityTestModel extends HyadesTestCase > { > >- protected Definition definition; >+ protected Definition definition; > >- protected String CAPABILITY_FILE_PATH = null; >+ protected String CAPABILITY_FILE_PATH = null; > >- protected XSDElementDeclaration resourcePropertyElement; >+ protected XSDElementDeclaration resourcePropertyElement; > >- protected Capability capability; >+ protected Capability capability; > >- protected XSDSchema propSchema; >- >- protected PropertyMetaDataDescriptor metaDataDescriptor; >- >- protected CapabilityDomain capabilityDomain; >- >- public CapabilityTestModel(String name, String capabilityIFilePath) >- { >- super(name); >- if (capabilityIFilePath == null) >- throw new AssertionFailedError( >- "Capability file path must be specified"); >- CAPABILITY_FILE_PATH = capabilityIFilePath; >- } >- >- protected void setUp() throws Exception >- { >- IFile capabilityFile = EclipseUtils.getIFile(CAPABILITY_FILE_PATH); >- assertNotNull(capabilityFile); >- >- definition = WsdlUtils.getWSDLDefinition(capabilityFile); >- assertNotNull(definition); >- >- Definition2Capability def2cap = new Definition2Capability(definition); >- capability = def2cap.getCapability(); >- assertNotNull(capability); >- capabilityDomain = new CapabilityDomain(); >- capabilityDomain.setDefinition(definition); >- capabilityDomain.setCapability(capability); >- List propList = capability.getProperties(); >- assertNotNull(propList); >- assertTrue(propList.size() > 0); >- >- resourcePropertyElement = def2cap.getResourcePropertyElement(); >- assertNotNull(resourcePropertyElement); >- capabilityDomain.setResourcePropertyElement(resourcePropertyElement); >- >- Object propertySchema = getPropertySchema(capability); >- assertNotNull(propertySchema); >- assertTrue(propertySchema instanceof XSDSchema); >- propSchema = (XSDSchema) propertySchema; >- capabilityDomain.setPropertySchema(propSchema); >- >- metaDataDescriptor = def2cap.getPropertyMetaDataDescriptor(); >- assertNotNull(metaDataDescriptor); >- capabilityDomain.setMetaDataDescriptor(metaDataDescriptor); >- } >- >- protected XSDElementDeclaration getPropertyRef( >- XSDElementDeclaration property) >- { >- XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition) resourcePropertyElement >- .getAnonymousTypeDefinition(); >- XSDModelGroup modelGroup = XsdUtils.getXSDModelGroup(typeDef); >- XSDElementDeclaration[] elementRefs = XsdUtils >- .getElementDeclarations(modelGroup); >- for (int i = 0; i < elementRefs.length; i++) >+ protected XSDSchema propSchema; >+ >+ protected MetadataDescriptor metaDataDescriptor; >+ >+ protected CapabilityDomain capabilityDomain; >+ >+ public CapabilityTestModel(String name, String capabilityIFilePath) >+ { >+ super(name); >+ if (capabilityIFilePath == null) >+ throw new AssertionFailedError( >+ "Capability file path must be specified"); >+ CAPABILITY_FILE_PATH = capabilityIFilePath; >+ } >+ >+ protected void setUp() throws Exception >+ { >+ IFile capabilityFile = EclipseUtils.getIFile(CAPABILITY_FILE_PATH); >+ assertNotNull(capabilityFile); >+ >+ definition = WsdlUtils.getWSDLDefinition(capabilityFile); >+ assertNotNull(definition); >+ >+ Definition2Capability def2cap = new Definition2Capability(definition); >+ capability = def2cap.getCapability(); >+ assertNotNull(capability); >+ capabilityDomain = new CapabilityDomain(); >+ capabilityDomain.setCapability(capability); >+ List propList = capability.getProperties(); >+ assertNotNull(propList); >+ assertTrue(propList.size() > 0); >+ >+ resourcePropertyElement = def2cap.getResourcePropertyElement(); >+ assertNotNull(resourcePropertyElement); >+ capabilityDomain.setResourcePropertyElement(resourcePropertyElement); >+ >+ Object propertySchema = getPropertySchema(capability); >+ assertNotNull(propertySchema); >+ assertTrue(propertySchema instanceof XSDSchema); >+ propSchema = (XSDSchema) propertySchema; >+ capabilityDomain.setPropertySchema(propSchema); >+ >+ metaDataDescriptor = def2cap.getCapability().getMetadata(); >+ assertNotNull(metaDataDescriptor); >+ } >+ >+ protected XSDElementDeclaration getPropertyRef( >+ XSDElementDeclaration property) > { >- if (XsdUtils.isReferencedElement(elementRefs[i])) >- { >- XSDElementDeclaration element = elementRefs[i] >- .getResolvedElementDeclaration(); >- if (element.getName().equals(property.getName()) >- && element.getTargetNamespace().equals( >- property.getTargetNamespace())) >- return elementRefs[i]; >- } >+ XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition) resourcePropertyElement >+ .getAnonymousTypeDefinition(); >+ XSDModelGroup modelGroup = XsdUtils.getXSDModelGroup(typeDef); >+ XSDElementDeclaration[] elementRefs = XsdUtils >+ .getElementDeclarations(modelGroup); >+ for (int i = 0; i < elementRefs.length; i++) >+ { >+ if (XsdUtils.isReferencedElement(elementRefs[i])) >+ { >+ XSDElementDeclaration element = elementRefs[i] >+ .getResolvedElementDeclaration(); >+ if (element.getName().equals(property.getName()) >+ && element.getTargetNamespace().equals( >+ property.getTargetNamespace())) >+ return elementRefs[i]; >+ } >+ } >+ return null; > } >- return null; >- } > >- private XSDSchema getPropertySchema(Capability capability) >- { >- String capNS = capability.getNamespace(); >- List propList = capability.getProperties(); >- for (int i = 0; i < propList.size(); i++) >+ private XSDSchema getPropertySchema(Capability capability) > { >- Property property = (Property) propList.get(i); >- XSDElementDeclaration element = property.getElement(); >- if (element != null) >- if (element.getTargetNamespace().equals(capNS)) >- return element.getSchema(); >+ String capNS = capability.getNamespace(); >+ List propList = capability.getProperties(); >+ for (int i = 0; i < propList.size(); i++) >+ { >+ Property property = (Property) propList.get(i); >+ XSDElementDeclaration element = property.getElement(); >+ if (element != null) >+ if (element.getTargetNamespace().equals(capNS)) >+ return element.getSchema(); >+ } >+ return null; > } >- return null; >- } > > } >Index: src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/RMDTestModel.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/RMDTestModel.java,v >retrieving revision 1.2 >diff -u -r1.2 RMDTestModel.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/RMDTestModel.java 15 Sep 2006 15:20:22 -0000 1.2 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/capability/model/test/RMDTestModel.java 22 Jan 2007 09:34:32 -0000 >@@ -26,98 +26,98 @@ > public class RMDTestModel extends HyadesTestCase > { > >- protected String RMD_FILE_PATH = Activator.PLUGIN_ID + "/" >- + "testfiles/capability/util/AppServer.rmd"; >+ protected String RMD_FILE_PATH = Activator.PLUGIN_ID + "/" >+ + "testfiles/capability/util/AppServer.rmd"; > >- protected DocumentRoot root; >+ protected DocumentRoot root; > >- protected MetadataDescriptorType metaDescriptor; >+ protected MetadataDescriptorType metaDescriptor; > >- protected String descriptorName = "AppServerDescriptor"; >+ protected String descriptorName = "AppServerDescriptor"; > >- protected int NO_OF_PROPERTIES = 3; >+ protected int NO_OF_PROPERTIES = 3; > >- protected class PropertyMetadata >- { >- public String propertyName; >+ protected class PropertyMetadata >+ { >+ public String propertyName; > >- public String modifiability; >+ public String modifiability; > >- public String mutability; >+ public String mutability; > >- public Object[] validValues; >+ public Object[] validValues; > >- public Object[] staticValues; >+ public Object[] staticValues; > >- public boolean hasMetric; >+ public boolean hasMetric; > >- public Metric metric; >+ public Metric metric; > >- PropertyMetadata(String propertyName, String modifiability, >- String mutability, Object[] validValues, Object[] staticValues, >- boolean hasMetric, Metric metric) >- { >- this.propertyName = propertyName; >- this.modifiability = modifiability; >- this.mutability = mutability; >- this.validValues = validValues; >- this.staticValues = staticValues; >- this.hasMetric = hasMetric; >- this.metric = metric; >+ PropertyMetadata(String propertyName, String modifiability, >+ String mutability, Object[] validValues, Object[] staticValues, >+ boolean hasMetric, Metric metric) >+ { >+ this.propertyName = propertyName; >+ this.modifiability = modifiability; >+ this.mutability = mutability; >+ this.validValues = validValues; >+ this.staticValues = staticValues; >+ this.hasMetric = hasMetric; >+ this.metric = metric; >+ } > } >- } > >- protected class Metric >- { >- public String changeType; >+ protected class Metric >+ { >+ public String changeType; > >- public String timeScope; >+ public String timeScope; > >- public String gatheringTime; >+ public String gatheringTime; > >- public String calculationInterval; >+ public String calculationInterval; >+ >+ Metric(String changeType, String timeScope, String gatheringTime, >+ String calculationInterval) >+ { >+ this.changeType = changeType; >+ this.timeScope = timeScope; >+ this.gatheringTime = gatheringTime; >+ this.calculationInterval = calculationInterval; >+ } >+ } > >- Metric(String changeType, String timeScope, String gatheringTime, >- String calculationInterval) >+ protected PropertyMetadata home_metadata; >+ >+ protected PropertyMetadata connectionPool_metadata; >+ >+ public RMDTestModel(String name) > { >- this.changeType = changeType; >- this.timeScope = timeScope; >- this.gatheringTime = gatheringTime; >- this.calculationInterval = calculationInterval; >+ super(name); > } >- } > >- protected PropertyMetadata home_metadata; >+ protected void setUp() throws Exception >+ { >+ IFile rmdFile = EclipseUtils.getIFile(RMD_FILE_PATH); >+ assertNotNull(rmdFile); > >- protected PropertyMetadata connectionPool_metadata; >+ root = MetaDataUtils.getDocumentRoot(rmdFile); >+ assertNotNull(root); > >- public RMDTestModel(String name) >- { >- super(name); >- } >- >- protected void setUp() throws Exception >- { >- IFile rmdFile = EclipseUtils.getIFile(RMD_FILE_PATH); >- assertNotNull(rmdFile); >- >- root = MetaDataUtils.getDocumentRoot(rmdFile); >- assertNotNull(root); >- >- metaDescriptor = MetaDataUtils.getMetadataDescriptorType(root, >- descriptorName); >- assertNotNull(metaDescriptor); >- >- Object[] validValues = new String[] { "jdbc_home", "j2ee_home", >- "jsp_home", "was_home" }; >- Object[] staticValues = new String[] { "j2ee_home", "was_home" }; >- home_metadata = new PropertyMetadata("home", MetaDataUtils.READ_ONLY, >- MetaDataUtils.CONSTANT, validValues, staticValues, false, null); >- >- Metric metric = new Metric("Gauge", "PointInTime", "Periodic", "PT1M"); >- connectionPool_metadata = new PropertyMetadata("connectionPool", >- MetaDataUtils.WRITABLE, MetaDataUtils.MUTABLE, new Object[0], >- new Object[0], true, metric); >- } >+ metaDescriptor = MetaDataUtils.getMetadataDescriptorType(root, >+ descriptorName); >+ assertNotNull(metaDescriptor); >+ >+ Object[] validValues = new String[] { "jdbc_home", "j2ee_home", >+ "jsp_home", "was_home" }; >+ Object[] staticValues = new String[] { "j2ee_home", "was_home" }; >+ home_metadata = new PropertyMetadata("home", MetaDataUtils.READ_ONLY, >+ MetaDataUtils.CONSTANT, validValues, staticValues, false, null); >+ >+ Metric metric = new Metric("Gauge", "PointInTime", "Periodic", "PT1M"); >+ connectionPool_metadata = new PropertyMetadata("connectionPool", >+ MetaDataUtils.WRITABLE, MetaDataUtils.MUTABLE, new Object[0], >+ new Object[0], true, metric); >+ } > > } >Index: junit/capability/util/MetaDataUtilsTest.testsuite >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/util/MetaDataUtilsTest.testsuite,v >retrieving revision 1.1 >diff -u -r1.1 MetaDataUtilsTest.testsuite >Binary files /tmp/cvsPebJUr and MetaDataUtilsTest.testsuite differ >Index: junit/capability/util/TopicSpace2MetaDataDescriptorTest.testsuite >=================================================================== >RCS file: /cvsroot/tptp/test-results/monitor/org.eclipse.tptp.wsdm.tooling.editor.capability.test/junit/capability/util/TopicSpace2MetaDataDescriptorTest.testsuite,v >retrieving revision 1.1 >diff -u -r1.1 TopicSpace2MetaDataDescriptorTest.testsuite >Binary files /tmp/cvsjUV4if and TopicSpace2MetaDataDescriptorTest.testsuite differ
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 161932
:
52511
|
56198
|
57069
|
57084
|
57207
| 57493