You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ba...@apache.org on 2008/09/27 16:42:07 UTC

svn commit: r699656 - /james/mailet/standard/trunk/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java

Author: bago
Date: Sat Sep 27 07:42:07 2008
New Revision: 699656

URL: http://svn.apache.org/viewvc?rev=699656&view=rev
Log:
Remove windows specific paths from tests.

Modified:
    james/mailet/standard/trunk/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java

Modified: james/mailet/standard/trunk/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
URL: http://svn.apache.org/viewvc/james/mailet/standard/trunk/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java?rev=699656&r1=699655&r2=699656&view=diff
==============================================================================
--- james/mailet/standard/trunk/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java (original)
+++ james/mailet/standard/trunk/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java Sat Sep 27 07:42:07 2008
@@ -94,7 +94,7 @@
 
         String name = (String) c.iterator().next();
 
-        File f = new File("c:/" + name);
+        File f = new File("./"+name);
         InputStream is = new FileInputStream(f);
         String savedFile = toString(is);
         is.close();
@@ -109,6 +109,7 @@
         final byte[] buffer = new byte[1024];
         int n = 0;
         while (-1 != (n = is.read(buffer))) {
+            System.err.println(new String(buffer,0,n));
             sw.write(buffer, 0, n);
         }
         return sw.toString();
@@ -119,7 +120,7 @@
 
         MockMailetConfig mci = new MockMailetConfig("Test",
                 new MockMailContext());
-        mci.setProperty("directory", "c:/");
+        mci.setProperty("directory", "./");
         mci.setProperty("remove", "all");
         mci.setProperty("notpattern", "^(winmail\\.dat$)");
         mailet.init(mci);
@@ -155,9 +156,7 @@
         ByteArrayOutputStream rawMessage = new ByteArrayOutputStream();
         mail.getMessage().writeTo(rawMessage,
                 new String[] { "Bcc", "Content-Length", "Message-ID" });
-        String res = rawMessage.toString();
-
-        System.out.println(res);
+        // String res = rawMessage.toString();
 
         Collection c = (Collection) mail
                 .getAttribute(StripAttachment.SAVED_ATTACHMENTS_ATTRIBUTE_KEY);
@@ -167,7 +166,7 @@
 
         String name = (String) c.iterator().next();
 
-        File f = new File("c:/" + name);
+        File f = new File("./"+name);
         InputStream is = new FileInputStream(f);
         String savedFile = toString(is);
         is.close();
@@ -217,9 +216,7 @@
         ByteArrayOutputStream rawMessage = new ByteArrayOutputStream();
         mail.getMessage().writeTo(rawMessage,
                 new String[] { "Bcc", "Content-Length", "Message-ID" });
-        String res = rawMessage.toString();
-
-        System.out.println(res);
+        // String res = rawMessage.toString();
 
         Collection c = (Collection) mail
                 .getAttribute(StripAttachment.SAVED_ATTACHMENTS_ATTRIBUTE_KEY);
@@ -233,7 +230,7 @@
 
         assertTrue(name.startsWith("e_Pubblicita_e_vietata_Milano9052"));
 
-        File f = new File("c:/" + name);
+        File f = new File("./"+name);
         InputStream is = new FileInputStream(f);
         String savedFile = toString(is);
         is.close();
@@ -328,7 +325,7 @@
 
         MockMailetConfig mci = new MockMailetConfig("Test",
                 new MockMailContext());
-        mci.setProperty("directory", "c:/");
+        mci.setProperty("directory", "./");
         mci.setProperty("remove", "all");
         mci.setProperty("pattern", ".*\\.tmp");
         mci.setProperty("decodeFilename", "true");



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org