You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2004/06/14 17:47:22 UTC
cvs commit: ws-axis/java/test/saaj TestEnvelope.java
dims 2004/06/14 08:47:22
Modified: java/src/org/apache/axis/utils ByteArray.java
java/src/org/apache/axis SOAPPart.java
java/test/saaj TestEnvelope.java
Log:
Up the DEFAULT_RESIDENT_SIZE and remove explicit cleanup (causes problems if you call get string and then get envelope)
Revision Changes Path
1.3 +1 -3 ws-axis/java/src/org/apache/axis/utils/ByteArray.java
Index: ByteArray.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/ByteArray.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ByteArray.java 3 Jun 2004 15:26:41 -0000 1.2
+++ ByteArray.java 14 Jun 2004 15:47:21 -0000 1.3
@@ -35,7 +35,7 @@
public class ByteArray extends OutputStream {
protected static double DEFAULT_CACHE_INCREMENT = 2.5;
- protected static int DEFAULT_RESIDENT_SIZE = 1 * 1024 * 1024; // 1 MB
+ protected static int DEFAULT_RESIDENT_SIZE = 512 * 1024 * 1024; // 512 MB
protected static boolean DEFAULT_ENABLE_BACKING_STORE = true;
protected static int WORKING_BUFFER_SIZE = 8192;
@@ -319,8 +319,6 @@
if (cache != null) {
byte[] v = cache;
int fp = cache_fp;
- cache = null;
- cache_fp = 0;
return new ByteArrayInputStream(v, 0, fp);
} else if (bs_handle != null) {
return createBackingStoreInputStream();
1.69 +0 -1 ws-axis/java/src/org/apache/axis/SOAPPart.java
Index: SOAPPart.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/SOAPPart.java,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- SOAPPart.java 11 May 2004 01:25:14 -0000 1.68
+++ SOAPPart.java 14 Jun 2004 15:47:21 -0000 1.69
@@ -261,7 +261,6 @@
"\"?>").getBytes());
}
((ByteArray) currentMessage).writeTo(os);
- ((ByteArray) currentMessage).discardBuffer();
} else {
Writer writer = new OutputStreamWriter(os,charEncoding);
writer = new BufferedWriter(new PrintWriter(writer));
1.7 +14 -0 ws-axis/java/test/saaj/TestEnvelope.java
Index: TestEnvelope.java
===================================================================
RCS file: /home/cvs/ws-axis/java/test/saaj/TestEnvelope.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TestEnvelope.java 7 Feb 2003 21:45:36 -0000 1.6
+++ TestEnvelope.java 14 Jun 2004 15:47:22 -0000 1.7
@@ -18,6 +18,7 @@
import javax.xml.soap.Detail;
import javax.xml.soap.DetailEntry;
import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.util.Iterator;
public class TestEnvelope extends junit.framework.TestCase {
@@ -55,6 +56,19 @@
assertTrue(se != null);
}
+ // Test JAXM methods...
+ public void testEnvelope2() throws Exception {
+ MessageFactory mf = MessageFactory.newInstance();
+ SOAPMessage smsg =
+ mf.createMessage(new MimeHeaders(), new ByteArrayInputStream(xmlString.getBytes()));
+ SOAPPart sp = smsg.getSOAPPart();
+ SOAPEnvelope se = (SOAPEnvelope)sp.getEnvelope();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ smsg.writeTo(baos);
+ SOAPBody body = smsg.getSOAPPart().getEnvelope().getBody();
+ assertTrue(body != null);
+ }
+
private SOAPEnvelope getSOAPEnvelope() throws Exception {
SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
SOAPConnection con = scFactory.createConnection();