Modified: 
incubator/woden/trunk/java/test/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidatorTest.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidatorTest.java?view=diff&rev=447385&r1=447384&r2=447385
==============================================================================
--- 
incubator/woden/trunk/java/test/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidatorTest.java
 (original)
+++ 
incubator/woden/trunk/java/test/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidatorTest.java
 Mon Sep 18 05:21:19 2006
@@ -985,7 +985,7 @@
     try
        {
       DescriptionImpl desc = new DescriptionImpl();
-      InterfaceElement interfaceElem = desc.createInterfaceElement();
+      InterfaceElement interfaceElem = desc.addInterfaceElement();
          if(!val.testAssertionInterface0031(interfaceElem, reporter))
          {
            fail("The testAssertionInterface0031 method returned false for an 
interface that specifies no style defaults.");
@@ -1001,7 +1001,7 @@
        try
        {
       DescriptionImpl desc = new DescriptionImpl();
-      InterfaceElement interfaceElem = desc.createInterfaceElement();
+      InterfaceElement interfaceElem = desc.addInterfaceElement();
          interfaceElem.addStyleDefaultURI(absoluteURI);
          if(!val.testAssertionInterface0031(interfaceElem, reporter))
          {
@@ -1018,7 +1018,7 @@
        try
        {
       DescriptionImpl desc = new DescriptionImpl();
-         InterfaceElement interfaceElem = desc.createInterfaceElement();
+         InterfaceElement interfaceElem = desc.addInterfaceElement();
          interfaceElem.addStyleDefaultURI(relativeURI);
          if(val.testAssertionInterface0031(interfaceElem, reporter))
          {
@@ -1035,7 +1035,7 @@
        try
        {
       DescriptionImpl desc = new DescriptionImpl();
-      InterfaceElement interfaceElem = desc.createInterfaceElement();
+      InterfaceElement interfaceElem = desc.addInterfaceElement();
          interfaceElem.addStyleDefaultURI(absoluteURI);
          interfaceElem.addStyleDefaultURI(relativeURI);
          if(val.testAssertionInterface0031(interfaceElem, reporter))
@@ -1053,7 +1053,7 @@
        try
        {
       DescriptionImpl desc = new DescriptionImpl();
-      InterfaceElement interfaceElem = desc.createInterfaceElement();
+      InterfaceElement interfaceElem = desc.addInterfaceElement();
          interfaceElem.addStyleDefaultURI(relativeURI);
          interfaceElem.addStyleDefaultURI(relativeURI2);
          val.testAssertionInterface0031(interfaceElem, reporter);
@@ -1074,18 +1074,18 @@
    */
   public void testTestAssertionSchema0020()
   {
-       // Create a schema for use in the tests and add it to a types section.
-       TypesElement types = new DescriptionImpl().createTypesElement();
-       String schemaString = "<schema 
xmlns=\"http://www.w3.org/2001/XMLSchema\"; 
targetNamespace=\"http://www.sample.org\";>"
-                 + "<complexType name=\"myType\">"     
-                 + "<sequence>"     
-          + "<element  name=\"element\" type=\"string\"/>"      
-          + "</sequence>"     
-          + "</complexType>" 
-          +    "<element name=\"myElement\" type=\"string\"/>"
-          + "</schema>";
+    // Create a schema for use in the tests and add it to a types section.
+    InlinedSchema schema = new InlinedSchemaImpl();
        try
        {
+      String schemaString = "<schema 
xmlns=\"http://www.w3.org/2001/XMLSchema\"; 
targetNamespace=\"http://www.sample.org\";>"
+              + "<complexType name=\"myType\">"     
+              + "<sequence>"     
+              + "<element  name=\"element\" type=\"string\"/>"      
+              + "</sequence>"     
+              + "</complexType>" 
+              + "<element name=\"myElement\" type=\"string\"/>"
+              + "</schema>";
          DOMParser builder = new DOMParser();
          Reader reader = new StringReader(schemaString);
       XMLInputSource is = new XMLInputSource(null,null,null,reader,null);
@@ -1094,9 +1094,9 @@
       XmlSchemaCollection xsc = new XmlSchemaCollection();
       XmlSchema xs1 = xsc.read(schemaDoc1.getDocumentElement());
       URI schemaNS = new URI("http://www.sample.org";);
-      InlinedSchema schema = new InlinedSchemaImpl();
       schema.setSchemaDefinition(xs1);
       schema.setNamespace(schemaNS);
+      TypesElement types = new DescriptionImpl().getTypesElement();
       types.addSchema(schema);
        }
        catch(Exception e)
@@ -1109,15 +1109,11 @@
        try
        {
          DescriptionElement descElem = new DescriptionImpl();
-         descElem.setTypesElement(types);
-         InterfaceElement interfaceElem = descElem.createInterfaceElement();
-         InterfaceOperationElement interfaceOperation = 
descElem.createInterfaceOperationElement();
-         InterfaceMessageReferenceElement messageRef = 
descElem.createInterfaceMessageReferenceElement();
+         InterfaceElement interfaceElem = descElem.addInterfaceElement();
+         InterfaceOperationElement interfaceOperation = 
interfaceElem.addInterfaceOperationElement();
+         InterfaceMessageReferenceElement messageRef = 
interfaceOperation.addInterfaceMessageReferenceElement();
          messageRef.setMessageContentModel(Constants.NMTOKEN_NONE);
          messageRef.setElementName(new 
QName("http://www.sample.org","myElement";));
-         interfaceOperation.addInterfaceMessageReferenceElement(messageRef);
-         interfaceElem.addInterfaceOperationElement(interfaceOperation);
-         descElem.addInterfaceElement(interfaceElem);
              
       if(!val.testAssertionSchema0020(descElem, messageRef, reporter))
       {
@@ -1136,14 +1132,12 @@
        {
       DescriptionElement descElem = new DescriptionImpl();
       descElem.setExtensionRegistry(new PopulatedExtensionRegistry());
-      descElem.setTypesElement(types);
-      InterfaceElement interfaceElem = descElem.createInterfaceElement();
-      InterfaceOperationElement interfaceOperation = 
descElem.createInterfaceOperationElement();
-      InterfaceMessageReferenceElement messageRef = 
descElem.createInterfaceMessageReferenceElement();
+      TypesElement types = descElem.getTypesElement();
+      types.addSchema(schema);
+      InterfaceElement interfaceElem = descElem.addInterfaceElement();
+      InterfaceOperationElement interfaceOperation = 
interfaceElem.addInterfaceOperationElement();
+      InterfaceMessageReferenceElement messageRef = 
interfaceOperation.addInterfaceMessageReferenceElement();
       messageRef.setElementName(new QName("http://www.sample.org";, 
"myElement"));
-      interfaceOperation.addInterfaceMessageReferenceElement(messageRef);
-      interfaceElem.addInterfaceOperationElement(interfaceOperation);
-      descElem.addInterfaceElement(interfaceElem);
       
          if(!val.testAssertionSchema0020(descElem, messageRef, reporter))
          {
@@ -1163,14 +1157,12 @@
        {
       DescriptionElement descElem = new DescriptionImpl();
       descElem.setExtensionRegistry(new PopulatedExtensionRegistry());
-      descElem.setTypesElement(types);
-      InterfaceElement interfaceElem = descElem.createInterfaceElement();
-      InterfaceOperationElement interfaceOperation = 
descElem.createInterfaceOperationElement();
-      InterfaceMessageReferenceElement messageRef = 
descElem.createInterfaceMessageReferenceElement();
+      TypesElement types = descElem.getTypesElement();
+      types.addSchema(schema);
+      InterfaceElement interfaceElem = descElem.addInterfaceElement();
+      InterfaceOperationElement interfaceOperation = 
interfaceElem.addInterfaceOperationElement();
+      InterfaceMessageReferenceElement messageRef = 
interfaceOperation.addInterfaceMessageReferenceElement();
       messageRef.setElementName(new QName("http://www.sample.org";, 
"myElement2"));
-      interfaceOperation.addInterfaceMessageReferenceElement(messageRef);
-      interfaceElem.addInterfaceOperationElement(interfaceOperation);
-      descElem.addInterfaceElement(interfaceElem);
       
          if(!val.testAssertionSchema0020(descElem, messageRef, reporter))
          {
@@ -1189,14 +1181,12 @@
        {
       DescriptionElement descElem = new DescriptionImpl();
       descElem.setExtensionRegistry(new PopulatedExtensionRegistry());
-      descElem.setTypesElement(types);
-      InterfaceElement interfaceElem = descElem.createInterfaceElement();
-      InterfaceOperationElement interfaceOperation = 
descElem.createInterfaceOperationElement();
-      InterfaceMessageReferenceElement messageRef = 
descElem.createInterfaceMessageReferenceElement();
+      TypesElement types = descElem.getTypesElement();
+      types.addSchema(schema);
+      InterfaceElement interfaceElem = descElem.addInterfaceElement();
+      InterfaceOperationElement interfaceOperation = 
interfaceElem.addInterfaceOperationElement();
+      InterfaceMessageReferenceElement messageRef = 
interfaceOperation.addInterfaceMessageReferenceElement();
       messageRef.setElementName(new QName("http://www.sample.org";, "myType"));
-      interfaceOperation.addInterfaceMessageReferenceElement(messageRef);
-      interfaceElem.addInterfaceOperationElement(interfaceOperation);
-      descElem.addInterfaceElement(interfaceElem);
       
          if(val.testAssertionSchema0020(descElem, messageRef, reporter))
          {
@@ -1241,17 +1231,17 @@
   public void testTestAssertionSchema0020b()
   {
        // Create a schema for use in the tests and add it to a types section.
-       TypesElement types = new DescriptionImpl().createTypesElement();
-       String schemaString = "<schema 
xmlns=\"http://www.w3.org/2001/XMLSchema\"; 
targetNamespace=\"http://www.sample.org\";>"
-                 + "<complexType name=\"myType\">"     
-                 + "<sequence>"     
-          + "<element  name=\"element\" type=\"string\"/>"      
-          + "</sequence>"     
-          + "</complexType>" 
-          +    "<element name=\"myElement\" type=\"string\"/>"
-          + "</schema>";
+    InlinedSchema schema = new InlinedSchemaImpl();
        try
        {
+      String schemaString = "<schema 
xmlns=\"http://www.w3.org/2001/XMLSchema\"; 
targetNamespace=\"http://www.sample.org\";>"
+              + "<complexType name=\"myType\">"     
+              + "<sequence>"     
+              + "<element  name=\"element\" type=\"string\"/>"      
+              + "</sequence>"     
+              + "</complexType>" 
+              + "<element name=\"myElement\" type=\"string\"/>"
+              + "</schema>";
          DOMParser builder = new DOMParser();
          Reader reader = new StringReader(schemaString);
       XMLInputSource is = new XMLInputSource(null,null,null,reader,null);
@@ -1260,9 +1250,9 @@
       XmlSchemaCollection xsc = new XmlSchemaCollection();
       XmlSchema xs1 = xsc.read(schemaDoc1.getDocumentElement());
       URI schemaNS = new URI("http://www.sample.org";);
-      InlinedSchema schema = new InlinedSchemaImpl();
       schema.setSchemaDefinition(xs1);
       schema.setNamespace(schemaNS);
+      TypesElement types = new DescriptionImpl().getTypesElement();
       types.addSchema(schema);
        }
        catch(Exception e)
@@ -1276,12 +1266,11 @@
     try
        {
       DescriptionElement descElem = new DescriptionImpl();
-      descElem.setTypesElement(types);
-      InterfaceElement interfaceElem = descElem.createInterfaceElement();
-      InterfaceFaultElement fault = descElem.createInterfaceFaultElement();
+      TypesElement types = descElem.getTypesElement();
+      types.addSchema(schema);
+      InterfaceElement interfaceElem = descElem.addInterfaceElement();
+      InterfaceFaultElement fault = interfaceElem.addInterfaceFaultElement();
       fault.setElementName(new QName("http://www.sample.org";, "myElement"));
-      interfaceElem.addInterfaceFaultElement(fault);
-      descElem.addInterfaceElement(interfaceElem);
       
          if(!val.testAssertionSchema0020b(descElem, fault, reporter))
          {
@@ -1300,12 +1289,11 @@
     try
        {
       DescriptionElement descElem = new DescriptionImpl();
-      descElem.setTypesElement(types);
-      InterfaceElement interfaceElem = descElem.createInterfaceElement();
-      InterfaceFaultElement fault = descElem.createInterfaceFaultElement();
+      TypesElement types = descElem.getTypesElement();
+      types.addSchema(schema);
+      InterfaceElement interfaceElem = descElem.addInterfaceElement();
+      InterfaceFaultElement fault = interfaceElem.addInterfaceFaultElement();
       fault.setElementName(new QName("http://www.sample.org";, "myElement2"));
-      interfaceElem.addInterfaceFaultElement(fault);
-      descElem.addInterfaceElement(interfaceElem);
       
          if(!val.testAssertionSchema0020b(descElem, fault, reporter))
          {
@@ -1323,12 +1311,11 @@
     try
        {
       DescriptionElement descElem = new DescriptionImpl();
-      descElem.setTypesElement(types);
-      InterfaceElement interfaceElem = descElem.createInterfaceElement();
-      InterfaceFaultElement fault = descElem.createInterfaceFaultElement();
+      TypesElement types = descElem.getTypesElement();
+      types.addSchema(schema);
+      InterfaceElement interfaceElem = descElem.addInterfaceElement();
+      InterfaceFaultElement fault = interfaceElem.addInterfaceFaultElement();
       fault.setElementName(new QName("http://www.sample.org";, "myType"));
-      interfaceElem.addInterfaceFaultElement(fault);
-      descElem.addInterfaceElement(interfaceElem);
       
          if(val.testAssertionSchema0020b(descElem, fault, reporter))
          {
@@ -1375,20 +1362,20 @@
   public void testTestAssertionSchema0016()
   {
        // Create a schema for use in the tests and add it to a types section.
-       TypesElement types = new DescriptionImpl().createTypesElement();
-       String schemaString = "<schema 
xmlns=\"http://www.w3.org/2001/XMLSchema\"; 
targetNamespace=\"http://www.sample.org\";>"
-                 + "<complexType name=\"myType\">"     
-                 + "<sequence>"     
-          + "<element  name=\"element\" type=\"string\"/>"      
-          + "</sequence>"     
-          + "</complexType>" 
-          +    "<element name=\"myElement\" type=\"string\"/>"
-          + "</schema>";
-       XmlSchema xs1 = null;
-       URI schemaNS = null;
+    InlinedSchema schema = new InlinedSchemaImpl();
+    XmlSchema xs1 = null;
+    URI schemaNS = null;
        try
        {
-         DOMParser builder = new DOMParser();
+      String schemaString = "<schema 
xmlns=\"http://www.w3.org/2001/XMLSchema\"; 
targetNamespace=\"http://www.sample.org\";>"
+              + "<complexType name=\"myType\">"     
+              + "<sequence>"     
+              + "<element  name=\"element\" type=\"string\"/>"      
+              + "</sequence>"     
+              + "</complexType>" 
+              + "<element name=\"myElement\" type=\"string\"/>"
+              + "</schema>";
+      DOMParser builder = new DOMParser();
          Reader reader = new StringReader(schemaString);
       XMLInputSource is = new XMLInputSource(null,null,null,reader,null);
       builder.parse(is);
@@ -1396,9 +1383,9 @@
       XmlSchemaCollection xsc = new XmlSchemaCollection();
       xs1 = xsc.read(schemaDoc1.getDocumentElement());
       schemaNS = new URI("http://www.sample.org";);
-      InlinedSchema schema = new InlinedSchemaImpl();
       schema.setSchemaDefinition(xs1);
       schema.setNamespace(schemaNS);
+      TypesElement types = new DescriptionImpl().getTypesElement();
       types.addSchema(schema);
        }
        catch(Exception e)
@@ -1411,7 +1398,8 @@
     try
        {
       DescriptionElement descElem = new DescriptionImpl();
-      descElem.setTypesElement(types);
+      TypesElement types = descElem.getTypesElement();
+      types.addSchema(schema);
       
          if(!val.testAssertionSchema0016(descElem, null, reporter))
          {
@@ -1429,7 +1417,8 @@
     try
        {
       DescriptionElement descElem = new DescriptionImpl();
-      descElem.setTypesElement(types);
+      TypesElement types = descElem.getTypesElement();
+      types.addSchema(schema);
       
          if(!val.testAssertionSchema0016(descElem, "http://www.sample.org";, 
reporter))
          {
@@ -1447,12 +1436,11 @@
     try
        {
       DescriptionElement descElem = new DescriptionImpl();
-      TypesElement typesImported = descElem.createTypesElement();
+      TypesElement typesImported = descElem.getTypesElement();
       ImportedSchema importedSchema = new ImportedSchemaImpl();
       importedSchema.setSchemaDefinition(xs1);
       importedSchema.setNamespace(schemaNS);
       typesImported.addSchema(importedSchema);
-      descElem.setTypesElement(typesImported);
       
          if(!val.testAssertionSchema0016(descElem, "http://www.sample.org";, 
reporter))
          {
@@ -1506,13 +1494,12 @@
     try
        {
       DescriptionElement descElem = new DescriptionImpl();
-      TypesElement typesImported = descElem.createTypesElement();
+      TypesElement typesImported = descElem.getTypesElement();
       InlinedSchema inlinedSchema = new InlinedSchemaImpl();
       typesImported.addSchema(inlinedSchema);
       InlinedSchema inlinedSchema2 = new InlinedSchemaImpl();
       inlinedSchema2.setNamespace(schemaNS);
       typesImported.addSchema(inlinedSchema2);
-      descElem.setTypesElement(typesImported);
       
          if(!val.testAssertionSchema0016(descElem, "http://www.sample.org";, 
reporter))
          {

Modified: 
incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTests.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTests.java?view=diff&rev=447385&r1=447384&r2=447385
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTests.java 
(original)
+++ incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTests.java 
Mon Sep 18 05:21:19 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.woden.tests;
 
+import org.apache.woden.wsdl20.xml.ChildElementCreationTest;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
@@ -43,6 +45,7 @@
     
       addTest(AllWodenTestsDOM.suite());
       addTest(AllWodenTestsOM.suite());
+      addTest(ChildElementCreationTest.suite());
     //TODO in-progress 30May06 tests for BindingOpExt and BindingMsgRefExt
   }
        

Modified: 
incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java?view=diff&rev=447385&r1=447384&r2=447385
==============================================================================
--- 
incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
 (original)
+++ 
incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
 Mon Sep 18 05:21:19 2006
@@ -97,8 +97,7 @@
     public void testSetAndGetNameFromOM() throws Exception{
         DescriptionElement descElem = new DescriptionImpl();
         descElem.setTargetNamespace(new URI("urn:woden"));
-        ServiceElement service = new ServiceImpl();
-        descElem.addServiceElement(service);
+        ServiceElement service = descElem.addServiceElement();
         service.setName(new NCName(fQName.getLocalPart()));
         assertTrue("QName returned by ServiceElement.getName() was not the one 
set by setName().",
                    fQName.equals(service.getName()));
@@ -156,19 +155,5 @@
         EndpointElement[] endpoints = fParsedService.getEndpointElements();
         assertTrue("ServiceElement.getEndpointElements() did not return 3 
endpoints, as expected.",
                 endpoints.length == 3);
-    }
-
-    /**
-     * Test that the EndpointElement added by the addEndpointElement method is
-     * present in the array returned by getEndpointElements.
-     */
-    public void testAddAndGetEndpointElementFromOM(){
-        EndpointElement endpoint = new EndpointImpl();
-        endpoint.setName(new NCName("endpoint99"));
-        ServiceElement service = new ServiceImpl();
-        service.addEndpointElement(endpoint);
-        assertTrue("The EndpointElement added by the 
ServiceElement.addEndpointElement method " +
-                   "was not returned by ServiceElement.getEndpointElements()",
-                   endpoint == service.getEndpointElements()[0]);
     }
 }

Modified: 
incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java?view=diff&rev=447385&r1=447384&r2=447385
==============================================================================
--- 
incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java
 (original)
+++ 
incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java
 Mon Sep 18 05:21:19 2006
@@ -103,8 +103,7 @@
     {
         DescriptionElement descElem = new DescriptionImpl();
         descElem.setTargetNamespace(new URI("urn:woden"));
-        ServiceElement service = new ServiceImpl();
-        descElem.addServiceElement(service);
+        ServiceElement service = descElem.addServiceElement();
         service.setName(new NCName(fQName.getLocalPart()));
         assertTrue("QName returned by ServiceElement.getName() was not the one 
set by setName().",
                    fQName.equals(service.getName()));
@@ -167,21 +166,4 @@
         assertTrue("ServiceElement.getEndpointElements() did not return 3 
endpoints, as expected.",
                 endpoints.length == 3);
     }
-
-    /**
-     * Test that the EndpointElement added by the addEndpointElement method is
-     * present in the array returned by getEndpointElements.
-     */
-    public void testAddAndGetEndpointElement()
-    {
-        EndpointElement endpoint = new EndpointImpl();
-        endpoint.setName(new NCName("endpoint99"));
-        ServiceElement service = new ServiceImpl();
-        service.addEndpointElement(endpoint);
-        assertTrue("The EndpointElement added by the 
ServiceElement.addEndpointElement method " +
-                   "was not returned by ServiceElement.getEndpointElements()",
-                   endpoint == service.getEndpointElements()[0]);
-        
-    }
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to