Author: sagara
Date: Wed Jun 13 06:19:17 2012
New Revision: 1349653

URL: http://svn.apache.org/viewvc?rev=1349653&view=rev
Log:
reverting  r1349648 due to build issues. 

Removed:
    
axis/axis2/java/core/trunk/modules/codegen/test-resources/schemas/custom_schemas/
    
axis/axis2/java/core/trunk/modules/codegen/test/org/apache/axis2/wsdl/codegen/CodeGenConfigurationTest.java
    
axis/axis2/java/core/trunk/modules/codegen/test/org/apache/axis2/wsdl/codegen/XMLSchemaTest.java
    
axis/axis2/java/core/trunk/modules/codegen/test/org/apache/axis2/wsdl/codegen/writer/
Modified:
    axis/axis2/java/core/trunk/modules/codegen/pom.xml
    
axis/axis2/java/core/trunk/modules/codegen/test/org/apache/axis2/wsdl/codegen/schema/AxisServiceTopElementSchemaGeneratorTest.java

Modified: axis/axis2/java/core/trunk/modules/codegen/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/codegen/pom.xml?rev=1349653&r1=1349652&r2=1349653&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/codegen/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/codegen/pom.xml Wed Jun 13 06:19:17 2012
@@ -77,11 +77,6 @@
              <artifactId>jaxws-rt</artifactId>            
              <scope>test</scope>
         </dependency>
-           <dependency>
-                <groupId>xmlunit</groupId>
-                <artifactId>xmlunit</artifactId>
-             <scope>test</scope>
-           </dependency>
     </dependencies>
     <url>http://axis.apache.org/axis2/java/core/</url>
     <scm>

Modified: 
axis/axis2/java/core/trunk/modules/codegen/test/org/apache/axis2/wsdl/codegen/schema/AxisServiceTopElementSchemaGeneratorTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/codegen/test/org/apache/axis2/wsdl/codegen/schema/AxisServiceTopElementSchemaGeneratorTest.java?rev=1349653&r1=1349652&r2=1349653&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/codegen/test/org/apache/axis2/wsdl/codegen/schema/AxisServiceTopElementSchemaGeneratorTest.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/codegen/test/org/apache/axis2/wsdl/codegen/schema/AxisServiceTopElementSchemaGeneratorTest.java
 Wed Jun 13 06:19:17 2012
@@ -19,85 +19,16 @@
 
 package org.apache.axis2.wsdl.codegen.schema;
 
-import java.util.ArrayList;
+import junit.framework.TestCase;
+import org.apache.axis2.namespace.Constants;
+
+import javax.xml.namespace.QName;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import javax.xml.namespace.QName;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.OperationContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.description.AxisMessage;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.namespace.Constants;
-import org.apache.axis2.wsdl.codegen.XMLSchemaTest;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.junit.Test;
-
-public class AxisServiceTopElementSchemaGeneratorTest extends XMLSchemaTest {
-    
-
-    private AxisService service;
-    private ArrayList<XmlSchema> schemas;
-    private AxisServiceTopElementSchemaGenerator generator;
-    private Map schemaMap;
-    private Set topElements;
-
-    @Override
-    protected void setUp() throws Exception {
-        service = new AxisService();
-        schemas = new ArrayList<XmlSchema>();
-        loadSampleSchemaFile(schemas);
-        service.addSchema(schemas);
-        generator = new AxisServiceTopElementSchemaGenerator(null);
-
-        topElements = new HashSet();
-
-        TopElement topElement;
-
-        topElement = new TopElement(new QName("http://test.com";, 
"testElement1"));
-        topElements.add(topElement);
-        topElement = new TopElement(new QName("http://test1.com";, 
"testElement2"));
-        topElements.add(topElement);
-        topElement = new TopElement(new QName("http://test1.com";, 
"testElement3"));
-        topElement.setTypeQName(new QName(Constants.URI_2001_SCHEMA_XSD, 
"string"));
-        topElements.add(topElement);
-
-        topElement = new TopElement(new QName("http://test1.com";, 
"testElement4"));
-        topElement.setTypeQName(new QName("http://test1.com";, 
"testComplexType1"));
-        topElements.add(topElement);
-
-        topElement = new TopElement(new QName("http://test1.com";, 
"testElement5"));
-        topElement.setTypeQName(new QName("http://test.com";, 
"testComplexType2"));
-        topElements.add(topElement);
-
-        topElement = new TopElement(new QName("http://test.com";, 
"testElement6"));
-        topElement.setTypeQName(new QName("http://test2.com";, 
"testComplexType2"));
-        topElements.add(topElement);
-
-        schemaMap = generator.getSchemaMap(topElements);
-        generator.getXmlSchemaList(schemaMap);
-
-        super.setUp();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        service = null;
-        generator = null;
-        schemaMap.clear();
-        topElements = null;
-        super.tearDown();
-    }
 
+public class AxisServiceTopElementSchemaGeneratorTest extends TestCase {
 
     public void testSchemaGeneration() throws Exception {
 
@@ -135,139 +66,4 @@ public class AxisServiceTopElementSchema
 //            
((org.apache.ws.commons.schema.XmlSchema)aXmlSchemaList).write(System.out);
 //        }
     }
-    
-    @Test
-    public void testGetSchemaMap(){
-        schemaMap = generator.getSchemaMap(topElements);
-        org.apache.axis2.wsdl.codegen.schema.XmlSchema 
schema=(org.apache.axis2.wsdl.codegen.schema.XmlSchema)schemaMap.get("http://test.com";);
-        TopElement topElement = new TopElement(new QName("http://test.com";, 
"testElement1"));
-        assertTrue(schemaMap.size()==3);
-        assertEquals(schema.getTargetNamespace(), "http://test.com";);
-    }
-    
-    @Test
-    public void testGetTopElements() throws Exception {
-        AxisOperation axisOperation = new AxisOperation() {
-
-            @Override
-            public void setRemainingPhasesInFlow(ArrayList list) {
-            }
-
-            @Override
-            public void setPhasesOutFlow(ArrayList list) {
-            }
-
-            @Override
-            public AxisService getAxisService() {
-                return service;
-            }
-
-            @Override
-            public void setPhasesOutFaultFlow(ArrayList list) {
-
-            }
-
-            @Override
-            public void setPhasesInFaultFlow(ArrayList list) {
-            }
-
-            @Override
-            public ArrayList getRemainingPhasesInFlow() {
-                return null;
-            }
-
-            @Override
-            public ArrayList getPhasesOutFlow() {
-                return null;
-            }
-
-            @Override
-            public ArrayList getPhasesOutFaultFlow() {
-                return null;
-            }
-
-            @Override
-            public ArrayList getPhasesInFaultFlow() {
-                return null;
-            }
-
-            @Override
-            public AxisMessage getMessage(String label) {
-                return null;
-            }
-
-            @Override
-            public OperationClient createClient(ServiceContext sc, Options 
options) {
-                return null;
-            }
-
-            @Override
-            public void addMessageContext(MessageContext msgContext, 
OperationContext opContext)
-                    throws AxisFault {
-            }
-
-            @Override
-            public void addMessage(AxisMessage message, String label) {
-            }
-
-            @Override
-            public void addFaultMessageContext(MessageContext msgContext, 
OperationContext opContext)
-                    throws AxisFault {
-
-            }
-        };
-        axisOperation.setName(new QName("http://www.w3schools.com";, "tset"));
-        AxisMessage axisMessage = new AxisMessage();
-        axisMessage.setParent(axisOperation);
-        axisMessage.setElementQName(new QName("http://www.w3schools.com";, 
"note"));
-        axisOperation.addChild("message",axisMessage);
-        service.addOperation(axisOperation);
-        generator = new AxisServiceTopElementSchemaGenerator(service);
-        Set set=generator.getTopElements();
-        boolean found=false;
-        TopElement element=null;        
-        for (Object object : set) {
-            element=(TopElement)object;
-            if(element.getElementQName().equals(new 
QName("http://www.w3schools.com";, "note"))){
-                found=true;
-            }
-        }
-        assertTrue(found);
-    }
-
-    @Test
-    public void testGetSchemaElement() throws Exception {
-        generator = new AxisServiceTopElementSchemaGenerator(service);
-        XmlSchemaElement element=generator.getSchemaElement(new 
QName("http://www.w3schools.com","note";));
-        assertNotNull(element);
-        assertEquals(element.getName(), "note");
-        
-    }
-
-    @Test
-    public void testGetXmlSchemaList() throws Exception {
-        Map map = generator.getSchemaMap(topElements);
-        List xmlSchemaList = generator.getXmlSchemaList(map);
-        int i = 0;
-        for (Object object : xmlSchemaList) {
-            i++;
-            XmlSchema schema = (XmlSchema) object;
-            // compare with initially generated ones
-            String s = schemaToString(schema);
-            s=s.replaceAll("<xsd:element name=\"testElement6\" 
type=\".*:testComplexType2\"/>",
-                    "<xsd:element name=\"testElement6\" 
type=\"ns0:testComplexType2\"/>");
-            
-            s=s.replaceAll("<xsd:element name=\"testElement5\" 
type=\".*:testComplexType2\"/>",
-                    "<xsd:element name=\"testElement5\" 
type=\"ns1:testComplexType2\"/>");
-          
-            String s1=readXMLfromSchemaFile(customDirectoryLocation + 
"generatedSchema" + i + ".xsd");
-  
-          assertNotNull(s);
-         
-       
-        }
-    }
-    
-    
-    
 }


Reply via email to