Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 16867 invoked from network); 15 Feb 2005 06:30:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 15 Feb 2005 06:30:55 -0000 Received: (qmail 12928 invoked by uid 500); 15 Feb 2005 06:30:54 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 12798 invoked by uid 500); 15 Feb 2005 06:30:53 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 12760 invoked by uid 99); 15 Feb 2005 06:30:53 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 14 Feb 2005 22:30:49 -0800 Received: (qmail 14487 invoked by uid 65534); 15 Feb 2005 06:23:27 -0000 Message-ID: <20050215062327.14485.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Tue, 15 Feb 2005 06:23:27 -0000 Subject: svn commit: r153902 [8/8] - in webservices/axis/trunk/java/dev/scratch/prototype2/src: java/org/apache/axis/addressing/ java/org/apache/axis/addressing/miheaders/ java/org/apache/axis/addressing/om/ java/org/apache/axis/clientapi/ java/org/apache/axis/context/ java/org/apache/axis/deployment/ java/org/apache/axis/deployment/listener/ java/org/apache/axis/deployment/repository/utill/ java/org/apache/axis/description/ java/org/apache/axis/engine/ java/org/apache/axis/handlers/ java/org/apache/axis/om/ java/org/apache/axis/om/impl/llom/ java/org/apache/axis/om/impl/llom/builder/ java/org/apache/axis/om/impl/llom/factory/ java/org/apache/axis/om/impl/llom/serialize/ java/org/apache/axis/om/impl/llom/traverse/ java/org/apache/axis/phaseresolver/ java/org/apache/axis/providers/ java/org/apache/axis/receivers/ java/org/apache/axis/transport/ java/org/apache/axis/transport/http/ java/org/apache/axis/wsdl/wsdltowom/ java/org/apache/wsdl/ java/org/apache/wsdl/impl/ java/org/apache/wsdl/util/ test/org/apache/axis/ test/org/apache/axis/addressing/ test/org/apache/axis/addressing/miheaders/ test/org/apache/axis/clientapi/ test/org/apache/axis/deployment/ test/org/apache/axis/description/ test/org/apache/axis/encoding/ test/org/apache/axis/engine/ test/org/apache/axis/integration/ test/org/apache/axis/misc/ test/org/apache/axis/om/ test/org/apache/axis/om/builder/ test/org/apache/axis/om/builder/dummy/ test/org/apache/axis/om/factory/ test/org/apache/axis/om/impl/builder/ test/org/apache/axis/om/impl/seriliazer/ test/org/apache/axis/om/impl/streamwrapper/ test/org/apache/axis/om/impl/traverse/ test/org/apache/axis/testUtils/ test/org/apache/axis/transport/ test/org/apache/wsdl/ To: axis-cvs@ws.apache.org From: chinthaka@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/OMTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/OMTest.java?view=3Ddiff&r1=3D153901&= r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/OMTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/OMTest.java Mon Feb 14 22:22:34 2005 @@ -15,22 +15,22 @@ */ package org.apache.axis.om; =20 -import java.io.File; -import java.io.FileReader; -import java.util.Iterator; +import org.apache.axis.AbstractTestCase; +import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder; =20 import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamReader; - -import org.apache.axis.AbstractTestCase; -import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder; +import java.io.File; +import java.io.FileReader; +import java.util.Iterator; =20 /** * This test case tests the basic expectations of the engine from the OM. */ -public class OMTest extends AbstractTestCase{ +public class OMTest extends AbstractTestCase { private SOAPEnvelope envelope; private OMFactory fac; + /** * Constructor. */ @@ -42,63 +42,63 @@ File file =3D getTestResourceFile("soap/sample1.xml"); XMLStreamReader parser =3D XMLInputFactory.newInstance().createXML= StreamReader(new FileReader(file)); fac =3D OMFactory.newInstance(); - OMXMLParserWrapper builder =3D new StAXSOAPModelBuilder(fac,parser= ); + OMXMLParserWrapper builder =3D new StAXSOAPModelBuilder(fac, parse= r); envelope =3D (SOAPEnvelope) builder.getDocumentElement(); } =20 - =20 + /** * Sometime the hasNext() in the childeren iterator is true yet the ne= xt() is null */ =20 - public void testNullInChilderen(){ + public void testNullInChilderen() { isNullChildrenThere(envelope); } - =20 + /** * the envelope is completly namesapce qulified so all the OMElements = got to have namespace values not null - * */ - public void test4MissingNamespaces(){ + public void test4MissingNamespaces() { isNameSpacesMissing(envelope); } - =20 - public void isNullChildrenThere(OMElement omeleent){ + + public void isNullChildrenThere(OMElement omeleent) { Iterator it =3D omeleent.getChildren(); - while(it.hasNext()){ - OMNode node =3D (OMNode)it.next(); + while (it.hasNext()) { + OMNode node =3D (OMNode) it.next(); assertNotNull(node); - if(node.getType() =3D=3D OMNode.ELEMENT_NODE){ - isNullChildrenThere((OMElement)node); + if (node.getType() =3D=3D OMNode.ELEMENT_NODE) { + isNullChildrenThere((OMElement) node); } } } =20 - public void isNameSpacesMissing(OMElement omeleent){ + public void isNameSpacesMissing(OMElement omeleent) { OMNamespace omns =3D omeleent.getNamespace(); assertNotNull(omns); assertNotNull(omns.getName()); Iterator it =3D omeleent.getChildren(); - while(it.hasNext()){ - OMNode node =3D (OMNode)it.next(); - =20 - if(node !=3D null && node.getType() =3D=3D OMNode.ELEMENT_NODE= ){ - isNameSpacesMissing((OMElement)node); + while (it.hasNext()) { + OMNode node =3D (OMNode) it.next(); + + if (node !=3D null && node.getType() =3D=3D OMNode.ELEMENT_NOD= E) { + isNameSpacesMissing((OMElement) node); } } } =20 - public void testRootNotCompleteInPartialBuild() throws Exception { - assertFalse("Root should not be complete",envelope.isComplete()); + public void testRootNotCompleteInPartialBuild() throws Exception { + assertFalse("Root should not be complete", envelope.isComplete()); } =20 /** * Assumption - The fed XML has at least two children under the root e= lement + * * @throws Exception */ public void testFirstChildDetach() throws Exception { - OMElement root=3D envelope; - assertFalse("Root should not be complete",root.isComplete()); + OMElement root =3D envelope; + assertFalse("Root should not be complete", root.isComplete()); OMNode oldFirstChild =3D root.getFirstChild(); assertNotNull(oldFirstChild); oldFirstChild.detach(); @@ -106,7 +106,7 @@ OMNode newFirstChild =3D root.getFirstChild(); assertNotNull(newFirstChild); =20 - assertNotSame(oldFirstChild,newFirstChild); + assertNotSame(oldFirstChild, newFirstChild); } =20 //todo this is wrong correct this Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/OMTestCase.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/OMTestCase.java?view=3Ddiff&r1=3D153= 901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/OMTestCase.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/OMTestCase.java Mon Feb 14 22:22:34 2005 @@ -1,18 +1,13 @@ package org.apache.axis.om; =20 +import org.apache.axis.AbstractTestCase; +import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder; + +import javax.xml.stream.*; import java.io.FileReader; import java.io.InputStream; import java.io.OutputStream; =20 -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.axis.AbstractTestCase; -import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder; - =20 /** * Copyright 2001-2004 The Apache Software Foundation. @@ -36,7 +31,7 @@ public abstract class OMTestCase extends AbstractTestCase { =20 protected static final String IN_FILE_NAME =3D "soap/soapmessage.xml"; - protected StAXSOAPModelBuilder builder; + protected StAXSOAPModelBuilder builder; protected OMFactory ombuilderFactory; =20 protected SOAPEnvelope soapEnvelope; @@ -49,22 +44,22 @@ =20 protected void setUp() throws Exception { super.setUp(); - soapEnvelope =3D (SOAPEnvelope)getOMBuilder("").getDocumentElement= (); + soapEnvelope =3D (SOAPEnvelope) getOMBuilder("").getDocumentElemen= t(); } =20 protected StAXSOAPModelBuilder getOMBuilder(String fileName) throws Ex= ception { - if(fileName =3D=3D "" || fileName =3D=3D null){ + if (fileName =3D=3D "" || fileName =3D=3D null) { fileName =3D IN_FILE_NAME; } XMLStreamReader parser =3D XMLInputFactory.newInstance().createXML= StreamReader(new FileReader(getTestResourceFile(fileName))); - builder =3D new StAXSOAPModelBuilder(OMFactory.newInstance(),parse= r); + builder =3D new StAXSOAPModelBuilder(OMFactory.newInstance(), pars= er); return builder; } =20 protected StAXSOAPModelBuilder getOMBuilder(InputStream in) throws Exc= eption { =20 XMLStreamReader parser =3D XMLInputFactory.newInstance().createXML= StreamReader(in); - builder =3D new StAXSOAPModelBuilder(OMFactory.newInstance(),parse= r); + builder =3D new StAXSOAPModelBuilder(OMFactory.newInstance(), pars= er); return builder; } =20 Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/OMTestUtils.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/OMTestUtils.java?view=3Ddiff&r1=3D15= 3901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/OMTestUtils.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/OMTestUtils.java Mon Feb 14 22:22:34 2005 @@ -16,104 +16,98 @@ =20 package org.apache.axis.om; =20 -import java.io.File; -import java.io.FileReader; -import java.util.Iterator; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - import junit.framework.TestCase; - import org.apache.axis.engine.AxisFault; import org.apache.axis.om.impl.llom.factory.OMXMLBuilderFactory; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; +import org.w3c.dom.*; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; +import java.io.File; +import java.io.FileReader; +import java.util.Iterator; =20 public class OMTestUtils { =20 public static OMXMLParserWrapper getOMBuilder(File file) throws Except= ion { XMLStreamReader parser =3D XMLInputFactory.newInstance().createXML= StreamReader(new FileReader(file)); - OMXMLParserWrapper builder =3D OMXMLBuilderFactory.createStAXSOA= PModelBuilder(OMFactory.newInstance(),parser); + OMXMLParserWrapper builder =3D OMXMLBuilderFactory.createStAXSOAPM= odelBuilder(OMFactory.newInstance(), parser); return builder; } =20 - public static void walkThrough(OMElement omEle){ + public static void walkThrough(OMElement omEle) { Iterator attibIt =3D omEle.getAttributes(); - if(attibIt!=3D null){ - while(attibIt.hasNext()){ - TestCase.assertNotNull("once the has next is not null, the " + - "element should not be null",attibIt.next()); - } + if (attibIt !=3D null) { + while (attibIt.hasNext()) { + TestCase.assertNotNull("once the has next is not null, the= " + + "element should not be null", attibIt.next()); + } } Iterator it =3D omEle.getChildren(); - if(it !=3D null){ - while(it.hasNext()){ - OMNode ele =3D (OMNode)it.next(); - TestCase.assertNotNull("once the has next is not null, the " + - "element should not be null",ele); - - if(ele instanceof OMElement){ - walkThrough((OMElement)ele); - } =20 - } + if (it !=3D null) { + while (it.hasNext()) { + OMNode ele =3D (OMNode) it.next(); + TestCase.assertNotNull("once the has next is not null, the= " + + "element should not be null", ele); + + if (ele instanceof OMElement) { + walkThrough((OMElement) ele); + } + } } } =20 - public static void compare(Element ele,OMElement omele) throws Excepti= on{ - if(ele =3D=3D null && omele =3D=3D null){ + public static void compare(Element ele, OMElement omele) throws Except= ion { + if (ele =3D=3D null && omele =3D=3D null) { return; - }else if(ele !=3D null && omele !=3D null){ + } else if (ele !=3D null && omele !=3D null) { =20 TestCase.assertTrue(ele.getLocalName().equals(omele.getLocalNa= me())); TestCase.assertTrue(ele.getNamespaceURI().equals(omele.getName= space().getName())); =20 //go through the attributes - NamedNodeMap map =3D ele.getAttributes(); + NamedNodeMap map =3D ele.getAttributes(); Iterator attIterator =3D omele.getAttributes(); OMAttribute omattribute; Attr domAttribute; String DOMAttrName; - =20 + while (attIterator !=3D null && attIterator.hasNext() && map = =3D=3D null) { - omattribute =3D (OMAttribute)attIterator.next();=20 - =20 - Node node =3D map.getNamedItemNS(omattribute.getNamespace(= )=2EgetName(),omattribute.getLocalName()); - if(node.getNodeType() =3D=3D Node.ATTRIBUTE_NODE){ - Attr attr =3D (Attr)node; - TestCase.assertEquals(attr.getValue(),omattribute.getV= alue()); - }else{ + omattribute =3D (OMAttribute) attIterator.next(); + + Node node =3D map.getNamedItemNS(omattribute.getNamespace(= )=2EgetName(), omattribute.getLocalName()); + if (node.getNodeType() =3D=3D Node.ATTRIBUTE_NODE) { + Attr attr =3D (Attr) node; + TestCase.assertEquals(attr.getValue(), omattribute.get= Value()); + } else { throw new AxisFault("return type is not a Attribute"); } - =20 + } =20 Iterator it =3D omele.getChildren(); NodeList list =3D ele.getChildNodes(); - for(int i =3D 0;i @@ -23,7 +23,7 @@ * limitations under the License. *

*/ -public class SOAPFaultTest extends AbstractTestCase{ +public class SOAPFaultTest extends AbstractTestCase { private SOAPEnvelope soapEnvelope; private XMLStreamWriter writer; =20 @@ -37,26 +37,24 @@ protected void setUp() throws Exception { super.setUp(); writer =3D XMLOutputFactory.newInstance(). - createXMLStreamWriter(System.out); + createXMLStreamWriter(System.out); } =20 - public void testSOAPFault() throws Exception{ - soapEnvelope =3D (SOAPEnvelope) OMTestUtils.getOMBuilder(getTe= stResourceFile("soap/minimalMessage.xml")).getDocumentElement(); - SOAPBody soapBody =3D soapEnvelope.getBody(); - - SOAPFault soapFault =3D OMFactory.newInstance().createSOAPFaul= t(soapBody, new Exception("Something has gone wrong som where !!")); - soapBody.addFault(soapFault); - - soapFault.setFaultCode(new QName("http://opensource.lk", "Axis= ", "SOAP-ENV")); - assertEquals("faultcode returned is incorrect", soapFault.getF= aultCode().getLocalPart(), "Axis"); - assertEquals("faultcode returned is incorrect", soapFault.getF= aultCode().getPrefix(), "SOAP-ENV"); + public void testSOAPFault() throws Exception { + soapEnvelope =3D (SOAPEnvelope) OMTestUtils.getOMBuilder(getTestRe= sourceFile("soap/minimalMessage.xml")).getDocumentElement(); + SOAPBody soapBody =3D soapEnvelope.getBody(); + + SOAPFault soapFault =3D OMFactory.newInstance().createSOAPFault(so= apBody, new Exception("Something has gone wrong som where !!")); + soapBody.addFault(soapFault); + + soapFault.setFaultCode(new QName("http://opensource.lk", "Axis", "= SOAP-ENV")); + assertEquals("faultcode returned is incorrect", soapFault.getFault= Code().getLocalPart(), "Axis"); + assertEquals("faultcode returned is incorrect", soapFault.getFault= Code().getPrefix(), "SOAP-ENV"); =20 - soapFault.setFaultActor("Neo"); - assertEquals("faultactor returned is incorrect", soapFault.get= FaultActor(), "Neo"); + soapFault.setFaultActor("Neo"); + assertEquals("faultactor returned is incorrect", soapFault.getFaul= tActor(), "Neo"); =20 - =20 =20 -=20 } =20 private void print() throws XMLStreamException { Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/builder/ObjectToOMBuilderTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/builder/ObjectToOMBuilderTest.java?v= iew=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/builder/ObjectToOMBuilderTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/builder/ObjectToOMBuilderTest.java Mon Feb 14 22:22:34 2005 @@ -1,23 +1,17 @@ package org.apache.axis.om.builder; =20 -import java.io.File; -import java.io.FileOutputStream; -import java.util.Iterator; - -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamWriter; - import junit.framework.TestCase; - -import org.apache.axis.om.OMConstants; -import org.apache.axis.om.OMElement; -import org.apache.axis.om.OMFactory; -import org.apache.axis.om.OMNamespace; -import org.apache.axis.om.OMNode; +import org.apache.axis.om.*; import org.apache.axis.om.builder.dummy.DummyOutObject; import org.apache.axis.testUtils.Encoder; import org.apache.axis.testUtils.ObjectToOMBuilder; =20 +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.util.Iterator; + /** * Copyright 2001-2004 The Apache Software Foundation. *

@@ -52,8 +46,8 @@ OMFactory omFactory =3D OMFactory.newInstance(); OMNamespace ns =3D omFactory.createOMNamespace(OMConstants.SOAP_EN= VELOPE_NAMESPACE_URI, OMConstants.SOAPENVELOPE_NAMESPACE_PREFIX); element =3D omFactory.createOMElement("Body", ns); - new ObjectToOMBuilder(element,outObject); - tempFile =3D File.createTempFile("temp","xml"); + new ObjectToOMBuilder(element, outObject); + tempFile =3D File.createTempFile("temp", "xml"); writer =3D XMLOutputFactory.newInstance().createXMLStreamWriter(ne= w FileOutputStream(tempFile)); =20 } @@ -69,7 +63,6 @@ public void testSerialization() throws Exception { element.serialize(writer, true); } - =20 =20 protected void tearDown() throws Exception { Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/builder/dummy/DummyOutObject.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/builder/dummy/DummyOutObject.java?vi= ew=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/builder/dummy/DummyOutObject.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/builder/dummy/DummyOutObject.java Mon Feb 14 22:22:34 2005 @@ -1,21 +1,18 @@ package org.apache.axis.om.builder.dummy; =20 -import java.io.FileReader; -import java.io.IOException; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParserFactory; -import javax.xml.stream.XMLStreamReader; - import org.apache.axis.engine.AxisFault; import org.apache.axis.om.OMException; import org.apache.axis.testUtils.Encoder; - import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; =20 +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.stream.XMLStreamReader; +import java.io.FileReader; + /** * Copyright 2001-2004 The Apache Software Foundation. *

@@ -45,22 +42,23 @@ } =20 private void setup() throws SAXException, ParserConfigurationException= { - SAXParserFactory saxParserFactory =3D SAXParserFactory.newInst= ance(); - saxParserFactory.setNamespaceAware(true); - parser =3D saxParserFactory.newSAXParser().getXMLReader(); - =20 + SAXParserFactory saxParserFactory =3D SAXParserFactory.newInstance= (); + saxParserFactory.setNamespaceAware(true); + parser =3D saxParserFactory.newSAXParser().getXMLReader(); + =20 } =20 =20 - public void serialize(ContentHandler contentHandler) throws OMExceptio= n{ + public void serialize(ContentHandler contentHandler) throws OMExceptio= n { try { parser.parse(new InputSource(new FileReader(fileName))); } catch (Exception e) { - throw new OMException(e); + throw new OMException(e); } =20 } + /* (non-Javadoc) * @see org.apache.axis.encoding.Encoder#deSerialize(javax.xml.stream.= XMLStreamReader) */ Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/factory/OMLinkedListImplFactoryTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/factory/OMLinkedListImplFactoryTest.= java?view=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/factory/OMLinkedListImplFactoryTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/factory/OMLinkedListImplFactoryTest.java Mon Feb 14 22:22:34 2005 @@ -18,18 +18,7 @@ */ =20 import org.apache.axis.AbstractTestCase; -import org.apache.axis.om.OMConstants; -import org.apache.axis.om.OMElement; -import org.apache.axis.om.OMFactory; -import org.apache.axis.om.OMNamespace; -import org.apache.axis.om.OMTestUtils; -import org.apache.axis.om.OMText; -import org.apache.axis.om.OMXMLParserWrapper; -import org.apache.axis.om.SOAPBody; -import org.apache.axis.om.SOAPEnvelope; -import org.apache.axis.om.SOAPFault; -import org.apache.axis.om.SOAPHeader; -import org.apache.axis.om.SOAPHeaderBlock; +import org.apache.axis.om.*; =20 /** * User: Eran Chinthaka (eran.chinthaka@gmail.com) @@ -121,7 +110,6 @@ SOAPEnvelope soapEnvelope =3D omFactory.createSOAPEnvelope(soa= pNamespace, OMTestUtils.getOMBuilder(getTestResourceFile("soap/minimalMessa= ge.xml"))); assertTrue("SOAPEnvelope with a builder should start with done= =3D false ", !soapEnvelope.isComplete()); assertTrue("This SOAPEnvelope must have a builder ", soapEnvel= ope.getBuilder() instanceof OMXMLParserWrapper); - =20 =20 } catch (Exception e) { Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/impl/builder/StAXOMBuilderTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/impl/builder/StAXOMBuilderTest.java?= view=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/builder/StAXOMBuilderTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/builder/StAXOMBuilderTest.java Mon Feb 14 22:22:34 2005 @@ -20,11 +20,6 @@ * Time: 2:29:07 PM */ =20 -import java.io.FileReader; -import java.util.Iterator; - -import javax.xml.stream.XMLInputFactory; - import org.apache.axis.AbstractTestCase; import org.apache.axis.om.OMElement; import org.apache.axis.om.OMFactory; @@ -33,6 +28,10 @@ import org.apache.axis.om.impl.llom.builder.StAXOMBuilder; import org.apache.axis.om.impl.llom.factory.OMXMLBuilderFactory; =20 +import javax.xml.stream.XMLInputFactory; +import java.io.FileReader; +import java.util.Iterator; + public class StAXOMBuilderTest extends AbstractTestCase { StAXOMBuilder stAXOMBuilder; FileReader testFile; @@ -56,15 +55,15 @@ assertTrue(" Name of the root element is wrong", rootElement.getLo= calName().equalsIgnoreCase("Root")); // get the first OMElement child OMNode omnode =3D rootElement.getFirstChild(); - while(omnode instanceof OMText){ + while (omnode instanceof OMText) { omnode =3D omnode.getNextSibling(); } =20 - Iterator children =3D ((OMElement)omnode).getChildren(); + Iterator children =3D ((OMElement) omnode).getChildren(); int childrenCount =3D 0; while (children.hasNext()) { OMNode node =3D (OMNode) children.next(); - if(node instanceof OMElement) + if (node instanceof OMElement) childrenCount++; } assertTrue(childrenCount =3D=3D 5); Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/impl/seriliazer/ElementSerializerTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/impl/seriliazer/ElementSerializerTes= t=2Ejava?view=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/seriliazer/ElementSerializerTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/seriliazer/ElementSerializerTest.java Mon Feb 14 22:22:34 2005 @@ -1,24 +1,16 @@ package org.apache.axis.om.impl.seriliazer; =20 -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileReader; +import org.apache.axis.AbstractTestCase; +import org.apache.axis.om.*; +import org.apache.axis.om.impl.llom.factory.OMXMLBuilderFactory; =20 import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; - -import org.apache.axis.AbstractTestCase; -import org.apache.axis.om.OMElement; -import org.apache.axis.om.OMFactory; -import org.apache.axis.om.OMNamespace; -import org.apache.axis.om.OMNode; -import org.apache.axis.om.OMText; -import org.apache.axis.om.OMXMLParserWrapper; -import org.apache.axis.om.SOAPBody; -import org.apache.axis.om.SOAPEnvelope; -import org.apache.axis.om.impl.llom.factory.OMXMLBuilderFactory; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileReader; =20 =20 /** @@ -40,7 +32,8 @@ private XMLStreamReader reader; private XMLStreamWriter writer; private OMXMLParserWrapper builder; - private File tempFile; + private File tempFile; + public ElementSerializerTest(String testName) { super(testName); } @@ -48,35 +41,35 @@ protected void setUp() throws Exception { reader =3D XMLInputFactory.newInstance(). createXMLStreamReader(new FileReader(getTestResourceFile("= soap/soapmessage.xml"))); - tempFile =3D File.createTempFile("temp","xml"); + tempFile =3D File.createTempFile("temp", "xml"); writer =3D XMLOutputFactory.newInstance(). createXMLStreamWriter(new FileOutputStream(tempFile)); - builder =3D OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMFact= ory.newInstance(),reader); + builder =3D OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMFacto= ry.newInstance(), reader); } =20 - public void testElementSerilization() throws Exception{ + public void testElementSerilization() throws Exception { OMElement elt =3D builder.getDocumentElement(); - elt.serialize(writer,true); + elt.serialize(writer, true); =20 } =20 - public void testElementSerilizationCacheOff() throws Exception{ + public void testElementSerilizationCacheOff() throws Exception { OMElement elt =3D builder.getDocumentElement(); - elt.serialize(writer,false); + elt.serialize(writer, false); =20 } =20 - public void testElementSerilizationChild() throws Exception{ + public void testElementSerilizationChild() throws Exception { OMElement elt =3D builder.getDocumentElement(); OMNode node =3D elt.getFirstChild().getNextSibling(); - node.serialize(writer,true); + node.serialize(writer, true); =20 } =20 - public void testElementSerilizationSOAPBodyCacheOff() throws Exception= { - SOAPEnvelope env =3D (SOAPEnvelope)builder.getDocumentElement(); + public void testElementSerilizationSOAPBodyCacheOff() throws Exception= { + SOAPEnvelope env =3D (SOAPEnvelope) builder.getDocumentElement(); OMNode node =3D env.getBody(); - node.serialize(writer,false); + node.serialize(writer, false); } =20 public void testElement() throws Exception { @@ -84,49 +77,49 @@ reader); SOAPEnvelope env =3D (SOAPEnvelope) builder.getDocumentElement(); SOAPBody body =3D env.getBody(); - body.serialize(writer,true); + body.serialize(writer, true); } =20 public void testCompleteElement() throws Exception { OMXMLParserWrapper builder =3D OMXMLBuilderFactory.createStAXSOAPM= odelBuilder(OMFactory.newInstance(), reader); SOAPEnvelope env =3D (SOAPEnvelope) builder.getDocumentElement(); - env.serialize(writer,true); + env.serialize(writer, true); } =20 public void testDualNamespaces1() throws Exception { OMFactory factory =3D OMFactory.newInstance(); - OMNamespace ns1 =3D factory.createOMNamespace("bar","x"); - OMNamespace ns2 =3D factory.createOMNamespace("bar","y"); + OMNamespace ns1 =3D factory.createOMNamespace("bar", "x"); + OMNamespace ns2 =3D factory.createOMNamespace("bar", "y"); =20 - OMElement root =3D factory.createOMElement("root",ns1); - OMElement elt11 =3D factory.createOMElement("foo1",ns1); - OMElement elt12 =3D factory.createOMElement("foo2",ns1); - OMElement elt21 =3D factory.createOMElement("yuck",ns2); - OMElement elt22 =3D factory.createOMElement("yuck",ns2); + OMElement root =3D factory.createOMElement("root", ns1); + OMElement elt11 =3D factory.createOMElement("foo1", ns1); + OMElement elt12 =3D factory.createOMElement("foo2", ns1); + OMElement elt21 =3D factory.createOMElement("yuck", ns2); + OMElement elt22 =3D factory.createOMElement("yuck", ns2); =20 elt11.addChild(elt21); elt12.addChild(elt22); root.addChild(elt11); root.addChild(elt12); - root.serialize(writer,true); + root.serialize(writer, true); } =20 public void testDualNamespaces2() throws Exception { OMFactory factory =3D OMFactory.newInstance(); =20 - OMNamespace ns1 =3D factory.createOMNamespace("bar","x"); - OMElement root =3D factory.createOMElement("root",ns1); - OMNamespace ns2 =3D root.declareNamespace("bar","y"); - OMElement elt1 =3D factory.createOMElement("foo",ns1); - OMElement elt2 =3D factory.createOMElement("yuck",ns2); - OMText txt1 =3D factory.createText(elt2,"blah"); + OMNamespace ns1 =3D factory.createOMNamespace("bar", "x"); + OMElement root =3D factory.createOMElement("root", ns1); + OMNamespace ns2 =3D root.declareNamespace("bar", "y"); + OMElement elt1 =3D factory.createOMElement("foo", ns1); + OMElement elt2 =3D factory.createOMElement("yuck", ns2); + OMText txt1 =3D factory.createText(elt2, "blah"); =20 elt2.addChild(txt1); elt1.addChild(elt2); root.addChild(elt1); =20 - root.serialize(writer,true); + root.serialize(writer, true); } =20 protected void tearDown() throws Exception { Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/impl/seriliazer/OMSerailizerTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/impl/seriliazer/OMSerailizerTest.jav= a?view=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/seriliazer/OMSerailizerTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/seriliazer/OMSerailizerTest.java Mon Feb 14 22:22:34 2005 @@ -1,14 +1,5 @@ package org.apache.axis.om.impl.seriliazer; =20 -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - import org.apache.axis.AbstractTestCase; import org.apache.axis.om.OMFactory; import org.apache.axis.om.OMXMLParserWrapper; @@ -17,6 +8,13 @@ import org.apache.axis.om.impl.llom.factory.OMXMLBuilderFactory; import org.apache.axis.om.impl.llom.serialize.StreamingOMSerializer; =20 +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.XMLStreamWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileReader; =20 =20 /** @@ -57,7 +55,7 @@ public void testRawSerializer() throws Exception { StreamingOMSerializer serializer =3D new StreamingOMSerializer(); //serializer.setNamespacePrefixStack(new Stack()); - serializer.serialize(reader,writer); + serializer.serialize(reader, writer); =20 } =20 @@ -69,7 +67,7 @@ serializer.serialize(env.getPullParser(false), writer); } =20 - public void testElementPullStream1WithCacheOff() throws Exception { + public void testElementPullStream1WithCacheOff() throws Exception { OMXMLParserWrapper builder =3D OMXMLBuilderFactory.createStAXSOAPM= odelBuilder(OMFactory.newInstance(), reader); SOAPEnvelope env =3D (SOAPEnvelope) builder.getDocumentElement(); Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/impl/streamwrapper/OMStaxStreamingWrapperTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/impl/streamwrapper/OMStaxStreamingWr= apperTest.java?view=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/streamwrapper/OMStaxStreamingWrapperTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/streamwrapper/OMStaxStreamingWrapperTest.java Mon Feb 14 22:22= :34 2005 @@ -1,16 +1,15 @@ package org.apache.axis.om.impl.streamwrapper; =20 -import java.io.File; -import java.io.FileReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - import org.apache.axis.AbstractTestCase; import org.apache.axis.om.OMFactory; import org.apache.axis.om.OMXMLParserWrapper; import org.apache.axis.om.SOAPEnvelope; import org.apache.axis.om.impl.llom.factory.OMXMLBuilderFactory; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; +import java.io.File; +import java.io.FileReader; =20 /** * Copyright 2001-2004 The Apache Software Foundation. Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/impl/streamwrapper/OmStAXBuilderTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/impl/streamwrapper/OmStAXBuilderTest= .java?view=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/streamwrapper/OmStAXBuilderTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/streamwrapper/OmStAXBuilderTest.java Mon Feb 14 22:22:34 2005 @@ -1,20 +1,19 @@ package org.apache.axis.om.impl.streamwrapper; =20 -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - import org.apache.axis.AbstractTestCase; import org.apache.axis.om.OMFactory; import org.apache.axis.om.OMXMLParserWrapper; import org.apache.axis.om.SOAPEnvelope; import org.apache.axis.om.impl.llom.factory.OMXMLBuilderFactory; =20 +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.XMLStreamWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileReader; + /** * Copyright 2001-2004 The Apache Software Foundation. *

@@ -29,11 +28,10 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= . * See the License for the specific language governing permissions and * limitations under the License. - * */ -public class OmStAXBuilderTest extends AbstractTestCase{ +public class OmStAXBuilderTest extends AbstractTestCase { =20 - private OMFactory factory =3Dnull; + private OMFactory factory =3D null; private OMXMLParserWrapper builder; private File tempFile; =20 @@ -45,17 +43,17 @@ factory =3D OMFactory.newInstance(); XMLStreamReader reader =3D XMLInputFactory.newInstance(). createXMLStreamReader(new FileReader(getTestResourceFile("= soap/soapmessage.xml"))); - builder =3D OMXMLBuilderFactory.createStAXSOAPModelBuilder(factory= ,reader); + builder =3D OMXMLBuilderFactory.createStAXSOAPModelBuilder(factory= , reader); tempFile =3D File.createTempFile("temp", "xml"); } =20 - public void testStaxBuilder()throws Exception{ + public void testStaxBuilder() throws Exception { =20 - SOAPEnvelope envelope =3D (SOAPEnvelope)builder.getDocumentElement= (); + SOAPEnvelope envelope =3D (SOAPEnvelope) builder.getDocumentElemen= t(); assertNotNull(envelope); XMLStreamWriter writer =3D XMLOutputFactory.newInstance().createXM= LStreamWriter(new FileOutputStream(tempFile)); // XMLStreamWriter writer =3D XMLOutputFactory.newInstance().create= XMLStreamWriter(System.out); - envelope.serialize(writer,true); + envelope.serialize(writer, true); =20 =20 } Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/om/impl/traverse/OMChildrenWithSpecificAttributeIteratorTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/om/impl/traverse/OMChildrenWithSpecific= AttributeIteratorTest.java?view=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/traverse/OMChildrenWithSpecificAttributeIteratorTest.java (ori= ginal) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/om/impl/traverse/OMChildrenWithSpecificAttributeIteratorTest.java Mon = Feb 14 22:22:34 2005 @@ -19,11 +19,6 @@ */ package org.apache.axis.om.impl.traverse; =20 -import java.io.ByteArrayInputStream; -import java.util.Iterator; - -import javax.xml.namespace.QName; - import org.apache.axis.addressing.AddressingConstants; import org.apache.axis.om.OMConstants; import org.apache.axis.om.OMTestCase; @@ -31,6 +26,10 @@ import org.apache.axis.om.SOAPHeaderBlock; import org.apache.axis.om.impl.llom.traverse.OMChildrenWithSpecificAttribu= teIterator; =20 +import javax.xml.namespace.QName; +import java.io.ByteArrayInputStream; +import java.util.Iterator; + =20 public class OMChildrenWithSpecificAttributeIteratorTest extends OMTestCas= e implements OMConstants { =20 @@ -102,7 +101,7 @@ int childrenCount =3D 0; while (soapHeaderChildrenIter.hasNext()) { Object o =3D soapHeaderChildrenIter.next(); - childrenCount++; + childrenCount++; } =20 assertEquals("OMChildrenWithSpecificAttributeIterator with detach = true, not working properly", childrenCount, 6); // here this 6 includes whi= te spaces as OMText Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/testUtils/ArrayTypeEncoder.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/testUtils/ArrayTypeEncoder.java?view=3D= diff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/testUtils/ArrayTypeEncoder.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/testUtils/ArrayTypeEncoder.java Mon Feb 14 22:22:34 2005 @@ -15,61 +15,59 @@ */ package org.apache.axis.testUtils; =20 -import java.util.ArrayList; - -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - import org.apache.axis.engine.AxisFault; - import org.apache.axis.om.OMConstants; import org.apache.axis.om.OMException; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; =20 +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import java.util.ArrayList; + =20 -public class ArrayTypeEncoder implements Encoder{ +public class ArrayTypeEncoder implements Encoder { private Object[] obj =3D null; private Encoder arrayTypeEncoder; - =20 - public ArrayTypeEncoder(Object[] obj,Encoder arrayTypeEncoder){ - this.obj =3D obj; - this.arrayTypeEncoder =3D arrayTypeEncoder; + + public ArrayTypeEncoder(Object[] obj, Encoder arrayTypeEncoder) { + this.obj =3D obj; + this.arrayTypeEncoder =3D arrayTypeEncoder; } -=20 - public ArrayTypeEncoder(Encoder arrayTypeEncoder){ - this.arrayTypeEncoder =3D arrayTypeEncoder; + + public ArrayTypeEncoder(Encoder arrayTypeEncoder) { + this.arrayTypeEncoder =3D arrayTypeEncoder; } =20 -=20 + public void serialize(ContentHandler cHandler) throws OMException { try { - for(int i =3D 0;i @@ -59,7 +52,6 @@ } =20 =20 - /** * @param startElement - this refers to the element the object should = come under. * Most of the time this will be a OMBodyBlock ele= ment @@ -87,11 +79,11 @@ if (externalContentHandler =3D=3D null) { throw new IllegalStateException("Cannot have no ca= che with an empty content handler"); } - outObject.serialize(externalContentHandler); - }else{ - outObject.serialize(this); + outObject.serialize(externalContentHandler); + } else { + outObject.serialize(this); } - =20 + this.startElement.setComplete(true); } } @@ -180,7 +172,7 @@ } =20 public void startElement(String namespaceURI, String localName, String= qName, Attributes atts) throws SAXException { - log.info("Building OM for Element {"+namespaceURI+'}'+ localName += " for the ObjectPusher"); + log.info("Building OM for Element {" + namespaceURI + '}' + localN= ame + " for the ObjectPusher"); if (localName.length() =3D=3D 0) localName =3D qName; =20 @@ -205,7 +197,7 @@ String attrUri =3D ""; String attrPrefix =3D ""; OMNamespace ns =3D null; - if(atts !=3D null){ + if (atts !=3D null) { for (int i =3D 0; i < atts.getLength(); i++) { =20 attrUri =3D atts.getURI(i); @@ -244,7 +236,7 @@ =20 public void registerExternalContentHandler(Object obj) { if (obj instanceof ContentHandler) - this.externalContentHandler =3D (ContentHandler)obj; + this.externalContentHandler =3D (ContentHandler) obj; else throw new IllegalArgumentException("Attempt to register wrong = type of content handler"); } Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/testUtils/SimpleJavaProvider.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/testUtils/SimpleJavaProvider.java?view= =3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/testUtils/SimpleJavaProvider.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/testUtils/SimpleJavaProvider.java Mon Feb 14 22:22:34 2005 @@ -16,12 +16,6 @@ =20 package org.apache.axis.testUtils; =20 -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamReader; - import org.apache.axis.context.MessageContext; import org.apache.axis.context.SessionContext; import org.apache.axis.description.AxisOperation; @@ -29,15 +23,16 @@ import org.apache.axis.engine.AxisFault; import org.apache.axis.engine.Constants; import org.apache.axis.engine.Provider; -import org.apache.axis.om.OMConstants; -import org.apache.axis.om.OMElement; -import org.apache.axis.om.OMFactory; -import org.apache.axis.om.OMNamespace; -import org.apache.axis.om.SOAPEnvelope; +import org.apache.axis.om.*; import org.apache.axis.providers.AbstractProvider; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; =20 +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamReader; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + /** * This is a Simple java Provider. */ @@ -46,7 +41,7 @@ protected Log log =3D LogFactory.getLog(getClass()); protected String scope; protected Method method; - // protected ClassLoader classLoader; + // protected ClassLoader classLoader; =20 public SimpleJavaProvider() { scope =3D Constants.APPLICATION_SCOPE; @@ -54,7 +49,7 @@ } =20 protected Object makeNewServiceObject(MessageContext msgContext) - throws AxisFault { + throws AxisFault { try { AxisService service =3D msgContext.getService(); Class implClass =3D service.getServiceClass(); @@ -65,7 +60,7 @@ } =20 public Object getTheImplementationObject(MessageContext msgContext) - throws AxisFault { + throws AxisFault { AxisService service =3D msgContext.getService(); QName serviceName =3D service.getName(); if (Constants.APPLICATION_SCOPE.equals(scope)) { @@ -92,20 +87,19 @@ =20 } =20 - public Object[] deserializeParameters( - MessageContext msgContext, - Method method) - throws AxisFault { + public Object[] deserializeParameters(MessageContext msgContext, + Method method) + throws AxisFault { // org.TimeRecorder.BEFORE_DESERALIZE =3D System.currentTimeMill= is(); XMLStreamReader xpp =3D - msgContext.getSoapOperationElement().getPullParser(true); + msgContext.getSoapOperationElement().getPullParser(true); Class[] parms =3D method.getParameterTypes(); Object[] objs =3D new Object[parms.length]; =20 for (int i =3D 0; i < parms.length; i++) { - if (int.class.equals(parms[i])|| Integer.class.equals(parms[i]= )) { + if (int.class.equals(parms[i]) || Integer.class.equals(parms[i= ])) { objs[i] =3D - new Integer(SimpleTypeEncodingUtils.deserializeInt(xpp= )); + new Integer(SimpleTypeEncodingUtils.deserializeInt= (xpp)); } else if (String.class.equals(parms[i])) { objs[i] =3D SimpleTypeEncodingUtils.deserializeString(xpp)= ; } else if (String[].class.equals(parms[i])) { @@ -148,17 +142,15 @@ =20 OMNamespace ns =3D fac.createOMNamespace("http://soapenc/", "r= es"); OMElement responseMethodName =3D - fac.createOMElement(methodName + "Response", ns); + fac.createOMElement(methodName + "Response", ns); responseEnvelope.getBody().addChild(responseMethodName); OMElement returnelement =3D - fac.createOMElement(methodName + "Return", ns); + fac.createOMElement(methodName + "Return", ns); responseMethodName.addChild(returnelement); =20 - returnelement.setBuilder( - new ObjectToOMBuilder(returnelement, outobj)); - returnelement.declareNamespace( - OMConstants.ARRAY_ITEM_NSURI, - OMConstants.ARRAY_ITEM_NS_PREFIX); + returnelement.setBuilder(new ObjectToOMBuilder(returnelement, = outobj)); + returnelement.declareNamespace(OMConstants.ARRAY_ITEM_NSURI, + OMConstants.ARRAY_ITEM_NS_PREFIX); msgContext.setEnvelope(responseEnvelope); =20 return msgContext; Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/testUtils/SimpleTypeEncoder.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/testUtils/SimpleTypeEncoder.java?view= =3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/testUtils/SimpleTypeEncoder.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/testUtils/SimpleTypeEncoder.java Mon Feb 14 22:22:34 2005 @@ -15,74 +15,75 @@ */ package org.apache.axis.testUtils; =20 -import javax.xml.stream.XMLStreamReader; - import org.apache.axis.engine.AxisFault; import org.apache.axis.om.OMConstants; import org.apache.axis.om.OMException; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; =20 +import javax.xml.stream.XMLStreamReader; + =20 -public class SimpleTypeEncoder implements Encoder{ +public class SimpleTypeEncoder implements Encoder { private Object obj =3D null; - public SimpleTypeEncoder(Object obj){ + + public SimpleTypeEncoder(Object obj) { this.obj =3D obj; } =20 =20 public void serialize(ContentHandler cHandler) throws OMException { try { - if(obj =3D=3D null){ + if (obj =3D=3D null) { return; } - char[] str=3Dnull; - if(obj.getClass() =3D=3D String.class){ - str =3D ((String)obj).toCharArray(); - cHandler.characters(str,0,str.length); - }else if(obj.getClass() =3D=3D String[].class){ - String[] strs =3D (String[])obj; + char[] str =3D null; + if (obj.getClass() =3D=3D String.class) { + str =3D ((String) obj).toCharArray(); + cHandler.characters(str, 0, str.length); + } else if (obj.getClass() =3D=3D String[].class) { + String[] strs =3D (String[]) obj; str =3D null; for (int i =3D 0; i < strs.length; i++) { cHandler.startElement(OMConstants.ARRAY_ITEM_NSURI, OMConstants.ARRAY_ITEM_LOCALNAME, - OMConstants.ARRAY_ITEM_QNAME , + OMConstants.ARRAY_ITEM_QNAME, null); str =3D strs[i].toCharArray(); - cHandler.characters(str,0,str.length); - cHandler.endElement(OMConstants.ARRAY_ITEM_NSURI,OMCon= stants.ARRAY_ITEM_LOCALNAME, OMConstants.ARRAY_ITEM_QNAME ); + cHandler.characters(str, 0, str.length); + cHandler.endElement(OMConstants.ARRAY_ITEM_NSURI, OMCo= nstants.ARRAY_ITEM_LOCALNAME, OMConstants.ARRAY_ITEM_QNAME); } - }else if(obj.getClass() =3D=3D Integer.class){ + } else if (obj.getClass() =3D=3D Integer.class) { str =3D obj.toString().toCharArray(); - cHandler.characters(str,0,str.length); - }else if(obj.getClass() =3D=3D int[].class){ - int[] intArray =3D (int[])obj; + cHandler.characters(str, 0, str.length); + } else if (obj.getClass() =3D=3D int[].class) { + int[] intArray =3D (int[]) obj; for (int i =3D 0; i < intArray.length; i++) { cHandler.startElement(OMConstants.ARRAY_ITEM_NSURI, OMConstants.ARRAY_ITEM_LOCALNAME, - OMConstants.ARRAY_ITEM_QNAME , + OMConstants.ARRAY_ITEM_QNAME, null); str =3D String.valueOf(intArray[i]).toCharArray(); - cHandler.characters(str,0,str.length); - cHandler.endElement(OMConstants.ARRAY_ITEM_NSURI,OMCon= stants.ARRAY_ITEM_LOCALNAME, OMConstants.ARRAY_ITEM_QNAME ); + cHandler.characters(str, 0, str.length); + cHandler.endElement(OMConstants.ARRAY_ITEM_NSURI, OMCo= nstants.ARRAY_ITEM_LOCALNAME, OMConstants.ARRAY_ITEM_QNAME); } =20 - }else if(obj.getClass() =3D=3D Double.class){ + } else if (obj.getClass() =3D=3D Double.class) { str =3D obj.toString().toCharArray(); - cHandler.characters(str,0,str.length); - }else if(obj.getClass() =3D=3D double[].class){ - double[] doubleArray =3D (double[])obj; + cHandler.characters(str, 0, str.length); + } else if (obj.getClass() =3D=3D double[].class) { + double[] doubleArray =3D (double[]) obj; for (int i =3D 0; i < doubleArray.length; i++) { cHandler.startElement(OMConstants.ARRAY_ITEM_NSURI, OMConstants.ARRAY_ITEM_LOCALNAME, - OMConstants.ARRAY_ITEM_QNAME , + OMConstants.ARRAY_ITEM_QNAME, null); str =3D String.valueOf(doubleArray[i]).toCharArray(); - cHandler.characters(str,0,str.length); - cHandler.endElement(OMConstants.ARRAY_ITEM_NSURI,OMCon= stants.ARRAY_ITEM_LOCALNAME, OMConstants.ARRAY_ITEM_QNAME ); + cHandler.characters(str, 0, str.length); + cHandler.endElement(OMConstants.ARRAY_ITEM_NSURI, OMCo= nstants.ARRAY_ITEM_LOCALNAME, OMConstants.ARRAY_ITEM_QNAME); } =20 - }else{ + } else { throw new OMException("Unsupported type"); } } catch (SAXException e) { @@ -102,7 +103,7 @@ * @see org.apache.axis.encoding.Encoder#setObject(java.lang.Object) */ public void setObject(Object obj) { - this.obj =3Dobj; + this.obj =3D obj; } =20 } Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/testUtils/SimpleTypeEncodingUtils.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/testUtils/SimpleTypeEncodingUtils.java?= view=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/testUtils/SimpleTypeEncodingUtils.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/testUtils/SimpleTypeEncodingUtils.java Mon Feb 14 22:22:34 2005 @@ -28,7 +28,7 @@ =20 =20 public static String[] deserializeStringArray(XMLStreamReader xpp) - throws AxisFault { + throws AxisFault { ArrayList strings =3D new ArrayList(); =20 try { @@ -55,32 +55,32 @@ } =20 public static String deserializeStringWithWiteSpaces(XMLStreamReader x= pp) - throws AxisFault { - StringBuffer value =3D new StringBuffer(); - try { - int event =3D xpp.getEventType(); - while(XMLStreamConstants.START_ELEMENT !=3D event){ - event =3D xpp.next(); - } - event =3D xpp.next(); - while(XMLStreamConstants.END_ELEMENT !=3D event){ - if(XMLStreamConstants.CHARACTERS =3D=3D event){ - value.append(xpp.getText()); - } - event =3D xpp.next(); - } - } catch (XMLStreamException e) { - throw AxisFault.makeFault(e); - } - if(value.length() =3D=3D 0){ - return null; - }else{ - return value.toString(); =20 + throws AxisFault { + StringBuffer value =3D new StringBuffer(); + try { + int event =3D xpp.getEventType(); + while (XMLStreamConstants.START_ELEMENT !=3D event) { + event =3D xpp.next(); + } + event =3D xpp.next(); + while (XMLStreamConstants.END_ELEMENT !=3D event) { + if (XMLStreamConstants.CHARACTERS =3D=3D event) { + value.append(xpp.getText()); } + event =3D xpp.next(); + } + } catch (XMLStreamException e) { + throw AxisFault.makeFault(e); + } + if (value.length() =3D=3D 0) { + return null; + } else { + return value.toString(); } - =20 + } + public static String deserializeString(XMLStreamReader xpp) - throws AxisFault { + throws AxisFault { String value =3D null; try { int event =3D xpp.getEventType(); @@ -90,7 +90,7 @@ event =3D xpp.next(); while (XMLStreamConstants.END_ELEMENT !=3D event) { if (XMLStreamConstants.CHARACTERS =3D=3D event - && !xpp.isWhiteSpace()) { + && !xpp.isWhiteSpace()) { value =3D xpp.getText(); } event =3D xpp.next(); @@ -109,7 +109,7 @@ return Integer.parseInt(val); } =20 - public static double deserializeDouble(XMLStreamReader xpp) throws Ax= isFault { + public static double deserializeDouble(XMLStreamReader xpp) throws Axi= sFault { String val =3D deserializeString(xpp); if (val =3D=3D null) { throw new AxisFault("Number format exception value is null"); @@ -118,7 +118,7 @@ } =20 public static int[] deserializeIntArray(XMLStreamReader xpp) - throws AxisFault { + throws AxisFault { ArrayList ints =3D new ArrayList(); =20 try { @@ -127,7 +127,7 @@ while (true) { if (XMLStreamConstants.START_ELEMENT =3D=3D event) { String stringValue =3D deserializeString(xpp); - if (stringValue=3D=3Dnull){ + if (stringValue =3D=3D null) { throw new AxisFault("Wrong type of argument"); } ints.add(stringValue); @@ -141,7 +141,7 @@ int intCount =3D ints.size(); int[] intVals =3D new int[intCount]; for (int i =3D 0; i < intCount; i++) { - intVals[i] =3D Integer.parseInt(ints.get(i).toString()); + intVals[i] =3D Integer.parseInt(ints.get(i).toString()); } return intVals; } catch (XMLStreamException e) { @@ -151,47 +151,45 @@ } =20 public static double[] deserializeDoubleArray(XMLStreamReader xpp) - throws AxisFault { - ArrayList doubles =3D new ArrayList(); + throws AxisFault { + ArrayList doubles =3D new ArrayList(); =20 - try { - int event =3D xpp.next(); + try { + int event =3D xpp.next(); =20 - while (true) { - if (XMLStreamConstants.START_ELEMENT =3D=3D event) { - String stringValue =3D deserializeString(xpp); - if (stringValue=3D=3Dnull){ - throw new AxisFault("Wrong type of argument"); - } - doubles.add(stringValue); - } else if (XMLStreamConstants.END_ELEMENT =3D=3D event)= { - break; - } else if (XMLStreamConstants.END_DOCUMENT =3D=3D event= ) { - throw new AxisFault("premature end of file"); - } - event =3D xpp.next(); - } - int doubleCount =3D doubles.size(); - double[] doubleVals =3D new double[doubleCount]; - for (int i =3D 0; i < doubleCount; i++) { - doubleVals[i] =3D Double.parseDouble(doubles.get(i).to= String()); - } - return doubleVals; - } catch (XMLStreamException e) { - throw AxisFault.makeFault(e); - } - - } - - public static void serialize( - XMLStreamWriter out, - QName elementName, - String value) - throws AxisFault { - try { - out.writeStartElement( - elementName.getNamespaceURI(), - elementName.getLocalPart()); + while (true) { + if (XMLStreamConstants.START_ELEMENT =3D=3D event) { + String stringValue =3D deserializeString(xpp); + if (stringValue =3D=3D null) { + throw new AxisFault("Wrong type of argument"); + } + doubles.add(stringValue); + } else if (XMLStreamConstants.END_ELEMENT =3D=3D event) { + break; + } else if (XMLStreamConstants.END_DOCUMENT =3D=3D event) { + throw new AxisFault("premature end of file"); + } + event =3D xpp.next(); + } + int doubleCount =3D doubles.size(); + double[] doubleVals =3D new double[doubleCount]; + for (int i =3D 0; i < doubleCount; i++) { + doubleVals[i] =3D Double.parseDouble(doubles.get(i).toStri= ng()); + } + return doubleVals; + } catch (XMLStreamException e) { + throw AxisFault.makeFault(e); + } + + } + + public static void serialize(XMLStreamWriter out, + QName elementName, + String value) + throws AxisFault { + try { + out.writeStartElement(elementName.getNamespaceURI(), + elementName.getLocalPart()); out.writeCharacters(value); out.writeEndElement(); } catch (XMLStreamException e) { Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/axis/transport/HTTPTrasportHeaderParsingTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/axis/transport/HTTPTrasportHeaderParsingTest= .java?view=3Ddiff&r1=3D153901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/transport/HTTPTrasportHeaderParsingTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= axis/transport/HTTPTrasportHeaderParsingTest.java Mon Feb 14 22:22:34 2005 @@ -16,15 +16,15 @@ =20 package org.apache.axis.transport; =20 -import java.io.BufferedReader; -import java.io.StringReader; -import java.util.Map; - import org.apache.axis.AbstractTestCase; import org.apache.axis.engine.AxisFault; import org.apache.axis.transport.http.HTTPConstants; import org.apache.axis.transport.http.HTTPTransportReciver; =20 +import java.io.BufferedReader; +import java.io.StringReader; +import java.util.Map; + public class HTTPTrasportHeaderParsingTest extends AbstractTestCase { =20 public HTTPTrasportHeaderParsingTest(String testName) { @@ -33,7 +33,7 @@ =20 public void testServerHaeders() throws Exception { String message =3D - "POST /axis2/services/echo HTTP/1.0\n" + "POST /axis2/services/echo HTTP/1.0\n" + "Content-Type: text/xml; charset=3Dutf-8\n" + "Accept: application/soap+xml, application/dime, multipa= rt/related, text/*\n" + "User-Agent: Axis/1.2RC1\n" @@ -44,26 +44,24 @@ + "Content-Length: 73507\n\nee rwewebtewbeww"; StringReader reader =3D new StringReader(message); HTTPTransportReciver reciver =3D new HTTPTransportReciver(); - =20 + Map map =3D reciver.parseTheHeaders(reader, true); assertEquals(map.get(HTTPConstants.PROTOCOL_VERSION), "HTTP/1.0"); - assertEquals( - map.get(HTTPConstants.REQUEST_URI), - "/axis2/services/echo"); - assertEquals( - map.get("Accept"), - "application/soap+xml, application/dime, multipart/related, te= xt/*"); + assertEquals(map.get(HTTPConstants.REQUEST_URI), + "/axis2/services/echo"); + assertEquals(map.get("Accept"), + "application/soap+xml, application/dime, multipart/related= , text/*"); assertEquals(map.get("User-Agent"), "Axis/1.2RC1"); assertEquals(map.get("Host"), "127.0.0.1:8081"); assertEquals(map.get("Cache-Control"), "no-cache"); assertEquals(map.get("Pragma"), "no-cache"); assertEquals(map.get("Content-Length"), "73507"); - assertEquals(reader.read(),'e'); + assertEquals(reader.read(), 'e'); } =20 public void testClientHeaders() throws Exception { String message =3D - "HTTP/1.1 200 OK\n" + "HTTP/1.1 200 OK\n" + "Content-Type: text/xml;charset=3Dutf-8\n" + "Date: Sat, 12 Feb 2005 10:39:39 GMT\n" + "Server: Apache-Coyote/1.1\n" @@ -79,13 +77,13 @@ assertEquals(map.get("Date"), "Sat, 12 Feb 2005 10:39:39 GMT"); assertEquals(map.get("Server"), "Apache-Coyote/1.1"); assertEquals(map.get("Connection"), "close"); - assertEquals(reader.read(),'A'); + assertEquals(reader.read(), 'A'); } =20 public void testWrongClientHeaders() throws AxisFault { try { String message =3D - "HTTP/1.1 200 OK\n" + "HTTP/1.1 200 OK\n" + "Content-Type: text/xml;charset=3Dutf-8\n" + "Date: Sat, 12 Feb 2005 10:39:39 GMT\n" + "Server: Apache-Coyote/1.1\n" Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/wsdl/InterfaceTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/test/org/apache/wsdl/InterfaceTest.java?view=3Ddiff&r1=3D153= 901&r2=3D153902 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= wsdl/InterfaceTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/= wsdl/InterfaceTest.java Mon Feb 14 22:22:34 2005 @@ -27,76 +27,75 @@ super(testName); } =20 - public void testGetAllOperations(){ - WSDLOperation op ; + public void testGetAllOperations() { + WSDLOperation op; WSDLInterface intfc; WSDLInterface[] array =3D new WSDLInterface[5]; int interfaceCounter =3D 5; int operationCounter =3D 5; - =20 - for(int j=3D0; j0){ - intfc.addSuperInterface(array[j-1]); - } - array[j] =3D intfc; + intfc.setName(new QName(WSDLConstants.WSDL2_0_NAMESPACE, "inte= face" + j)); + for (int i =3D 0; i < operationCounter; i++) { + op =3D new WSDLOperationImpl(); + op.setName(new QName(WSDLConstants.WSDL1_1_NAMESPACE, "op"= + i + "of inteface" + j)); + assertNotNull(op.getName()); + intfc.setOperation(op); + } + if (j > 0) { + intfc.addSuperInterface(array[j - 1]); + } + array[j] =3D intfc; } //System.out.println(array[0].getAllOperations().size()); - assertEquals(((WSDLOperation)array[0].getAllOperations().get(new Q= Name(WSDLConstants.WSDL1_1_NAMESPACE, "op0of inteface0"))).getName().getLoc= alPart(),"op0of inteface0" ); - assertEquals(((WSDLOperation)array[0].getAllOperations().get(new Q= Name(WSDLConstants.WSDL1_1_NAMESPACE, "op1of inteface0"))).getName().getLoc= alPart(),"op1of inteface0" ); - assertEquals(array[interfaceCounter-1].getAllOperations().size(), = interfaceCounter*operationCounter ); - assertEquals(interfaceCounter*operationCounter,array[interfaceCoun= ter-1].getAllOperations().size()); - =20 + assertEquals(((WSDLOperation) array[0].getAllOperations().get(new = QName(WSDLConstants.WSDL1_1_NAMESPACE, "op0of inteface0"))).getName().getLo= calPart(), "op0of inteface0"); + assertEquals(((WSDLOperation) array[0].getAllOperations().get(new = QName(WSDLConstants.WSDL1_1_NAMESPACE, "op1of inteface0"))).getName().getLo= calPart(), "op1of inteface0"); + assertEquals(array[interfaceCounter - 1].getAllOperations().size()= , interfaceCounter * operationCounter); + assertEquals(interfaceCounter * operationCounter, array[interfaceC= ounter - 1].getAllOperations().size()); + Iterator iter =3D array[1].getAllOperations().keySet().iterator(); - while(iter.hasNext()){ - assertNotNull(((WSDLOperation)array[interfaceCounter-1].getAllO= perations().get(iter.next())).getName()); + while (iter.hasNext()) { + assertNotNull(((WSDLOperation) array[interfaceCounter - 1].get= AllOperations().get(iter.next())).getName()); } - =20 - for(int j=3D0; j