Author: ningjiang
Date: Wed Dec 6 00:45:15 2006
New Revision: 482969
URL: http://svn.apache.org/viewvc?view=rev&rev=482969
Log:
[JIRA CXF-236] Added the apache licenses header in the file headerSoapReq.xml
also changed some codes of the StaxUtilsTest.java
Modified:
incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/resources/headerSoapReq.xml
Modified:
incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java?view=diff&rev=482969&r1=482968&r2=482969
==============================================================================
---
incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
(original)
+++
incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
Wed Dec 6 00:45:15 2006
@@ -62,17 +62,22 @@
baos.flush();
// write output to a string
- String output = baos.toString();
+ String output = baos.toString();
// re-read the input xml doc to a string
InputStreamReader inputStreamReader = new
InputStreamReader(getTestStream(soapMessage));
StringWriter stringWriter = new StringWriter();
char[] buffer = new char[4096];
int n = 0;
- while (-1 != (n = inputStreamReader.read(buffer))) {
+ n = inputStreamReader.read(buffer);
+ while (n > 0) {
stringWriter.write(buffer, 0 , n);
+ n = inputStreamReader.read(buffer);
}
String input = stringWriter.toString();
+ // seach for the first begin of "<soap:Envelope" to escape the apache
licenses header
+ int beginIndex = input.indexOf("<soap:Envelope");
+ input = input.substring(beginIndex);
// compare the input and output string
assertEquals(input, output);
Modified:
incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/resources/headerSoapReq.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/resources/headerSoapReq.xml?view=diff&rev=482969&r1=482968&r2=482969
==============================================================================
---
incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/resources/headerSoapReq.xml
(original)
+++
incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/resources/headerSoapReq.xml
Wed Dec 6 00:45:15 2006
@@ -1,3 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ns3:SOAPHeaderInfo xmlns:ns3="http://apache.org/headers/types"
xmlns:ns2="http://www.w3.org/2005/08/addressing/wsdl">