Author: sagara
Date: Mon Jul 9 06:31:20 2012
New Revision: 1358931
URL: http://svn.apache.org/viewvc?rev=1358931&view=rev
Log:
Fix AXIS2-5363.
Added:
axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/schemas/custom_schemas/sampleSchema7.xsd
(with props)
Modified:
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/SchemaCompilerTest.java
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/XMLSchemaTest.java
Added:
axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/schemas/custom_schemas/sampleSchema7.xsd
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/schemas/custom_schemas/sampleSchema7.xsd?rev=1358931&view=auto
==
---
axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/schemas/custom_schemas/sampleSchema7.xsd
(added)
+++
axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/schemas/custom_schemas/sampleSchema7.xsd
Mon Jul 9 06:31:20 2012
@@ -0,0 +1,57 @@
+
+
+
+http://www.w3.org/2001/XMLSchema";>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Propchange:
axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/schemas/custom_schemas/sampleSchema7.xsd
--
svn:eol-style = native
Modified:
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/SchemaCompilerTest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/SchemaCompilerTest.java?rev=1358931&r1=1358930&r2=1358931&view=diff
==
---
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/SchemaCompilerTest.java
(original)
+++
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/SchemaCompilerTest.java
Mon Jul 9 06:31:20 2012
@@ -23,13 +23,13 @@ import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
import org.apache.ws.commons.schema.XmlSchema;
import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.junit.Test;
import org.w3c.dom.Document;
public class SchemaCompilerTest extends XMLSchemaTest{
@@ -41,8 +41,7 @@ public class SchemaCompilerTest extends
@Override
protected void setUp() throws Exception {
-schemas=new ArrayList();
-loadSampleSchemaFile(schemas);
+schemas=new ArrayList();
schemaCompiler=new SchemaCompiler(null);
}
@@ -52,8 +51,11 @@ public class SchemaCompilerTest extends
super.tearDown();
}
-@Test
+
public void testCompileSchema() throws Exception{
+List excludes = new ArrayList();
+excludes.add(6);
+loadSampleSchemaFile(schemas, excludes);
Map map=schemaCompiler.getProcessedModelMap();
schemaCompiler.compile(schemas);
processedElementMap=schemaCompiler.getProcessedElementMap();
@@ -73,9 +75,17 @@ public class SchemaCompilerTest extends
}
-
-
-
-
+public void testCompileSchemaForMixContent() throws Exception {
+schemas.add(loadSampleSchemaFile(String.valueOf(6)));
+Map map = schemaCompiler.getProcessedModelMap();
+try {
+schemaCompiler.compile(schemas);
+fail("Compiling sampleSchema6.xsd should throw
SchemaCompilationException");
+} catch (SchemaCompilationException e) {
+assertTrue(e.getMessage().contains(
+"SD complexType with mix content not supported in ADB"));
+}
+
+}
}
Modified:
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/XMLSchemaTest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/XMLSchemaTest.java?rev=1358931&r1=1358930&r2=1358931&view=diff
==
---
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/XMLSchemaTest.java
(original)
+++
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/XMLSchemaTest.java
Mon Jul 9 06:31:20 2012
@@ -27,6 +27,7 @@ import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.List;
import javax.xml.transform.stream.StreamSource;
@@ -70,22 +71,35 @@ public abstract class XMLSchemaTest exte
}
public void loadSampleSchemaFile(ArrayList sche