Author: lmandel
Date: Mon Jan 29 11:39:20 2007
New Revision: 501155
URL: http://svn.apache.org/viewvc?view=rev&rev=501155
Log:
[WODEN-132] Broke up the validateInterfaces method into separate methods for
each component. Performed some other cleanup of the class.
Modified:
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java
Modified:
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java
URL:
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java?view=diff&rev=501155&r1=501154&r2=501155
==============================================================================
---
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java
(original)
+++
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java
Mon Jan 29 11:39:20 2007
@@ -62,7 +62,7 @@
*/
public void validate(Description desc, ErrorReporter errorReporter) throws
WSDLException
{
- validateInterfaces(desc.getInterfaces(), desc, errorReporter);
+ validateInterfaces(desc.getInterfaces(), errorReporter);
validateBindings(desc.getBindings(), desc, errorReporter);
validateServices(desc.getServices(), desc, errorReporter);
}
@@ -71,11 +71,10 @@
* Validate the interfaces in the WSDL component model.
*
* @param interfaces The interfaces in the WSDL component model.
- * @param desc The WSDL 2.0 description component.
* @param errorReporter An error reporter to be used for reporting errors.
* @throws WSDLException A WSDLException is thrown if a problem occurs while
validating the interface components.
*/
- protected void validateInterfaces(Interface[] interfaces, Description desc,
ErrorReporter errorReporter) throws WSDLException
+ protected void validateInterfaces(Interface[] interfaces, ErrorReporter
errorReporter) throws WSDLException
{
testAssertionInterface0030(interfaces, errorReporter);
@@ -86,84 +85,96 @@
testAssertionInterface0027(interfac, errorReporter);
- InterfaceOperation[] interfaceOperations =
interfac.getInterfaceOperations();
- testAssertionInterfaceOperation0035(interfaceOperations,
errorReporter);
+ validateInterfaceOperations(interfac,
interfac.getInterfaceOperations(), errorReporter);
- int numInterfaceOperations = interfaceOperations.length;
- for(int j = 0; j < numInterfaceOperations; j++)
- {
- InterfaceOperation interfaceOperation = interfaceOperations[j];
-
-
testAssertionMEP0037(interfaceOperation.getMessageExchangePattern(),
errorReporter);
- testAssertionInterfaceOperation0029(interfaceOperation,
interfac, errorReporter);
-
- InterfaceMessageReference[] messageReferences =
interfaceOperation.getInterfaceMessageReferences();
-
- testAssertionInterfaceMessageReference0042(messageReferences,
errorReporter);
-
- int numMessageReferences = messageReferences.length;
- for(int k = 0; k < numMessageReferences; k++)
- {
- InterfaceMessageReference messageReference =
messageReferences[k];
-
- testAssertionInterfaceMessageReference0041(messageReference,
errorReporter);
- }
+ validateInterfaceFaults(interfac, interfac.getInterfaceFaults(),
errorReporter);
+ }
+ }
+
+ /**
+ * Validate the interface operations in the WSDL component model.
+ *
+ * @param interfac The interface that contains the interface operations.
+ * @param interfaceOperations An array of the interface operations.
+ * @param errorReporter An error reporter.
+ * @throws WSDLException
+ */
+ protected void validateInterfaceOperations(Interface interfac,
InterfaceOperation[] interfaceOperations, ErrorReporter errorReporter) throws
WSDLException
+ {
+ testAssertionInterfaceOperation0035(interfaceOperations, errorReporter);
+
+ int numInterfaceOperations = interfaceOperations.length;
+ for(int j = 0; j < numInterfaceOperations; j++)
+ {
+ InterfaceOperation interfaceOperation = interfaceOperations[j];
- InterfaceFaultReference[] faultReferences =
interfaceOperation.getInterfaceFaultReferences();
+ testAssertionMEP0037(interfaceOperation.getMessageExchangePattern(),
errorReporter);
+ testAssertionInterfaceOperation0029(interfaceOperation, interfac,
errorReporter);
- testAssertionInterfaceFaultReference0045(faultReferences,
errorReporter);
+
validateInterfaceMessageReferences(interfaceOperation.getInterfaceMessageReferences(),
errorReporter);
- int numFaultReferences = faultReferences.length;
- for(int k = 0; k < numFaultReferences; k++)
- {
- InterfaceFaultReference faultReference = faultReferences[k];
- //TODO check if any validation is required here
- }
- }
-
- InterfaceFault[] interfaceFaults = interfac.getInterfaceFaults();
- testAssertionInterfaceFault0032(interfaceFaults, errorReporter);
+
validateInterfaceFaultReferences(interfaceOperation.getInterfaceFaultReferences(),
errorReporter);
+ }
+ }
+
+ /**
+ * Validate the interface faults in the WSDL component model.
+ *
+ * @param interfac The interface that contains the interface faults.
+ * @param interfaceFaults An array of the interface faults.
+ * @param errorReporter An error reporter.
+ * @throws WSDLException
+ */
+ protected void validateInterfaceFaults(Interface interfac, InterfaceFault[]
interfaceFaults, ErrorReporter errorReporter) throws WSDLException
+ {
+ testAssertionInterfaceFault0032(interfaceFaults, errorReporter);
- int numInterfaceFaults = interfaceFaults.length;
- for(int j = 0; j < numInterfaceFaults; j++)
- {
- InterfaceFault interfaceFault = interfaceFaults[j];
+ int numInterfaceFaults = interfaceFaults.length;
+ for(int j = 0; j < numInterfaceFaults; j++)
+ {
+ InterfaceFault interfaceFault = interfaceFaults[j];
- testAssertionInterfaceFault0028(interfaceFault, interfac,
errorReporter);
- }
- }
-
-//
-// # test for equivalence of two fault definitions. Should the
equivalence code be in the InterfaceFault class.
-// interface-fault-0033 =
-// interface-fault-0033.ref = 2.3.1
-// interface-fault-0033.assertion = In cases where, due to an
interface extending one or more other interfaces, two or more Interface Fault
components have the same value for their {name} property, then the component
models of those Interface Fault components MUST be equivalent (see 2.17
Equivalence of Components).
- // # next three messages are MEP related
-// interface-fault-ref-0043 =
-// interface-fault-ref-0043.ref = 2.6.1
-// interface-fault-ref-0043.assertion = The value of this property
MUST match the name of a placeholder message defined by the message exchange
pattern.
- //
-// interface-fault-ref-0044 =
-// interface-fault-ref-0044.ref = 2.6.1
-// interface-fault-ref-0044.assertion = The direction MUST be
consistent with the direction implied by the fault propagation ruleset used in
the message exchange pattern of the operation.
- //
-//
-// interface-message-ref-0040 =
-// interface-message-ref-0040.ref = 2.5.1
-// interface-message-ref-0040.assertion = The direction MUST be
the same as the direction of the message identified by the {message label}
property in the {message exchange pattern} of the Interface Operation component
this is contained within.
- //
-//
-//
-//
-// interface-operation-0036 =
-// interface-operation-0036 = 2.4.1
-// interface-operation-0036.assertion = In cases where, due to an
interface extending one or more other interfaces, two or more Interface
Operation components have the same value for their {name} property, then the
component models of those Interface Operation components MUST be equivalent
(see 2.17 Equivalence of Components).
- //
-// interface-operation-0038 =
-// interface-operation-0038.ref = 2.4.1.2
-// interface-operation-0038.assertion = An Interface Operation
component MUST satisfy the specification defined by each operation style
identified by its {style} property.
- //
+ testAssertionInterfaceFault0028(interfaceFault, interfac, errorReporter);
+ }
+ }
+
+ /**
+ * Validate the interface message references in the WSDL component model.
+ *
+ * @param messageReferences An array containing the interface message
references.
+ * @param errorReporter An error reporter.
+ * @throws WSDLException
+ */
+ protected void
validateInterfaceMessageReferences(InterfaceMessageReference[]
messageReferences, ErrorReporter errorReporter) throws WSDLException
+ {
+ testAssertionInterfaceMessageReference0042(messageReferences,
errorReporter);
+ int numMessageReferences = messageReferences.length;
+ for(int k = 0; k < numMessageReferences; k++)
+ {
+ InterfaceMessageReference messageReference = messageReferences[k];
+
+ testAssertionInterfaceMessageReference0041(messageReference,
errorReporter);
+ }
+ }
+
+ /**
+ * Validate the interface fault references in the WSDL component model.
+ *
+ * @param faultReferences An array containing the interface fault references.
+ * @param errorReporter An error reporter.
+ * @throws WSDLException
+ */
+ protected void validateInterfaceFaultReferences(InterfaceFaultReference[]
faultReferences, ErrorReporter errorReporter) throws WSDLException
+ {
+ testAssertionInterfaceFaultReference0045(faultReferences,
errorReporter);
+
+// int numFaultReferences = faultReferences.length;
+// for(int k = 0; k < numFaultReferences; k++)
+// {
+// InterfaceFaultReference faultReference = faultReferences[k];
+// //TODO check if any validation is required here
+// }
}
/**
@@ -1038,30 +1049,4 @@
}
return true;
}
-
-// property-0051 =
-// property-0051.ref = 2.8.1.1
-// property-0051.assertion = All specified values MUST be equal and belong
to each specified value set.
-//
-//
-
-//
-// # ---------------- WSDL Component Level Assertions -------------------
-//
- // # This assertion may be a dup of others.
-// description-0024 =
-// description-0024.ref = 2.1.2
-// description-0024.assertion = Each WSDL 2.0 or type system component
MUST be uniquely identified by its qualified name.
-//
-// message-label-0039 =
-// message-label-0039.ref = 2.5.1
-// message-label-0039.assertion = The value of this property MUST match
the name of a placeholder message defined by the message exchange pattern.
-//
-// qname-0002 =
-// qname-0002.assertion = Furthermore, all QName references, whether to
the same of to difference namespace MUST resolve to components (see 2.1.9 QName
resolution).
-//
-// types-0026 =
-// types-0026.ref = 2.1.2.1
-// types-0026.assertion = It is an error if there are multiple type
definitions for each QName.
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]