You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2007/03/29 20:49:16 UTC
svn commit: r523794 [7/8] - in /webservices/axis2/trunk/java/modules:
adb/src/org/apache/axis2/databinding/
adb/src/org/apache/axis2/databinding/i18n/
adb/src/org/apache/axis2/databinding/typemapping/
adb/src/org/apache/axis2/databinding/types/ adb/src...
Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java (original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java Thu Mar 29 11:49:12 2007
@@ -1,20 +1,5 @@
package org.apache.axis2.databinding.utils.reader;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
import org.apache.axiom.attachments.ByteArrayDataSource;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMAttribute;
@@ -22,14 +7,28 @@
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
+import org.apache.axiom.om.util.Base64;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axis2.databinding.ADBBean;
import org.apache.axis2.databinding.utils.Constants;
-import org.apache.axiom.om.util.Base64;
import org.apache.axis2.util.StreamWrapper;
import org.custommonkey.xmlunit.XMLTestCase;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -56,40 +55,39 @@
db = dbf.newDocumentBuilder();
}
- /**
- * complex array scenario
- */
+ /** complex array scenario */
public void testComplexObjectArrayScenario() {
try {
- String expectedXML = "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
- "<Foo>Some Text</Foo>" +
- "<Dependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</Dependent>" +
- "<AdditionalDependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</AdditionalDependent>" +
- "<AdditionalDependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</AdditionalDependent>" +
- "<AdditionalDependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</AdditionalDependent>" +
- "<AdditionalDependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</AdditionalDependent>" +
- "<Bar>Some More Text</Bar><" +
- "/ns1:TestComplexStringArrayScenario>";
+ String expectedXML =
+ "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
+ "<Foo>Some Text</Foo>" +
+ "<Dependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</Dependent>" +
+ "<AdditionalDependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</AdditionalDependent>" +
+ "<AdditionalDependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</AdditionalDependent>" +
+ "<AdditionalDependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</AdditionalDependent>" +
+ "<AdditionalDependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</AdditionalDependent>" +
+ "<Bar>Some More Text</Bar><" +
+ "/ns1:TestComplexStringArrayScenario>";
ArrayList propertyList = new ArrayList();
propertyList.add("Foo");
@@ -111,7 +109,9 @@
propertyList.add("Bar");
propertyList.add("Some More Text");
- XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(new QName("http://testComplexStringArrayScenario.org", "TestComplexStringArrayScenario", "ns1"), propertyList.toArray(), null);
+ XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(new QName(
+ "http://testComplexStringArrayScenario.org", "TestComplexStringArrayScenario",
+ "ns1"), propertyList.toArray(), null);
String actualXML = getStringXML(pullParser);
@@ -127,31 +127,30 @@
}
}
- /**
- * complex array scenario with nulls in between
- */
+ /** complex array scenario with nulls in between */
public void testComplexObjectArrayScenarioWithNulls() {
try {
- String expectedXML = "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
- "<AdditionalDependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</AdditionalDependent>" +
- "<AdditionalDependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</AdditionalDependent>" +
- "<AdditionalDependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</AdditionalDependent>" +
- "<AdditionalDependent xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" +
- "</AdditionalDependent>" +
- "<Bar>Some More Text</Bar><" +
- "/ns1:TestComplexStringArrayScenario>";
+ String expectedXML =
+ "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
+ "<AdditionalDependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</AdditionalDependent>" +
+ "<AdditionalDependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</AdditionalDependent>" +
+ "<AdditionalDependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</AdditionalDependent>" +
+ "<AdditionalDependent xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" +
+ "</AdditionalDependent>" +
+ "<Bar>Some More Text</Bar><" +
+ "/ns1:TestComplexStringArrayScenario>";
ArrayList propertyList = new ArrayList();
@@ -171,7 +170,9 @@
propertyList.add("Bar");
propertyList.add("Some More Text");
- XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(new QName("http://testComplexStringArrayScenario.org", "TestComplexStringArrayScenario", "ns1"), propertyList.toArray(), null);
+ XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(new QName(
+ "http://testComplexStringArrayScenario.org", "TestComplexStringArrayScenario",
+ "ns1"), propertyList.toArray(), null);
String actualXML = getStringXML(pullParser);
assertXMLEqual(newDocument(expectedXML), newDocument(actualXML));
@@ -186,20 +187,19 @@
}
}
- /**
- * Empty array
- */
+ /** Empty array */
public void testComplexObjectArrayScenarioEmptyArray() {
try {
- String expectedXML = "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
- "<Foo>Some Text</Foo>" +
- "<Dependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</Dependent>" +
- "<Bar>Some More Text</Bar><" +
- "/ns1:TestComplexStringArrayScenario>";
+ String expectedXML =
+ "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
+ "<Foo>Some Text</Foo>" +
+ "<Dependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</Dependent>" +
+ "<Bar>Some More Text</Bar><" +
+ "/ns1:TestComplexStringArrayScenario>";
ArrayList propertyList = new ArrayList();
propertyList.add("Foo");
@@ -208,7 +208,7 @@
DummyADBBean dummyBean = new DummyADBBean();
propertyList.add(dummyBean);
- String[] array = new String[]{};
+ String[] array = new String[] { };
propertyList.add(new QName("AdditionalDependent"));
propertyList.add(array);
@@ -217,7 +217,7 @@
XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(
new QName("http://testComplexStringArrayScenario.org",
- "TestComplexStringArrayScenario", "ns1"),
+ "TestComplexStringArrayScenario", "ns1"),
propertyList.toArray(),
null);
String actualXML = getStringXML(pullParser);
@@ -233,9 +233,8 @@
fail("Error has occurred " + e);
}
}
- /**
- * test a complex array list
- */
+
+ /** test a complex array list */
public void testComplexArrayList() {
try {
@@ -267,7 +266,8 @@
propertyList.add(dummyBean);
QName projectQName = new QName("Person");
- XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(projectQName, propertyList.toArray(), null);
+ XMLStreamReader pullParser =
+ new ADBXMLStreamReaderImpl(projectQName, propertyList.toArray(), null);
Document actualDom = newDocument(getStringXML(pullParser));
Document expectedDocument = newDocument(exptectedXML);
@@ -310,16 +310,20 @@
public void testWithOMElements() throws XMLStreamException {
- String expectedXML = "<OMElementTest><axis2:FirstOMElement xmlns:axis2=\"http://ws.apache.org/namespaces/axis2\">" +
- "<axis2:SecondOMElement></axis2:SecondOMElement></axis2:FirstOMElement><Foo>Some Text</Foo>" +
- "<Dependent><Name>FooTwo</Name><Age>25</Age><Sex>Male</Sex></Dependent>" +
- "<axis2:SecondOMElement xmlns:axis2=\"http://ws.apache.org/namespaces/axis2\">" +
- "</axis2:SecondOMElement></OMElementTest>";
+ String expectedXML =
+ "<OMElementTest><axis2:FirstOMElement xmlns:axis2=\"http://ws.apache.org/namespaces/axis2\">" +
+ "<axis2:SecondOMElement></axis2:SecondOMElement></axis2:FirstOMElement><Foo>Some Text</Foo>" +
+ "<Dependent><Name>FooTwo</Name><Age>25</Age><Sex>Male</Sex></Dependent>" +
+ "<axis2:SecondOMElement xmlns:axis2=\"http://ws.apache.org/namespaces/axis2\">" +
+ "</axis2:SecondOMElement></OMElementTest>";
OMFactory factory = OMAbstractFactory.getOMFactory();
- OMNamespace axis2Namespace = factory.createOMNamespace(org.apache.axis2.Constants.AXIS2_NAMESPACE_URI, org.apache.axis2.Constants.AXIS2_NAMESPACE_PREFIX);
+ OMNamespace axis2Namespace = factory.createOMNamespace(
+ org.apache.axis2.Constants.AXIS2_NAMESPACE_URI,
+ org.apache.axis2.Constants.AXIS2_NAMESPACE_PREFIX);
OMElement firstElement = factory.createOMElement("FirstOMElement", axis2Namespace);
- OMElement secondElement = factory.createOMElement("SecondOMElement", axis2Namespace, firstElement);
+ OMElement secondElement =
+ factory.createOMElement("SecondOMElement", axis2Namespace, firstElement);
ArrayList propertyList = new ArrayList();
@@ -339,7 +343,8 @@
propertyList.add(secondElement);
- XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(new QName("OMElementTest"), propertyList.toArray(), null);
+ XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(new QName("OMElementTest"),
+ propertyList.toArray(), null);
String stringXML = getStringXML(pullParser);
try {
Document actualDom = newDocument(stringXML);
@@ -354,9 +359,8 @@
}
}
- /**
- * Test a completely null element
- */
+
+ /** Test a completely null element */
public void testNullableAttribute() {
try {
@@ -364,9 +368,10 @@
This is what I expect :
*/
- String exptectedXML = "<Person xmlns=\"\"><Name xmlns=\"\">FooOne</Name><DependentOne xmlns=\"\" " +
- "xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>" +
- "</Person>";
+ String exptectedXML =
+ "<Person xmlns=\"\"><Name xmlns=\"\">FooOne</Name><DependentOne xmlns=\"\" " +
+ "xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>" +
+ "</Person>";
ArrayList propertyList = new ArrayList();
propertyList.add("Name");
@@ -375,7 +380,8 @@
propertyList.add(null);
QName projectQName = new QName("Person");
- XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(projectQName, propertyList.toArray(), null);
+ XMLStreamReader pullParser =
+ new ADBXMLStreamReaderImpl(projectQName, propertyList.toArray(), null);
Document actualDom = newDocument(getStringXML(pullParser));
Document expectedDocument = newDocument(exptectedXML);
@@ -386,23 +392,22 @@
fail("Exception in parsing documents " + e);
} catch (IOException e) {
fail("Exception in parsing documents " + e);
- } catch (XMLStreamException e) {
+ } catch (XMLStreamException e) {
fail("Exception in parsing documents " + e);
}
}
- /**
- * Test a simple array
- */
+ /** Test a simple array */
public void testSimpleStringArrayScenario() {
try {
- String expectedXML = "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
- "<StringInfo>Some Text 0</StringInfo>" +
- "<StringInfo>Some Text 1</StringInfo>" +
- "<StringInfo>Some Text 2</StringInfo>" +
- "<StringInfo>Some Text 3</StringInfo>" +
- "</ns1:TestComplexStringArrayScenario>";
+ String expectedXML =
+ "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
+ "<StringInfo>Some Text 0</StringInfo>" +
+ "<StringInfo>Some Text 1</StringInfo>" +
+ "<StringInfo>Some Text 2</StringInfo>" +
+ "<StringInfo>Some Text 3</StringInfo>" +
+ "</ns1:TestComplexStringArrayScenario>";
ArrayList propertyList = new ArrayList();
@@ -415,7 +420,7 @@
XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(
new QName("http://testComplexStringArrayScenario.org",
- "TestComplexStringArrayScenario", "ns1"),
+ "TestComplexStringArrayScenario", "ns1"),
propertyList.toArray(), null);
String actualXML = getStringXML(pullParser);
@@ -427,24 +432,23 @@
fail("Error has occurred " + e);
} catch (IOException e) {
fail("Error has occurred " + e);
- }catch (XMLStreamException e) {
+ } catch (XMLStreamException e) {
fail("Error has occurred " + e);
}
}
- /**
- * Test a simple array with null's inbetween
- */
+ /** Test a simple array with null's inbetween */
public void testSimpleStringArrayScenarioWithNulls() {
try {
- String expectedXML = "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
- "<StringInfo>Some Text 0</StringInfo>" +
- "<StringInfo xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>" +
- "<StringInfo>Some Text 2</StringInfo>" +
- "<StringInfo>Some Text 3</StringInfo>" +
- "</ns1:TestComplexStringArrayScenario>";
+ String expectedXML =
+ "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
+ "<StringInfo>Some Text 0</StringInfo>" +
+ "<StringInfo xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>" +
+ "<StringInfo>Some Text 2</StringInfo>" +
+ "<StringInfo>Some Text 3</StringInfo>" +
+ "</ns1:TestComplexStringArrayScenario>";
ArrayList propertyList = new ArrayList();
@@ -452,14 +456,14 @@
for (int i = 0; i < 4; i++) {
stringArray[i] = "Some Text " + i;
}
- stringArray[1] =null;
+ stringArray[1] = null;
propertyList.add("StringInfo");
propertyList.add(stringArray);
XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(
new QName("http://testComplexStringArrayScenario.org",
- "TestComplexStringArrayScenario", "ns1"),
+ "TestComplexStringArrayScenario", "ns1"),
propertyList.toArray(), null);
String actualXML = getStringXML(pullParser);
@@ -471,7 +475,7 @@
fail("Error has occurred " + e);
} catch (IOException e) {
fail("Error has occurred " + e);
- }catch (XMLStreamException e) {
+ } catch (XMLStreamException e) {
fail("Error has occurred " + e);
}
@@ -479,24 +483,23 @@
}
- /**
- * test the mixed content
- */
+ /** test the mixed content */
public void testComplexStringArrayScenarioWithMixedContent() {
try {
- String expectedXML = "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
- "<Foo>Some Text</Foo>" +
- "<Dependent>" +
- "<Name>FooTwo</Name>" +
- "<Age>25</Age>" +
- "<Sex>Male</Sex>" +
- "</Dependent>" +
- "<StringInfo>Some Text 0</StringInfo>" +
- "<StringInfo>Some Text 1</StringInfo>" +
- "<StringInfo>Some Text 2</StringInfo>" +
- "<StringInfo>Some Text 3</StringInfo>" +
- "<Bar>Some More Text</Bar>" +
- "</ns1:TestComplexStringArrayScenario>";
+ String expectedXML =
+ "<ns1:TestComplexStringArrayScenario xmlns:ns1=\"http://testComplexStringArrayScenario.org\">" +
+ "<Foo>Some Text</Foo>" +
+ "<Dependent>" +
+ "<Name>FooTwo</Name>" +
+ "<Age>25</Age>" +
+ "<Sex>Male</Sex>" +
+ "</Dependent>" +
+ "<StringInfo>Some Text 0</StringInfo>" +
+ "<StringInfo>Some Text 1</StringInfo>" +
+ "<StringInfo>Some Text 2</StringInfo>" +
+ "<StringInfo>Some Text 3</StringInfo>" +
+ "<Bar>Some More Text</Bar>" +
+ "</ns1:TestComplexStringArrayScenario>";
ArrayList propertyList = new ArrayList();
propertyList.add("Foo");
@@ -517,7 +520,7 @@
XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(
new QName("http://testComplexStringArrayScenario.org",
- "TestComplexStringArrayScenario", "ns1"),
+ "TestComplexStringArrayScenario", "ns1"),
propertyList.toArray(),
null);
String actualXML = getStringXML(pullParser);
@@ -530,15 +533,14 @@
fail("Error has occurred " + e);
} catch (IOException e) {
fail("Error has occurred " + e);
- }catch (Exception e) {
+ } catch (Exception e) {
fail("Error has occurred " + e);
}
}
- /**
- * Test a simple array with one element nil
- */
+
+ /** Test a simple array with one element nil */
public void testComplexStringArrayScenarioWithNull() {
try {
String expectedXML = "<ns1:TestComplexStringArrayScenario " +
@@ -555,16 +557,16 @@
String[] stringArray = new String[4];
for (int i = 0; i < 4; i++) {
- if (i!=1) stringArray[i] = "Some Text " + i;
+ if (i != 1) stringArray[i] = "Some Text " + i;
}
- stringArray[1] = null;
+ stringArray[1] = null;
propertyList.add("StringInfo");
propertyList.add(stringArray);
XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(
new QName("http://testComplexStringArrayScenario.org",
- "TestComplexStringArrayScenario", "ns1"),
+ "TestComplexStringArrayScenario", "ns1"),
propertyList.toArray(), null);
String actualXML = getStringXML(pullParser);
@@ -576,7 +578,7 @@
fail("Error has occurred " + e);
} catch (IOException e) {
fail("Error has occurred " + e);
- }catch (XMLStreamException e) {
+ } catch (XMLStreamException e) {
fail("Error has occurred " + e);
}
@@ -585,12 +587,14 @@
/**
* Test multiple unqulified attributes
+ *
* @throws XMLStreamException
*/
public void testAttributes() throws XMLStreamException {
- String expectedXML = "<emp:Employee xmlns:emp=\"http://ec.org/software\" Attr2=\"Value 2\" " +
- "Attr3=\"Value 3\" Attr1=\"Value 1\" Attr5=\"Value 5\" Attr4=\"Value 4\"></emp:Employee>";
+ String expectedXML =
+ "<emp:Employee xmlns:emp=\"http://ec.org/software\" Attr2=\"Value 2\" " +
+ "Attr3=\"Value 3\" Attr1=\"Value 1\" Attr5=\"Value 5\" Attr4=\"Value 4\"></emp:Employee>";
OMFactory factory = OMAbstractFactory.getOMFactory();
QName elementQName = new QName("http://ec.org/software", "Employee", "emp");
@@ -608,8 +612,8 @@
String stringXML = getStringXML(new ADBXMLStreamReaderImpl(elementQName,
- null,
- omAttribList.toArray()));
+ null,
+ omAttribList.toArray()));
try {
Document actualDom = newDocument(stringXML);
Document expectedDocument = newDocument(expectedXML);
@@ -625,9 +629,7 @@
}
- /**
- * A text only element
- */
+ /** A text only element */
public void testElementText() {
String expectedXML = "<ns1:testElementText xmlns:ns1=\"http://testElementText.org\">" +
@@ -638,7 +640,8 @@
properties.add("This is some Text for the element");
XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(
- new QName("http://testElementText.org", "testElementText", "ns1"), properties.toArray(), null);
+ new QName("http://testElementText.org", "testElementText", "ns1"),
+ properties.toArray(), null);
String actualXML = getStringXML(pullParser);
@@ -696,14 +699,14 @@
// fail("Exception in parsing documents " + e);
// }
// }
- /**
- * test for qualified attributes
- */
+
+ /** test for qualified attributes */
public void testUnQualifiedAttributes() {
- String expectedXML = "<ns1:testElementText xmlns:ns1=\"http://testElementText.org\" MyUnQualifiedAttribute=\"MyAttributeValue\">" +
- "<ns2:QualifiedElement xmlns:ns2=\"http://testQElementText.org\">" +
- "This is some Text for the element</ns2:QualifiedElement></ns1:testElementText>";
+ String expectedXML =
+ "<ns1:testElementText xmlns:ns1=\"http://testElementText.org\" MyUnQualifiedAttribute=\"MyAttributeValue\">" +
+ "<ns2:QualifiedElement xmlns:ns2=\"http://testQElementText.org\">" +
+ "This is some Text for the element</ns2:QualifiedElement></ns1:testElementText>";
try {
ArrayList properties = new ArrayList();
properties.add(new QName("http://testQElementText.org", "QualifiedElement", "ns2"));
@@ -714,7 +717,7 @@
attributes[1] = "MyAttributeValue";
- XMLStreamReader pullParser =new ADBXMLStreamReaderImpl(
+ XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(
new QName("http://testElementText.org", "testElementText", "ns1"),
properties.toArray(),
attributes);
@@ -728,13 +731,12 @@
fail("Error has occurred " + e);
} catch (IOException e) {
fail("Error has occurred " + e);
- }catch (Exception e) {
+ } catch (Exception e) {
fail("Error has occurred " + e);
}
}
- /**
- * test for base64
- */
+
+ /** test for base64 */
public void testBase64EncodedText() {
String textTobeSent = "33344MthwrrewrIOTEN)(&**^E(W)EW";
@@ -748,7 +750,7 @@
properties.add(new QName("http://testQElementText.org", "QualifiedElement", "ns2"));
properties.add(new DataHandler(new ByteArrayDataSource(textTobeSent.getBytes())));
- XMLStreamReader pullParser =new ADBXMLStreamReaderImpl(
+ XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(
new QName("http://testElementText.org", "testElementText", "ns1"),
properties.toArray(),
null);
@@ -762,14 +764,12 @@
fail("Error has occurred " + e);
} catch (IOException e) {
fail("Error has occurred " + e);
- }catch (Exception e) {
+ } catch (Exception e) {
fail("Error has occurred " + e);
}
}
- /**
- * test the qualified elements
- * A qulified element has been associated with a namespace
- */
+
+ /** test the qualified elements A qulified element has been associated with a namespace */
public void testQualifiedElement() {
String expectedXML = "<ns1:testElementText xmlns:ns1=\"http://testElementText.org\">" +
@@ -800,10 +800,11 @@
/**
* Util method to convert the pullstream to a string
+ *
* @param reader
* @return
*/
- private String getStringXML(XMLStreamReader reader) throws XMLStreamException{
+ private String getStringXML(XMLStreamReader reader) throws XMLStreamException {
//the returned pullparser starts at an Element rather than the start
//document event. This is somewhat disturbing but since an ADBBean
//denotes an XMLFragment, it is justifiable to keep the current event
@@ -839,8 +840,10 @@
// OMElement omelement = stAXOMBuilder.getDocumentElement();
// return omelement.toString();
// }
+
/**
* Creates a DOM document from the string
+ *
* @param xml
* @return
* @throws ParserConfigurationException
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java Thu Mar 29 11:49:12 2007
@@ -109,10 +109,13 @@
} else {
result = AddressingMessages.getMessage("addressingHeaderRequired");
}
- }else if(AddressingConstants.FAULT_ADDRESSING_DESTINATION_UNREACHABLE.equals(faultCodeLocalName)){
- if(faultDetail!=null){
- result = AddressingMessages.getMessage("specificDestinationUnreachable", faultDetail);
- }else{
+ } else
+ if (AddressingConstants.FAULT_ADDRESSING_DESTINATION_UNREACHABLE.equals(faultCodeLocalName))
+ {
+ if (faultDetail != null) {
+ result = AddressingMessages
+ .getMessage("specificDestinationUnreachable", faultDetail);
+ } else {
result = AddressingMessages.getMessage("destinationUnreachable");
}
} else if (AddressingConstants.FAULT_ACTION_NOT_SUPPORTED.equals(faultCodeLocalName)) {
@@ -137,7 +140,7 @@
" incorrectHeaderName: " + incorrectHeaderName);
}
String namespace =
- (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+ (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
if (Submission.WSA_NAMESPACE.equals(namespace)) {
triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_HEADER_QNAME,
AddressingConstants.WSA_DEFAULT_PREFIX + ":" +
@@ -163,7 +166,7 @@
" incorrectHeaderName: " + incorrectHeaderName);
}
String namespace =
- (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+ (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
if (Submission.WSA_NAMESPACE.equals(namespace)) {
triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_HEADER_QNAME,
AddressingConstants.WSA_DEFAULT_PREFIX + ":" +
@@ -187,7 +190,7 @@
log.debug("triggerActionMismatchFault: messageContext: " + messageContext);
}
String namespace =
- (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+ (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
if (Submission.WSA_NAMESPACE.equals(namespace)) {
triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_HEADER_QNAME,
AddressingConstants.WSA_DEFAULT_PREFIX + ":Action",
@@ -212,7 +215,7 @@
messageContext + " incorrectHeaderName: " + incorrectHeaderName);
}
String namespace =
- (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+ (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
if (Submission.WSA_NAMESPACE.equals(namespace)) {
triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_HEADER_QNAME,
AddressingConstants.WSA_DEFAULT_PREFIX + ":" +
@@ -238,7 +241,7 @@
messageContext + " incorrectHeaderName: " + incorrectHeaderName);
}
String namespace =
- (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+ (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
if (Submission.WSA_NAMESPACE.equals(namespace)) {
triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_HEADER_QNAME,
AddressingConstants.WSA_DEFAULT_PREFIX + ":" +
@@ -264,7 +267,7 @@
" missingHeaderName: " + missingHeaderName);
}
String namespace =
- (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+ (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
if (Submission.WSA_NAMESPACE.equals(namespace)) {
triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_HEADER_QNAME,
AddressingConstants.WSA_DEFAULT_PREFIX + ":" + missingHeaderName,
@@ -281,21 +284,24 @@
}
// wsa:DestinationUnreachable [Reason] the string: "No route can be determined to reach [destination]"
- public static void triggerDestinationUnreachableFault(MessageContext messageContext, String address) throws AxisFault {
- if(log.isDebugEnabled()){
- log.debug("triggerDestinationUnreachableFault: messageContext: "+messageContext+
- " address: "+address);
+ public static void triggerDestinationUnreachableFault(MessageContext messageContext,
+ String address) throws AxisFault {
+ if (log.isDebugEnabled()) {
+ log.debug("triggerDestinationUnreachableFault: messageContext: " + messageContext +
+ " address: " + address);
}
String namespace =
- (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
- if (Submission.WSA_NAMESPACE.equals(namespace)){
+ (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+ if (Submission.WSA_NAMESPACE.equals(namespace)) {
triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_IRI, address,
- AddressingConstants.FAULT_ADDRESSING_DESTINATION_UNREACHABLE, null,
+ AddressingConstants.FAULT_ADDRESSING_DESTINATION_UNREACHABLE,
+ null,
AddressingMessages.getMessage(
"spec.submission.FAULT_ADDRESSING_DESTINATION_UNREACHABLE_REASON"));
- }else{
+ } else {
triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_IRI, null,
- AddressingConstants.FAULT_ADDRESSING_DESTINATION_UNREACHABLE, null,
+ AddressingConstants.FAULT_ADDRESSING_DESTINATION_UNREACHABLE,
+ null,
AddressingMessages.getMessage(
"spec.final.FAULT_ADDRESSING_DESTINATION_UNREACHABLE_REASON"));
}
@@ -322,7 +328,7 @@
String faultSubcode, String faultReason)
throws AxisFault {
Map faultInformation =
- (Map) messageContext.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
+ (Map)messageContext.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
if (faultInformation == null) {
faultInformation = new HashMap();
messageContext.setProperty(Constants.FAULT_INFORMATION_FOR_HEADERS, faultInformation);
@@ -342,7 +348,7 @@
messageContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES,
Boolean.FALSE);
String namespace =
- (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+ (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
throw new AxisFault(faultReason, new QName(namespace, faultcode,
AddressingConstants.WSA_DEFAULT_PREFIX));
}
@@ -374,13 +380,13 @@
public static OMElement getDetailElementForAddressingFault(MessageContext messageContext,
OMNamespace addressingNamespaceObject) {
- Map faultInfo = (Map) messageContext.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
+ Map faultInfo = (Map)messageContext.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
OMElement problemDetail = null;
if (faultInfo != null) {
- String faultyHeaderQName = (String) faultInfo.get(Final.FAULT_HEADER_PROB_HEADER_QNAME);
- String faultyAction = (String) faultInfo.get(Final.FAULT_PROBLEM_ACTION_NAME);
- String faultyAddress = (String) faultInfo.get(Final.FAULT_HEADER_PROB_IRI);
- if(faultyAddress!=null && !"".equals(faultyAddress)){
+ String faultyHeaderQName = (String)faultInfo.get(Final.FAULT_HEADER_PROB_HEADER_QNAME);
+ String faultyAction = (String)faultInfo.get(Final.FAULT_PROBLEM_ACTION_NAME);
+ String faultyAddress = (String)faultInfo.get(Final.FAULT_HEADER_PROB_IRI);
+ if (faultyAddress != null && !"".equals(faultyAddress)) {
problemDetail = messageContext.getEnvelope().getOMFactory().createOMElement(
Final.FAULT_HEADER_PROB_IRI, addressingNamespaceObject);
problemDetail.setText(faultyAddress);
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingModule.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingModule.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingModule.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingModule.java Thu Mar 29 11:49:12 2007
@@ -47,7 +47,7 @@
if (moduleConfig != null) {
List list = moduleConfig.getParameters();
for (int i = 0, size = list.size(); i < size; i++) {
- Parameter param = (Parameter) list.get(i);
+ Parameter param = (Parameter)list.get(i);
arg1.addParameter(param);
if (log.isTraceEnabled()) {
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/i18n/AddressingMessages.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/i18n/AddressingMessages.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/i18n/AddressingMessages.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/i18n/AddressingMessages.java Thu Mar 29 11:49:12 2007
@@ -44,7 +44,7 @@
: MessagesConstants.rootBundle;
- /** ** NO NEED TO CHANGE ANYTHING BELOW **** */
+ /** * NO NEED TO CHANGE ANYTHING BELOW **** */
private static final MessageBundle messageBundle =
new MessageBundle(projectName, packageName, resourceName,
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java Thu Mar 29 11:49:12 2007
@@ -45,7 +45,7 @@
String namespace) {
Iterator headerBlocks = header.getChildElements();
while (headerBlocks.hasNext()) {
- OMElement headerElement = (OMElement) headerBlocks.next();
+ OMElement headerElement = (OMElement)headerBlocks.next();
OMAttribute isRefParamAttr =
headerElement.getAttribute(new QName(namespace, "IsReferenceParameter"));
if (log.isTraceEnabled()) {
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInFaultHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInFaultHandler.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInFaultHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInFaultHandler.java Thu Mar 29 11:49:12 2007
@@ -19,12 +19,12 @@
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFactory;
import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultCode;
+import org.apache.axiom.soap.SOAPFaultDetail;
import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.soap.SOAPFaultSubCode;
import org.apache.axiom.soap.SOAPFaultText;
import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axiom.soap.SOAPFaultDetail;
-import org.apache.axiom.soap.SOAPFaultCode;
-import org.apache.axiom.soap.SOAPFaultSubCode;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.AddressingConstants;
@@ -53,7 +53,7 @@
throw new AxisFault("Problem");
}
- SOAPFactory sf = ((SOAPFactory) envelope.getOMFactory());
+ SOAPFactory sf = ((SOAPFactory)envelope.getOMFactory());
SOAPFaultDetail detail = null;
if (msgContext.isSOAP11()) {
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java Thu Mar 29 11:49:12 2007
@@ -135,7 +135,7 @@
messageContext = mc;
envelope = mc.getEnvelope();
- factory = (SOAPFactory) envelope.getOMFactory();
+ factory = (SOAPFactory)envelope.getOMFactory();
header = envelope.getHeader();
@@ -199,12 +199,12 @@
if (messageID != null && !isAddressingHeaderAlreadyAvailable(WSA_MESSAGE_ID, false))
{//optional
OMElement oe = processStringInfo(messageID, WSA_MESSAGE_ID);
- ArrayList attributes = (ArrayList) messageContextOptions
+ ArrayList attributes = (ArrayList)messageContextOptions
.getProperty(AddressingConstants.MESSAGEID_ATTRIBUTES);
if (attributes != null && !attributes.isEmpty()) {
Iterator attrIterator = attributes.iterator();
while (attrIterator.hasNext()) {
- AttributeHelper.importOMAttribute((OMAttribute) attrIterator.next(), oe);
+ AttributeHelper.importOMAttribute((OMAttribute)attrIterator.next(), oe);
}
}
}
@@ -263,13 +263,13 @@
}
// Otherwise just add the header
OMElement oe = processStringInfo(action, WSA_ACTION);
- ArrayList attributes = (ArrayList) messageContextOptions
+ ArrayList attributes = (ArrayList)messageContextOptions
.getProperty(AddressingConstants.ACTION_ATTRIBUTES);
if (attributes != null && !attributes.isEmpty()) {
Iterator attrIterator = attributes.iterator();
while (attrIterator.hasNext()) {
AttributeHelper
- .importOMAttribute((OMAttribute) attrIterator.next(), oe);
+ .importOMAttribute((OMAttribute)attrIterator.next(), oe);
}
}
}
@@ -314,7 +314,7 @@
Iterator attributes =
relatesTo[i].getExtensibilityAttributes().iterator();
while (attributes.hasNext()) {
- OMAttribute oma = (OMAttribute) attributes.next();
+ OMAttribute oma = (OMAttribute)attributes.next();
AttributeHelper.importOMAttribute(oma, relatesToHeader);
}
}
@@ -393,7 +393,7 @@
if (epr.getAddressAttributes() != null) {
Iterator addressAttributes = epr.getAddressAttributes().iterator();
while (addressAttributes.hasNext()) {
- OMAttribute attr = (OMAttribute) addressAttributes.next();
+ OMAttribute attr = (OMAttribute)addressAttributes.next();
AttributeHelper.importOMAttribute(attr, toHeaderBlock);
}
}
@@ -465,7 +465,7 @@
if (referenceInformation != null && parent != null) {
Iterator iterator = referenceInformation.values().iterator();
while (iterator.hasNext()) {
- OMElement omElement = (OMElement) iterator.next();
+ OMElement omElement = (OMElement)iterator.next();
parent.addChild(
ElementHelper.importOMElement(omElement, parent.getOMFactory()));
if (isFinalAddressingNamespace) {
@@ -496,7 +496,7 @@
if (replaceHeaders) {
Iterator iterator = header.getChildrenWithName(qname);
while (iterator.hasNext()) {
- OMElement addressingHeader = (OMElement) iterator.next();
+ OMElement addressingHeader = (OMElement)iterator.next();
addressingHeader.detach();
}
}
@@ -529,7 +529,7 @@
List headers = header.getHeaderBlocksWithNSURI(addressingNamespace);
for (int i = 0, size = headers.size(); i < size; i++) {
- SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) headers.get(i);
+ SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock)headers.get(i);
soapHeaderBlock.setMustUnderstand(true);
if (log.isTraceEnabled()) {
log.trace(
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingValidationHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingValidationHandler.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingValidationHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingValidationHandler.java Thu Mar 29 11:49:12 2007
@@ -148,7 +148,7 @@
* @see AddressingSubmissionInHandler#checkForMandatoryHeaders
*/
private void checkMessageIDHeader(MessageContext msgContext) throws AxisFault {
- String namespace = (String) msgContext.getProperty(WS_ADDRESSING_VERSION);
+ String namespace = (String)msgContext.getProperty(WS_ADDRESSING_VERSION);
if (!Final.WSA_NAMESPACE.equals(namespace)) {
return;
}
Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/addressing/AddressingFaultsTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/addressing/AddressingFaultsTest.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/addressing/AddressingFaultsTest.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/addressing/AddressingFaultsTest.java Thu Mar 29 11:49:12 2007
@@ -42,7 +42,7 @@
assertEquals(Final.FAULT_INVALID_HEADER_REASON, af.getMessage());
assertEquals(new QName(Final.WSA_NAMESPACE, Final.FAULT_INVALID_HEADER),
af.getFaultCode());
- assertEquals("wsa:Action", ((Map) messageContext
+ assertEquals("wsa:Action", ((Map)messageContext
.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS)).get(
Final.FAULT_HEADER_PROB_HEADER_QNAME));
assertEquals(Boolean.FALSE, messageContext.getProperty(
@@ -63,7 +63,7 @@
assertEquals(Final.FAULT_INVALID_HEADER_REASON, af.getMessage());
assertEquals(new QName(Final.WSA_NAMESPACE, Final.FAULT_INVALID_HEADER),
af.getFaultCode());
- assertEquals("wsa:Action", ((Map) messageContext
+ assertEquals("wsa:Action", ((Map)messageContext
.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS)).get(
Final.FAULT_HEADER_PROB_HEADER_QNAME));
assertEquals(Boolean.FALSE, messageContext.getProperty(
@@ -88,7 +88,7 @@
assertEquals(Final.FAULT_INVALID_HEADER_REASON, af.getMessage());
assertEquals(new QName(Final.WSA_NAMESPACE, Final.FAULT_INVALID_HEADER),
af.getFaultCode());
- assertEquals("wsa:ReplyTo", ((Map) messageContext
+ assertEquals("wsa:ReplyTo", ((Map)messageContext
.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS)).get(
Final.FAULT_HEADER_PROB_HEADER_QNAME));
assertEquals(Boolean.FALSE, messageContext.getProperty(
@@ -113,7 +113,7 @@
assertEquals(Final.FAULT_INVALID_HEADER_REASON, af.getMessage());
assertEquals(new QName(Final.WSA_NAMESPACE, Final.FAULT_INVALID_HEADER),
af.getFaultCode());
- assertEquals("wsa:ReplyTo", ((Map) messageContext
+ assertEquals("wsa:ReplyTo", ((Map)messageContext
.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS)).get(
Final.FAULT_HEADER_PROB_HEADER_QNAME));
assertEquals(Boolean.FALSE, messageContext.getProperty(
@@ -137,7 +137,7 @@
assertEquals(Final.FAULT_ADDRESSING_HEADER_REQUIRED_REASON, af.getMessage());
assertEquals(new QName(Final.WSA_NAMESPACE, Final.FAULT_ADDRESSING_HEADER_REQUIRED),
af.getFaultCode());
- assertEquals("wsa:Action", ((Map) messageContext
+ assertEquals("wsa:Action", ((Map)messageContext
.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS)).get(
Final.FAULT_HEADER_PROB_HEADER_QNAME));
assertEquals(Boolean.FALSE, messageContext.getProperty(
@@ -163,7 +163,7 @@
assertEquals(
new QName(Final.WSA_NAMESPACE, AddressingConstants.FAULT_ACTION_NOT_SUPPORTED),
af.getFaultCode());
- assertEquals("http://incorrect/action", ((Map) messageContext
+ assertEquals("http://incorrect/action", ((Map)messageContext
.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS)).get(
AddressingConstants.Final.FAULT_PROBLEM_ACTION_NAME));
assertEquals(Boolean.FALSE, messageContext.getProperty(
Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java Thu Mar 29 11:49:12 2007
@@ -264,7 +264,7 @@
private void assertEPRHasCorrectMetadata(EndpointReference epr) {
ArrayList metadata = epr.getMetaData();
if (metadata != null) {
- OMElement md = (OMElement) metadata.get(0);
+ OMElement md = (OMElement)metadata.get(0);
assertEquals(md.getQName(),
new QName("http://ws.apache.org/namespaces/axis2", "MetaExt"));
assertEquals(md.getText(), "123456789");
Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java Thu Mar 29 11:49:12 2007
@@ -15,11 +15,10 @@
package org.apache.axis2.handlers.addressing;
import junit.framework.TestCase;
-import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.om.OMElement;
import org.apache.axiom.soap.SOAP12Constants;
-import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
-import org.apache.axiom.om.OMElement;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.AddressingConstants;
@@ -78,7 +77,7 @@
String testfile =
"fault-messages/" + (isSOAP11 ? "soap11" : "soap12") + "/" + testName + ".xml";
StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(testfile);
- SOAPEnvelope envelope = ((SOAPEnvelope) omBuilder.getDocumentElement());
+ SOAPEnvelope envelope = ((SOAPEnvelope)omBuilder.getDocumentElement());
MessageContext msgContext = new MessageContext();
msgContext.setEnvelope(envelope);
AddressingFinalInHandler afih = new AddressingFinalInHandler();
@@ -86,7 +85,7 @@
AddressingInFaultHandler aifh = new AddressingInFaultHandler();
aifh.invoke(msgContext);
- return (AxisFault) msgContext.getProperty(Constants.INBOUND_FAULT_OVERRIDE);
+ return (AxisFault)msgContext.getProperty(Constants.INBOUND_FAULT_OVERRIDE);
}
}
Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java Thu Mar 29 11:49:12 2007
@@ -63,7 +63,7 @@
MessageContext mc)
throws Exception {
StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(testMessagePath);
- SOAPHeader header = ((SOAPEnvelope) omBuilder.getDocumentElement()).getHeader();
+ SOAPHeader header = ((SOAPEnvelope)omBuilder.getDocumentElement()).getHeader();
ArrayList addressingHeaderBlocks = header.getHeaderBlocksWithNSURI(addressingNamespace);
inHandler.extractAddressingInformation(header, mc, addressingHeaderBlocks,
addressingNamespace);
@@ -261,12 +261,12 @@
//</wsa:ReferenceParameters>
Map referenceParameters = epr.getAllReferenceParameters();
if (referenceParameters != null) {
- OMElement refparm1 = (OMElement) referenceParameters
+ OMElement refparm1 = (OMElement)referenceParameters
.get(new QName("http://example.com/fabrikam", "CustomerKey"));
assertNotNull(refparm1);
assertEquals("ReferenceParameter value incorrect.", refparm1.getText(), "123456789");
- OMElement refparm2 = (OMElement) referenceParameters
+ OMElement refparm2 = (OMElement)referenceParameters
.get(new QName("http://example.com/fabrikam", "ShoppingCart"));
assertNotNull(refparm2);
assertEquals("ReferenceParameter value incorrect.", refparm2.getText(), "ABCDEFG");
@@ -277,11 +277,11 @@
private void assertActionHasExtensibilityAttribute(MessageContext mc) {
boolean attributeFound = false;
- ArrayList attributes = (ArrayList) mc.getProperty(AddressingConstants.ACTION_ATTRIBUTES);
+ ArrayList attributes = (ArrayList)mc.getProperty(AddressingConstants.ACTION_ATTRIBUTES);
if (attributes != null) {
Iterator iter = attributes.iterator();
while (iter.hasNext()) {
- OMAttribute oa = (OMAttribute) iter.next();
+ OMAttribute oa = (OMAttribute)iter.next();
if (oa.getLocalName().equals("AttrExt")) {
attributeFound = true;
assertEquals("Attribute value incorrectly deserialised", oa.getAttributeValue(),
@@ -294,11 +294,11 @@
private void assertMessageIDHasExtensibilityAttribute(MessageContext mc) {
boolean attributeFound = false;
- ArrayList attributes = (ArrayList) mc.getProperty(AddressingConstants.MESSAGEID_ATTRIBUTES);
+ ArrayList attributes = (ArrayList)mc.getProperty(AddressingConstants.MESSAGEID_ATTRIBUTES);
if (attributes != null) {
Iterator iter = attributes.iterator();
while (iter.hasNext()) {
- OMAttribute oa = (OMAttribute) iter.next();
+ OMAttribute oa = (OMAttribute)iter.next();
if (oa.getLocalName().equals("AttrExt")) {
attributeFound = true;
assertEquals("Attribute value incorrectly deserialised", oa.getAttributeValue(),
@@ -315,7 +315,7 @@
if (attributes != null) {
Iterator iter = attributes.iterator();
while (iter.hasNext()) {
- OMAttribute oa = (OMAttribute) iter.next();
+ OMAttribute oa = (OMAttribute)iter.next();
if (oa.getLocalName().equals("AttrExt")) {
attributeFound = true;
assertEquals("Attribute value incorrectly deserialised", oa.getAttributeValue(),
@@ -332,7 +332,7 @@
if (attributes != null) {
Iterator iter = attributes.iterator();
while (iter.hasNext()) {
- OMAttribute oa = (OMAttribute) iter.next();
+ OMAttribute oa = (OMAttribute)iter.next();
if (oa.getLocalName().equals("AttrExt")) {
attributeFound = true;
assertEquals("Attribute value incorrectly deserialised", oa.getAttributeValue(),
@@ -349,7 +349,7 @@
if (attributes != null) {
Iterator iter = attributes.iterator();
while (iter.hasNext()) {
- OMAttribute oa = (OMAttribute) iter.next();
+ OMAttribute oa = (OMAttribute)iter.next();
if (oa.getLocalName().equals("AttrExt")) {
attributeFound = true;
assertEquals("Attribute value incorrectly deserialised", oa.getAttributeValue(),
@@ -363,7 +363,7 @@
private void assertEPRHasCorrectExtensibilityElements(EndpointReference epr) {
ArrayList eelements = epr.getExtensibleElements();
if (eelements != null) {
- OMElement ee = (OMElement) eelements.get(0);
+ OMElement ee = (OMElement)eelements.get(0);
assertEquals(ee.getQName(),
new QName("http://ws.apache.org/namespaces/axis2", "EPRExt"));
assertEquals(ee.getText(), "123456789");
Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java Thu Mar 29 11:49:12 2007
@@ -127,7 +127,7 @@
} catch (AxisFault axisFault) {
// Confirm this is the correct fault
assertEquals("Wrong fault code",
- new QName(Final.WSA_NAMESPACE,
+ new QName(Final.WSA_NAMESPACE,
Final.FAULT_ADDRESSING_HEADER_REQUIRED),
axisFault.getFaultCode());
return;
Modified: webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarExplodedMojo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarExplodedMojo.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarExplodedMojo.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarExplodedMojo.java Thu Mar 29 11:49:12 2007
@@ -26,11 +26,9 @@
* @requiresDependencyResolution runtime
*/
public class AarExplodedMojo
- extends AbstractAarMojo
-{
- public void execute()
- throws MojoExecutionException
- {
+ extends AbstractAarMojo {
+ public void execute()
+ throws MojoExecutionException {
buildExplodedAar();
}
}
Modified: webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarInPlaceMojo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarInPlaceMojo.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarInPlaceMojo.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarInPlaceMojo.java Thu Mar 29 11:49:12 2007
@@ -24,15 +24,13 @@
* @goal inplace
* @requiresDependencyResolution runtime
*/
-public class AarInPlaceMojo
- extends AbstractAarMojo
-{
+public class AarInPlaceMojo
+ extends AbstractAarMojo {
- public void execute()
- throws MojoExecutionException
- {
+ public void execute()
+ throws MojoExecutionException {
- getLog().debug("Generating aar in source directory... " + aarDirectory);
- buildExplodedAar();
- }
+ getLog().debug("Generating aar in source directory... " + aarDirectory);
+ buildExplodedAar();
+ }
}
Modified: webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java Thu Mar 29 11:49:12 2007
@@ -16,9 +16,6 @@
* limitations under the License.
*/
-import java.io.File;
-import java.io.IOException;
-
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.artifact.Artifact;
@@ -29,18 +26,20 @@
import org.codehaus.plexus.archiver.jar.JarArchiver;
import org.codehaus.plexus.archiver.jar.ManifestException;
+import java.io.File;
+import java.io.IOException;
+
/**
* Build a aar.
- *
+ *
* @goal aar
* @phase package
* @requiresDependencyResolution runtime
*/
-public class AarMojo extends AbstractAarMojo
-{
+public class AarMojo extends AbstractAarMojo {
/**
* The directory for the generated aar.
- *
+ *
* @parameter expression="${project.build.directory}"
* @required
*/
@@ -48,7 +47,7 @@
/**
* The name of the generated aar.
- *
+ *
* @parameter expression="${project.build.finalName}"
* @required
*/
@@ -56,7 +55,7 @@
/**
* The Jar archiver.
- *
+ *
* @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#jar}"
* @required
*/
@@ -64,97 +63,84 @@
/**
* The maven archive configuration to use.
- *
+ *
* @parameter
*/
private MavenArchiveConfiguration archive = new MavenArchiveConfiguration();
/**
- * Classifier to add to the artifact generated. If given, the artifact will be an attachment instead.
- *
+ * Classifier to add to the artifact generated. If given, the artifact will be an attachment
+ * instead.
+ *
* @parameter
*/
private String classifier;
/**
- * Whether this is the main artifact being built. Set to <code>false</code> if you don't want to install or deploy
- * it to the local repository instead of the default one in an execution.
- *
+ * Whether this is the main artifact being built. Set to <code>false</code> if you don't want to
+ * install or deploy it to the local repository instead of the default one in an execution.
+ *
* @parameter expression="${primaryArtifact}" default-value="true"
*/
private boolean primaryArtifact;
- /**
- * @component
- */
+ /** @component */
private MavenProjectHelper projectHelper;
/**
* Executes the AarMojo on the current project.
- *
- * @throws MojoExecutionException
- * if an error occured while building the webapp
- */
- public void execute() throws MojoExecutionException
- {
-
- File aarFile = new File( outputDirectory, aarName + ".aar" );
-
- try
- {
- performPackaging( aarFile );
+ *
+ * @throws MojoExecutionException if an error occured while building the webapp
+ */
+ public void execute() throws MojoExecutionException {
+
+ File aarFile = new File(outputDirectory, aarName + ".aar");
+
+ try {
+ performPackaging(aarFile);
}
- catch ( Exception e )
- {
- throw new MojoExecutionException( "Error assembling aar", e );
+ catch (Exception e) {
+ throw new MojoExecutionException("Error assembling aar", e);
}
}
/**
* Generates the aar.
- *
- * @param aarFile
- * the target aar file
+ *
+ * @param aarFile the target aar file
* @throws IOException
* @throws ArchiverException
* @throws ManifestException
* @throws DependencyResolutionRequiredException
+ *
*/
- private void performPackaging( File aarFile )
- throws IOException, ArchiverException, ManifestException, DependencyResolutionRequiredException,
- MojoExecutionException
- {
+ private void performPackaging(File aarFile)
+ throws IOException, ArchiverException, ManifestException,
+ DependencyResolutionRequiredException,
+ MojoExecutionException {
- buildExplodedAar( );
+ buildExplodedAar();
// generate aar file
- getLog().info( "Generating aar " + aarFile.getAbsolutePath() );
+ getLog().info("Generating aar " + aarFile.getAbsolutePath());
MavenArchiver archiver = new MavenArchiver();
- archiver.setArchiver( jarArchiver );
- archiver.setOutputFile( aarFile );
- jarArchiver.addDirectory( aarDirectory );
+ archiver.setArchiver(jarArchiver);
+ archiver.setOutputFile(aarFile);
+ jarArchiver.addDirectory(aarDirectory);
// create archive
- archiver.createArchive( project, archive );
+ archiver.createArchive(project, archive);
- if ( classifier != null )
- {
- projectHelper.attachArtifact( project, "aar", classifier, aarFile );
- }
- else
- {
+ if (classifier != null) {
+ projectHelper.attachArtifact(project, "aar", classifier, aarFile);
+ } else {
Artifact artifact = project.getArtifact();
- if ( primaryArtifact )
- {
- artifact.setFile( aarFile );
- }
- else if ( artifact.getFile() == null || artifact.getFile().isDirectory() )
- {
- artifact.setFile( aarFile );
- }
- else
- {
- projectHelper.attachArtifact( project, "aar", aarFile );
+ if (primaryArtifact) {
+ artifact.setFile(aarFile);
+ } else if (artifact.getFile() == null || artifact.getFile().isDirectory()) {
+ artifact.setFile(aarFile);
+ } else {
+ projectHelper.attachArtifact(project, "aar", aarFile);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org