james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r906954 - in /james/mime4j/trunk/core: ./ src/test/java/org/apache/james/mime4j/codec/ src/test/java/org/apache/james/mime4j/parser/
Date Fri, 05 Feb 2010 14:45:15 GMT
Author: olegk
Date: Fri Feb  5 14:45:15 2010
New Revision: 906954

URL: http://svn.apache.org/viewvc?rev=906954&view=rev
Log:
Removed dependency on Commons-logging and Log4j in Core

Modified:
    james/mime4j/trunk/core/pom.xml
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/DecoderUtilTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableInputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserExampleMessagesTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java

Modified: james/mime4j/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/pom.xml?rev=906954&r1=906953&r2=906954&view=diff
==============================================================================
--- james/mime4j/trunk/core/pom.xml (original)
+++ james/mime4j/trunk/core/pom.xml Fri Feb  5 14:45:15 2010
@@ -50,15 +50,6 @@
   
   <dependencies>
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <type>jar</type>

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java?rev=906954&r1=906953&r2=906954&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java
Fri Feb  5 14:45:15 2010
@@ -27,18 +27,11 @@
 import java.util.Random;
 
 import org.apache.commons.io.output.NullOutputStream;
-import org.apache.log4j.BasicConfigurator;
 
 import junit.framework.TestCase;
 
 public class Base64InputStreamTest extends TestCase {
 
-    @Override
-    public void setUp() {
-        BasicConfigurator.resetConfiguration();
-        BasicConfigurator.configure();
-    }
-    
     public void testDecode() throws IOException {
         ByteArrayInputStream bis = null;
         Base64InputStream decoder = null;

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/DecoderUtilTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/DecoderUtilTest.java?rev=906954&r1=906953&r2=906954&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/DecoderUtilTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/DecoderUtilTest.java
Fri Feb  5 14:45:15 2010
@@ -23,16 +23,8 @@
 
 import junit.framework.TestCase;
 
-import org.apache.log4j.BasicConfigurator;
-
 public class DecoderUtilTest extends TestCase {
 
-    @Override
-    public void setUp() {
-        BasicConfigurator.resetConfiguration();
-        BasicConfigurator.configure();
-    }
-
     public void testDecodeB() throws UnsupportedEncodingException {
         String s = DecoderUtil.decodeB("VGhpcyBpcyB0aGUgcGxhaW4gd"
                     + "GV4dCBtZXNzYWdlIQ==", "ISO8859-1", DecodeMonitor.STRICT);

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableInputStreamTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableInputStreamTest.java?rev=906954&r1=906953&r2=906954&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableInputStreamTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableInputStreamTest.java
Fri Feb  5 14:45:15 2010
@@ -27,16 +27,8 @@
 
 import junit.framework.TestCase;
 
-import org.apache.log4j.BasicConfigurator;
-
 public class QuotedPrintableInputStreamTest extends TestCase {
 
-    @Override
-    public void setUp() {
-        BasicConfigurator.resetConfiguration();
-        BasicConfigurator.configure();
-    }
-    
     public void testBasicDecode() throws IOException, UnsupportedEncodingException {
         ByteArrayInputStream bis = new ByteArrayInputStream("=e1=e2=E3=E4\r\n".getBytes("US-ASCII"));
         QuotedPrintableInputStream decoder = new QuotedPrintableInputStream(bis);
@@ -48,7 +40,7 @@
                 "=e1=e2=E3=E4\r\n=e1=e2=E3=E4\r\n=e1=e2=E3=E4\r\n=e1=e2=E3=E4\r\n=e1=e2=E3=E4\r\n".getBytes("US-ASCII"));
         QuotedPrintableInputStream decoder = new QuotedPrintableInputStream(bis);
         assertEquals("\u00e1\u00e2\u00e3\u00e4\r\n\u00e1\u00e2\u00e3\u00e4\r\n\u00e1\u00e2\u00e3"
+
-        		"\u00e4\r\n\u00e1\u00e2\u00e3\u00e4\r\n\u00e1\u00e2\u00e3\u00e4\r\n", new String(read(decoder),
"ISO8859-1"));
+                "\u00e4\r\n\u00e1\u00e2\u00e3\u00e4\r\n\u00e1\u00e2\u00e3\u00e4\r\n", new
String(read(decoder), "ISO8859-1"));
     }
 
     public void testInvalidValueDecode() throws IOException, UnsupportedEncodingException
{

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserExampleMessagesTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserExampleMessagesTest.java?rev=906954&r1=906953&r2=906954&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserExampleMessagesTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserExampleMessagesTest.java
Fri Feb  5 14:45:15 2010
@@ -34,7 +34,6 @@
 import org.apache.commons.io.IOUtils;
 import org.apache.james.mime4j.parser.MimeStreamParser;
 import org.apache.james.mime4j.stream.MimeEntityConfig;
-import org.apache.log4j.BasicConfigurator;
 
 /**
  * Creates a TestSuite running the test for each .msg file in the test resouce folder.
@@ -55,12 +54,6 @@
     }
 
     @Override
-    public void setUp() {
-        BasicConfigurator.resetConfiguration();
-        BasicConfigurator.configure();
-    }
-   
-    @Override
     protected void runTest() throws Throwable {
         MimeStreamParser parser = null;
         TestHandler handler = null;

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java?rev=906954&r1=906953&r2=906954&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
Fri Feb  5 14:45:15 2010
@@ -32,59 +32,9 @@
 import org.apache.james.mime4j.stream.RawField;
 import org.apache.james.mime4j.util.ByteSequence;
 import org.apache.james.mime4j.util.ContentUtil;
-import org.apache.log4j.BasicConfigurator;
 
 public class MimeStreamParserTest extends TestCase {
 
-    @Override
-    public void setUp() {
-        BasicConfigurator.resetConfiguration();
-        BasicConfigurator.configure();
-    }
-        /*
-    public void testRootAndBodyStreamsAreSynched() throws IOException {
-        File dir = new File("testmsgs");
-        File[] files = dir.listFiles();
-        
-        for (int i = 0; i < files.length; i++) {
-            File f = files[i];
-            
-            if (f.getName().toLowerCase().endsWith(".msg")) {
-                final RandomAccessFile file = new RandomAccessFile(f, "r");
-                final EOLTrackingInputStream rootStream = 
-                    new EOLTrackingInputStream(
-                       new RandomAccessFileInputStream(file, 0, file.length()));
-                
-                ContentHandler handler = new AbstractContentHandler() {
-                    public void body(BodyDescriptor bd, InputStream expected) throws IOException
{
-                       int pos = rootStream.getMark();
-                       if (expected instanceof RootInputStream) {
-                           pos++;
-                       }
-                       InputStream actual = 
-                           new EOLConvertingInputStream(
-                                 new RandomAccessFileInputStream(file, pos, file.length()));
-                       
-                       StringBuilder sb1 = new StringBuilder();
-                       StringBuilder sb2 = new StringBuilder();
-                       int b = 0;
-                       while ((b = expected.read()) != -1) {
-                           sb1.append((char) (b & 0xff));
-                           sb2.append((char) (actual.read() & 0xff));
-                       }
-                       assertEquals(sb1.toString(), sb2.toString());
-                    }
-                };
-                
-                System.out.println("Testing synch of " + f.getName());
-                
-                MimeStreamParser parser = new MimeStreamParser();
-                parser.setContentHandler(handler);
-                parser.parse(rootStream);
-            }
-        }
-    }*/
-    
     public void testBoundaryInEpilogue() throws Exception {
         StringBuilder sb = new StringBuilder();
         sb.append("From: foo@bar.com\r\n");



Mime
View raw message