Author: deepal Date: Fri May 18 04:50:27 2007 New Revision: 539399 URL: http://svn.apache.org/viewvc?view=rev&rev=539399 Log: applied the patch in 2653 - Thx Sanjaya for the patch
(There were author tags pls remove them next time) Modified: webservices/axis2/trunk/java/modules/fastinfoset/pom.xml webservices/axis2/trunk/java/modules/fastinfoset/project.xml webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetBuilder.java webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetMessageFormatter.java webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetInputOutputTest.java webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetTest.java webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddService.java webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddServiceClient.java Modified: webservices/axis2/trunk/java/modules/fastinfoset/pom.xml URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/fastinfoset/pom.xml?view=diff&rev=539399&r1=539398&r2=539399 ============================================================================== --- webservices/axis2/trunk/java/modules/fastinfoset/pom.xml (original) +++ webservices/axis2/trunk/java/modules/fastinfoset/pom.xml Fri May 18 04:50:27 2007 @@ -112,20 +112,17 @@ <directory>test-resources</directory> </testResource> </testResources> - <plugins> - <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <inherited>true</inherited> - <configuration> - <skip>false</skip> - <excludes> - <exclude>**/FastInfosetInputOutputTest.java</exclude> - </excludes> - <includes> - <include>**/*Test.java</include> - </includes> - </configuration> - </plugin> - </plugins> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <inherited>true</inherited> + <configuration> + <skip>false</skip> + <includes> + <include>**/*Test.java</include> + </includes> + </configuration> + </plugin> + </plugins> </build> </project> Modified: webservices/axis2/trunk/java/modules/fastinfoset/project.xml URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/fastinfoset/project.xml?view=diff&rev=539399&r1=539398&r2=539399 ============================================================================== --- webservices/axis2/trunk/java/modules/fastinfoset/project.xml (original) +++ webservices/axis2/trunk/java/modules/fastinfoset/project.xml Fri May 18 04:50:27 2007 @@ -36,14 +36,14 @@ </properties> <url>https://maven-repository.dev.java.net/nonav/repository/</url> </dependency> - <dependency> - <groupId>xmlunit</groupId> - <artifactId>xmlunit</artifactId> - <version>${xmlunit.version}</version> - <properties> - <module>true</module> - </properties> - </dependency> + <dependency> + <groupId>xmlunit</groupId> + <artifactId>xmlunit</artifactId> + <version>${xmlunit.version}</version> + <properties> + <module>true</module> + </properties> + </dependency> <dependency> <groupId>com.sun.xml.fastinfoset</groupId> <artifactId>FastInfoset</artifactId> @@ -191,33 +191,29 @@ </includes> </resource> </resources> - <unitTestSourceDirectory>test</unitTestSourceDirectory> - <unitTest> - <includes> - <include>**/*Test.java</include> - </includes> - <excludes> - <exclude>**/FastInfosetInputOutputTest.java</exclude> - </excludes> - - <resources> - <resource> - <directory>${basedir}/test-resources</directory> - </resource> - <resource> - <directory>conf</directory> - <includes> - <include>**/*.properties</include> - </includes> - </resource> - <resource> - <directory>src</directory> - <includes> - <include>**/*.properties</include> - <include>**/*.xml</include> - </includes> - </resource> - </resources> - </unitTest> + <unitTestSourceDirectory>test</unitTestSourceDirectory> + <unitTest> + <includes> + <include>**/*Test.java</include> + </includes> + <resources> + <resource> + <directory>${basedir}/test-resources</directory> + </resource> + <resource> + <directory>conf</directory> + <includes> + <include>**/*.properties</include> + </includes> + </resource> + <resource> + <directory>src</directory> + <includes> + <include>**/*.properties</include> + <include>**/*.xml</include> + </includes> + </resource> + </resources> + </unitTest> </build> </project> Modified: webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetBuilder.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetBuilder.java?view=diff&rev=539399&r1=539398&r2=539399 ============================================================================== --- webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetBuilder.java (original) +++ webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetBuilder.java Fri May 18 04:50:27 2007 @@ -32,8 +32,8 @@ import com.sun.xml.fastinfoset.stax.StAXDocumentParser; /** - * - * + * @author Sanjaya Karunasena ([EMAIL PROTECTED]) + * @date Feb 06, 2007 */ public class FastInfosetBuilder implements Builder { Modified: webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetMessageFormatter.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetMessageFormatter.java?view=diff&rev=539399&r1=539398&r2=539399 ============================================================================== --- webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetMessageFormatter.java (original) +++ webservices/axis2/trunk/java/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetMessageFormatter.java Fri May 18 04:50:27 2007 @@ -36,6 +36,10 @@ import com.sun.xml.fastinfoset.stax.StAXDocumentSerializer; +/** + * @author Sanjaya Karunasena ([EMAIL PROTECTED]) + * @date Feb 06, 2007 + */ public class FastInfosetMessageFormatter implements MessageFormatter { private Log logger = LogFactory.getLog(FastInfosetMessageFormatter.class); Modified: webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetInputOutputTest.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetInputOutputTest.java?view=diff&rev=539399&r1=539398&r2=539399 ============================================================================== --- webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetInputOutputTest.java (original) +++ webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetInputOutputTest.java Fri May 18 04:50:27 2007 @@ -16,26 +16,22 @@ package org.apache.axis2.fastinfoset; -import com.sun.xml.fastinfoset.stax.StAXDocumentParser; -import com.sun.xml.fastinfoset.stax.StAXDocumentSerializer; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXBuilder; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder; -import org.custommonkey.xmlunit.XMLTestCase; -import org.xml.sax.SAXException; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; -import java.io.IOException; + +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.XMLStreamWriter; + +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.impl.builder.StAXBuilder; +import org.apache.axiom.om.impl.builder.StAXOMBuilder; +import org.custommonkey.xmlunit.XMLTestCase; + +import com.sun.xml.fastinfoset.stax.StAXDocumentParser; +import com.sun.xml.fastinfoset.stax.StAXDocumentSerializer; /** * @author : Eran Chinthaka ([EMAIL PROTECTED]) @@ -53,45 +49,32 @@ * <p/> * Then the initial XML file and the last XML will be compared to see whether they are the same. */ -// public void testInputOutput() { -// String inputFile = "maven.xml"; -// File outputFile = new File("output.xml"); -// File tempFile = new File("test.bin"); -// -// try { -// // first let's read the xml document in to Axiom -// OMElement element = new StAXOMBuilder(inputFile).getDocumentElement(); -// -// // output it using binary xml outputter -// XMLStreamWriter streamWriter = new StAXDocumentSerializer(new FileOutputStream(tempFile)); -// element.serializeAndConsume(streamWriter); -// -// // now let's read the binary file in to Axiom -// XMLStreamReader streamReader = new StAXDocumentParser(new FileInputStream(tempFile)); -// StAXBuilder builder = new StAXSOAPModelBuilder(streamReader); -// builder.getDocumentElement().serialize(new FileWriter(outputFile)); -// -// // let's see this is the same that we fed in to this test initially -// assertXMLEqual(new FileReader(inputFile), new FileReader(outputFile)); -// -// } catch (XMLStreamException e) { -// e.printStackTrace(); -// fail(); -// } catch (FileNotFoundException e) { -// e.printStackTrace(); -// fail(); -// } catch (IOException e) { -// e.printStackTrace(); -// fail(); -// } catch (ParserConfigurationException e) { -// e.printStackTrace(); -// fail(); -// } catch (SAXException e) { -// e.printStackTrace(); -// fail(); -// } finally { -// if (outputFile.exists()) outputFile.delete(); -// if (tempFile.exists()) tempFile.delete(); -// } -// } + public void testInputOutput() throws Exception { + String inputFile = "maven.xml"; + File outputFile = new File("output.xml"); + File tempFile = new File("test.bin"); + + try { + // first let's read the xml document in to Axiom + OMElement element = new StAXOMBuilder(inputFile).getDocumentElement(); + + // output it using binary xml outputter + XMLStreamWriter streamWriter = new StAXDocumentSerializer(new FileOutputStream(tempFile)); + streamWriter.writeStartDocument(); + element.serializeAndConsume(streamWriter); + streamWriter.writeEndDocument(); + + // now let's read the binary file in to Axiom + XMLStreamReader streamReader = new StAXDocumentParser(new FileInputStream(tempFile)); + StAXBuilder builder = new StAXOMBuilder(streamReader); + builder.getDocumentElement().serialize(new FileWriter(outputFile)); + + // let's see this is the same that we fed in to this test initially + assertXMLEqual(new FileReader(inputFile), new FileReader(outputFile)); + + } finally { + if (outputFile.exists()) outputFile.delete(); + if (tempFile.exists()) tempFile.delete(); + } + } } Modified: webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetTest.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetTest.java?view=diff&rev=539399&r1=539398&r2=539399 ============================================================================== --- webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetTest.java (original) +++ webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/FastInfosetTest.java Fri May 18 04:50:27 2007 @@ -1,3 +1,19 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + package org.apache.axis2.fastinfoset; import java.io.File; @@ -15,6 +31,10 @@ import org.apache.axis2.rpc.receivers.RPCMessageReceiver; import org.apache.axis2.transport.http.SimpleHTTPServer; +/** + * @author Sanjaya Karunasena ([EMAIL PROTECTED]) + * @date Feb 16, 2007 + */ public class FastInfosetTest extends TestCase { private SimpleHTTPServer server; Modified: webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddService.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddService.java?view=diff&rev=539399&r1=539398&r2=539399 ============================================================================== --- webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddService.java (original) +++ webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddService.java Fri May 18 04:50:27 2007 @@ -1,5 +1,25 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + package org.apache.axis2.fastinfoset; +/** + * @author Sanjaya Karunasena ([EMAIL PROTECTED]) + * @date Feb 16, 2007 + */ public class SimpleAddService { public int addInts(int val1, int val2) { Modified: webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddServiceClient.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddServiceClient.java?view=diff&rev=539399&r1=539398&r2=539399 ============================================================================== --- webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddServiceClient.java (original) +++ webservices/axis2/trunk/java/modules/fastinfoset/test/org/apache/axis2/fastinfoset/SimpleAddServiceClient.java Fri May 18 04:50:27 2007 @@ -33,6 +33,10 @@ import org.apache.axis2.fastinfoset.xsd.SimpleAddServiceStub.AddStrings; import org.apache.axis2.fastinfoset.xsd.SimpleAddServiceStub.AddStringsResponse; +/** + * @author Sanjaya Karunasena ([EMAIL PROTECTED]) + * @date Feb 16, 2007 + */ public class SimpleAddServiceClient { private SimpleAddServiceStub serviceStub; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]