You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ju...@apache.org on 2012/11/13 21:19:44 UTC
svn commit: r1408935 - in /jackrabbit/oak/trunk:
oak-it/osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java
oak-it/osgi/test-bundles.xml oak-lucene/pom.xml
Author: jukka
Date: Tue Nov 13 20:19:43 2012
New Revision: 1408935
URL: http://svn.apache.org/viewvc?rev=1408935&view=rev
Log:
OAK-438: Provide the lucene index as an osgi bundle
Improved oak-lucene bundle settings. Fixed integration test.
Modified:
jackrabbit/oak/trunk/oak-it/osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java
jackrabbit/oak/trunk/oak-it/osgi/test-bundles.xml
jackrabbit/oak/trunk/oak-lucene/pom.xml
Modified: jackrabbit/oak/trunk/oak-it/osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java?rev=1408935&r1=1408934&r2=1408935&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java (original)
+++ jackrabbit/oak/trunk/oak-it/osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java Tue Nov 13 20:19:43 2012
@@ -18,6 +18,7 @@ package org.apache.jackrabbit.oak.osgi;
import java.io.File;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.regex.Pattern;
@@ -26,13 +27,13 @@ import javax.jcr.Repository;
import org.apache.jackrabbit.mk.api.MicroKernel;
import org.apache.jackrabbit.oak.api.ContentRepository;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.options.UrlProvisionOption;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
@@ -41,28 +42,32 @@ import static org.ops4j.pax.exam.CoreOpt
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
@RunWith(JUnit4TestRunner.class)
-@Ignore("OAK-438") // FIXME OAK-438
public class OSGiIT {
- private final File TARGET = new File("target");
-
@Configuration
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(new File(base, "jcr.jar").toURI().toURL().toString()),
- bundle(new File(base, "guava.jar").toURI().toURL().toString()),
- bundle(new File(base, "jackrabbit-api.jar").toURI().toURL().toString()),
- bundle(new File(base, "jackrabbit-jcr-commons.jar").toURI().toURL().toString()),
- bundle(new File(base, "oak-commons.jar").toURI().toURL().toString()),
- bundle(new File(base, "oak-mk-api.jar").toURI().toURL().toString()),
- bundle(new File(base, "oak-mk.jar").toURI().toURL().toString()),
- bundle(new File(base, "oak-mk-remote.jar").toURI().toURL().toString()),
- bundle(new File(base, "oak-core.jar").toURI().toURL().toString()),
- bundle(new File(base, "oak-lucene.jar").toURI().toURL().toString()),
- bundle(new File(base, "oak-jcr.jar").toURI().toURL().toString()));
+ jarBundle("jcr.jar"),
+ jarBundle("guava.jar"),
+ jarBundle("jackrabbit-api.jar"),
+ jarBundle("jackrabbit-jcr-commons.jar"),
+ jarBundle("oak-commons.jar"),
+ jarBundle("oak-mk-api.jar"),
+ jarBundle("oak-mk.jar"),
+ jarBundle("oak-mk-remote.jar"),
+ jarBundle("oak-core.jar"),
+ jarBundle("oak-lucene.jar"),
+ jarBundle("oak-jcr.jar"),
+ jarBundle("tika-core.jar"));
+ }
+
+ private UrlProvisionOption jarBundle(String jar)
+ throws MalformedURLException {
+ File target = new File("target");
+ File bundles = new File(target, "test-bundles");
+ return bundle(new File(bundles, jar).toURI().toURL().toString());
}
@Inject
Modified: jackrabbit/oak/trunk/oak-it/osgi/test-bundles.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/osgi/test-bundles.xml?rev=1408935&r1=1408934&r2=1408935&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/osgi/test-bundles.xml (original)
+++ jackrabbit/oak/trunk/oak-it/osgi/test-bundles.xml Tue Nov 13 20:19:43 2012
@@ -39,6 +39,7 @@
<include>org.apache.jackrabbit:oak-core</include>
<include>org.apache.jackrabbit:oak-jcr</include>
<include>org.apache.jackrabbit:oak-lucene</include>
+ <include>org.apache.tika:tika-core</include>
</includes>
</dependencySet>
</dependencySets>
Modified: jackrabbit/oak/trunk/oak-lucene/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/pom.xml?rev=1408935&r1=1408934&r2=1408935&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-lucene/pom.xml Tue Nov 13 20:19:43 2012
@@ -39,11 +39,9 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <Export-Package>
- org.apache.jackrabbit.oak.plugins.index.lucene
- </Export-Package>
- <Embed-Transitive>true</Embed-Transitive>
- <Embed-Dependency>lucene-*;scope=compile</Embed-Dependency>
+ <!-- TODO: Should only provide services, not export packages -->
+ <Export-Package>org.apache.jackrabbit.oak.plugins.index.lucene</Export-Package>
+ <Embed-Dependency>lucene-*;inline=true</Embed-Dependency>
</instructions>
</configuration>
</plugin>
@@ -82,22 +80,24 @@
<artifactId>oak-core</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-core</artifactId>
+ <version>1.2</version>
+ </dependency>
- <!-- Optional Lucene dependency -->
+ <!-- Embedded non-OSGi Lucene dependencies -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>4.0.0</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
<version>4.0.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tika</groupId>
- <artifactId>tika-core</artifactId>
- <version>1.2</version>
+ <scope>provided</scope>
</dependency>
<!-- Logging -->