You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by bo...@apache.org on 2016/03/02 14:54:31 UTC
[1/3] tika git commit: TIKA-1860 - Added bundle poms and tests to
tika-parsers-bundle folder
Repository: tika
Updated Branches:
refs/heads/2.x f1e4ebdb4 -> 9f8d6aedf
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-scientific-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-scientific-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-scientific-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-scientific-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-text-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-text-bundle/pom.xml b/tika-parser-bundles/tika-parser-text-bundle/pom.xml
new file mode 100644
index 0000000..bf4e14a
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-text-bundle/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-text-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser text bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-text-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.text.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-text-module;inline=true,
+ juniversalchardet;inline=true,
+ commons-codec;inline=true,
+ commons-io;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.strings.*,
+ org.apache.tika.parser.txt.*,
+ org.apache.tika.parser.audio.*,
+ org.apache.tika.parser.xml.*
+ </Export-Package>
+ <Import-Package>
+ *,
+ javax.servlet.annotation;resolution:=optional,
+ javax.servlet;resolution:=optional,
+ javax.servlet.http;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-text-bundle/src/test/java/org/apache/tika/module/text/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-text-bundle/src/test/java/org/apache/tika/module/text/BundleIT.java b/tika-parser-bundles/tika-parser-text-bundle/src/test/java/org/apache/tika/module/text/BundleIT.java
new file mode 100644
index 0000000..9f6dcfe
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-text-bundle/src/test/java/org/apache/tika/module/text/BundleIT.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.text;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-text-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Text bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 3, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-text-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-text-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-text-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-text-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-web-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-web-bundle/pom.xml b/tika-parser-bundles/tika-parser-web-bundle/pom.xml
new file mode 100644
index 0000000..72d22da
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-web-bundle/pom.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-web-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser web bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-web-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.web.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-web-module;inline=true,
+ tagsoup;inline=true,
+ boilerpipe;inline=true,
+ rome;inline=true,
+ rome-utils;inline=true,
+ apache-mime4j-core;inline=true,
+ apache-mime4j-dom;inline=true,
+ commons-io;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.feed.*,
+ org.apache.tika.parser.html.*,
+ org.apache.tika.parser.iptc.*,
+ org.apache.tika.parser.mail.*
+ </Export-Package>
+ <Import-Package>
+ *,
+ org.apache.xerces.parsers;resolution:=optional,
+ org.apache.xerces.util;resolution:=optional,
+ org.apache.xerces.xni;resolution:=optional,
+ org.apache.xerces.xni.parser;resolution:=optional,
+ org.cyberneko.html.xercesbridge;resolution:=optional,
+ org.jdom;resolution:=optional,
+ org.jdom.input;resolution:=optional,
+ org.jdom.output;resolution:=optional,
+ org.jdom2;resolution:=optional,
+ org.jdom2.input;resolution:=optional,
+ org.jdom2.input.sax;resolution:=optional,
+ org.jdom2.output;resolution:=optional,
+ org.jdom2.filter;resolution:=optional,
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-web-bundle/src/test/java/org/apache/tika/module/web/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-web-bundle/src/test/java/org/apache/tika/module/web/BundleIT.java b/tika-parser-bundles/tika-parser-web-bundle/src/test/java/org/apache/tika/module/web/BundleIT.java
new file mode 100644
index 0000000..98a0cec
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-web-bundle/src/test/java/org/apache/tika/module/web/BundleIT.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.web;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-web-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Web bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 4, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-web-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-web-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-web-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-web-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-advanced-module/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-advanced-module/pom.xml b/tika-parser-modules/tika-parser-advanced-module/pom.xml
index 14da26a..2e02904 100644
--- a/tika-parser-modules/tika-parser-advanced-module/pom.xml
+++ b/tika-parser-modules/tika-parser-advanced-module/pom.xml
@@ -20,7 +20,6 @@
</parent>
<artifactId>tika-parser-advanced-module</artifactId>
- <packaging>bundle</packaging>
<name>Apache Tika parser advanced module</name>
<url>http://tika.apache.org/</url>
@@ -64,49 +63,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <classifier>bundle</classifier>
- <instructions>
- <Bundle-Activator>org.apache.tika.module.advanced.internal.Activator</Bundle-Activator>
- <Embed-Dependency>
- opennlp-tools;inline=true,
- opennlp-maxent;inline=true,
- commons-io;inline=true,
- jwnl;inline=true
- </Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- <Export-Package>
- org.apache.tika.parser.ner.*,
- org.apache.tika.parser.ner.corenlp.*,
- org.apache.tika.parser.ner.opennlp.*,
- org.apache.tika.parser.ner.regex.*
- </Export-Package>
- <Import-Package>
- *,
- opennlp.maxent;resolution:=optional,
- opennlp.tools.namefind;resolution:=optional,
- org.apache.commons.io;resolution:=optional,
- org.json;resolution:=optional,
- org.osgi.framework;resolution:=optional,
- net.didion.jwnl;resolution:=optional
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-failsafe-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-advanced-module/src/test/java/org/apache/tika/module/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-advanced-module/src/test/java/org/apache/tika/module/BundleIT.java b/tika-parser-modules/tika-parser-advanced-module/src/test/java/org/apache/tika/module/BundleIT.java
deleted file mode 100644
index c446ee8..0000000
--- a/tika-parser-modules/tika-parser-advanced-module/src/test/java/org/apache/tika/module/BundleIT.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.module;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
-import static org.ops4j.pax.exam.CoreOptions.bundle;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-
-import javax.inject.Inject;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URISyntaxException;
-import java.util.Dictionary;
-
-import org.apache.tika.io.TikaInputStream;
-import org.apache.tika.metadata.Metadata;
-import org.apache.tika.metadata.TikaCoreProperties;
-import org.apache.tika.mime.MediaType;
-import org.apache.tika.osgi.TikaService;
-import org.apache.tika.parser.ParseContext;
-import org.apache.tika.sax.BodyContentHandler;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerMethod;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.xml.sax.ContentHandler;
-
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerMethod.class)
-public class BundleIT {
-
- private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
-
- @Inject
- private BundleContext bc;
-
- @Configuration
- public Option[] configuration() throws IOException, URISyntaxException {
- String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
-
- return options(junitBundles(),
- bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
- bundle(new File(bundleFileName).toURI().toString()));
- }
-
- @Test
- public void testBundleLoaded() throws Exception {
- boolean hasCore = false, hasBundle = false;
- for (Bundle b : bc.getBundles()) {
- if ("org.apache.tika.core".equals(b.getSymbolicName())) {
- hasCore = true;
- assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
- }
- if ("org.apache.tika.parser-advanced-module".equals(b.getSymbolicName())) {
- hasBundle = true;
- assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
- }
- }
- assertTrue("Core bundle not found", hasCore);
- assertTrue("Advanced bundle not found", hasBundle);
- }
-}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-advanced-module/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-advanced-module/test-bundles.xml b/tika-parser-modules/tika-parser-advanced-module/test-bundles.xml
deleted file mode 100644
index 53bb6e4..0000000
--- a/tika-parser-modules/tika-parser-advanced-module/test-bundles.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
- <id>bundles</id>
- <formats>
- <format>dir</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory/>
- <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
- <includes>
- <include>org.apache.tika:tika-core</include>
- </includes>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-cad-module/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-cad-module/pom.xml b/tika-parser-modules/tika-parser-cad-module/pom.xml
index 89ddcd4..c606b06 100644
--- a/tika-parser-modules/tika-parser-cad-module/pom.xml
+++ b/tika-parser-modules/tika-parser-cad-module/pom.xml
@@ -20,7 +20,6 @@
</parent>
<artifactId>tika-parser-cad-module</artifactId>
- <packaging>bundle</packaging>
<name>Apache Tika parser CAD module</name>
<url>http://tika.apache.org/</url>
@@ -49,39 +48,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <classifier>bundle</classifier>
- <instructions>
- <Bundle-Activator>org.apache.tika.module.cad.internal.Activator</Bundle-Activator>
- <Embed-Dependency>
- poi;inline=true,
- commons-codec;inline=true
- </Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- <Export-Package>
- org.apache.tika.parser.dwg.*,
- org.apache.tika.parser.prt.*
- </Export-Package>
- <Import-Package>
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-failsafe-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-cad-module/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-cad-module/test-bundles.xml b/tika-parser-modules/tika-parser-cad-module/test-bundles.xml
deleted file mode 100644
index 53bb6e4..0000000
--- a/tika-parser-modules/tika-parser-cad-module/test-bundles.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
- <id>bundles</id>
- <formats>
- <format>dir</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory/>
- <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
- <includes>
- <include>org.apache.tika:tika-core</include>
- </includes>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-code-module/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-code-module/pom.xml b/tika-parser-modules/tika-parser-code-module/pom.xml
index c804f8d..c74455a 100644
--- a/tika-parser-modules/tika-parser-code-module/pom.xml
+++ b/tika-parser-modules/tika-parser-code-module/pom.xml
@@ -20,7 +20,6 @@
</parent>
<artifactId>tika-parser-code-module</artifactId>
- <packaging>bundle</packaging>
<name>Apache Tika parser code module</name>
<url>http://tika.apache.org/</url>
@@ -69,46 +68,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <classifier>bundle</classifier>
- <instructions>
- <Bundle-Activator>org.apache.tika.module.code.internal.Activator</Bundle-Activator>
- <Embed-Dependency>
- asm;inline=true,
- tagsoup;inline=true,
- jhighlight;inline=true,
- commons-io;inline=true,
- commons-codec;inline=true,
- poi;inline=true
- </Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- <Export-Package>
- org.apache.tika.parser.asm.*,
- org.apache.tika.parser.code.*,
- org.apache.tika.parser.executable.*
- </Export-Package>
- <Import-Package>
- *,
- javax.servlet;resolution:=optional,
- javax.servlet.http;resolution:=optional
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-failsafe-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-code-module/src/test/java/org/apache/tika/module/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-code-module/src/test/java/org/apache/tika/module/BundleIT.java b/tika-parser-modules/tika-parser-code-module/src/test/java/org/apache/tika/module/BundleIT.java
deleted file mode 100644
index e1570ee..0000000
--- a/tika-parser-modules/tika-parser-code-module/src/test/java/org/apache/tika/module/BundleIT.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.module;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
-import static org.ops4j.pax.exam.CoreOptions.bundle;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-
-import javax.inject.Inject;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URISyntaxException;
-import java.util.Dictionary;
-
-import org.apache.tika.io.TikaInputStream;
-import org.apache.tika.metadata.Metadata;
-import org.apache.tika.metadata.TikaCoreProperties;
-import org.apache.tika.mime.MediaType;
-import org.apache.tika.osgi.TikaService;
-import org.apache.tika.parser.ParseContext;
-import org.apache.tika.sax.BodyContentHandler;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerMethod;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.xml.sax.ContentHandler;
-
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerMethod.class)
-public class BundleIT {
-
- private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
-
- @Inject
- private BundleContext bc;
-
- @Configuration
- public Option[] configuration() throws IOException, URISyntaxException {
- String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
- return options(junitBundles(),
- bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
- bundle(new File(bundleFileName).toURI().toString()));
- }
-
- @Test
- public void testBundleLoaded() throws Exception {
- boolean hasCore = false, hasBundle = false;
- for (Bundle b : bc.getBundles()) {
- if ("org.apache.tika.core".equals(b.getSymbolicName())) {
- hasCore = true;
- assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
- }
- if ("org.apache.tika.parser-code-module".equals(b.getSymbolicName())) {
- hasBundle = true;
- assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
- }
- }
- assertTrue("Core bundle not found", hasCore);
- assertTrue("Code bundle not found", hasBundle);
- }
-}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-code-module/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-code-module/test-bundles.xml b/tika-parser-modules/tika-parser-code-module/test-bundles.xml
deleted file mode 100644
index 53bb6e4..0000000
--- a/tika-parser-modules/tika-parser-code-module/test-bundles.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
- <id>bundles</id>
- <formats>
- <format>dir</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory/>
- <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
- <includes>
- <include>org.apache.tika:tika-core</include>
- </includes>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-crypto-module/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-crypto-module/pom.xml b/tika-parser-modules/tika-parser-crypto-module/pom.xml
index 0838a00..3d41017 100644
--- a/tika-parser-modules/tika-parser-crypto-module/pom.xml
+++ b/tika-parser-modules/tika-parser-crypto-module/pom.xml
@@ -20,7 +20,6 @@
</parent>
<artifactId>tika-parser-crypto-module</artifactId>
- <packaging>bundle</packaging>
<name>Apache Tika parser crypto module</name>
<url>http://tika.apache.org/</url>
@@ -48,49 +47,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <classifier>bundle</classifier>
- <instructions>
- <Bundle-Activator>org.apache.tika.module.crypto.internal.Activator</Bundle-Activator>
- <Embed-Dependency>
- bcmail-jdk15on;inline=true,
- bcprov-jdk15on;inline=true,
- bcpkix-jdk15on;inline=true,
- commons-io;inline=true
- </Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- <Export-Package>
- org.apache.tika.parser.crypto.*,
- </Export-Package>
- <Import-Package>
- *,
- javax.mail;resolution:=optional,
- javax.mail.internet;resolution:=optional,
- org.bouncycastle.cert;resolution:=optional,
- org.bouncycastle.cert.jcajce;resolution:=optional,
- org.bouncycastle.cert.ocsp;resolution:=optional,
- org.bouncycastle.cms.bc;resolution:=optional,
- org.bouncycastle.operator;resolution:=optional,
- org.bouncycastle.operator.bc;resolution:=optional,
- org.bouncycastle.tsp;resolution:=optional
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-failsafe-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-crypto-module/src/test/java/org/apache/tika/module/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-crypto-module/src/test/java/org/apache/tika/module/BundleIT.java b/tika-parser-modules/tika-parser-crypto-module/src/test/java/org/apache/tika/module/BundleIT.java
deleted file mode 100644
index 46c4b4e..0000000
--- a/tika-parser-modules/tika-parser-crypto-module/src/test/java/org/apache/tika/module/BundleIT.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.module;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
-import static org.ops4j.pax.exam.CoreOptions.bundle;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-
-import javax.inject.Inject;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URISyntaxException;
-import java.util.Dictionary;
-
-import org.apache.tika.io.TikaInputStream;
-import org.apache.tika.metadata.Metadata;
-import org.apache.tika.metadata.TikaCoreProperties;
-import org.apache.tika.mime.MediaType;
-import org.apache.tika.osgi.TikaService;
-import org.apache.tika.parser.ParseContext;
-import org.apache.tika.sax.BodyContentHandler;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerMethod;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.xml.sax.ContentHandler;
-
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerMethod.class)
-public class BundleIT {
-
- private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
-
- @Inject
- private BundleContext bc;
-
- @Configuration
- public Option[] configuration() throws IOException, URISyntaxException {
- String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
- return options(junitBundles(),
- bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
- bundle(new File(bundleFileName).toURI().toString()));
- }
-
- @Test
- public void testBundleLoaded() throws Exception {
- boolean hasCore = false, hasBundle = false;
- for (Bundle b : bc.getBundles()) {
- if ("org.apache.tika.core".equals(b.getSymbolicName())) {
- hasCore = true;
- assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
- }
- if ("org.apache.tika.parser-crypto-module".equals(b.getSymbolicName())) {
- hasBundle = true;
- assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
- }
- }
- assertTrue("Core bundle not found", hasCore);
- assertTrue("Crypto bundle not found", hasBundle);
- }
-}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-crypto-module/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-crypto-module/test-bundles.xml b/tika-parser-modules/tika-parser-crypto-module/test-bundles.xml
deleted file mode 100644
index 53bb6e4..0000000
--- a/tika-parser-modules/tika-parser-crypto-module/test-bundles.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
- <id>bundles</id>
- <formats>
- <format>dir</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory/>
- <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
- <includes>
- <include>org.apache.tika:tika-core</include>
- </includes>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-database-module/src/main/java/org/apache/tika/module/database/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-database-module/src/main/java/org/apache/tika/module/database/internal/Activator.java b/tika-parser-modules/tika-parser-database-module/src/main/java/org/apache/tika/module/database/internal/Activator.java
new file mode 100644
index 0000000..4b798fa
--- /dev/null
+++ b/tika-parser-modules/tika-parser-database-module/src/main/java/org/apache/tika/module/database/internal/Activator.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.database.internal;
+
+import org.apache.tika.osgi.TikaAbstractBundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends TikaAbstractBundleActivator {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+
+ registerTikaParserServiceLoader(context, Activator.class.getClassLoader());
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-ebook-module/src/main/java/org/apache/tika/module/ebook/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-ebook-module/src/main/java/org/apache/tika/module/ebook/internal/Activator.java b/tika-parser-modules/tika-parser-ebook-module/src/main/java/org/apache/tika/module/ebook/internal/Activator.java
new file mode 100644
index 0000000..62e1582
--- /dev/null
+++ b/tika-parser-modules/tika-parser-ebook-module/src/main/java/org/apache/tika/module/ebook/internal/Activator.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.ebook.internal;
+
+import org.apache.tika.osgi.TikaAbstractBundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends TikaAbstractBundleActivator {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+
+ registerTikaParserServiceLoader(context, Activator.class.getClassLoader());
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-journal-module/src/main/java/org/apache/tika/module/journal/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-journal-module/src/main/java/org/apache/tika/module/journal/internal/Activator.java b/tika-parser-modules/tika-parser-journal-module/src/main/java/org/apache/tika/module/journal/internal/Activator.java
new file mode 100644
index 0000000..2f9c36a
--- /dev/null
+++ b/tika-parser-modules/tika-parser-journal-module/src/main/java/org/apache/tika/module/journal/internal/Activator.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.journal.internal;
+
+import org.apache.tika.osgi.TikaAbstractBundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends TikaAbstractBundleActivator {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+
+ registerTikaParserServiceLoader(context, Activator.class.getClassLoader());
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-multimedia-module/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-multimedia-module/pom.xml b/tika-parser-modules/tika-parser-multimedia-module/pom.xml
index 566ad81..f15f3bd 100644
--- a/tika-parser-modules/tika-parser-multimedia-module/pom.xml
+++ b/tika-parser-modules/tika-parser-multimedia-module/pom.xml
@@ -22,7 +22,6 @@
<artifactId>tika-parser-multimedia-module</artifactId>
<name>Apache Tika parser multimedia module</name>
<url>http://tika.apache.org/</url>
- <packaging>bundle</packaging>
<properties>
<metadata.extractor.version>2.8.0</metadata.extractor.version>
@@ -122,55 +121,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <classifier>bundle</classifier>
- <instructions>
- <Bundle-Activator>org.apache.tika.module.multimedia.internal.Activator</Bundle-Activator>
- <_runsystempackages>com.sun.xml.bind.marshaller,
- com.sun.xml.internal.bind.marshaller</_runsystempackages>
- <Embed-Dependency>
- metadata-extractor;inline=true,
- xmpcore;inline=true,
- commons-codec;inline=true,
- commons-io;inline=true,
- jempbox;inline=true,
- fontbox;inline=true,
- poi;inline=true,
- isoparser;inline=true,
- aspectjrt;inline=true
- </Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- <Export-Package>
- org.apache.tika.parser.image.*,
- org.apache.tika.parser.jpeg.*,
- org.apache.tika.parser.audio.*,
- org.apache.tika.parser.video.*,
- org.apache.tika.parser.mp3.*,
- org.apache.tika.parser.mp4.*
- </Export-Package>
- <Import-Package>
- *,
- com.adobe.xmp;resolution:=optional,
- com.adobe.xmp.properties;resolution:=optional,
- android.util;resolution:=optional
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-failsafe-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-multimedia-module/src/test/java/org/apache/tika/module/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-multimedia-module/src/test/java/org/apache/tika/module/BundleIT.java b/tika-parser-modules/tika-parser-multimedia-module/src/test/java/org/apache/tika/module/BundleIT.java
deleted file mode 100644
index 10b1a95..0000000
--- a/tika-parser-modules/tika-parser-multimedia-module/src/test/java/org/apache/tika/module/BundleIT.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.module;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
-import static org.ops4j.pax.exam.CoreOptions.bundle;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-
-import javax.inject.Inject;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URISyntaxException;
-import java.util.Dictionary;
-
-import org.apache.tika.io.TikaInputStream;
-import org.apache.tika.metadata.Metadata;
-import org.apache.tika.metadata.TikaCoreProperties;
-import org.apache.tika.mime.MediaType;
-import org.apache.tika.osgi.TikaService;
-import org.apache.tika.parser.ParseContext;
-import org.apache.tika.sax.BodyContentHandler;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerMethod;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.xml.sax.ContentHandler;
-
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerMethod.class)
-public class BundleIT {
-
- private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
-
- @Inject
- private BundleContext bc;
-
- @Configuration
- public Option[] configuration() throws IOException, URISyntaxException {
- String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
- return options(junitBundles(),
- bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
- bundle(new File(bundleFileName).toURI().toString()));
- }
-
- @Test
- public void testBundleLoaded() throws Exception {
- boolean hasCore = false, hasBundle = false;
- for (Bundle b : bc.getBundles()) {
- if ("org.apache.tika.core".equals(b.getSymbolicName())) {
- hasCore = true;
- assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
- }
- if ("org.apache.tika.parser-multimedia-module".equals(b.getSymbolicName())) {
- hasBundle = true;
- assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
- }
- }
- assertTrue("Core bundle not found", hasCore);
- assertTrue("Image bundle not found", hasBundle);
- }
-
- @Test
- public void testImageParser() throws Exception {
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("/test-documents/testPNG.png").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be PNG", MediaType.image("png"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
-
- assertEquals("Image Output Width Should Match", "100", metadata.get(Metadata.IMAGE_WIDTH));
- }
-
- @Test
- public void testJpegParser() throws Exception {
-
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("/test-documents/testJPEG.jpg").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be JPEG", MediaType.image("jpeg"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
-
- assertEquals("Jpg Output Width Should Match", "100", metadata.get(Metadata.IMAGE_WIDTH));
- }
- @Test
- public void testVideoParser() throws Exception {
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("/test-documents/testFLV.flv").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be FLV", MediaType.video("x-flv"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
-
- assertEquals("Video Should have audio", "true", metadata.get("hasAudio"));
-
- }
-
- @Test
- public void testMp3Parser() throws Exception {
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("/test-documents/testMP3i18n.mp3").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be MP3", MediaType.audio("mpeg"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
-
- assertEquals("MP3 should have title", "Une chason en Fran\u00e7ais", metadata.get(TikaCoreProperties.TITLE));
-
- }
-
- @Test
- public void testMidiParser() throws Exception {
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("/test-documents/testMID.mid").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be Midi", MediaType.audio("midi"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
- assertEquals("Midi should have 2 tracks", "2", metadata.get("tracks"));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-multimedia-module/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-multimedia-module/test-bundles.xml b/tika-parser-modules/tika-parser-multimedia-module/test-bundles.xml
deleted file mode 100644
index 53bb6e4..0000000
--- a/tika-parser-modules/tika-parser-multimedia-module/test-bundles.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
- <id>bundles</id>
- <formats>
- <format>dir</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory/>
- <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
- <includes>
- <include>org.apache.tika:tika-core</include>
- </includes>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/module/office/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/module/office/internal/Activator.java b/tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/module/office/internal/Activator.java
new file mode 100644
index 0000000..32a41ab
--- /dev/null
+++ b/tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/module/office/internal/Activator.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.office.internal;
+
+import org.apache.tika.osgi.TikaAbstractBundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends TikaAbstractBundleActivator {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+
+ registerTikaParserServiceLoader(context, Activator.class.getClassLoader());
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-office-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-office-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser b/tika-parser-modules/tika-parser-office-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser
index 23d57c7..9b770d4 100644
--- a/tika-parser-modules/tika-parser-office-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser
+++ b/tika-parser-modules/tika-parser-office-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser
@@ -25,3 +25,5 @@ org.apache.tika.parser.microsoft.ooxml.OOXMLParser
org.apache.tika.parser.odf.OpenDocumentParser
#org.apache.tika.parser.opendocument.OpenOfficeParser
org.apache.tika.parser.rtf.RTFParser
+org.apache.tika.parser.mbox.MboxParser
+org.apache.tika.parser.mbox.OutlookPSTParser
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-package-module/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-package-module/pom.xml b/tika-parser-modules/tika-parser-package-module/pom.xml
index 7a3faa9..77f85d0 100644
--- a/tika-parser-modules/tika-parser-package-module/pom.xml
+++ b/tika-parser-modules/tika-parser-package-module/pom.xml
@@ -22,12 +22,12 @@
<artifactId>tika-parser-package-module</artifactId>
<name>Apache Tika parser package module</name>
<url>http://tika.apache.org/</url>
-
+
<properties>
<!-- NOTE: sync tukaani version with commons-compress -->
<tukaani.version>1.5</tukaani.version>
</properties>
-
+
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
@@ -70,7 +70,7 @@
<version>${commons.compress.version}</version>
</dependency>
</dependencies>
-
+
<build>
<plugins>
<plugin>
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-package-module/src/main/java/org/apache/tika/module/pkg/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-package-module/src/main/java/org/apache/tika/module/pkg/internal/Activator.java b/tika-parser-modules/tika-parser-package-module/src/main/java/org/apache/tika/module/pkg/internal/Activator.java
new file mode 100644
index 0000000..0fb71fa
--- /dev/null
+++ b/tika-parser-modules/tika-parser-package-module/src/main/java/org/apache/tika/module/pkg/internal/Activator.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.pkg.internal;
+
+import org.apache.tika.osgi.TikaAbstractBundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends TikaAbstractBundleActivator {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+
+ registerTikaParserServiceLoader(context, Activator.class.getClassLoader());
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/module/pdf/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/module/pdf/internal/Activator.java b/tika-parser-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/module/pdf/internal/Activator.java
new file mode 100644
index 0000000..9860934
--- /dev/null
+++ b/tika-parser-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/module/pdf/internal/Activator.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.pdf.internal;
+
+import org.apache.tika.osgi.TikaAbstractBundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends TikaAbstractBundleActivator {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+
+ registerTikaParserServiceLoader(context, Activator.class.getClassLoader());
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-scientific-module/src/main/java/org/apache/tika/module/scientific/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-scientific-module/src/main/java/org/apache/tika/module/scientific/internal/Activator.java b/tika-parser-modules/tika-parser-scientific-module/src/main/java/org/apache/tika/module/scientific/internal/Activator.java
new file mode 100644
index 0000000..0195b63
--- /dev/null
+++ b/tika-parser-modules/tika-parser-scientific-module/src/main/java/org/apache/tika/module/scientific/internal/Activator.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.scientific.internal;
+
+import org.apache.tika.osgi.TikaAbstractBundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends TikaAbstractBundleActivator {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+
+ registerTikaParserServiceLoader(context, Activator.class.getClassLoader());
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-text-module/src/main/java/org/apache/tika/module/text/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-text-module/src/main/java/org/apache/tika/module/text/internal/Activator.java b/tika-parser-modules/tika-parser-text-module/src/main/java/org/apache/tika/module/text/internal/Activator.java
new file mode 100644
index 0000000..80716d8
--- /dev/null
+++ b/tika-parser-modules/tika-parser-text-module/src/main/java/org/apache/tika/module/text/internal/Activator.java
@@ -0,0 +1,20 @@
+package org.apache.tika.module.text.internal;
+
+import org.apache.tika.osgi.TikaAbstractBundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends TikaAbstractBundleActivator {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+
+ registerTikaParserServiceLoader(context, Activator.class.getClassLoader());
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-web-module/src/main/java/org/apache/tika/module/web/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-web-module/src/main/java/org/apache/tika/module/web/internal/Activator.java b/tika-parser-modules/tika-parser-web-module/src/main/java/org/apache/tika/module/web/internal/Activator.java
new file mode 100644
index 0000000..53e28ca
--- /dev/null
+++ b/tika-parser-modules/tika-parser-web-module/src/main/java/org/apache/tika/module/web/internal/Activator.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.web.internal;
+
+import org.apache.tika.osgi.TikaAbstractBundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends TikaAbstractBundleActivator {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+
+ registerTikaParserServiceLoader(context, Activator.class.getClassLoader());
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-modules/tika-parser-web-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser
----------------------------------------------------------------------
diff --git a/tika-parser-modules/tika-parser-web-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser b/tika-parser-modules/tika-parser-web-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser
index 4e27b89..ca0f860 100644
--- a/tika-parser-modules/tika-parser-web-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser
+++ b/tika-parser-modules/tika-parser-web-module/src/main/resources/META-INF/services/org.apache.tika.parser.Parser
@@ -17,6 +17,4 @@
org.apache.tika.parser.feed.FeedParser
org.apache.tika.parser.html.HtmlParser
org.apache.tika.parser.mail.RFC822Parser
-org.apache.tika.parser.mbox.MboxParser
-org.apache.tika.parser.mbox.OutlookPSTParser
org.apache.tika.parser.iptc.IptcAnpaParser
[3/3] tika git commit: TIKA-1860 - Added bundle poms and tests to
tika-parsers-bundle folder
Posted by bo...@apache.org.
TIKA-1860 - Added bundle poms and tests to tika-parsers-bundle folder
Project: http://git-wip-us.apache.org/repos/asf/tika/repo
Commit: http://git-wip-us.apache.org/repos/asf/tika/commit/9f8d6aed
Tree: http://git-wip-us.apache.org/repos/asf/tika/tree/9f8d6aed
Diff: http://git-wip-us.apache.org/repos/asf/tika/diff/9f8d6aed
Branch: refs/heads/2.x
Commit: 9f8d6aedf375c64be428d36d555c15afa4d25c95
Parents: f1e4ebd
Author: Bob Paulin <bo...@apache.org>
Authored: Tue Mar 1 21:11:01 2016 -0600
Committer: Bob Paulin <bo...@apache.org>
Committed: Tue Mar 1 21:11:41 2016 -0600
----------------------------------------------------------------------
pom.xml | 1 +
tika-parser-bundles/pom.xml | 65 +++++-
.../tika-multimedia-bundle/pom.xml | 102 ---------
.../module/multimedia/internal/Activator.java | 49 -----
.../java/org/apache/tika/module/BundleIT.java | 203 ------------------
.../src/test/resources/hadoop.jpg | Bin 8362 -> 0 bytes
.../src/test/resources/testFLV.flv | Bin 90580 -> 0 bytes
.../src/test/resources/testMID.mid | Bin 322 -> 0 bytes
.../src/test/resources/testMP3i18n.mp3 | Bin 40832 -> 0 bytes
.../src/test/resources/tika.png | Bin 22216 -> 0 bytes
.../module/BundleIT.java | 89 ++++++++
.../tika-parser-advanced-bundle/pom.xml | 83 ++++++++
.../apache/tika/module/advanced/BundleIT.java | 98 +++++++++
.../test-bundles.xml | 34 +++
.../tika-parser-cad-bundle/pom.xml | 73 +++++++
.../org/apache/tika/module/cad/BundleIT.java | 96 +++++++++
.../tika-parser-cad-bundle/test-bundles.xml | 34 +++
.../tika-parser-code-bundle/.gitignore | 1 +
.../tika-parser-code-bundle/pom.xml | 76 +++++++
.../org/apache/tika/module/code/BundleIT.java | 96 +++++++++
.../tika-parser-code-bundle/test-bundles.xml | 34 +++
.../tika-parser-crypto-bundle/.gitignore | 1 +
.../tika-parser-crypto-bundle/pom.xml | 79 +++++++
.../org/apache/tika/module/crypto/BundleIT.java | 96 +++++++++
.../tika-parser-crypto-bundle/test-bundles.xml | 34 +++
.../tika-parser-database-bundle/.gitignore | 1 +
.../tika-parser-database-bundle/pom.xml | 68 ++++++
.../apache/tika/module/database/BundleIT.java | 96 +++++++++
.../test-bundles.xml | 34 +++
.../tika-parser-ebook-bundle/pom.xml | 72 +++++++
.../org/apache/tika/module/ebook/BundleIT.java | 97 +++++++++
.../tika-parser-ebook-bundle/test-bundles.xml | 35 +++
.../tika-parser-journal-bundle/pom.xml | 80 +++++++
.../apache/tika/module/journal/BundleIT.java | 97 +++++++++
.../tika-parser-journal-bundle/test-bundles.xml | 35 +++
.../tika-parser-multimedia-bundle/pom.xml | 85 ++++++++
.../apache/tika/module/multimedia/BundleIT.java | 211 +++++++++++++++++++
.../src/test/resources/hadoop.jpg | Bin 0 -> 8362 bytes
.../src/test/resources/testFLV.flv | Bin 0 -> 90580 bytes
.../src/test/resources/testMID.mid | Bin 0 -> 322 bytes
.../src/test/resources/testMP3i18n.mp3 | Bin 0 -> 40832 bytes
.../src/test/resources/tika.png | Bin 0 -> 22216 bytes
.../test-bundles.xml | 34 +++
.../tika-parser-office-bundle/pom.xml | 138 ++++++++++++
.../org/apache/tika/module/office/BundleIT.java | 87 ++++++++
.../tika-parser-office-bundle/test-bundles.xml | 37 ++++
.../tika-parser-package-bundle/pom.xml | 134 ++++++++++++
.../org/apache/tika/module/pkg/BundleIT.java | 96 +++++++++
.../tika-parser-package-bundle/test-bundles.xml | 34 +++
.../tika-parser-pdf-bundle/pom.xml | 87 ++++++++
.../org/apache/tika/module/pdf/BundleIT.java | 96 +++++++++
.../tika-parser-pdf-bundle/test-bundles.xml | 34 +++
.../tika-parser-scientific-bundle/pom.xml | 202 ++++++++++++++++++
.../apache/tika/module/scientific/BundleIT.java | 96 +++++++++
.../test-bundles.xml | 34 +++
.../tika-parser-text-bundle/pom.xml | 79 +++++++
.../org/apache/tika/module/text/BundleIT.java | 96 +++++++++
.../tika-parser-text-bundle/test-bundles.xml | 34 +++
.../tika-parser-web-bundle/pom.xml | 93 ++++++++
.../org/apache/tika/module/web/BundleIT.java | 96 +++++++++
.../tika-parser-web-bundle/test-bundles.xml | 34 +++
.../tika-parser-advanced-module/pom.xml | 44 ----
.../java/org/apache/tika/module/BundleIT.java | 89 --------
.../test-bundles.xml | 34 ---
.../tika-parser-cad-module/pom.xml | 34 ---
.../tika-parser-cad-module/test-bundles.xml | 34 ---
.../tika-parser-code-module/pom.xml | 41 ----
.../java/org/apache/tika/module/BundleIT.java | 88 --------
.../tika-parser-code-module/test-bundles.xml | 34 ---
.../tika-parser-crypto-module/pom.xml | 44 ----
.../java/org/apache/tika/module/BundleIT.java | 88 --------
.../tika-parser-crypto-module/test-bundles.xml | 34 ---
.../module/database/internal/Activator.java | 36 ++++
.../tika/module/ebook/internal/Activator.java | 36 ++++
.../tika/module/journal/internal/Activator.java | 36 ++++
.../tika-parser-multimedia-module/pom.xml | 50 -----
.../java/org/apache/tika/module/BundleIT.java | 205 ------------------
.../test-bundles.xml | 34 ---
.../tika/module/office/internal/Activator.java | 36 ++++
.../services/org.apache.tika.parser.Parser | 2 +
.../tika-parser-package-module/pom.xml | 6 +-
.../tika/module/pkg/internal/Activator.java | 36 ++++
.../tika/module/pdf/internal/Activator.java | 36 ++++
.../module/scientific/internal/Activator.java | 36 ++++
.../tika/module/text/internal/Activator.java | 20 ++
.../tika/module/web/internal/Activator.java | 36 ++++
.../services/org.apache.tika.parser.Parser | 2 -
87 files changed, 3752 insertions(+), 1215 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f4024e3..c790244 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,6 +60,7 @@
<module>tika-example</module>
<module>tika-java7</module>
<module>tika-parser-modules</module>
+ <module>tika-parser-bundles</module>
</modules>
<profiles>
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/pom.xml b/tika-parser-bundles/pom.xml
index e7addc7..1b60f9f 100644
--- a/tika-parser-bundles/pom.xml
+++ b/tika-parser-bundles/pom.xml
@@ -40,10 +40,23 @@
<pdfbox.version>1.8.10</pdfbox.version>
</properties>
- <!-- <modules>
- <module>tika-multimedia-bundle</module>
+ <modules>
+ <module>tika-parser-advanced-bundle</module>
+ <module>tika-parser-cad-bundle</module>
+ <module>tika-parser-code-bundle</module>
+ <module>tika-parser-crypto-bundle</module>
+ <module>tika-parser-database-bundle</module>
+ <module>tika-parser-ebook-bundle</module>
+ <module>tika-parser-journal-bundle</module>
+ <module>tika-parser-multimedia-bundle</module>
+ <module>tika-parser-office-bundle</module>
+ <module>tika-parser-package-bundle</module>
+ <module>tika-parser-pdf-bundle</module>
+ <module>tika-parser-scientific-bundle</module>
+ <module>tika-parser-text-bundle</module>
+ <module>tika-parser-web-bundle</module>
</modules>
- -->
+
<dependencies>
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
@@ -113,4 +126,50 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <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>
+ <systemProperties>
+ <property>
+ <name>project.bundle.file</name>
+ <value>target/${project.build.finalName}.jar</value>
+ </property>
+ </systemProperties>
+ </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>
+ </plugins>
+ </pluginManagement>
+ </build>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-multimedia-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-multimedia-bundle/pom.xml b/tika-parser-bundles/tika-multimedia-bundle/pom.xml
deleted file mode 100644
index 2e48ff6..0000000
--- a/tika-parser-bundles/tika-multimedia-bundle/pom.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.tika</groupId>
- <artifactId>tika-parser-bundles</artifactId>
- <version>2.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>tika-multimedia-bundle</artifactId>
- <packaging>bundle</packaging>
- <name>Apache Tika Multimedia Bundle</name>
- <url>http://tika.apache.org/</url>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>tika-parser-multimedia-module</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Activator>org.apache.tika.module.multimedia.internal.Activator</Bundle-Activator>
- <_runsystempackages>com.sun.xml.bind.marshaller,
- com.sun.xml.internal.bind.marshaller</_runsystempackages>
- <Embed-Dependency>
- metadata-extractor,
- xmpcore,
- commons-codec,
- commons-io,
- jempbox,
- poi,
- isoparser,
- aspectjrt,
- tika-multimedia-parser-module;inline=true
- </Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- <Export-Package>
- org.apache.tika.parser.image.*,
- org.apache.tika.parser.jpeg.*,
- org.apache.tika.parser.audio.*,
- org.apache.tika.parser.video.*,
- org.apache.tika.parser.mp3.*,
- org.apache.tika.parser.mp4.*
- </Export-Package>
- <Import-Package>
- *,
- com.adobe.xmp;resolution:=optional,
- com.adobe.xmp.properties;resolution:=optional,
- android.util;resolution:=optional
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-failsafe-plugin</artifactId>
- <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>
- <systemProperties>
- <property>
- <name>project.bundle.file</name>
- <value>target/${project.build.finalName}.jar</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-multimedia-bundle/src/main/java/org/apache/tika/module/multimedia/internal/Activator.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-multimedia-bundle/src/main/java/org/apache/tika/module/multimedia/internal/Activator.java b/tika-parser-bundles/tika-multimedia-bundle/src/main/java/org/apache/tika/module/multimedia/internal/Activator.java
deleted file mode 100644
index 278fb4f..0000000
--- a/tika-parser-bundles/tika-multimedia-bundle/src/main/java/org/apache/tika/module/multimedia/internal/Activator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.module.multimedia.internal;
-
-import org.apache.tika.osgi.TikaAbstractBundleActivator;
-import org.apache.tika.parser.audio.AudioParser;
-import org.apache.tika.parser.audio.MidiParser;
-import org.apache.tika.parser.image.ImageParser;
-import org.apache.tika.parser.jpeg.JpegParser;
-import org.apache.tika.parser.mp3.Mp3Parser;
-import org.apache.tika.parser.mp4.MP4Parser;
-import org.apache.tika.parser.video.FLVParser;
-import org.osgi.framework.BundleContext;
-
-public class Activator extends TikaAbstractBundleActivator {
-
- @Override
- public void start(BundleContext context) throws Exception {
-
- registerTikaService(context, new JpegParser(), null);
- registerTikaService(context, new ImageParser(), null);
- registerTikaService(context, new AudioParser(), null);
- registerTikaService(context, new MidiParser(), null);
- registerTikaService(context, new FLVParser(), null);
- registerTikaService(context, new Mp3Parser(), null);
- registerTikaService(context, new MP4Parser(), null);
-
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-multimedia-bundle/src/test/java/org/apache/tika/module/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-multimedia-bundle/src/test/java/org/apache/tika/module/BundleIT.java b/tika-parser-bundles/tika-multimedia-bundle/src/test/java/org/apache/tika/module/BundleIT.java
deleted file mode 100644
index bd6225e..0000000
--- a/tika-parser-bundles/tika-multimedia-bundle/src/test/java/org/apache/tika/module/BundleIT.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.module;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
-import static org.ops4j.pax.exam.CoreOptions.bundle;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-
-import javax.inject.Inject;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URISyntaxException;
-import java.util.Dictionary;
-
-import org.apache.tika.io.TikaInputStream;
-import org.apache.tika.metadata.Metadata;
-import org.apache.tika.metadata.TikaCoreProperties;
-import org.apache.tika.mime.MediaType;
-import org.apache.tika.osgi.TikaService;
-import org.apache.tika.parser.ParseContext;
-import org.apache.tika.sax.BodyContentHandler;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerMethod;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.xml.sax.ContentHandler;
-
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerMethod.class)
-public class BundleIT {
-
- private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
- @Inject
- private BundleContext bc;
-
- @Configuration
- public Option[] configuration() throws IOException, URISyntaxException {
- String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
- return options(junitBundles(), mavenBundle("org.apache.tika", "tika-core"),
- bundle(new File(bundleFileName).toURI().toString()));
- }
-
- @Test
- public void testBundleLoaded() throws Exception {
- boolean hasCore = false, hasBundle = false;
- for (Bundle b : bc.getBundles()) {
- if ("org.apache.tika.core".equals(b.getSymbolicName())) {
- hasCore = true;
- assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
- }
- if ("org.apache.tika.multimedia-bundle".equals(b.getSymbolicName())) {
- hasBundle = true;
- assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
- }
- }
- assertTrue("Core bundle not found", hasCore);
- assertTrue("Image bundle not found", hasBundle);
- }
-
- @Test
- public void testImageParser() throws Exception {
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("tika.png").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be PNG", MediaType.image("png"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
-
- assertEquals("Image Output Width Should Match", "292", metadata.get(Metadata.IMAGE_WIDTH));
- }
-
- @Test
- public void testJpegParser() throws Exception {
-
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("hadoop.jpg").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be JPEG", MediaType.image("jpeg"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
-
- assertEquals("Jpg Output Width Should Match", "212", metadata.get(Metadata.IMAGE_WIDTH));
- }
- @Test
- public void testVideoParser() throws Exception {
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("testFLV.flv").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be FLV", MediaType.video("x-flv"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
-
- assertEquals("Video Should have audio", "true", metadata.get("hasAudio"));
-
- }
-
- @Test
- public void testMp3Parser() throws Exception {
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("testMP3i18n.mp3").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be MP3", MediaType.audio("mpeg"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
-
- assertEquals("MP3 should have title", "Une chason en Fran\u00e7ais", metadata.get(TikaCoreProperties.TITLE));
-
- }
-
- @Test
- public void testMidiParser() throws Exception {
- TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
- InputStream stream = bc.getBundle().getResource("testMID.mid").openStream();
-
- assertNotNull(stream);
-
- Metadata metadata = new Metadata();
- TikaInputStream tikaStream = TikaInputStream.get(stream);
- MediaType type = tikaService.detect(tikaStream, metadata);
-
- assertEquals("Media Type should be Midi", MediaType.audio("midi"), type);
-
- metadata.add(Metadata.CONTENT_TYPE, type.toString());
- Writer writer = new StringWriter();
- ContentHandler contentHandler = new BodyContentHandler(writer);
- ParseContext context = new ParseContext();
-
- tikaService.parse(tikaStream, contentHandler, metadata, context);
- assertEquals("Midi should have 2 tracks", "2", metadata.get("tracks"));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/hadoop.jpg
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/hadoop.jpg b/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/hadoop.jpg
deleted file mode 100644
index f1bc2da..0000000
Binary files a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/hadoop.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testFLV.flv
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testFLV.flv b/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testFLV.flv
deleted file mode 100644
index d35e9bb..0000000
Binary files a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testFLV.flv and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testMID.mid
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testMID.mid b/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testMID.mid
deleted file mode 100644
index 883ef37..0000000
Binary files a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testMID.mid and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testMP3i18n.mp3
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testMP3i18n.mp3 b/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testMP3i18n.mp3
deleted file mode 100644
index 0f25370..0000000
Binary files a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/testMP3i18n.mp3 and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/tika.png
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/tika.png b/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/tika.png
deleted file mode 100644
index d3487c5..0000000
Binary files a/tika-parser-bundles/tika-multimedia-bundle/src/test/resources/tika.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-advanced-bundle/module/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-advanced-bundle/module/BundleIT.java b/tika-parser-bundles/tika-parser-advanced-bundle/module/BundleIT.java
new file mode 100644
index 0000000..c446ee8
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-advanced-bundle/module/BundleIT.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-advanced-module".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Advanced bundle not found", hasBundle);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-advanced-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-advanced-bundle/pom.xml b/tika-parser-bundles/tika-parser-advanced-bundle/pom.xml
new file mode 100644
index 0000000..2339483
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-advanced-bundle/pom.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-advanced-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser advanced bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-advanced-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.advanced.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-advanced-module;inline=true,
+ opennlp-tools;inline=true,
+ opennlp-maxent;inline=true,
+ commons-io;inline=true,
+ jwnl;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.ner.*,
+ org.apache.tika.parser.ner.corenlp.*,
+ org.apache.tika.parser.ner.opennlp.*,
+ org.apache.tika.parser.ner.regex.*
+ </Export-Package>
+ <Import-Package>
+ *,
+ opennlp.maxent;resolution:=optional,
+ opennlp.tools.namefind;resolution:=optional,
+ org.apache.commons.io;resolution:=optional,
+ org.json;resolution:=optional,
+ org.osgi.framework;resolution:=optional,
+ net.didion.jwnl;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-advanced-bundle/src/test/java/org/apache/tika/module/advanced/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-advanced-bundle/src/test/java/org/apache/tika/module/advanced/BundleIT.java b/tika-parser-bundles/tika-parser-advanced-bundle/src/test/java/org/apache/tika/module/advanced/BundleIT.java
new file mode 100644
index 0000000..3f30950
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-advanced-bundle/src/test/java/org/apache/tika/module/advanced/BundleIT.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.advanced;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-advanced-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Advanced bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testNoServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertNull("Not all Services have started", services);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-advanced-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-advanced-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-advanced-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-advanced-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-cad-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-cad-bundle/pom.xml b/tika-parser-bundles/tika-parser-cad-bundle/pom.xml
new file mode 100644
index 0000000..f269a7d
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-cad-bundle/pom.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-cad-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser cad bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-cad-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.cad.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-cad-module;inline=true,
+ poi;inline=true,
+ commons-codec;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.dwg.*,
+ org.apache.tika.parser.prt.*
+ </Export-Package>
+ <Import-Package>
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-cad-bundle/src/test/java/org/apache/tika/module/cad/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-cad-bundle/src/test/java/org/apache/tika/module/cad/BundleIT.java b/tika-parser-bundles/tika-parser-cad-bundle/src/test/java/org/apache/tika/module/cad/BundleIT.java
new file mode 100644
index 0000000..849c1f4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-cad-bundle/src/test/java/org/apache/tika/module/cad/BundleIT.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.cad;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-cad-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Cad bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 1, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-cad-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-cad-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-cad-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-cad-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-code-bundle/.gitignore
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-code-bundle/.gitignore b/tika-parser-bundles/tika-parser-code-bundle/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-code-bundle/.gitignore
@@ -0,0 +1 @@
+/target/
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-code-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-code-bundle/pom.xml b/tika-parser-bundles/tika-parser-code-bundle/pom.xml
new file mode 100644
index 0000000..c900de4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-code-bundle/pom.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-code-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser code bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-code-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.code.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-code-module;inline=true,
+ asm;inline=true,
+ tagsoup;inline=true,
+ jhighlight;inline=true,
+ commons-io;inline=true,
+ commons-codec;inline=true,
+ poi;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.asm.*,
+ org.apache.tika.parser.code.*,
+ org.apache.tika.parser.executable.*
+ </Export-Package>
+ <Import-Package>
+ *,
+ javax.servlet;resolution:=optional,
+ javax.servlet.http;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-code-bundle/src/test/java/org/apache/tika/module/code/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-code-bundle/src/test/java/org/apache/tika/module/code/BundleIT.java b/tika-parser-bundles/tika-parser-code-bundle/src/test/java/org/apache/tika/module/code/BundleIT.java
new file mode 100644
index 0000000..1dda91b
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-code-bundle/src/test/java/org/apache/tika/module/code/BundleIT.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.code;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-code-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Code bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 3, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-code-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-code-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-code-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-code-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-crypto-bundle/.gitignore
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-crypto-bundle/.gitignore b/tika-parser-bundles/tika-parser-crypto-bundle/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-crypto-bundle/.gitignore
@@ -0,0 +1 @@
+/target/
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-crypto-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-crypto-bundle/pom.xml b/tika-parser-bundles/tika-parser-crypto-bundle/pom.xml
new file mode 100644
index 0000000..64203fe
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-crypto-bundle/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-crypto-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser crypto bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-crypto-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.crypto.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-crypto-module;inline=true,
+ bcmail-jdk15on;inline=true,
+ bcprov-jdk15on;inline=true,
+ bcpkix-jdk15on;inline=true,
+ commons-io;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.crypto.*,
+ </Export-Package>
+ <Import-Package>
+ *,
+ javax.mail;resolution:=optional,
+ javax.mail.internet;resolution:=optional,
+ org.bouncycastle.cert;resolution:=optional,
+ org.bouncycastle.cert.jcajce;resolution:=optional,
+ org.bouncycastle.cert.ocsp;resolution:=optional,
+ org.bouncycastle.cms.bc;resolution:=optional,
+ org.bouncycastle.operator;resolution:=optional,
+ org.bouncycastle.operator.bc;resolution:=optional,
+ org.bouncycastle.tsp;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-crypto-bundle/src/test/java/org/apache/tika/module/crypto/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-crypto-bundle/src/test/java/org/apache/tika/module/crypto/BundleIT.java b/tika-parser-bundles/tika-parser-crypto-bundle/src/test/java/org/apache/tika/module/crypto/BundleIT.java
new file mode 100644
index 0000000..46fba94
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-crypto-bundle/src/test/java/org/apache/tika/module/crypto/BundleIT.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.crypto;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-crypto-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Crypto bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 1, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-crypto-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-crypto-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-crypto-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-crypto-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-database-bundle/.gitignore
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-database-bundle/.gitignore b/tika-parser-bundles/tika-parser-database-bundle/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-database-bundle/.gitignore
@@ -0,0 +1 @@
+/target/
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-database-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-database-bundle/pom.xml b/tika-parser-bundles/tika-parser-database-bundle/pom.xml
new file mode 100644
index 0000000..972dce3
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-database-bundle/pom.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-database-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser database bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-database-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.database.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-database-module;inline=true,
+ commons-io;inline=true,
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.jdbc.*
+ </Export-Package>
+ <Import-Package>
+ *,
+ org.sqlite;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-database-bundle/src/test/java/org/apache/tika/module/database/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-database-bundle/src/test/java/org/apache/tika/module/database/BundleIT.java b/tika-parser-bundles/tika-parser-database-bundle/src/test/java/org/apache/tika/module/database/BundleIT.java
new file mode 100644
index 0000000..b431da5
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-database-bundle/src/test/java/org/apache/tika/module/database/BundleIT.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.database;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-database-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Database bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 1, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-database-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-database-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-database-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-database-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-ebook-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-ebook-bundle/pom.xml b/tika-parser-bundles/tika-parser-ebook-bundle/pom.xml
new file mode 100644
index 0000000..742ec99
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-ebook-bundle/pom.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-ebook-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser ebook bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-ebook-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-text-bundle</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.ebook.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-ebook-module;inline=true,
+ commons-io;inline=true,
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.epub.*
+ </Export-Package>
+ <Import-Package>
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
[2/3] tika git commit: TIKA-1860 - Added bundle poms and tests to
tika-parsers-bundle folder
Posted by bo...@apache.org.
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-ebook-bundle/src/test/java/org/apache/tika/module/ebook/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-ebook-bundle/src/test/java/org/apache/tika/module/ebook/BundleIT.java b/tika-parser-bundles/tika-parser-ebook-bundle/src/test/java/org/apache/tika/module/ebook/BundleIT.java
new file mode 100644
index 0000000..9af01f8
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-ebook-bundle/src/test/java/org/apache/tika/module/ebook/BundleIT.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.ebook;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File("target/test-bundles/tika-parser-text-bundle.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-ebook-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("E-Book bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 4, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-ebook-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-ebook-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-ebook-bundle/test-bundles.xml
new file mode 100644
index 0000000..65978d0
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-ebook-bundle/test-bundles.xml
@@ -0,0 +1,35 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ <include>org.apache.tika:tika-parser-text-bundle</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-journal-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-journal-bundle/pom.xml b/tika-parser-bundles/tika-parser-journal-bundle/pom.xml
new file mode 100644
index 0000000..c03cb4b
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-journal-bundle/pom.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-journal-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser journal bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-journal-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-pdf-bundle</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.journal.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-journal-module;inline=true,
+ commons-io;inline=true,
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.journal.*
+ </Export-Package>
+ <Import-Package>
+ *,
+ javax.ws.rs.core;resolution:=optional,
+ org.apache.cxf.jaxrs.client;resolution:=optional,
+ org.apache.cxf.jaxrs.ext.multipart;resolution:=optional,
+ org.json;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-journal-bundle/src/test/java/org/apache/tika/module/journal/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-journal-bundle/src/test/java/org/apache/tika/module/journal/BundleIT.java b/tika-parser-bundles/tika-parser-journal-bundle/src/test/java/org/apache/tika/module/journal/BundleIT.java
new file mode 100644
index 0000000..6d65164
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-journal-bundle/src/test/java/org/apache/tika/module/journal/BundleIT.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.journal;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File("target/test-bundles/tika-parser-pdf-bundle.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-journal-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Journal bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 2, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-journal-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-journal-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-journal-bundle/test-bundles.xml
new file mode 100644
index 0000000..8cd36d6
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-journal-bundle/test-bundles.xml
@@ -0,0 +1,35 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ <include>org.apache.tika:tika-parser-pdf-bundle</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-multimedia-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-multimedia-bundle/pom.xml b/tika-parser-bundles/tika-parser-multimedia-bundle/pom.xml
new file mode 100644
index 0000000..85e09f8
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-multimedia-bundle/pom.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-multimedia-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser multimedia bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-multimedia-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.multimedia.internal.Activator</Bundle-Activator>
+ <_runsystempackages>com.sun.xml.bind.marshaller,
+ com.sun.xml.internal.bind.marshaller</_runsystempackages>
+ <Embed-Dependency>
+ tika-parser-multimedia-module;inline=true,
+ metadata-extractor;inline=true,
+ xmpcore;inline=true,
+ commons-codec;inline=true,
+ commons-io;inline=true,
+ jempbox;inline=true,
+ fontbox;inline=true,
+ poi;inline=true,
+ isoparser;inline=true,
+ aspectjrt;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.image.*,
+ org.apache.tika.parser.jpeg.*,
+ org.apache.tika.parser.audio.*,
+ org.apache.tika.parser.video.*,
+ org.apache.tika.parser.mp3.*,
+ org.apache.tika.parser.mp4.*
+ </Export-Package>
+ <Import-Package>
+ *,
+ com.adobe.xmp;resolution:=optional,
+ com.adobe.xmp.properties;resolution:=optional,
+ android.util;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/java/org/apache/tika/module/multimedia/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/java/org/apache/tika/module/multimedia/BundleIT.java b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/java/org/apache/tika/module/multimedia/BundleIT.java
new file mode 100644
index 0000000..10568ca
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/java/org/apache/tika/module/multimedia/BundleIT.java
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.multimedia;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(), mavenBundle("org.apache.tika", "tika-core"),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-multimedia-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Multimedia bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 14, services.length);
+ }
+
+ @Test
+ public void testImageParser() throws Exception {
+ TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
+ InputStream stream = bc.getBundle().getResource("tika.png").openStream();
+
+ assertNotNull(stream);
+
+ Metadata metadata = new Metadata();
+ TikaInputStream tikaStream = TikaInputStream.get(stream);
+ MediaType type = tikaService.detect(tikaStream, metadata);
+
+ assertEquals("Media Type should be PNG", MediaType.image("png"), type);
+
+ metadata.add(Metadata.CONTENT_TYPE, type.toString());
+ Writer writer = new StringWriter();
+ ContentHandler contentHandler = new BodyContentHandler(writer);
+ ParseContext context = new ParseContext();
+
+ tikaService.parse(tikaStream, contentHandler, metadata, context);
+
+ assertEquals("Image Output Width Should Match", "292", metadata.get(Metadata.IMAGE_WIDTH));
+ }
+
+ @Test
+ public void testJpegParser() throws Exception {
+
+ TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
+ InputStream stream = bc.getBundle().getResource("hadoop.jpg").openStream();
+
+ assertNotNull(stream);
+
+ Metadata metadata = new Metadata();
+ TikaInputStream tikaStream = TikaInputStream.get(stream);
+ MediaType type = tikaService.detect(tikaStream, metadata);
+
+ assertEquals("Media Type should be JPEG", MediaType.image("jpeg"), type);
+
+ metadata.add(Metadata.CONTENT_TYPE, type.toString());
+ Writer writer = new StringWriter();
+ ContentHandler contentHandler = new BodyContentHandler(writer);
+ ParseContext context = new ParseContext();
+
+ tikaService.parse(tikaStream, contentHandler, metadata, context);
+
+ assertEquals("Jpg Output Width Should Match", "212", metadata.get(Metadata.IMAGE_WIDTH));
+ }
+ @Test
+ public void testVideoParser() throws Exception {
+ TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
+ InputStream stream = bc.getBundle().getResource("testFLV.flv").openStream();
+
+ assertNotNull(stream);
+
+ Metadata metadata = new Metadata();
+ TikaInputStream tikaStream = TikaInputStream.get(stream);
+ MediaType type = tikaService.detect(tikaStream, metadata);
+
+ assertEquals("Media Type should be FLV", MediaType.video("x-flv"), type);
+
+ metadata.add(Metadata.CONTENT_TYPE, type.toString());
+ Writer writer = new StringWriter();
+ ContentHandler contentHandler = new BodyContentHandler(writer);
+ ParseContext context = new ParseContext();
+
+ tikaService.parse(tikaStream, contentHandler, metadata, context);
+
+ assertEquals("Video Should have audio", "true", metadata.get("hasAudio"));
+
+ }
+
+ @Test
+ public void testMp3Parser() throws Exception {
+ TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
+ InputStream stream = bc.getBundle().getResource("testMP3i18n.mp3").openStream();
+
+ assertNotNull(stream);
+
+ Metadata metadata = new Metadata();
+ TikaInputStream tikaStream = TikaInputStream.get(stream);
+ MediaType type = tikaService.detect(tikaStream, metadata);
+
+ assertEquals("Media Type should be MP3", MediaType.audio("mpeg"), type);
+
+ metadata.add(Metadata.CONTENT_TYPE, type.toString());
+ Writer writer = new StringWriter();
+ ContentHandler contentHandler = new BodyContentHandler(writer);
+ ParseContext context = new ParseContext();
+
+ tikaService.parse(tikaStream, contentHandler, metadata, context);
+
+ assertEquals("MP3 should have title", "Une chason en Fran\u00e7ais", metadata.get(TikaCoreProperties.TITLE));
+
+ }
+
+ @Test
+ public void testMidiParser() throws Exception {
+ TikaService tikaService = bc.getService(bc.getServiceReference(TikaService.class));
+ InputStream stream = bc.getBundle().getResource("testMID.mid").openStream();
+
+ assertNotNull(stream);
+
+ Metadata metadata = new Metadata();
+ TikaInputStream tikaStream = TikaInputStream.get(stream);
+ MediaType type = tikaService.detect(tikaStream, metadata);
+
+ assertEquals("Media Type should be Midi", MediaType.audio("midi"), type);
+
+ metadata.add(Metadata.CONTENT_TYPE, type.toString());
+ Writer writer = new StringWriter();
+ ContentHandler contentHandler = new BodyContentHandler(writer);
+ ParseContext context = new ParseContext();
+
+ tikaService.parse(tikaStream, contentHandler, metadata, context);
+ assertEquals("Midi should have 2 tracks", "2", metadata.get("tracks"));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/hadoop.jpg
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/hadoop.jpg b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/hadoop.jpg
new file mode 100644
index 0000000..f1bc2da
Binary files /dev/null and b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/hadoop.jpg differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testFLV.flv
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testFLV.flv b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testFLV.flv
new file mode 100644
index 0000000..d35e9bb
Binary files /dev/null and b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testFLV.flv differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testMID.mid
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testMID.mid b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testMID.mid
new file mode 100644
index 0000000..883ef37
Binary files /dev/null and b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testMID.mid differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testMP3i18n.mp3
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testMP3i18n.mp3 b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testMP3i18n.mp3
new file mode 100644
index 0000000..0f25370
Binary files /dev/null and b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/testMP3i18n.mp3 differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/tika.png
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/tika.png b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/tika.png
new file mode 100644
index 0000000..d3487c5
Binary files /dev/null and b/tika-parser-bundles/tika-parser-multimedia-bundle/src/test/resources/tika.png differ
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-multimedia-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-multimedia-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-multimedia-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-multimedia-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-office-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-office-bundle/pom.xml b/tika-parser-bundles/tika-parser-office-bundle/pom.xml
new file mode 100644
index 0000000..cd6ef7f
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-office-bundle/pom.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-office-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser office bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-office-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-package-bundle</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-web-bundle</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-text-bundle</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.office.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-office-module;inline=true,
+ commons-lang;inline=true,
+ commons-io;inline=true,
+ commons-codec;inline=true,
+ poi;inline=true,
+ poi-scratchpad;inline=true,
+ poi-ooxml;inline=true,
+ poi-ooxml-schemas;inline=true;
+ jackcess;inline=true,
+ jackcess-encrypt;inline=true,
+ java-libpst;inline=true,
+ curvesapi;inline=true,
+ xmlbeans;inline=true,
+ bcprov-jdk15on;inline=true,
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.chm.*,
+ org.apache.tika.parser.mbox.*,
+ org.apache.tika.parser.microsoft.*,
+ org.apache.tika.parser.microsoft.ooxml.*,
+ org.apache.tika.parser.odf.*,
+ org.apache.tika.parser.opendocument.*,
+ org.apache.tika.parser.rtf.*
+ </Export-Package>
+ <Import-Package>
+ !org.junit,
+ !org.junit.*,
+ !junit.*,
+ *,
+ com.microsoft.schemas.office.powerpoint;resolution:=optional,
+ com.microsoft.schemas.office.word;resolution:=optional,
+ com.sun.javadoc;resolution:=optional,
+ com.sun.xml.bind.marshaller;resolution:=optional,
+ com.sun.xml.internal.bind.marshaller;resolution:=optional,
+ com.sun.msv.datatype;resolution:=optional,
+ com.sun.msv.datatype.xsd;resolution:=optional,
+ com.sun.tools.javadoc;resolution:=optional,
+ org.apache.crimson.jaxp;resolution:=optional,
+ org.apache.jcp.xml.dsig.internal.dom;resolution:=optional,
+ org.apache.tools.ant;resolution:=optional,
+ org.apache.tools.ant.taskdefs;resolution:=optional,
+ org.apache.tools.ant.types;resolution:=optional,
+ org.apache.xml.resolver;resolution:=optional,
+ org.apache.xml.resolver.tools;resolution:=optional,
+ org.apache.xml.security;resolution:=optional,
+ org.apache.xml.security.c14n;resolution:=optional,
+ org.apache.xml.security.utils;resolution:=optional,
+ org.apache.xmlbeans.impl.xpath.saxon;resolution:=optional,
+ org.apache.xmlbeans.impl.xquery.saxon;resolution:=optional,
+ org.bouncycastle.cert;resolution:=optional,
+ org.bouncycastle.cert.jcajce;resolution:=optional,
+ org.bouncycastle.cert.ocsp;resolution:=optional,
+ org.bouncycastle.cms;resolution:=optional,
+ org.bouncycastle.cms.bc;resolution:=optional,
+ org.bouncycastle.operator;resolution:=optional,
+ org.bouncycastle.operator.bc;resolution:=optional,
+ org.bouncycastle.tsp;resolution:=optional,
+ org.etsi.uri.x01903.v14;resolution:=optional,
+ org.openxmlformats.schemas.officeDocument.x2006.math;resolution:=optional,
+ org.openxmlformats.schemas.schemaLibrary.x2006.main;resolution:=optional,
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-office-bundle/src/test/java/org/apache/tika/module/office/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-office-bundle/src/test/java/org/apache/tika/module/office/BundleIT.java b/tika-parser-bundles/tika-parser-office-bundle/src/test/java/org/apache/tika/module/office/BundleIT.java
new file mode 100644
index 0000000..7b0ca8b
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-office-bundle/src/test/java/org/apache/tika/module/office/BundleIT.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.office;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+
+import java.net.URISyntaxException;
+
+import org.apache.tika.parser.Parser;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File("target/test-bundles/tika-parser-web-bundle.jar").toURI().toURL().toString()),
+ bundle(new File("target/test-bundles/tika-parser-package-bundle.jar").toURI().toURL().toString()),
+ bundle(new File("target/test-bundles/tika-parser-text-bundle.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-office-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Office bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 21, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-office-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-office-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-office-bundle/test-bundles.xml
new file mode 100644
index 0000000..d106357
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-office-bundle/test-bundles.xml
@@ -0,0 +1,37 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ <include>org.apache.tika:tika-parser-web-bundle</include>
+ <include>org.apache.tika:tika-parser-package-bundle</include>
+ <include>org.apache.tika:tika-parser-text-bundle</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-package-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-package-bundle/pom.xml b/tika-parser-bundles/tika-parser-package-bundle/pom.xml
new file mode 100644
index 0000000..bbd917f
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-package-bundle/pom.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-package-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser package bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-package-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.pkg.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-package-module;inline=true,
+ commons-io;inline=true,
+ commons-codec;inline=true,
+ xz;inline=true,
+ poi;inline=true,
+ poi-ooxml;inline=true,
+ poi-ooxml-schemas;inline=true,
+ xmlbeans;inline=true,
+ commons-compress;inline=true,
+ junrar;inline=true,
+ curvesapi;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.pkg.*,
+ org.apache.tika.parser.iwork.*
+ </Export-Package>
+ <Import-Package>
+ !org.junit,
+ !org.junit.*,
+ !junit.*,
+ *,
+ com.microsoft.schemas.office.powerpoint;resolution:=optional,
+ com.microsoft.schemas.office.word;resolution:=optional,
+ org.apache.commons.vfs2;resolution:=optional,
+ org.apache.commons.vfs2.provider;resolution:=optional,
+ org.apache.commons.vfs2.util;resolution:=optional,
+ org.apache.crimson.jaxp;resolution:=optional,
+ org.apache.jcp.xml.dsig.internal.dom;resolution:=optional,
+ org.apache.xml.resolver;resolution:=optional,
+ org.apache.xml.resolver.tools;resolution:=optional,
+ org.apache.xml.security;resolution:=optional,
+ org.apache.xml.security.c14n;resolution:=optional,
+ org.apache.xml.security.utils;resolution:=optional,
+ org.apache.xmlbeans.impl.xpath.saxon;resolution:=optional,
+ org.apache.xmlbeans.impl.xquery.saxon;resolution:=optional,
+ com.sun.javadoc;resolution:=optional,
+ com.sun.xml.bind.marshaller;resolution:=optional,
+ com.sun.xml.internal.bind.marshaller;resolution:=optional,
+ com.sun.msv.datatype;resolution:=optional,
+ com.sun.msv.datatype.xsd;resolution:=optional,
+ com.sun.tools.javadoc;resolution:=optional,
+ org.apache.poi.hdgf.extractor;resolution:=optional,
+ org.apache.poi.hpbf.extractor;resolution:=optional,
+ org.apache.poi.hslf.blip;resolution:=optional,
+ org.apache.poi.hslf.extractor;resolution:=optional,
+ org.apache.poi.hsmf;resolution:=optional,
+ org.apache.poi.hsmf.datatypes;resolution:=optional,
+ org.apache.poi.hsmf.extractor;resolution:=optional,
+ org.apache.poi.hwpf;resolution:=optional,
+ org.apache.poi.hwpf.extractor;resolution:=optional,
+ org.apache.tools.ant;resolution:=optional,
+ org.apache.tools.ant.taskdefs;resolution:=optional,
+ org.apache.tools.ant.types;resolution:=optional,
+ org.bouncycastle.asn1;resolution:=optional,
+ org.bouncycastle.asn1.cmp;resolution:=optional,
+ org.bouncycastle.asn1.nist;resolution:=optional,
+ org.bouncycastle.asn1.ocsp;resolution:=optional,
+ org.bouncycastle.asn1.x500;resolution:=optional,
+ org.bouncycastle.asn1.x509;resolution:=optional,
+ org.bouncycastle.cert;resolution:=optional,
+ org.bouncycastle.cert.jcajce;resolution:=optional,
+ org.bouncycastle.cert.ocsp;resolution:=optional,
+ org.bouncycastle.cms;resolution:=optional,
+ org.bouncycastle.cms.bc;resolution:=optional,
+ org.bouncycastle.operator;resolution:=optional,
+ org.bouncycastle.operator.bc;resolution:=optional,
+ org.bouncycastle.tsp;resolution:=optional,
+ org.bouncycastle.util;resolution:=optional,
+ org.etsi.uri.x01903.v14;resolution:=optional,
+ org.openxmlformats.schemas.officeDocument.x2006.math;resolution:=optional,
+ org.openxmlformats.schemas.schemaLibrary.x2006.main;resolution:=optional,
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-package-bundle/src/test/java/org/apache/tika/module/pkg/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-package-bundle/src/test/java/org/apache/tika/module/pkg/BundleIT.java b/tika-parser-bundles/tika-parser-package-bundle/src/test/java/org/apache/tika/module/pkg/BundleIT.java
new file mode 100644
index 0000000..afe8911
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-package-bundle/src/test/java/org/apache/tika/module/pkg/BundleIT.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.pkg;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-package-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Package bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 4, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-package-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-package-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-package-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-package-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-pdf-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-pdf-bundle/pom.xml b/tika-parser-bundles/tika-parser-pdf-bundle/pom.xml
new file mode 100644
index 0000000..08cd863
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-pdf-bundle/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-pdf-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser pdf bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-pdf-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.pdf.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-pdf-module;inline=true,
+ commons-io;inline=true,
+ pdfbox;inline=true,
+ bcmail-jdk15on;inline=true,
+ bcprov-jdk15on;inline=true,
+ fontbox;inline=true,
+ jempbox;inline=true,
+ bcpkix-jdk15on;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.pdf.*
+ </Export-Package>
+ <Import-Package>
+ *,
+ com.ibm.icu.text;resolution:=optional,
+ javax.mail;resolution:=optional,
+ javax.mail.internet;resolution:=optional,
+ org.bouncycastle.cert;resolution:=optional,
+ org.bouncycastle.cert.jcajce;resolution:=optional,
+ org.bouncycastle.cert.ocsp;resolution:=optional,
+ org.bouncycastle.cms.bc;resolution:=optional,
+ org.bouncycastle.operator;resolution:=optional,
+ org.bouncycastle.operator.bc;resolution:=optional,
+ org.bouncycastle.tsp;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-pdf-bundle/src/test/java/org/apache/tika/module/pdf/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-pdf-bundle/src/test/java/org/apache/tika/module/pdf/BundleIT.java b/tika-parser-bundles/tika-parser-pdf-bundle/src/test/java/org/apache/tika/module/pdf/BundleIT.java
new file mode 100644
index 0000000..bbc72bb
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-pdf-bundle/src/test/java/org/apache/tika/module/pdf/BundleIT.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.pdf;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-pdf-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("PDF bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 1, services.length);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-pdf-bundle/test-bundles.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-pdf-bundle/test-bundles.xml b/tika-parser-bundles/tika-parser-pdf-bundle/test-bundles.xml
new file mode 100644
index 0000000..53bb6e4
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-pdf-bundle/test-bundles.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bundles</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory/>
+ <outputFileNameMapping>${artifact.artifactId}.jar</outputFileNameMapping>
+ <includes>
+ <include>org.apache.tika:tika-core</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-scientific-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-scientific-bundle/pom.xml b/tika-parser-bundles/tika-parser-scientific-bundle/pom.xml
new file mode 100644
index 0000000..578ecab
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-scientific-bundle/pom.xml
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parser-bundles</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tika-parser-scientific-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Tika parser scientific bundle</name>
+ <url>http://tika.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-parser-scientific-module</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-core</artifactId>
+ <version>3.2.2</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.apache.tika.module.scientific.internal.Activator</Bundle-Activator>
+ <Embed-Dependency>
+ tika-parser-scientific-module;inline=true,
+ commons-csv;inline=true,
+ commons-exec;inline=true,
+ commons-codec;inline=true,
+ commons-io;inline=true,
+ json-simple;inline=true,
+ sis-utility;inline=true,
+ sis-netcdf;inline=true,
+ sis-metadata;inline=true,
+ sis-storage;inline=true,
+ netcdf4;inline=true,
+ grib;inline=true,
+ cdm;inline=true,
+ httpservices;inline=true,
+ jmatio;inline=true,
+ jsr-275;inline=true,
+ jcip-annotations;inline=true,
+ opennlp-tools;inline=true,
+ opennlp-maxent;inline=true,
+ jwnl;inline=true,
+ geoapi;inline=true
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Export-Package>
+ org.apache.tika.parser.ctakes.*,
+ org.apache.tika.parser.dif.*,
+ org.apache.tika.parser.envi.*,
+ org.apache.tika.parser.gdal.*
+ </Export-Package>
+ <Import-Package>
+ !org.apache.ctakes.*,
+ !org.apache.uima.*,
+ *,
+ colorspace;resolution:=optional,
+ org.apache.sis;resolution:=optional,
+ org.apache.sis.distance;resolution:=optional,
+ org.apache.sis.geometry;resolution:=optional,
+ com.beust.jcommander;resolution:=optional,
+ com.google.common.base;resolution:=optional,
+ com.google.common.math;resolution:=optional,
+ com.google.protobuf;resolution:=optional,
+ ucar.units;resolution:=optional,
+ ucar.httpservices;resolution:=optional,
+ ucar.nc2.util;resolution:=optional,
+ ucar.nc2.util.cache;resolution:=optional,
+ ucar.nc2.dataset;resolution:=optional,
+ ucar.nc2;resolution:=optional,
+ ucar.nc2.constants;resolution:=optional,
+ ucar.nc2.dt;resolution:=optional,
+ ucar.nc2.dt.grid;resolution:=optional,
+ ucar.nc2.ft;resolution:=optional,
+ ucar.nc2.iosp;resolution:=optional,
+ ucar.nc2.iosp.hdf4;resolution:=optional,
+ ucar.nc2.ncml;resolution:=optional,
+ ucar.nc2.stream;resolution:=optional,
+ ucar.nc2.time;resolution:=optional,
+ ucar.nc2.units;resolution:=optional,
+ ucar.nc2.wmo;resolution:=optional,
+ ucar.nc2.write;resolution:=optional,
+ ucar.ma2;resolution:=optional,
+ ucar.grib;resolution:=optional,
+ ucar.grib.grib1;resolution:=optional,
+ ucar.grib.grib2;resolution:=optional,
+ ucar.grid;resolution:=optional,
+ ucar.unidata.geoloc;resolution:=optional,
+ ucar.unidata.geoloc.projection;resolution:=optional,
+ ucar.unidata.geoloc.projection.proj4;resolution:=optional,
+ ucar.unidata.geoloc.projection.sat;resolution:=optional,
+ ucar.unidata.io;resolution:=optional,
+ ucar.unidata.util;resolution:=optional,
+ com.jmatio.io;resolution:=optional,
+ com.sun.jna;resolution:=optional,
+ com.sun.jna.ptr;resolution:=optional,
+ com.sun.xml.bind.marshaller;resolution:=optional,
+ com.sun.xml.internal.bind.marshaller;resolution:=optional,
+ com.sun.msv.datatype;resolution:=optional,
+ com.sun.msv.datatype.xsd;resolution:=optional,
+ com.sun.tools.javadoc;resolution:=optional,
+ sun.misc;resolution:=optional,
+ sun.reflect.generics.reflectiveObjects;resolution:=optional,
+ org.quartz;resolution:=optional,
+ org.quartz.impl;resolution:=optional,
+ icc;resolution:=optional,
+ org.jdom;resolution:=optional,
+ org.jdom.input;resolution:=optional,
+ org.jdom.output;resolution:=optional,
+ org.jdom2;resolution:=optional,
+ org.jdom2.input;resolution:=optional,
+ org.jdom2.input.sax;resolution:=optional,
+ org.jdom2.output;resolution:=optional,
+ org.jdom2.filter;resolution:=optional,
+ javax.measure.converter;resolution:=optional,
+ javax.servlet.annotation;resolution:=optional,
+ javax.servlet;resolution:=optional,
+ javax.servlet.http;resolution:=optional,
+ jj2000.j2k.codestream;resolution:=optional,
+ jj2000.j2k.codestream.reader;resolution:=optional,
+ jj2000.j2k.decoder;resolution:=optional,
+ jj2000.j2k.entropy.decoder;resolution:=optional,
+ jj2000.j2k.fileformat.reader;resolution:=optional,
+ jj2000.j2k.image;resolution:=optional,
+ jj2000.j2k.image.invcomptransf;resolution:=optional,
+ jj2000.j2k.image.output;resolution:=optional,
+ jj2000.j2k.io;resolution:=optional,
+ jj2000.j2k.quantization.dequantizer;resolution:=optional,
+ jj2000.j2k.roi;resolution:=optional,
+ jj2000.j2k.util;resolution:=optional,
+ jj2000.j2k.wavelet.synthesis;resolution:=optional,
+ org.itadaki.bzip2;resolution:=optional,
+ org.jsoup;resolution:=optional,
+ org.jsoup.nodes;resolution:=optional,
+ org.jsoup.select;resolution:=optional,
+ opennlp.maxent;resolution:=optional,
+ opennlp.tools.namefind;resolution:=optional,
+ net.didion.jwnl;resolution:=optional,
+ org.joda.time;resolution:=optional,
+ org.joda.time.chrono;resolution:=optional,
+ org.joda.time.field;resolution:=optional,
+ org.joda.time.format;resolution:=optional,
+ org.apache.http;resolution:=optional,
+ org.apache.http.auth;resolution:=optional,
+ org.apache.http.client;resolution:=optional,
+ org.apache.http.client.entity;resolution:=optional,
+ org.apache.http.client.methods;resolution:=optional,
+ org.apache.http.conn;resolution:=optional,
+ org.apache.http.conn.scheme;resolution:=optional,
+ org.apache.http.cookie;resolution:=optional,
+ org.apache.http.entity;resolution:=optional,
+ org.apache.http.impl.client;resolution:=optional,
+ org.apache.http.impl.conn;resolution:=optional,
+ org.apache.http.message;resolution:=optional,
+ org.apache.http.params;resolution:=optional,
+ org.apache.http.protocol;resolution:=optional,
+ org.apache.http.util;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tika/blob/9f8d6aed/tika-parser-bundles/tika-parser-scientific-bundle/src/test/java/org/apache/tika/module/scientific/BundleIT.java
----------------------------------------------------------------------
diff --git a/tika-parser-bundles/tika-parser-scientific-bundle/src/test/java/org/apache/tika/module/scientific/BundleIT.java b/tika-parser-bundles/tika-parser-scientific-bundle/src/test/java/org/apache/tika/module/scientific/BundleIT.java
new file mode 100644
index 0000000..503bc44
--- /dev/null
+++ b/tika-parser-bundles/tika-parser-scientific-bundle/src/test/java/org/apache/tika/module/scientific/BundleIT.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.module.scientific;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.osgi.TikaService;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.ContentHandler;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class BundleIT {
+
+ private static final String BUNDLE_JAR_SYS_PROP = "project.bundle.file";
+
+ @Inject
+ private BundleContext bc;
+
+ @Configuration
+ public Option[] configuration() throws IOException, URISyntaxException {
+ String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
+ return options(junitBundles(),
+ bundle(new File("target/test-bundles/tika-core.jar").toURI().toURL().toString()),
+ bundle(new File(bundleFileName).toURI().toString()));
+ }
+
+ @Test
+ public void testBundleLoaded() throws Exception {
+ boolean hasCore = false, hasBundle = false;
+ for (Bundle b : bc.getBundles()) {
+ if ("org.apache.tika.core".equals(b.getSymbolicName())) {
+ hasCore = true;
+ assertEquals("Core not activated", Bundle.ACTIVE, b.getState());
+ }
+ if ("org.apache.tika.parser-scientific-bundle".equals(b.getSymbolicName())) {
+ hasBundle = true;
+ assertEquals("Bundle not activated", Bundle.ACTIVE, b.getState());
+ }
+ }
+ assertTrue("Core bundle not found", hasCore);
+ assertTrue("Scientific bundle not found", hasBundle);
+ }
+
+ @Test
+ public void testServicesCreated() throws Exception {
+ ServiceReference[] services = bc.getAllServiceReferences(Parser.class.getName(), null);
+ assertEquals("Not all Services have started", 10, services.length);
+ }
+}