james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r906951 - in /james/mime4j/trunk: ./ benchmark/ core/ core/src/main/java/org/apache/james/mime4j/dom/ core/src/main/java/org/apache/james/mime4j/field/ core/src/main/java/org/apache/james/mime4j/message/ core/src/main/java/org/apache/james/...
Date Fri, 05 Feb 2010 14:38:42 GMT
Author: olegk
Date: Fri Feb  5 14:38:41 2010
New Revision: 906951

URL: http://svn.apache.org/viewvc?rev=906951&view=rev
Log:
MIME4J-129: Moved 'field', 'dom', 'message', and 'storage' classes to a separate module; two
test cases (MessageParserTest and ExampleMessagesRoundtripTest) dependent on file resources
in the '/testmsgs' package are currently broken

Added:
    james/mime4j/trunk/dom/
    james/mime4j/trunk/dom/pom.xml
      - copied, changed from r906891, james/mime4j/trunk/core/pom.xml
    james/mime4j/trunk/dom/src/
    james/mime4j/trunk/dom/src/main/
    james/mime4j/trunk/dom/src/main/appended-resources/
      - copied from r906891, james/mime4j/trunk/core/src/main/appended-resources/
    james/mime4j/trunk/dom/src/main/java/
    james/mime4j/trunk/dom/src/main/java/org/
    james/mime4j/trunk/dom/src/main/java/org/apache/
    james/mime4j/trunk/dom/src/main/java/org/apache/james/
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/
      - copied from r906891, james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/dom/
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/
      - copied from r906891, james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/
      - copied from r906891, james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/storage/
      - copied from r906891, james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/
    james/mime4j/trunk/dom/src/main/javacc/
      - copied from r906891, james/mime4j/trunk/core/src/main/javacc/
    james/mime4j/trunk/dom/src/main/jjtree/
      - copied from r906891, james/mime4j/trunk/core/src/main/jjtree/
    james/mime4j/trunk/dom/src/main/resources/
      - copied from r906891, james/mime4j/trunk/core/src/main/resources/
    james/mime4j/trunk/dom/src/test/
    james/mime4j/trunk/dom/src/test/java/
    james/mime4j/trunk/dom/src/test/java/org/
    james/mime4j/trunk/dom/src/test/java/org/apache/
    james/mime4j/trunk/dom/src/test/java/org/apache/james/
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/
      - copied from r906891, james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/dom/
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/
      - copied from r906891, james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/field/
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/message/
      - copied from r906891, james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/message/
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/storage/
      - copied from r906891, james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/storage/
Removed:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/dom/
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/message/
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/storage/
    james/mime4j/trunk/core/src/main/javacc/
    james/mime4j/trunk/core/src/main/jjtree/
    james/mime4j/trunk/core/src/main/resources/
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/dom/
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/field/
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/message/
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/storage/
Modified:
    james/mime4j/trunk/benchmark/pom.xml
    james/mime4j/trunk/core/pom.xml
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/ExampleMessagesRoundtripTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
    james/mime4j/trunk/examples/pom.xml
    james/mime4j/trunk/pom.xml

Modified: james/mime4j/trunk/benchmark/pom.xml
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/benchmark/pom.xml?rev=906951&r1=906950&r2=906951&view=diff
==============================================================================
--- james/mime4j/trunk/benchmark/pom.xml (original)
+++ james/mime4j/trunk/benchmark/pom.xml Fri Feb  5 14:38:41 2010
@@ -34,6 +34,11 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.james</groupId>
+      <artifactId>apache-mime4j-dom</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
     </dependency>
@@ -43,10 +48,5 @@
       <optional>false</optional>
       <scope>compile</scope>
     </dependency>
-    <dependency>
-      <groupId>org.apache.james</groupId>
-      <artifactId>apache-mime4j-core</artifactId>
-      <version>${project.version}</version>
-    </dependency>
   </dependencies>
 </project>

Modified: james/mime4j/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/pom.xml?rev=906951&r1=906950&r2=906951&view=diff
==============================================================================
--- james/mime4j/trunk/core/pom.xml (original)
+++ james/mime4j/trunk/core/pom.xml Fri Feb  5 14:38:41 2010
@@ -32,32 +32,22 @@
   <version>0.7-SNAPSHOT</version>
   <description>Java stream based MIME message parser</description>
 
-   <build>
+  <build>
     <plugins>
-       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>javacc-maven-plugin</artifactId>
-        <version>2.6</version>
-        <executions>
-          <execution>
-            <id>generate-jjtree</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>jjtree-javacc</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>generate-javacc</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>javacc</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
+     <plugin>
+       <groupId>org.apache.maven.plugins</groupId>
+       <artifactId>maven-jar-plugin</artifactId>
+       <executions>
+         <execution>
+           <goals>
+             <goal>test-jar</goal>
+           </goals>
+         </execution>
+       </executions>
+     </plugin>
     </plugins>
-  </build>  
-
+  </build>
+  
   <dependencies>
     <dependency>
       <groupId>commons-logging</groupId>

Copied: james/mime4j/trunk/dom/pom.xml (from r906891, james/mime4j/trunk/core/pom.xml)
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/pom.xml?p2=james/mime4j/trunk/dom/pom.xml&p1=james/mime4j/trunk/core/pom.xml&r1=906891&r2=906951&rev=906951&view=diff
==============================================================================
--- james/mime4j/trunk/core/pom.xml (original)
+++ james/mime4j/trunk/dom/pom.xml Fri Feb  5 14:38:41 2010
@@ -27,10 +27,10 @@
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.james</groupId>
-  <artifactId>apache-mime4j-core</artifactId>
-  <name>Apache JAMES Mime4j (Core)</name>
+  <artifactId>apache-mime4j-dom</artifactId>
+  <name>Apache JAMES Mime4j (DOM)</name>
   <version>0.7-SNAPSHOT</version>
-  <description>Java stream based MIME message parser</description>
+  <description>Java MIME Document Object Model</description>
 
    <build>
     <plugins>
@@ -60,8 +60,22 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.james</groupId>
+      <artifactId>apache-mime4j-core</artifactId>
+      <version>${project.version}</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.james</groupId>
+      <artifactId>apache-mime4j-core</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>log4j</groupId>

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/ExampleMessagesRoundtripTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/ExampleMessagesRoundtripTest.java?rev=906951&r1=906891&r2=906951&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/ExampleMessagesRoundtripTest.java
(original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/ExampleMessagesRoundtripTest.java
Fri Feb  5 14:38:41 2010
@@ -66,7 +66,7 @@
     protected void runTest() throws Throwable {
         MimeEntityConfig config = new MimeEntityConfig();
         if (getName().startsWith("malformedHeaderStartsBody")) {
-        	config.setMalformedHeaderStartsBody(true);
+            config.setMalformedHeaderStartsBody(true);
         }
         config.setMaxLineLen(-1);
         Message inputMessage = new MessageImpl(new FileInputStream(file), config);
@@ -102,14 +102,17 @@
             super();
             URL resource = ExampleMessagesRountripTestSuite.class.getResource(TESTS_FOLDER);
             if (resource != null) {
-				File dir = new File(resource.toURI());
-	            File[] files = dir.listFiles();
-	            
-	            for (File f : files) {
-	                if (f.getName().toLowerCase().endsWith(".msg")) {
-	                    addTest(new ExampleMessagesRoundtripTest(f.getName().substring(0, f.getName().length()-4),
f));
-	                }
-	            }
+                if (resource.getProtocol().equalsIgnoreCase("file")) {
+                    File dir = new File(resource.toURI());
+                    File[] files = dir.listFiles();
+                    
+                    for (File f : files) {
+                        if (f.getName().toLowerCase().endsWith(".msg")) {
+                            addTest(new ExampleMessagesRoundtripTest(f.getName().substring(0,
f.getName().length()-4), f));
+                        }
+                    }
+                } else if (resource.getProtocol().equalsIgnoreCase("jar")) {
+                }
             }
         }
         

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java?rev=906951&r1=906891&r2=906951&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
(original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
Fri Feb  5 14:38:41 2010
@@ -76,18 +76,20 @@
         private static final String TESTS_FOLDER = "/testmsgs";
 
         public MessageParserTestSuite() throws URISyntaxException {
-			URL resource = MessageParserTestSuite.class.getResource(TESTS_FOLDER);
-			if (resource != null) {
-				File dir = new File(resource.toURI());
-	            File[] files = dir.listFiles();
-	            
-	            for (int i = 0; i < files.length && i < 5000; i++) {
-	                File f = files[i];
-	                if (f.getName().toLowerCase().endsWith(".msg")) {
-	                    addTest(new MessageParserTest(f.getName().substring(0, f.getName().length()-4),
f));
-	                }
-	            }
-			}
+            URL resource = MessageParserTestSuite.class.getResource(TESTS_FOLDER);
+            if (resource != null) {
+                if (resource.getProtocol().equalsIgnoreCase("file")) {
+                    File dir = new File(resource.toURI());
+                    File[] files = dir.listFiles();
+                    
+                    for (File f : files) {
+                        if (f.getName().toLowerCase().endsWith(".msg")) {
+                            addTest(new ExampleMessagesRoundtripTest(f.getName().substring(0,
f.getName().length()-4), f));
+                        }
+                    }
+                } else if (resource.getProtocol().equalsIgnoreCase("jar")) {
+                }
+            }
         }
         
         public static File getFile(String name) throws URISyntaxException {
@@ -104,7 +106,7 @@
         
         MimeEntityConfig config = new MimeEntityConfig();
         if (getName().startsWith("malformedHeaderStartsBody")) {
-        	config.setMalformedHeaderStartsBody(true);
+            config.setMalformedHeaderStartsBody(true);
         }
         config.setMaxLineLen(-1);
         MessageImpl m = new MessageImpl(new FileInputStream(f), config);

Modified: james/mime4j/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/examples/pom.xml?rev=906951&r1=906950&r2=906951&view=diff
==============================================================================
--- james/mime4j/trunk/examples/pom.xml (original)
+++ james/mime4j/trunk/examples/pom.xml Fri Feb  5 14:38:41 2010
@@ -35,7 +35,7 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.james</groupId>
-      <artifactId>apache-mime4j-core</artifactId>
+      <artifactId>apache-mime4j-dom</artifactId>
       <version>${project.version}</version>
     </dependency>
    </dependencies>

Modified: james/mime4j/trunk/pom.xml
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/pom.xml?rev=906951&r1=906950&r2=906951&view=diff
==============================================================================
--- james/mime4j/trunk/pom.xml (original)
+++ james/mime4j/trunk/pom.xml Fri Feb  5 14:38:41 2010
@@ -39,6 +39,7 @@
   
   <modules>
     <module>core</module>
+    <module>dom</module>
     <module>benchmark</module>
     <module>examples</module>
     <module>assemble</module>



Mime
View raw message