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/04/06 16:35:18 UTC
cvs commit: ws-axis/java/test/saaj TestAttachment.java
dims 2004/04/06 07:35:18
Modified: java/test/saaj TestAttachment.java
Log:
Remove unintentional check-in.
Revision Changes Path
1.8 +32 -22 ws-axis/java/test/saaj/TestAttachment.java
Index: TestAttachment.java
===================================================================
RCS file: /home/cvs/ws-axis/java/test/saaj/TestAttachment.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TestAttachment.java 22 Dec 2002 15:40:26 -0000 1.7
+++ TestAttachment.java 6 Apr 2004 14:35:18 -0000 1.8
@@ -5,12 +5,21 @@
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.MimeHeaders;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.util.Iterator;
+import java.net.URL;
public class TestAttachment extends junit.framework.TestCase {
@@ -87,34 +96,35 @@
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
- class Src implements DataSource{
- InputStream m_src;
- String m_type;
-
- public Src(InputStream data, String type){
- m_src=data;
- m_type=type;
- }
- public String getContentType(){
- return m_type;
- }
- public InputStream getInputStream() throws IOException{
- m_src.reset();
- return m_src;
- }
- public String getName(){
- return "Some-Data";
- }
- public OutputStream getOutputStream(){
- throw new UnsupportedOperationException("I don't give output streams");
- }
- }
ByteArrayInputStream ins=new ByteArrayInputStream(new byte[5]);
DataHandler dh=new DataHandler(new Src(ins,"text/plain"));
AttachmentPart part = message.createAttachmentPart(dh);
assertEquals("Size should match",5,part.getSize());
}
+ class Src implements DataSource{
+ InputStream m_src;
+ String m_type;
+
+ public Src(InputStream data, String type){
+ m_src=data;
+ m_type=type;
+ }
+ public String getContentType(){
+ return m_type;
+ }
+ public InputStream getInputStream() throws IOException{
+ m_src.reset();
+ return m_src;
+ }
+ public String getName(){
+ return "Some-Data";
+ }
+ public OutputStream getOutputStream(){
+ throw new UnsupportedOperationException("I don't give output streams");
+ }
+ }
+
public static void main(String[] args) throws Exception {
test.saaj.TestAttachment tester = new test.saaj.TestAttachment("TestSAAJ");
tester.testMultipleAttachments();