Author: jkaputin Date: Mon Jan 8 10:07:38 2007 New Revision: 494134 URL: http://svn.apache.org/viewvc?view=rev&rev=494134 Log: WODEN-100 Removed support for assertion Schema-0019 which required that an inlined schema had a targetNS, because that assertion has been removed from the WSDL2 spec. This fixes testcase Schema-1G.
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidator.java incubator/woden/trunk/java/test/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidatorTest.java Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties?view=diff&rev=494134&r1=494133&r2=494134 ============================================================================== --- incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties (original) +++ incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties Mon Jan 8 10:07:38 2007 @@ -154,9 +154,6 @@ Schema-0018b = The type ''{0}'' has already been defined in another inline XML Schema with the target namespace ''{1}''. Schema-0018b.assertion = A WSDL 2.0 document MUST NOT define the same element or type in more than one inlined schema. -Schema-0019 = The XML schema does not define a target namespace. A target namespace must be defined on all WSDL 2.0 inlined XML Schemas. -Schema-0019.assertion = The xs:schema element information item MUST contain a targetNamespace attribute information item. - # This assertion is for interface message reference Schema-0020 = The message reference ''{0}'' refers to the type definition ''{1}''. A message reference must refer to an element definition. Schema-0020.assertion = An element attribute information item MUST NOT refer to a global xs:simpleType or xs:complexType definition. Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java?view=diff&rev=494134&r1=494133&r2=494134 ============================================================================== --- incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java (original) +++ incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java Mon Jan 8 10:07:38 2007 @@ -202,7 +202,7 @@ //so replace it with the including schema's tns. edQN = new QName(schemaTns, xseQN.getLocalPart(), xseQN.getPrefix()); } - if(edQN.getNamespaceURI().equals(schemaTns)) //TODO test with schema imports, may be incorrect. + if(edQN.getNamespaceURI().equals(schemaTns) || schemaTns == null) //TODO test with schema imports, may be incorrect. { ElementDeclarationImpl ed = new ElementDeclarationImpl(); ed.setName(edQN); Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidator.java URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidator.java?view=diff&rev=494134&r1=494133&r2=494134 ============================================================================== --- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidator.java (original) +++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidator.java Mon Jan 8 10:07:38 2007 @@ -128,15 +128,6 @@ InlinedSchema[] inlinedSchemas = types.getInlinedSchemas(); if(!testAssertionSchema0018(inlinedSchemas, errorReporter)) isValid = false; - int numInlinedSchemas = inlinedSchemas.length; - for(int i = 0; i < numInlinedSchemas; i++) - { - InlinedSchema schema = (InlinedSchema)inlinedSchemas[i]; - - if(!testAssertionSchema0019(schema, errorReporter)) - isValid = false; - - } return isValid; } @@ -302,26 +293,6 @@ if(specifiedTargetNS != null && !specifiedTargetNS.equals(importedSchemaTargetNS)) { errorReporter.reportError(new ErrorLocatorImpl(), "Schema-0052", new Object[]{specifiedTargetNS}, ErrorReporter.SEVERITY_ERROR); - return false; - } - return true; - } - - /** - * Test assertion Schema-0019. Inlined XML Schemas must define - * a target namespace. - * - * @param schema The inline schema to check. - * @param errorReporter The error reporter. - * @return True if the assertion passes, false otherwise. - * @throws WSDLException - */ - protected boolean testAssertionSchema0019(InlinedSchema schema, ErrorReporter errorReporter) throws WSDLException - { - URI targetNS = schema.getNamespace(); - if(targetNS == null || targetNS.toString().equals("")) - { - errorReporter.reportError(new ErrorLocatorImpl(), "Schema-0019", new Object[]{}, ErrorReporter.SEVERITY_ERROR); return false; } return true; 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=494134&r1=494133&r2=494134 ============================================================================== --- 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 Jan 8 10:07:38 2007 @@ -430,103 +430,6 @@ } /** - * Test assertion Schema-0019. Inline schemas must defined a target namespace - */ - public void testTestAssertionSchema0019() - { - // Test that no error is reported for an inline schema that has - // defined a target namespace. - handler.reset(); - try - { - InlinedSchemaImpl inlinedSchema = new InlinedSchemaImpl(); - - inlinedSchema.setNamespace(new URI("http://www.sample.org")); - - - XmlSchema schema = new XmlSchema("http://www.sample.org", null); - inlinedSchema.setSchemaDefinition(schema); - if(!val.testAssertionSchema0019(inlinedSchema, reporter)) - { - fail("The testAssertionSchema0019 method returned false for a schema with a target namespace."); - } - } - catch(URISyntaxException e) - { - fail("There was a problem setting the namespace of the imported schema: " + e); - } - catch(WSDLException e) - { - fail("There was a problem running the test assertion method " + e); - } - - // Test that an error is reported for an inlined schema that has - // no defined target namespace. - handler.reset(); - try - { - InlinedSchemaImpl inlinedSchema = new InlinedSchemaImpl(); - - inlinedSchema.setNamespace(null); - - - XmlSchema schema = new XmlSchema(null, null); - inlinedSchema.setSchemaDefinition(schema); - if(val.testAssertionSchema0019(inlinedSchema, reporter)) - { - fail("There was no error reported for a schema with a null target namespace."); - } - else if(handler.errors.size() > 1) - { - fail("More than one error was reported for a schema with a null target namespace."); - } - else if(!handler.errors.containsKey("Schema-0019")) - { - fail("The error Schema-0019 was not reported for a schema with a null target namespace."); - } - } - catch(WSDLException e) - { - fail("There was a problem running the test assertion method " + e); - } - - // Test that an error is reported for an inlined schema that has - // an empty defined target namespace. - handler.reset(); - try - { - InlinedSchemaImpl inlinedSchema = new InlinedSchemaImpl(); - - inlinedSchema.setNamespace(new URI("")); - - - XmlSchema schema = new XmlSchema("", null); - inlinedSchema.setSchemaDefinition(schema); - if(val.testAssertionSchema0019(inlinedSchema, reporter)) - { - fail("There was no error reported for a schema with an empty target namespace."); - } - else if(handler.errors.size() > 1) - { - fail("More than one error was reported for a schema with an empty target namespace."); - } - else if(!handler.errors.containsKey("Schema-0019")) - { - fail("The error Schema-0019 was not reported for a schema with an empty target namespace."); - } - } - catch(URISyntaxException e) - { - fail("There was a problem setting the namespace of the imported schema: " + e); - } - catch(WSDLException e) - { - fail("There was a problem running the test assertion method " + e); - } - - } - - /** * Test assertion Schema-0018. Inline schemas must not define an element with a name * of an element that has already been defined in another inline schema with the same target namespace. */ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]