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 ch...@apache.org on 2006/09/06 19:35:34 UTC
svn commit: r440799 - in
/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om:
DefaultNSHandlingTest.java NamespaceTest.java OMBodyTest.java
impl/serializer/NoNamespaceSerializerTest.java
Author: chinthaka
Date: Wed Sep 6 10:35:34 2006
New Revision: 440799
URL: http://svn.apache.org/viewvc?view=rev&rev=440799
Log:
Nothing should be output to the console in tests. Fixing all of them with proper checkings whenever possible.
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/impl/serializer/NoNamespaceSerializerTest.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?view=diff&rev=440799&r1=440798&r2=440799
==============================================================================
--- 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 Wed Sep 6 10:35:34 2006
@@ -73,8 +73,6 @@
OMElement omElementThree = omFactory.createOMElement("Bar", defaultNS1, omElementTwo);
omElementThree.declareDefaultNamespace("http://defaultNS1.org");
- System.out.println("omElementOne = " + omElementOne);
-
assertTrue("".equals(omElementOneChild.getNamespace().getNamespaceURI()));
assertTrue("".equals(omElementTwoChild.getNamespace().getNamespaceURI()));
}
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?view=diff&rev=440799&r1=440798&r2=440799
==============================================================================
--- 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 Wed Sep 6 10:35:34 2006
@@ -278,7 +278,6 @@
personElem.addChild(ageElem);
personElem.addChild(weightElem);
- System.out.println("personElem = " + personElem);
try {
assertXMLEqual(expectedXML, personElem.toString());
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?view=diff&rev=440799&r1=440798&r2=440799
==============================================================================
--- 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 Wed Sep 6 10:35:34 2006
@@ -16,10 +16,10 @@
package org.apache.axiom.om;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class OMBodyTest extends OMTestCase implements OMConstants {
SOAPBody soapBody;
@@ -41,7 +41,7 @@
* Class under test for SOAPFault addFault()
*/
public void testAddFault() {
- log.info("Adding SOAP fault to body ....");
+ log.debug("Adding SOAP fault to body ....");
try {
soapBody.addChild(
soapFactory.createSOAPFault(soapBody,
@@ -50,9 +50,9 @@
log.info(e.getMessage());
fail(e.getMessage());
}
- log.info("\t checking for SOAP Fault ...");
+ log.debug("\t checking for SOAP Fault ...");
assertTrue("SOAP body has no SOAP fault", soapBody.hasFault());
- log.info("\t checking for not-nullity ...");
+ log.debug("\t checking for not-nullity ...");
assertTrue("SOAP body has no SOAP fault", soapBody.getFault() != null);
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java?view=diff&rev=440799&r1=440798&r2=440799
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java Wed Sep 6 10:35:34 2006
@@ -81,7 +81,7 @@
new InputStreamReader(
new ByteArrayInputStream(xmlTextTwo.getBytes())));
writer = XMLOutputFactory.newInstance().
- createXMLStreamWriter(System.out);
+ createXMLStreamWriter(new ByteArrayOutputStream());
builderOne =
OMXMLBuilderFactory.createStAXSOAPModelBuilder(
OMAbstractFactory.getSOAP11Factory(), readerOne);
@@ -128,12 +128,14 @@
* Will just do a probe test to check serialize with caching on works without any exception
*/
public void testSerilizationWithCacheOn() throws Exception {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
writer = XMLOutputFactory.newInstance().
- createXMLStreamWriter(new ByteArrayOutputStream());
+ createXMLStreamWriter(byteArrayOutputStream);
SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
env.serialize(writer);
writer.flush();
+ assertTrue(new String(byteArrayOutputStream.toByteArray()).length() > 1);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org