You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ju...@apache.org on 2011/11/01 01:26:55 UTC

svn commit: r1195729 - in /tika/trunk: tika-bundle-it/ tika-bundle/pom.xml tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java

Author: jukka
Date: Tue Nov  1 00:25:58 2011
New Revision: 1195729

URL: http://svn.apache.org/viewvc?rev=1195729&view=rev
Log:
TIKA-565: Improved OSGi bundling

Move the integration test to a Java 6 profile to prevent test failures on Java 6.

 Use a platfrom-independent way to construct the bundle URIs used in the test case.

Remove the now unused tika-bundle-it directory.

Removed:
    tika/trunk/tika-bundle-it/
Modified:
    tika/trunk/tika-bundle/pom.xml
    tika/trunk/tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java

Modified: tika/trunk/tika-bundle/pom.xml
URL: http://svn.apache.org/viewvc/tika/trunk/tika-bundle/pom.xml?rev=1195729&r1=1195728&r2=1195729&view=diff
==============================================================================
--- tika/trunk/tika-bundle/pom.xml (original)
+++ tika/trunk/tika-bundle/pom.xml Tue Nov  1 00:25:58 2011
@@ -41,7 +41,7 @@
   <url>http://tika.apache.org/</url>
 
   <properties>
-    <pax.exam.version>2.1.0</pax.exam.version>
+    <pax.exam.version>2.2.0</pax.exam.version>
   </properties>
 
   <dependencies>
@@ -165,42 +165,55 @@
           </instructions>
         </configuration>
       </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>pre-integration-test</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-            <configuration>
-              <descriptor>test-bundles.xml</descriptor>
-              <finalName>test</finalName>
-              <attach>false</attach>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-failsafe-plugin</artifactId>
-        <version>2.10</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>integration-test</goal>
-              <goal>verify</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-         <systemPropertyVariables>
-           <org.ops4j.pax.logging.DefaultServiceLog.level>
-             WARN
-           </org.ops4j.pax.logging.DefaultServiceLog.level>
-         </systemPropertyVariables>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 
+  <profiles>
+    <profile>
+      <id>java6</id>
+      <activation>
+        <jdk>1.6</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>pre-integration-test</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <descriptor>test-bundles.xml</descriptor>
+                  <finalName>test</finalName>
+                  <attach>false</attach>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <artifactId>maven-failsafe-plugin</artifactId>
+            <version>2.10</version>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>integration-test</goal>
+                  <goal>verify</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+             <systemPropertyVariables>
+               <org.ops4j.pax.logging.DefaultServiceLog.level>
+                 WARN
+               </org.ops4j.pax.logging.DefaultServiceLog.level>
+             </systemPropertyVariables>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>

Modified: tika/trunk/tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java
URL: http://svn.apache.org/viewvc/tika/trunk/tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java?rev=1195729&r1=1195728&r2=1195729&view=diff
==============================================================================
--- tika/trunk/tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java (original)
+++ tika/trunk/tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java Tue Nov  1 00:25:58 2011
@@ -26,6 +26,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.URISyntaxException;
 
 import org.apache.tika.Tika;
 import org.apache.tika.metadata.Metadata;
@@ -47,13 +48,13 @@ public class BundleIT {
     private final File TARGET = new File("target");
 
     @Configuration
-    public Option[] configuration() throws IOException {
-        String root = "file://" + TARGET.getCanonicalPath();
+    public Option[] configuration() throws IOException, URISyntaxException {
+        File base = new File(TARGET, "test-bundles");
         return CoreOptions.options(
                 junitBundles(),
                 mavenBundle("org.apache.felix", "org.apache.felix.scr", "1.6.0"),
-                bundle(root + "/test-bundles/tika-core.jar"),
-                bundle(root + "/test-bundles/tika-bundle.jar"));
+                bundle(new File(base, "tika-core.jar").toURL().toURI().toString()),
+                bundle(new File(base, "tika-bundle.jar").toURL().toURI().toString()));
     }
  
     @Test