ANY23-304 Add extractor for OpenIE
Project: http://git-wip-us.apache.org/repos/asf/any23/repo Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/ef146144 Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/ef146144 Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/ef146144 Branch: refs/heads/master Commit: ef14614473f608d275eecd4c10b3ab2e50391167 Parents: b39d220 Author: Lewis John McGibbney <[email protected]> Authored: Wed Aug 23 12:15:56 2017 -0700 Committer: Lewis John McGibbney <[email protected]> Committed: Wed Aug 23 12:15:56 2017 -0700 ---------------------------------------------------------------------- cli/pom.xml | 5 +++-- .../java/org/apache/any23/plugin/PluginIT.java | 21 ++++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/any23/blob/ef146144/cli/pom.xml ---------------------------------------------------------------------- diff --git a/cli/pom.xml b/cli/pom.xml index 79e8cab..8700f92 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -70,12 +70,13 @@ <type>test-jar</type> <scope>test</scope> </dependency> - <dependency> + <!-- Disabled due to memory overhead during test execution --> + <!--dependency> <groupId>${project.groupId}</groupId> <artifactId>apache-any23-openie</artifactId> <version>${project.version}</version> <scope>runtime</scope> - </dependency> + </dependency--> <dependency> <groupId>${project.groupId}.plugins</groupId> <artifactId>apache-any23-office-scraper</artifactId> http://git-wip-us.apache.org/repos/asf/any23/blob/ef146144/plugins/integration-test/src/test/java/org/apache/any23/plugin/PluginIT.java ---------------------------------------------------------------------- diff --git a/plugins/integration-test/src/test/java/org/apache/any23/plugin/PluginIT.java b/plugins/integration-test/src/test/java/org/apache/any23/plugin/PluginIT.java index 1abeb2b..1b69463 100644 --- a/plugins/integration-test/src/test/java/org/apache/any23/plugin/PluginIT.java +++ b/plugins/integration-test/src/test/java/org/apache/any23/plugin/PluginIT.java @@ -41,7 +41,9 @@ import static org.junit.Assert.assertTrue; */ public class PluginIT { - private static final int NUM_OF_EXTRACTORS = 34; + private static final int NUM_OF_EXTRACTORS_INCL_OPENIE = 34; + + private static final int NUM_OF_EXTRACTORS_EXCL_OPENIE = 33; private static final String PLUGIN_DIR = "target/plugins-build/"; @@ -79,12 +81,19 @@ public class PluginIT { new ExtractorRegistryImpl(), HTML_SCRAPER_TARGET_DIR, // Required to satisfy class dependencies. HTML_SCRAPER_DEPENDENCY_DIR, - OFFICE_SCRAPER_TARGET_DIR -, OFFICE_SCRAPER_DEPENDENCY_DIR // Required to satisfy class dependencies. - ); - assertEquals("Did not find the number of expected extractors", NUM_OF_EXTRACTORS , // HTMLScraper Plugin, OfficeScraper Plugin. - extractorGroup.getNumOfExtractors() + OFFICE_SCRAPER_TARGET_DIR, + OFFICE_SCRAPER_DEPENDENCY_DIR // Required to satisfy class dependencies. ); + try { + Class.forName("org.apache.any23.extractor.openie.OpenIEExtractor", false, this.getClass().getClassLoader()); + assertEquals("Did not find the number of expected extractors", NUM_OF_EXTRACTORS_INCL_OPENIE , + extractorGroup.getNumOfExtractors() + ); + } catch (ClassNotFoundException e) { + assertEquals("Did not find the number of expected extractors", NUM_OF_EXTRACTORS_EXCL_OPENIE , + extractorGroup.getNumOfExtractors() + ); + } } /**
