You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2012/02/28 23:34:51 UTC
svn commit: r1294873 - in
/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom:
om/ om/impl/dom/ om/util/ soap/ soap/impl/builder/ soap/impl/llom/
Author: veithen
Date: Tue Feb 28 22:34:50 2012
New Revision: 1294873
URL: http://svn.apache.org/viewvc?rev=1294873&view=rev
Log:
Eliminated some compiler warnings.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMBodyTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMAttributeHelperTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11DefaultFaultConversionTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java Tue Feb 28 22:34:50 2012
@@ -20,11 +20,7 @@
package org.apache.axiom.om;
import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axiom.om.xpath.AXIOMXPath;
import org.custommonkey.xmlunit.XMLTestCase;
-import org.jaxen.JaxenException;
-import org.jaxen.SimpleNamespaceContext;
-import org.jaxen.XPath;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
@@ -90,21 +86,21 @@ public class DefaultNSHandlingTest exten
// e.printStackTrace();
// }
// }
-
-
- private OMElement getOMElement(String xpathString,
- OMElement parentElement) throws JaxenException {
- XPath xpath = getXPath(xpathString);
- return (OMElement) xpath.selectSingleNode(parentElement);
- }
-
- private XPath getXPath(String xpathString) throws JaxenException {
- SimpleNamespaceContext nsCtx = new SimpleNamespaceContext();
- nsCtx.addNamespace("ns", "http://geronimo.apache.org/xml/ns/j2ee/connector-1.1");
- XPath xpath = new AXIOMXPath(xpathString);
- xpath.setNamespaceContext(nsCtx);
- return xpath;
- }
+//
+//
+// private OMElement getOMElement(String xpathString,
+// OMElement parentElement) throws JaxenException {
+// XPath xpath = getXPath(xpathString);
+// return (OMElement) xpath.selectSingleNode(parentElement);
+// }
+//
+// private XPath getXPath(String xpathString) throws JaxenException {
+// SimpleNamespaceContext nsCtx = new SimpleNamespaceContext();
+// nsCtx.addNamespace("ns", "http://geronimo.apache.org/xml/ns/j2ee/connector-1.1");
+// XPath xpath = new AXIOMXPath(xpathString);
+// xpath.setNamespaceContext(nsCtx);
+// return xpath;
+// }
public static void main(String[] args) {
try {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java Tue Feb 28 22:34:50 2012
@@ -19,7 +19,7 @@
package org.apache.axiom.om;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.om.util.AXIOMUtil;
import org.apache.axiom.om.util.StAXUtils;
import org.custommonkey.xmlunit.XMLTestCase;
import org.xml.sax.SAXException;
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMBodyTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMBodyTest.java?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMBodyTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMBodyTest.java Tue Feb 28 22:34:50 2012
@@ -67,16 +67,14 @@ public class OMBodyTest extends OMTestCa
soapBody.addChild(om1); // NOOP..Expected behavior: child removed and then added
soapBody.addChild(om2);
- OMElement node = (OMElement) soapBody.
- getFirstChildWithName(new QName("http://myChild", "child1"));
+ OMElement node = soapBody.getFirstChildWithName(new QName("http://myChild", "child1"));
node = (OMElement) node.detach();
assertTrue("Node is missing", node != null);
assertTrue("Node has the wrong name " + node.getLocalName(),
node.getLocalName().equals("child1"));
- node = (OMElement) soapBody.
- getFirstChildWithName(new QName("http://myChild", "child2"));
+ node = soapBody.getFirstChildWithName(new QName("http://myChild", "child2"));
assertTrue("Node is missing", node != null);
assertTrue("Node has the wrong name " + node.getLocalName(),
node.getLocalName().equals("child2"));
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java Tue Feb 28 22:34:50 2012
@@ -30,7 +30,7 @@ public class OMDTDTest extends AbstractT
protected void setUp() throws Exception {
try {
OMXMLParserWrapper stAXOMBuilder = OMXMLBuilderFactory.createOMBuilder(getTestResource("dtd.xml"));
- document = this.document = stAXOMBuilder.getDocument();
+ document = stAXOMBuilder.getDocument();
} catch (Exception e) {
e.printStackTrace();
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java Tue Feb 28 22:34:50 2012
@@ -94,7 +94,7 @@ public class ConvertLLOMToDOOMTest exten
env.build();
StAXSOAPModelBuilder doomBuilder = new StAXSOAPModelBuilder(env.getXMLStreamReader(),
- DOOMAbstractFactory.getSOAP11Factory(),
+ OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory(),
SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
SOAPEnvelope doomEnv = doomBuilder.getSOAPEnvelope();
@@ -122,7 +122,7 @@ public class ConvertLLOMToDOOMTest exten
env.build();
StAXSOAPModelBuilder doomBuilder = new StAXSOAPModelBuilder(env.getXMLStreamReader(),
- DOOMAbstractFactory.getSOAP11Factory(),
+ OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory(),
SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
SOAPEnvelope doomEnv = doomBuilder.getSOAPEnvelope();
@@ -131,12 +131,12 @@ public class ConvertLLOMToDOOMTest exten
}
public void testAddChild() {
- SOAPFactory fac = DOOMAbstractFactory.getSOAP11Factory();
+ SOAPFactory fac = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory();
SOAPEnvelope env = fac.getDefaultEnvelope();
fac.createOMElement(new QName("http://test.org", "Test"), env.getBody());
env.build();
- SOAPFactory llomFac = DOOMAbstractFactory.getSOAP11Factory();
+ SOAPFactory llomFac = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory();
OMElement elem = llomFac.createOMElement("newDomElement", null);
OMElement firstElement = env.getBody().getFirstElement();
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMAttributeHelperTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMAttributeHelperTest.java?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMAttributeHelperTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMAttributeHelperTest.java Tue Feb 28 22:34:50 2012
@@ -25,7 +25,6 @@ import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
import javax.xml.namespace.QName;
@@ -37,7 +36,7 @@ public class OMAttributeHelperTest exten
OMNamespace ns1 = omf.createOMNamespace("http://nsurl", "prefix");
OMAttribute attr1 = omf.createOMAttribute("attr1", ns1, "attr1value");
- OMFactory doomf = DOOMAbstractFactory.getOMFactory();
+ OMFactory doomf = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMElement ome1 = doomf.createOMElement("element", ns1.getNamespaceURI(), ns1.getPrefix());
AttributeHelper.importOMAttribute(attr1, ome1);
assertNotSame(attr1, ome1.getAttribute(attr1.getQName()));
@@ -72,10 +71,10 @@ public class OMAttributeHelperTest exten
}
public void testDetachedElement() {
- OMNamespace top = DOOMAbstractFactory.getOMFactory().createOMNamespace("urn:test1", "t1");
- OMElement ome = DOOMAbstractFactory.getOMFactory().createOMElement("test", top);
+ OMNamespace top = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory().createOMNamespace("urn:test1", "t1");
+ OMElement ome = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory().createOMElement("test", top);
OMElement child =
- DOOMAbstractFactory.getOMFactory().createOMElement(new QName("test"), ome);
+ OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory().createOMElement(new QName("test"), ome);
OMAttribute oma = child.addAttribute("attr", "value", top);
OMElement target =
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java Tue Feb 28 22:34:50 2012
@@ -23,7 +23,6 @@ import org.apache.axiom.om.AbstractTestC
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
public class OMElementHelperTest extends AbstractTestCase {
@@ -42,10 +41,10 @@ public class OMElementHelperTest extends
// then lets pass in an OMElement created using llom and pass DOOMFactory
OMElement importedElement = ElementHelper
- .importOMElement(documentElement, DOOMAbstractFactory.getOMFactory());
+ .importOMElement(documentElement, OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory());
assertTrue(importedElement != documentElement);
assertTrue(importedElement.getOMFactory().getClass().isInstance(
- DOOMAbstractFactory.getOMFactory()));
+ OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory()));
documentElement.close(false);
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11DefaultFaultConversionTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11DefaultFaultConversionTest.java?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11DefaultFaultConversionTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11DefaultFaultConversionTest.java Tue Feb 28 22:34:50 2012
@@ -21,7 +21,6 @@ package org.apache.axiom.soap;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
@@ -56,7 +55,7 @@ public class SOAP11DefaultFaultConversio
envelope.build();
- factory = DOOMAbstractFactory.getSOAP11Factory();
+ factory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory();
StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(
envelope.getXMLStreamReader(), factory,SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
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?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- 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 Tue Feb 28 22:34:50 2012
@@ -662,13 +662,13 @@ public class StAXSOAPModelBuilderTest ex
StAXSOAPModelBuilder soap11Builder = new StAXSOAPModelBuilder(parser, null);
SOAPEnvelope env = soap11Builder.getSOAPEnvelope();
boolean isFault = env.hasFault();
- this.assertTrue(isFault);
- this.assertTrue(!parser.isReadBody());
+ assertTrue(isFault);
+ assertTrue(!parser.isReadBody());
// Get the name of the first element in the body
String localName = env.getSOAPBodyFirstElementLocalName();
- this.assertTrue(localName.equals("Fault"));
- this.assertTrue(!parser.isReadBody());
+ assertTrue(localName.equals("Fault"));
+ assertTrue(!parser.isReadBody());
parser.close();
}
}
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?rev=1294873&r1=1294872&r2=1294873&view=diff
==============================================================================
--- 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 Tue Feb 28 22:34:50 2012
@@ -28,7 +28,6 @@ import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMTestCase;
import org.apache.axiom.om.OMText;
import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
import org.apache.commons.logging.Log;
@@ -147,7 +146,7 @@ public class OMElementTest extends OMTes
}
public void testAddDOOMElementAsChild() throws XMLStreamException {
- OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+ OMFactory doomFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMFactory llomFactory = OMAbstractFactory.getOMFactory();
String text = "This was a DOOM Text";
@@ -165,7 +164,7 @@ public class OMElementTest extends OMTes
}
public void testAddDOOMTextAsChild() throws XMLStreamException {
- OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+ OMFactory doomFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMFactory llomFactory = OMAbstractFactory.getOMFactory();
String text = "This was a DOOM Text";
@@ -180,7 +179,7 @@ public class OMElementTest extends OMTes
}
public void testAddLLOMElementChildToDOOM() throws XMLStreamException {
- OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+ OMFactory doomFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMFactory llomFactory = OMAbstractFactory.getOMFactory();
String text = "This was a LLOM Text";
@@ -198,7 +197,7 @@ public class OMElementTest extends OMTes
}
public void testAddLLOMTextChildToDOOM() throws XMLStreamException {
- OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+ OMFactory doomFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMFactory llomFactory = OMAbstractFactory.getOMFactory();
String text = "This was a DOOM Text";