You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by gd...@apache.org on 2007/03/07 15:59:13 UTC
svn commit: r515594 [18/19] - in
/webservices/commons/trunk/modules/axiom/modules:
axiom-api/src/main/java/org/apache/axiom/attachments/
axiom-api/src/main/java/org/apache/axiom/attachments/utils/
axiom-api/src/main/java/org/apache/axiom/om/ axiom-api/...
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java?view=diff&rev=515594&r1=515593&r2=515594
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java Wed Mar 7 06:59:00 2007
@@ -149,246 +149,249 @@
SOAPEnvelope soap12Envelope = (SOAPEnvelope) soap12Builder.getDocumentElement();
assertTrue("SOAP 1.2 :- envelope local name mismatch",
- soap12Envelope.getLocalName().equals(
- SOAPConstants.SOAPENVELOPE_LOCAL_NAME));
+ soap12Envelope.getLocalName().equals(
+ SOAPConstants.SOAPENVELOPE_LOCAL_NAME));
assertTrue("SOAP 1.2 :- envelope namespace uri mismatch",
- soap12Envelope.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ soap12Envelope.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
SOAPHeader header = soap12Envelope.getHeader();
assertTrue("SOAP 1.2 :- Header local name mismatch",
- header.getLocalName().equals(
- SOAPConstants.HEADER_LOCAL_NAME));
+ header.getLocalName().equals(
+ SOAPConstants.HEADER_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Header namespace uri mismatch",
- header.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ header.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) header.getFirstElement();
assertTrue("SOAP 1.2 :- Header block name mismatch",
- headerBlock.getLocalName().equals("echoOk"));
+ headerBlock.getLocalName().equals("echoOk"));
assertTrue("SOAP 1.2 :- Header block name space uri mismatch",
- headerBlock.getNamespace().getNamespaceURI().equals(
- "http://example.org/ts-tests"));
- assertEquals("SOAP 1.2 :- Header block text mismatch", headerBlock.getText().trim(), "foo");
+ headerBlock.getNamespace().getNamespaceURI().equals(
+ "http://example.org/ts-tests"));
+ assertEquals("SOAP 1.2 :- Header block text mismatch", headerBlock.getText().trim(),
+ "foo");
// Attribute iteration is not in any guaranteed order.
// Use QNames to get the OMAttributes.
- QName roleQName = new QName(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAP12Constants.SOAP_ROLE);
- QName mustUnderstandQName = new QName(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAP12Constants.ATTR_MUSTUNDERSTAND);
+ QName roleQName = new QName(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP12Constants.SOAP_ROLE);
+ QName mustUnderstandQName = new QName(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP12Constants.ATTR_MUSTUNDERSTAND);
OMAttribute roleAttribute = headerBlock.getAttribute(roleQName);
OMAttribute mustUnderstandAttribute = headerBlock.getAttribute(mustUnderstandQName);
assertTrue("SOAP 1.2 :- Role attribute name not found",
- roleAttribute != null);
+ roleAttribute != null);
assertTrue("SOAP 1.2 :- Role value mismatch",
- roleAttribute.getAttributeValue().trim().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI + "/" +
- SOAP12Constants.SOAP_ROLE +
- "/" +
- "ultimateReceiver"));
+ roleAttribute.getAttributeValue().trim().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI + "/" +
+ SOAP12Constants.SOAP_ROLE +
+ "/" +
+ "ultimateReceiver"));
assertTrue("SOAP 1.2 :- Mustunderstand attribute not found",
- mustUnderstandAttribute != null);
+ mustUnderstandAttribute != null);
assertTrue("SOAP 1.2 :- Mustunderstand value mismatch",
- mustUnderstandAttribute.getAttributeValue().equals(
- SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE));
+ mustUnderstandAttribute.getAttributeValue().equals(
+ SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE));
SOAPBody body = soap12Envelope.getBody();
assertTrue("SOAP 1.2 :- Body local name mismatch",
- body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
+ body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Body namespace uri mismatch",
- body.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ body.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
SOAPFault fault = body.getFault();
assertTrue("SOAP 1.2 :- Fault local name mismatch",
- fault.getLocalName().equals(
- SOAPConstants.SOAPFAULT_LOCAL_NAME));
+ fault.getLocalName().equals(
+ SOAPConstants.SOAPFAULT_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault namespace uri mismatch",
- fault.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ fault.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
Iterator iteratorInFault = fault.getChildren();
iteratorInFault.next();
SOAPFaultCode code = (SOAPFaultCode) iteratorInFault.next();
assertTrue("SOAP 1.2 :- Fault code local name mismatch",
- code.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME));
+ code.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault code namespace uri mismatch",
- code.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ code.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
Iterator iteratorInCode = code.getChildren();
iteratorInCode.next();
SOAPFaultValue value1 = (SOAPFaultValue) iteratorInCode.next();
assertTrue("SOAP 1.2 :- Fault code value local name mismatch",
- value1.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME));
+ value1.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault code namespace uri mismatch",
- value1.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ value1.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
assertTrue("SOAP 1.2 :- Value1 text mismatch",
- value1.getText().equals("env:Sender"));
-
+ value1.getText().equals("env:Sender"));
+
QName valueQName = value1.getTextAsQName();
assertTrue("SOAP 1.2 :- Fault code value's qname local name mismatch",
- valueQName.getLocalPart().equals("Sender"));
-
+ valueQName.getLocalPart().equals("Sender"));
+
assertTrue("SOAP 1.2 :- Fault code value's qname namespace uri mismatch",
- valueQName.getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
-
+ valueQName.getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+
iteratorInCode.next();
SOAPFaultSubCode subCode1 = (SOAPFaultSubCode) iteratorInCode.next();
assertTrue("SOAP 1.2 :- Fault sub code local name mismatch",
- subCode1.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME));
+ subCode1.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault subcode namespace uri mismatch",
- subCode1.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ subCode1.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
Iterator iteratorInSubCode1 = subCode1.getChildren();
iteratorInSubCode1.next();
SOAPFaultValue value2 = (SOAPFaultValue) iteratorInSubCode1.next();
assertTrue("SOAP 1.2 :- Fault code value local name mismatch",
- value2.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME));
+ value2.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault code namespace uri mismatch",
- value2.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ value2.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
assertTrue("SOAP 1.2 :- Value2 text mismatch",
- value2.getText().equals("m:MessageTimeout"));
+ value2.getText().equals("m:MessageTimeout"));
iteratorInSubCode1.next();
SOAPFaultSubCode subCode2 = (SOAPFaultSubCode) iteratorInSubCode1.next();
assertTrue("SOAP 1.2 :- Fault sub code local name mismatch",
- subCode2.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME));
+ subCode2.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault subcode namespace uri mismatch",
- subCode2.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ subCode2.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
Iterator iteratorInSubCode2 = subCode2.getChildren();
iteratorInSubCode2.next();
SOAPFaultValue value3 = (SOAPFaultValue) iteratorInSubCode2.next();
assertTrue("SOAP 1.2 :- Fault code value local name mismatch",
- value3.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME));
+ value3.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault code namespace uri mismatch",
- value3.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ value3.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
assertTrue("SOAP 1.2 :- Value2 text mismatch",
- value3.getText().equals("m:MessageTimeout"));
+ value3.getText().equals("m:MessageTimeout"));
iteratorInFault.next();
SOAPFaultReason reason = (SOAPFaultReason) iteratorInFault.next();
assertTrue("SOAP 1.2 :- Fault reason local name mismatch",
- reason.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME));
+ reason.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault reason namespace uri mismatch",
- reason.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ reason.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
Iterator iteratorInReason = reason.getChildren();
iteratorInReason.next();
SOAPFaultText text = (SOAPFaultText) iteratorInReason.next();
assertTrue("SOAP 1.2 :- Fault text local name mismatch",
- text.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME));
+ text.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Text namespace uri mismatch",
- text.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ text.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
assertTrue("SOAP 1.2 :- Text value mismatch",
- text.getText().equals("Sender Timeout"));
+ text.getText().equals("Sender Timeout"));
iteratorInFault.next();
SOAPFaultNode node = (SOAPFaultNode) iteratorInFault.next();
assertTrue("SOAP 1.2 :- Fault node local name mismatch",
- node.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
+ node.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault node namespace uri mismatch",
- node.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ node.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
assertTrue("SOAP 1.2 :- Node value mismatch",
- node.getText().trim().equals(
- "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+ node.getText().trim().equals(
+ "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
iteratorInFault.next();
SOAPFaultRole role = (SOAPFaultRole) iteratorInFault.next();
assertTrue("SOAP 1.2 :- Fault role local name mismatch",
- role.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
+ role.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault role namespace uri mismatch",
- role.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ role.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
assertTrue("SOAP 1.2 :- Role value mismatch",
- role.getText().trim().equals("ultimateReceiver"));
+ role.getText().trim().equals("ultimateReceiver"));
iteratorInFault.next();
SOAPFaultDetail detail = (SOAPFaultDetail) iteratorInFault.next();
assertTrue("SOAP 1.2 :- Fault detail local name mismatch",
- detail.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
+ detail.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Fault detail namespace uri mismatch",
- detail.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ detail.getNamespace().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
assertTrue("SOAP 1.2 :- Text in detail mismatch",
- detail.getText().trim().equals("Details of error"));
+ detail.getText().trim().equals("Details of error"));
Iterator iteratorInDetail = detail.getChildren();
iteratorInDetail.next();
OMElement element1 = (OMElement) iteratorInDetail.next();
assertTrue("SOAP 1.2 :- MaxTime element mismatch",
- element1.getLocalName().equals("MaxTime"));
+ element1.getLocalName().equals("MaxTime"));
assertTrue("SOAP 1.2 :- MaxTime element namespace mismatch",
- element1.getNamespace().getNamespaceURI().equals(
- "http:www.sample.org"));
+ element1.getNamespace().getNamespaceURI().equals(
+ "http:www.sample.org"));
assertTrue("SOAP 1.2 :- Text value in MaxTime element mismatch",
- element1.getText().trim().equals("P5M"));
+ element1.getText().trim().equals("P5M"));
Iterator attributeIterator = element1.getAllAttributes();
OMAttribute attributeInMaxTime = (OMAttribute) attributeIterator.next();
assertTrue("SOAP 1.2 :- Attribute local name mismatch",
- attributeInMaxTime.getLocalName().equals("detail"));
+ attributeInMaxTime.getLocalName().equals("detail"));
assertTrue("SOAP 1.2 :- Attribute namespace mismatch",
- attributeInMaxTime.getNamespace().getNamespaceURI().equals(
- "http:www.sample.org"));
+ attributeInMaxTime.getNamespace().getNamespaceURI().equals(
+ "http:www.sample.org"));
assertTrue("SOAP 1.2 :- Attribute value mismatch",
- attributeInMaxTime.getAttributeValue().trim().equals("This is only a test"));
+ attributeInMaxTime.getAttributeValue().trim().equals("This is only a test"));
iteratorInDetail.next();
OMElement element2 = (OMElement) iteratorInDetail.next();
assertTrue("SOAP 1.2 :- AveTime element mismatch",
- element2.getLocalName().equals("AveTime"));
+ element2.getLocalName().equals("AveTime"));
assertTrue("SOAP 1.2 :- AveTime element namespace mismatch",
- element2.getNamespace().getNamespaceURI().equals(
- "http:www.sample.org"));
+ element2.getNamespace().getNamespaceURI().equals(
+ "http:www.sample.org"));
Iterator iteratorInAveTimeElement = element2.getChildren();
iteratorInAveTimeElement.next();
OMElement element21 = (OMElement) iteratorInAveTimeElement.next();
assertTrue("SOAP 1.2 :- Time element mismatch",
- element21.getLocalName().equals("Time"));
+ element21.getLocalName().equals("Time"));
assertTrue("SOAP 1.2 :- Time element namespace mismatch",
- element21.getNamespace().getNamespaceURI().equals(
- "http:www.sample.org"));
+ element21.getNamespace().getNamespaceURI().equals(
+ "http:www.sample.org"));
assertTrue("SOAP 1.2 :- Text value in Time element mismatch",
- element21.getText().trim().equals("P3M"));
+ element21.getText().trim().equals("P3M"));
XMLStreamReader sopa11Parser = XMLInputFactory.newInstance()
.createXMLStreamReader(new StringReader(soap11Message));
@@ -400,165 +403,167 @@
// writer.flush();
assertTrue("SOAP 1.1 :- envelope local name mismatch",
- soap11Envelope.getLocalName().equals(
- SOAPConstants.SOAPENVELOPE_LOCAL_NAME));
+ soap11Envelope.getLocalName().equals(
+ SOAPConstants.SOAPENVELOPE_LOCAL_NAME));
assertTrue("SOAP 1.1 :- envelope namespace uri mismatch",
- soap11Envelope.getNamespace().getNamespaceURI().equals(
- SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ soap11Envelope.getNamespace().getNamespaceURI().equals(
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
header = soap11Envelope.getHeader();
assertTrue("SOAP 1.1 :- Header local name mismatch",
- header.getLocalName().equals(
- SOAPConstants.HEADER_LOCAL_NAME));
+ header.getLocalName().equals(
+ SOAPConstants.HEADER_LOCAL_NAME));
assertTrue("SOAP 1.1 :- Header namespace uri mismatch",
- header.getNamespace().getNamespaceURI().equals(
- SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ header.getNamespace().getNamespaceURI().equals(
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
headerBlock = (SOAPHeaderBlock) header.getFirstElement();
assertTrue("SOAP 1.1 :- Header block name mismatch",
- headerBlock.getLocalName().equals("echoOk"));
+ headerBlock.getLocalName().equals("echoOk"));
assertTrue("SOAP 1.1 :- Header block name space uri mismatch",
- headerBlock.getNamespace().getNamespaceURI().equals(
- "http://example.org/ts-tests"));
+ headerBlock.getNamespace().getNamespaceURI().equals(
+ "http://example.org/ts-tests"));
assertTrue("SOAP 1.1 :- Headaer block text mismatch",
- headerBlock.getText().trim().equals("foo"));
+ headerBlock.getText().trim().equals("foo"));
// Attribute iteration is not in any guaranteed order.
// Use QNames to get the OMAttributes.
- QName actorQName = new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAP11Constants.ATTR_ACTOR);
- mustUnderstandQName = new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAP11Constants.ATTR_MUSTUNDERSTAND);
+ QName actorQName = new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP11Constants.ATTR_ACTOR);
+ mustUnderstandQName = new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP11Constants.ATTR_MUSTUNDERSTAND);
OMAttribute actorAttribute = headerBlock.getAttribute(actorQName);
mustUnderstandAttribute = headerBlock.getAttribute(mustUnderstandQName);
assertTrue("SOAP 1.1 :- Mustunderstand attribute not found",
- mustUnderstandAttribute != null);
+ mustUnderstandAttribute != null);
assertTrue("SOAP 1.1 :- Mustunderstand value mismatch",
- mustUnderstandAttribute.getAttributeValue().equals(
- SOAPConstants.ATTR_MUSTUNDERSTAND_1));
+ mustUnderstandAttribute.getAttributeValue().equals(
+ SOAPConstants.ATTR_MUSTUNDERSTAND_1));
assertTrue(
"SOAP 1.1 :- Mustunderstand attribute namespace uri mismatch",
mustUnderstandAttribute.getNamespace().getNamespaceURI().equals(
SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
assertTrue("SOAP 1.1 :- Actor attribute name not found",
- actorAttribute != null);
+ actorAttribute != null);
assertTrue("SOAP 1.1 :- Actor value mismatch",
- actorAttribute.getAttributeValue().trim().equals(
- "http://schemas.xmlsoap.org/soap/" +
- SOAP11Constants.ATTR_ACTOR +
- "/" +
- "next"));
+ actorAttribute.getAttributeValue().trim().equals(
+ "http://schemas.xmlsoap.org/soap/" +
+ SOAP11Constants.ATTR_ACTOR +
+ "/" +
+ "next"));
assertTrue("SOAP 1.1 :- Actor attribute namespace uri mismatch",
- actorAttribute.getNamespace().getNamespaceURI().equals(
- SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ actorAttribute.getNamespace().getNamespaceURI().equals(
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
body = soap11Envelope.getBody();
assertTrue("SOAP 1.1 :- Body local name mismatch",
- body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
+ body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
assertTrue("SOAP 1.1 :- Body namespace uri mismatch",
- body.getNamespace().getNamespaceURI().equals(
- SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ body.getNamespace().getNamespaceURI().equals(
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
fault = body.getFault();
assertTrue("SOAP 1.1 :- Fault namespace uri mismatch",
- fault.getNamespace().getNamespaceURI().equals(
- SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ fault.getNamespace().getNamespaceURI().equals(
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
iteratorInFault = fault.getChildren();
iteratorInFault.next();
code = (SOAPFaultCode) iteratorInFault.next();
assertEquals("SOAP Fault code local name mismatch",
- code.getLocalName(),
- (SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME));
+ code.getLocalName(),
+ (SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME));
assertEquals("SOAP 1.1 :- Fault code value mismatch", code.getText().trim(),
- "env:Sender");
+ "env:Sender");
iteratorInFault.next();
reason = (SOAPFaultReason) iteratorInFault.next();
assertTrue("SOAP 1.1 :- Fault string local name mismatch",
- reason.getLocalName().equals(
- SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME));
+ reason.getLocalName().equals(
+ SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME));
assertTrue("SOAP 1.1 :- Fault string value mismatch",
- reason.getText().trim().equals("Sender Timeout"));
+ reason.getText().trim().equals("Sender Timeout"));
iteratorInFault.next();
role = (SOAPFaultRole) iteratorInFault.next();
assertTrue("SOAP 1.1 :- Fault actor local name mismatch",
- role.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
+ role.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
assertTrue("SOAP 1.1 :- Actor value mismatch",
- role.getText().trim().equals(
- "http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver"));
+ role.getText().trim().equals(
+ "http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver"));
iteratorInFault.next();
detail = (SOAPFaultDetail) iteratorInFault.next();
assertTrue("SOAP 1.1 :- Fault detail local name mismatch",
- detail.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
+ detail.getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Text in detail mismatch",
- detail.getText().trim().equals("Details of error"));
+ detail.getText().trim().equals("Details of error"));
iteratorInDetail = detail.getChildren();
iteratorInDetail.next();
element1 = (OMElement) iteratorInDetail.next();
assertTrue("SOAP 1.1 :- MaxTime element mismatch",
- element1.getLocalName().equals("MaxTime"));
+ element1.getLocalName().equals("MaxTime"));
assertTrue("SOAP 1.1 :- MaxTime element namespace mismatch",
- element1.getNamespace().getNamespaceURI().equals(
- "http:www.sample.org"));
+ element1.getNamespace().getNamespaceURI().equals(
+ "http:www.sample.org"));
assertTrue("SOAP 1.1 :- Text value in MaxTime element mismatch",
- element1.getText().trim().equals("P5M"));
+ element1.getText().trim().equals("P5M"));
attributeIterator = element1.getAllAttributes();
attributeInMaxTime = (OMAttribute) attributeIterator.next();
assertTrue("SOAP 1.1 :- Attribute local name mismatch",
- attributeInMaxTime.getLocalName().equals("detail"));
+ attributeInMaxTime.getLocalName().equals("detail"));
assertTrue("SOAP 1.1 :- Attribute namespace mismatch",
- attributeInMaxTime.getNamespace().getNamespaceURI().equals(
- "http:www.sample.org"));
+ attributeInMaxTime.getNamespace().getNamespaceURI().equals(
+ "http:www.sample.org"));
assertTrue("SOAP 1.1 :- Attribute value mismatch",
- attributeInMaxTime.getAttributeValue().equals("This is only a test"));
+ attributeInMaxTime.getAttributeValue().equals("This is only a test"));
iteratorInDetail.next();
element2 = (OMElement) iteratorInDetail.next();
assertTrue("SOAP 1.1 :- AveTime element mismatch",
- element2.getLocalName().equals("AveTime"));
+ element2.getLocalName().equals("AveTime"));
assertTrue("SOAP 1.1 :- AveTime element namespace mismatch",
- element2.getNamespace().getNamespaceURI().equals(
- "http:www.sample.org"));
+ element2.getNamespace().getNamespaceURI().equals(
+ "http:www.sample.org"));
iteratorInAveTimeElement = element2.getChildren();
iteratorInAveTimeElement.next();
element21 = (OMElement) iteratorInAveTimeElement.next();
assertTrue("SOAP 1.1 :- Time element mismatch",
- element21.getLocalName().equals("Time"));
+ element21.getLocalName().equals("Time"));
assertTrue("SOAP 1.1 :- Time element namespace mismatch",
- element21.getNamespace().getNamespaceURI().equals(
- "http:www.sample.org"));
+ element21.getNamespace().getNamespaceURI().equals(
+ "http:www.sample.org"));
assertTrue("SOAP 1.1 :- Text value in Time element mismatch",
- element21.getText().trim().equals("P3M"));
+ element21.getText().trim().equals("P3M"));
iteratorInFault.next();
OMElement testElement = (OMElement) iteratorInFault.next();
assertTrue("SOAP 1.1 :- Test element mismatch",
- testElement.getLocalName().equals("Test"));
+ testElement.getLocalName().equals("Test"));
assertTrue("SOAP 1.1 :- Test element namespace mismatch",
- testElement.getNamespace().getNamespaceURI().equals(
- "http:www.Test.org"));
+ testElement.getNamespace().getNamespaceURI().equals(
+ "http:www.Test.org"));
OMElement childOfTestElement = testElement.getFirstElement();
assertTrue("SOAP 1.1 :- Test element child local name mismatch",
- childOfTestElement.getLocalName().equals("TestElement"));
+ childOfTestElement.getLocalName().equals("TestElement"));
assertTrue("SOAP 1.1 :- Test element child namespace mismatch",
- childOfTestElement.getNamespace().getNamespaceURI().equals(
- "http:www.Test.org"));
+ childOfTestElement.getNamespace().getNamespaceURI().equals(
+ "http:www.Test.org"));
assertTrue("SOAP 1.1 :- Test element child value mismatch",
- childOfTestElement.getText().trim().equals("This is only a test"));
+ childOfTestElement.getText().trim().equals("This is only a test"));
} catch (XMLStreamException e) {
log.info(e.getMessage());
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncodingTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncodingTest.java?view=diff&rev=515594&r1=515593&r2=515594
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncodingTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncodingTest.java Wed Mar 7 06:59:00 2007
@@ -15,6 +15,7 @@
*/
package org.apache.axiom.soap.impl.llom;
+
import junit.framework.TestCase;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
@@ -32,109 +33,109 @@
import java.io.IOException;
-/**
- * Test for serialization and deserialization using UTF-16
- * character encoding
- */
+/** Test for serialization and deserialization using UTF-16 character encoding */
public class CharacterEncodingTest extends TestCase {
- public static final String UTF_16 = "utf-16";
-
- public CharacterEncodingTest(String name) {
- super(name);
- }
-
- public void runTest(String value, String expected) throws XMLStreamException, FactoryConfigurationError, IOException {
-
- SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
- SOAPEnvelope envelope = factory.getDefaultEnvelope();
- String ns = "http://testuri.org";
- OMNamespace namespace = factory.createOMNamespace(ns,"tst");
-
- String ln = "Child";
-
- OMElement bodyChild = factory.createOMElement(ln,namespace);
- bodyChild.addChild(factory.createOMText(value));
-
- envelope.getBody().addChild(bodyChild);
-
-
- ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
-
- OMOutputFormat outputFormat = new OMOutputFormat();
+ public static final String UTF_16 = "utf-16";
+
+ public CharacterEncodingTest(String name) {
+ super(name);
+ }
+
+ public void runTest(String value, String expected)
+ throws XMLStreamException, FactoryConfigurationError, IOException {
+
+ SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
+ SOAPEnvelope envelope = factory.getDefaultEnvelope();
+ String ns = "http://testuri.org";
+ OMNamespace namespace = factory.createOMNamespace(ns, "tst");
+
+ String ln = "Child";
+
+ OMElement bodyChild = factory.createOMElement(ln, namespace);
+ bodyChild.addChild(factory.createOMText(value));
+
+ envelope.getBody().addChild(bodyChild);
+
+
+ ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
+
+ OMOutputFormat outputFormat = new OMOutputFormat();
outputFormat.setCharSetEncoding(UTF_16);
- envelope.serialize(byteOutStr, outputFormat);
-
- ByteArrayInputStream byteInStr = new ByteArrayInputStream(byteOutStr.toByteArray());
-
- StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(byteInStr, UTF_16),null);
-
- SOAPEnvelope resultEnv = builder.getSOAPEnvelope();
-
- OMElement bodyChildResult = resultEnv.getBody().getFirstElement();
-
- assertNotNull("No child in body element", bodyChildResult);
-
- String result = bodyChildResult.getText();
-
- assertNotNull("No value for testParam param", result);
-
- assertEquals("Expected result not received.", expected, result);
-
-
- }
-
+ envelope.serialize(byteOutStr, outputFormat);
+
+ ByteArrayInputStream byteInStr = new ByteArrayInputStream(byteOutStr.toByteArray());
+
+ StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(
+ XMLInputFactory.newInstance().createXMLStreamReader(byteInStr, UTF_16), null);
+
+ SOAPEnvelope resultEnv = builder.getSOAPEnvelope();
+
+ OMElement bodyChildResult = resultEnv.getBody().getFirstElement();
+
+ assertNotNull("No child in body element", bodyChildResult);
+
+ String result = bodyChildResult.getText();
+
+ assertNotNull("No value for testParam param", result);
+
+ assertEquals("Expected result not received.", expected, result);
+
+
+ }
+
private void runtest(String value) throws Exception {
runTest(value, value);
}
-
+
public void testSimpleString() throws Exception {
runtest("a simple string");
}
-
+
public void testStringWithApostrophes() throws Exception {
runtest("this isn't a simple string");
}
-
+
public void testStringWithEntities() throws Exception {
runTest("&<>'"", "&<>'"");
}
-
+
public void testStringWithRawEntities() throws Exception {
runTest("&<>'\"", "&<>'\"");
}
+
public void testStringWithLeadingAndTrailingSpaces() throws Exception {
runtest(" centered ");
}
-
+
public void testWhitespace() throws Exception {
runtest(" \n \t "); // note: \r fails
}
-
+
public void testFrenchAccents() throws Exception {
runtest("\u00e0\u00e2\u00e4\u00e7\u00e8\u00e9\u00ea\u00eb\u00ee\u00ef\u00f4\u00f6\u00f9\u00fb\u00fc");
}
-
+
public void testGermanUmlauts() throws Exception {
runtest(" Some text \u00df with \u00fc special \u00f6 chars \u00e4.");
}
-
+
public void testWelcomeUnicode() throws Exception {
// welcome in several languages
runtest(
- "Chinese (trad.) : \u6b61\u8fce ");
+ "Chinese (trad.) : \u6b61\u8fce ");
}
public void testWelcomeUnicode2() throws Exception {
// welcome in several languages
runtest(
- "Greek : \u03ba\u03b1\u03bb\u03ce\u03c2 \u03bf\u03c1\u03af\u03c3\u03b1\u03c4\u03b5");
+ "Greek : \u03ba\u03b1\u03bb\u03ce\u03c2 \u03bf\u03c1\u03af\u03c3\u03b1\u03c4\u03b5");
}
public void testWelcomeUnicode3() throws Exception {
// welcome in several languages
runtest(
- "Japanese : \u3088\u3046\u3053\u305d");
+ "Japanese : \u3088\u3046\u3053\u305d");
}
-
+
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java?view=diff&rev=515594&r1=515593&r2=515594
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java Wed Mar 7 06:59:00 2007
@@ -33,7 +33,6 @@
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-
import java.util.Iterator;
public class OMElementTest extends OMTestCase implements OMConstants {
@@ -54,11 +53,11 @@
* @see TestCase#setUp()
*/
protected void setUp() throws Exception {
- OMNamespace testingNamespace = factory.createOMNamespace(
- "http://testing.ws.org", "ws");
+ OMNamespace testingNamespace = factory.createOMNamespace(
+ "http://testing.ws.org", "ws");
firstElement = factory.createOMElement("FirstElement", testingNamespace);
secondElement = factory.createOMElement("SecondElement", factory.createOMNamespace(
- "http://moretesting.ws.org", "ws"), firstElement);
+ "http://moretesting.ws.org", "ws"), firstElement);
}
public void testGetText() {
@@ -71,14 +70,14 @@
String expectedString = "http://localhost:8081/axis/services/BankPort";
assertEquals("getText is not returning the correct value",
- wsaTo.getText().trim(),
- expectedString);
+ wsaTo.getText().trim(),
+ expectedString);
} catch (Exception e) {
log.info(e.getMessage());
}
}
- public void testConstructors(){
+ public void testConstructors() {
try {
factory.createOMElement("", null);
@@ -88,112 +87,125 @@
}
assertTrue("Namespace having same information, declared in the same context, should share" +
- " the same namespace object",firstElement.getNamespace() != secondElement.getNamespace());
- assertEquals("OMElement children addition has not worked properly", secondElement, firstElement.getFirstElement());
+ " the same namespace object",
+ firstElement.getNamespace() != secondElement.getNamespace());
+ assertEquals("OMElement children addition has not worked properly", secondElement,
+ firstElement.getFirstElement());
OMNamespace testNamespace2 = factory.createOMNamespace("ftp://anotherTest.ws.org", "ws");
firstElement.declareNamespace(testNamespace2);
- OMNamespace inheritedSecondNamespace = secondElement.findNamespace(testNamespace2.getNamespaceURI(),
- testNamespace2.getPrefix());
- assertNotNull("Children should inherit namespaces declared in parent", inheritedSecondNamespace);
- assertEquals("inherited namespace uri should be equal", inheritedSecondNamespace.getNamespaceURI(), testNamespace2.getNamespaceURI());
- assertEquals("inherited namespace prefix should be equal", inheritedSecondNamespace.getPrefix(), testNamespace2.getPrefix());
+ OMNamespace inheritedSecondNamespace =
+ secondElement.findNamespace(testNamespace2.getNamespaceURI(),
+ testNamespace2.getPrefix());
+ assertNotNull("Children should inherit namespaces declared in parent",
+ inheritedSecondNamespace);
+ assertEquals("inherited namespace uri should be equal",
+ inheritedSecondNamespace.getNamespaceURI(), testNamespace2.getNamespaceURI());
+ assertEquals("inherited namespace prefix should be equal",
+ inheritedSecondNamespace.getPrefix(), testNamespace2.getPrefix());
}
public void testChildDetachment() {
OMNamespace testNamespace2 = factory.createOMNamespace("ftp://anotherTest.ws.org", "ws");
-
+
secondElement.detach();
- assertTrue("OMElement children detachment has not worked properly", !secondElement.equals(firstElement.getFirstElement()));
- assertNull("First Element should not contain elements after detaching. ", firstElement.getFirstElement());
- assertNull("First Element should not contain elements after detaching. ", firstElement.getFirstOMChild());
- assertNull(secondElement.findNamespace(testNamespace2.getNamespaceURI(), testNamespace2.getPrefix()));
+ assertTrue("OMElement children detachment has not worked properly",
+ !secondElement.equals(firstElement.getFirstElement()));
+ assertNull("First Element should not contain elements after detaching. ",
+ firstElement.getFirstElement());
+ assertNull("First Element should not contain elements after detaching. ",
+ firstElement.getFirstOMChild());
+ assertNull(secondElement.findNamespace(testNamespace2.getNamespaceURI(),
+ testNamespace2.getPrefix()));
firstElement.addChild(secondElement);
firstElement.setText("Some Sample Text");
- assertTrue("First added child must be the first child", secondElement.equals(firstElement.getFirstOMChild()));
+ assertTrue("First added child must be the first child",
+ secondElement.equals(firstElement.getFirstOMChild()));
Iterator children = firstElement.getChildren();
int childCount = 0;
while (children.hasNext()) {
- children.next();
+ children.next();
childCount++;
}
assertEquals("Children count should be two", childCount, 2);
secondElement.detach();
- assertTrue("First child should be the text child", firstElement.getFirstOMChild() instanceof OMText);
+ assertTrue("First child should be the text child",
+ firstElement.getFirstOMChild() instanceof OMText);
}
public void testAddDOOMElementAsChild() throws XMLStreamException {
- OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
- OMFactory llomFactory = OMAbstractFactory.getOMFactory();
- String text = "This was a DOOM Text";
-
- OMElement llomRoot = llomFactory.createOMElement("root",null);
- OMElement doomElement = doomFactory.createOMElement("second","test","a");
- doomElement.setText(text);
- llomRoot.addChild(doomElement);
-
- OMElement newElement = (new StAXOMBuilder(this.factory, llomRoot
- .getXMLStreamReader())).getDocumentElement();
- newElement.build();
- OMElement secondElement = newElement.getFirstElement();
- assertNotNull(secondElement);
- assertEquals(secondElement.getText(),text);
+ OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+ OMFactory llomFactory = OMAbstractFactory.getOMFactory();
+ String text = "This was a DOOM Text";
+
+ OMElement llomRoot = llomFactory.createOMElement("root", null);
+ OMElement doomElement = doomFactory.createOMElement("second", "test", "a");
+ doomElement.setText(text);
+ llomRoot.addChild(doomElement);
+
+ OMElement newElement = (new StAXOMBuilder(this.factory, llomRoot
+ .getXMLStreamReader())).getDocumentElement();
+ newElement.build();
+ OMElement secondElement = newElement.getFirstElement();
+ assertNotNull(secondElement);
+ assertEquals(secondElement.getText(), text);
}
-
+
public void testAddDOOMTextAsChild() throws XMLStreamException {
- OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
- OMFactory llomFactory = OMAbstractFactory.getOMFactory();
- String text = "This was a DOOM Text";
-
- OMElement llomRoot = llomFactory.createOMElement("root",null);
- OMText doomText = doomFactory.createOMText(text);
- llomRoot.addChild(doomText);
-
- OMElement newElement = (new StAXOMBuilder(this.factory, llomRoot
- .getXMLStreamReader())).getDocumentElement();
- newElement.build();
- assertEquals(newElement.getText(),text);
+ OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+ OMFactory llomFactory = OMAbstractFactory.getOMFactory();
+ String text = "This was a DOOM Text";
+
+ OMElement llomRoot = llomFactory.createOMElement("root", null);
+ OMText doomText = doomFactory.createOMText(text);
+ llomRoot.addChild(doomText);
+
+ OMElement newElement = (new StAXOMBuilder(this.factory, llomRoot
+ .getXMLStreamReader())).getDocumentElement();
+ newElement.build();
+ assertEquals(newElement.getText(), text);
}
+
public void testAddLLOMElementChildToDOOM() throws XMLStreamException {
- OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
- OMFactory llomFactory = OMAbstractFactory.getOMFactory();
- String text = "This was a LLOM Text";
-
- OMElement doomRoot = doomFactory.createOMElement("root",null);
- OMElement llomElement = llomFactory.createOMElement("second","test","a");
- llomElement.setText(text);
- doomRoot.addChild(llomElement);
-
- OMElement newElement = (new StAXOMBuilder(this.factory, doomRoot
- .getXMLStreamReader())).getDocumentElement();
- newElement.build();
- OMElement secondElement = newElement.getFirstElement();
- assertNotNull(secondElement);
- assertEquals(secondElement.getText(),text);
+ OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+ OMFactory llomFactory = OMAbstractFactory.getOMFactory();
+ String text = "This was a LLOM Text";
+
+ OMElement doomRoot = doomFactory.createOMElement("root", null);
+ OMElement llomElement = llomFactory.createOMElement("second", "test", "a");
+ llomElement.setText(text);
+ doomRoot.addChild(llomElement);
+
+ OMElement newElement = (new StAXOMBuilder(this.factory, doomRoot
+ .getXMLStreamReader())).getDocumentElement();
+ newElement.build();
+ OMElement secondElement = newElement.getFirstElement();
+ assertNotNull(secondElement);
+ assertEquals(secondElement.getText(), text);
}
-
+
public void testAddLLOMTextChildToDOOM() throws XMLStreamException {
- OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
- OMFactory llomFactory = OMAbstractFactory.getOMFactory();
- String text = "This was a DOOM Text";
-
- OMElement doomRoot = doomFactory.createOMElement("root",null);
- OMText llomText = llomFactory.createOMText(text);
- OMComment comment = llomFactory.createOMComment(null,"comment");
- doomRoot.addChild(llomText);
- doomRoot.addChild(comment);
-
- OMElement newElement = (new StAXOMBuilder(this.factory, doomRoot
- .getXMLStreamReader())).getDocumentElement();
- newElement.build();
- assertEquals(newElement.getText(),text);
+ OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+ OMFactory llomFactory = OMAbstractFactory.getOMFactory();
+ String text = "This was a DOOM Text";
+
+ OMElement doomRoot = doomFactory.createOMElement("root", null);
+ OMText llomText = llomFactory.createOMText(text);
+ OMComment comment = llomFactory.createOMComment(null, "comment");
+ doomRoot.addChild(llomText);
+ doomRoot.addChild(comment);
+
+ OMElement newElement = (new StAXOMBuilder(this.factory, doomRoot
+ .getXMLStreamReader())).getDocumentElement();
+ newElement.build();
+ assertEquals(newElement.getText(), text);
}
-
+
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMEnvelopeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMEnvelopeTest.java?view=diff&rev=515594&r1=515593&r2=515594
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMEnvelopeTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMEnvelopeTest.java Wed Mar 7 06:59:00 2007
@@ -19,15 +19,16 @@
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMTestCase;
import org.apache.axiom.om.OMTestUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPHeader;
import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class OMEnvelopeTest extends OMTestCase {
private Log log = LogFactory.getLog(getClass());
+
public OMEnvelopeTest(String testName) {
super(testName);
}
@@ -39,14 +40,14 @@
public void testGetHeader1() {
SOAPHeader header = soapEnvelope.getHeader();
assertTrue("Header information retrieved not correct",
- (header != null &&
- header.getLocalName().equalsIgnoreCase("Header")));
+ (header != null &&
+ header.getLocalName().equalsIgnoreCase("Header")));
}
public void testGetBody1() {
SOAPBody body = soapEnvelope.getBody();
assertTrue("Header information retrieved not correct",
- (body != null && body.getLocalName().equalsIgnoreCase("Body")));
+ (body != null && body.getLocalName().equalsIgnoreCase("Body")));
}
private SOAPEnvelope getSecondEnvelope() throws Exception {
@@ -58,14 +59,14 @@
public void testGetHeader2() throws Exception {
SOAPHeader header = getSecondEnvelope().getHeader();
assertTrue("Header information retrieved not correct",
- (header != null &&
- header.getLocalName().equalsIgnoreCase("Header")));
+ (header != null &&
+ header.getLocalName().equalsIgnoreCase("Header")));
}
public void testGetBody2() throws Exception {
SOAPBody body = getSecondEnvelope().getBody();
assertTrue("Header information retrieved not correct",
- (body != null && body.getLocalName().equalsIgnoreCase("Body")));
+ (body != null && body.getLocalName().equalsIgnoreCase("Body")));
}
public void testDefaultEnveleope() {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMHeaderBlockTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMHeaderBlockTest.java?view=diff&rev=515594&r1=515593&r2=515594
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMHeaderBlockTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMHeaderBlockTest.java Wed Mar 7 06:59:00 2007
@@ -43,13 +43,13 @@
String newActorURI = "http://newActor.org";
soapHeaderElement.setRole(newActorURI);
assertTrue("Actor was not properly set",
- soapHeaderElement.getRole().equalsIgnoreCase(newActorURI));
+ soapHeaderElement.getRole().equalsIgnoreCase(newActorURI));
}
public void testSetAndGetMustUnderstand() {
soapHeaderElement.setMustUnderstand(false);
assertTrue("MustUnderstand was not properly set",
- !soapHeaderElement.getMustUnderstand());
+ !soapHeaderElement.getMustUnderstand());
}
public void testGetMustUnderstand() {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11SerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11SerializerTest.java?view=diff&rev=515594&r1=515593&r2=515594
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11SerializerTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11SerializerTest.java Wed Mar 7 06:59:00 2007
@@ -36,11 +36,13 @@
super.setUp();
soapEnvelope =
(SOAPEnvelope) getOMBuilder("soap/soap11/soap11fault.xml")
- .getDocumentElement();
+ .getDocumentElement();
}
/**
- * This will check whether we can call the serialize method two times, if the first calls makes the object model.
+ * This will check whether we can call the serialize method two times, if the first calls makes
+ * the object model.
+ *
* @throws Exception
*/
public void testSerialize() throws Exception {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/XPathAppliedToSOAPEnvelopeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/XPathAppliedToSOAPEnvelopeTest.java?view=diff&rev=515594&r1=515593&r2=515594
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/XPathAppliedToSOAPEnvelopeTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/XPathAppliedToSOAPEnvelopeTest.java Wed Mar 7 06:59:00 2007
@@ -25,49 +25,49 @@
public class XPathAppliedToSOAPEnvelopeTest extends TestCase {
- public void testDocumentNotAdded () throws Exception {
- SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+ public void testDocumentNotAdded() throws Exception {
+ SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
- OMElement elem1 = factory.createOMElement("elem1",null);
- OMElement elem2 = factory.createOMElement("elem2",null);
- OMElement elem3 = factory.createOMElement("elem3",null);
- elem2.addChild(elem3);
- elem1.addChild(elem2);
- SOAPEnvelope envelope = factory.getDefaultEnvelope();
- envelope.getBody().addChild(elem1);
+ OMElement elem1 = factory.createOMElement("elem1", null);
+ OMElement elem2 = factory.createOMElement("elem2", null);
+ OMElement elem3 = factory.createOMElement("elem3", null);
+ elem2.addChild(elem3);
+ elem1.addChild(elem2);
+ SOAPEnvelope envelope = factory.getDefaultEnvelope();
+ envelope.getBody().addChild(elem1);
- //The only difference of the two test methods is the following line.
+ //The only difference of the two test methods is the following line.
// factory.createOMDocument().addChild(envelope);
- String XPathString = "//elem1";
+ String XPathString = "//elem1";
- AXIOMXPath XPath = new AXIOMXPath (XPathString);
- OMNode node = (OMNode) XPath.selectSingleNode(envelope);
+ AXIOMXPath XPath = new AXIOMXPath(XPathString);
+ OMNode node = (OMNode) XPath.selectSingleNode(envelope);
- assertNotNull(node);
- }
+ assertNotNull(node);
+ }
- public void testDocumentAdded () throws Exception {
- SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+ public void testDocumentAdded() throws Exception {
+ SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
- OMElement elem1 = factory.createOMElement("elem1",null);
- OMElement elem2 = factory.createOMElement("elem2",null);
- OMElement elem3 = factory.createOMElement("elem3",null);
- elem2.addChild(elem3);
- elem1.addChild(elem2);
- SOAPEnvelope envelope = factory.getDefaultEnvelope();
- envelope.getBody().addChild(elem1);
+ OMElement elem1 = factory.createOMElement("elem1", null);
+ OMElement elem2 = factory.createOMElement("elem2", null);
+ OMElement elem3 = factory.createOMElement("elem3", null);
+ elem2.addChild(elem3);
+ elem1.addChild(elem2);
+ SOAPEnvelope envelope = factory.getDefaultEnvelope();
+ envelope.getBody().addChild(elem1);
- //The only difference of the two test methods is the following line.
- factory.createOMDocument().addChild(envelope);
+ //The only difference of the two test methods is the following line.
+ factory.createOMDocument().addChild(envelope);
- String XPathString = "//elem1";
+ String XPathString = "//elem1";
- AXIOMXPath XPath = new AXIOMXPath (XPathString);
- OMNode node = (OMNode) XPath.selectSingleNode(envelope);
+ AXIOMXPath XPath = new AXIOMXPath(XPathString);
+ OMNode node = (OMNode) XPath.selectSingleNode(envelope);
- assertNotNull(node);
- }
+ assertNotNull(node);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org