You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2012/05/11 14:46:36 UTC
svn commit: r1337129 - in /incubator/stanbol/trunk/entityhub/indexing:
core/src/main/java/org/apache/stanbol/entityhub/indexing/core/
core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/
core/src/test/java/org/apache/stanbol/entityhub/...
Author: rwesten
Date: Fri May 11 12:46:36 2012
New Revision: 1337129
URL: http://svn.apache.org/viewvc?rev=1337129&view=rev
Log:
fix for STANBOL-610. See comments of the Issue for details
Modified:
incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/IndexerFactory.java
incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java
incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/ConfigTest.java
incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/IndexerTest.java
incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/test/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestinationTest.java
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/test/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSourceTest.java
Modified: incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/IndexerFactory.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/IndexerFactory.java?rev=1337129&r1=1337128&r2=1337129&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/IndexerFactory.java (original)
+++ incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/IndexerFactory.java Fri May 11 12:46:36 2012
@@ -80,8 +80,22 @@ public class IndexerFactory {
* not found or is not valid
*/
public Indexer create(String dir){
+ return create(dir, null);
+ }
+ /**
+ * Internally used for unit testing
+ * @param dir
+ * @param classpathOffset
+ * @return
+ */
+ protected Indexer create(String dir,String classpathOffset){
Indexer indexer;
- IndexingConfig config = new IndexingConfig(dir);
+ IndexingConfig config;
+ if(classpathOffset != null){
+ config= new IndexingConfig(dir,classpathOffset){};
+ } else {
+ config= new IndexingConfig(dir);
+ }
//get the mode based on the configured IndexingComponents
EntityDataIterable dataIterable = config.getDataInterable();
EntityIterator idIterator = config.getEntityIdIterator();
Modified: incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java?rev=1337129&r1=1337128&r2=1337129&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java (original)
+++ incubator/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java Fri May 11 12:46:36 2012
@@ -69,10 +69,14 @@ import org.slf4j.LoggerFactory;
public class IndexingConfig {
private static final String DEFAULT_ROOT_PATH = "indexing";
- private static final String CONFIG_PATH = "config";
- private static final String SOURCE_PATH = "resources";
- private static final String DESTINATION_PATH = "destination";
- private static final String DISTRIBUTION_PATH = "dist";
+ private static final String CONFIG_FOLDER = "config";
+ private static final String CONFIG_PATH = DEFAULT_ROOT_PATH+File.separatorChar+CONFIG_FOLDER;
+ private static final String SOURCE_FOLDER = "resources";
+ private static final String SOURCE_PATH = DEFAULT_ROOT_PATH+File.separatorChar+SOURCE_FOLDER;
+ private static final String DESTINATION_FOLDER = "destination";
+ private static final String DESTINATION_PATH = DEFAULT_ROOT_PATH+File.separatorChar+DESTINATION_FOLDER;
+ private static final String DISTRIBUTION_FOLDER = "dist";
+ private static final String DISTRIBUTION_PATH = DEFAULT_ROOT_PATH+File.separatorChar+DISTRIBUTION_FOLDER;
private static final String INDEXING_PROERTIES = "indexing.properties";
private static final String CONFIG_PARAM = "config";
public static final String KEY_INDEXING_CONFIG = "indexingConfig";
@@ -100,32 +104,32 @@ public class IndexingConfig {
* The root directory for the indexing (defaults to {@link #DEFAULT_ROOT_PATH})
*/
private final File rootDir;
- /**
- * The root directory for the configuration
- */
- private final File configDir;
- /**
- * The root directory for the resources (indexing source files)
- */
- private final File sourceDir;
- /**
- * The root directory for the files created during the indexing process
- */
- private final File destinationDir;
- /**
- * The root directory for the distribution files created in the finalisation
- * phase of the indexing (e.g. The archive with the index,
- * OSGI configuration, ...)
- */
- private final File distributionDir;
-
- /**
- * Map between the relative paths stored in {@link #rootDir}, {@link #configDir},
- * {@link #sourceDir}, {@link #destinationDir} and {@link #distributionDir}
- * to the {@link File#getCanonicalFile()} counterparts as returned by the
- * {@link #getRootFolder()} ... methods.
- */
- private final Map<File,File> canonicalDirs = new HashMap<File,File>();
+// /**
+// * The root directory for the configuration
+// */
+// private final File configDir;
+// /**
+// * The root directory for the resources (indexing source files)
+// */
+// private final File sourceDir;
+// /**
+// * The root directory for the files created during the indexing process
+// */
+// private final File destinationDir;
+// /**
+// * The root directory for the distribution files created in the finalisation
+// * phase of the indexing (e.g. The archive with the index,
+// * OSGI configuration, ...)
+// */
+// private final File distributionDir;
+//
+// /**
+// * Map between the relative paths stored in {@link #rootDir}, {@link #configDir},
+// * {@link #sourceDir}, {@link #destinationDir} and {@link #distributionDir}
+// * to the {@link File#getCanonicalFile()} counterparts as returned by the
+// * {@link #getRootFolder()} ... methods.
+// */
+// private final Map<File,File> canonicalDirs = new HashMap<File,File>();
/**
* The main indexing configuration as parsed form {@link #INDEXING_PROERTIES}
@@ -208,30 +212,53 @@ public class IndexingConfig {
* {@link IndexingConstants#KEY_INDEX_FIELD_CONFIG} key.
*/
private Collection<FieldMapping> fieldMappings;
+ /**
+ * offset to load resources via the classpath (only used for unit testing)
+ */
+ private String classpathResourceOffset;
/**
* Creates an instance using {@link #DEFAULT_ROOT_PATH} (relative to the
- * working directory) as {@link #getRootFolder()} for the indexing
+ * working directory) as {@link #getIndexingFolder()} for the indexing
*/
public IndexingConfig(){
this(null);
}
/**
* Creates an isntace using the parsed offset plus {@link #DEFAULT_ROOT_PATH}
- * as {@link #getRootFolder()} for the indexing
+ * as {@link #getIndexingFolder()} for the indexing
* @param rootPath
*/
public IndexingConfig(String rootPath){
+ this(rootPath,null);
+ }
+ /**
+ * Internally used for unit testing. Allows to parse an offset for loading
+ * the indexer configuration from the classpath. Currently a protected
+ * feature, but might be moved to the public API at a later point of time.
+ * (would allow to include multiple default configurations via the
+ * classpath).
+ * @param rootPath
+ * @param classpathOffset
+ */
+ protected IndexingConfig(String rootPath,String classpathOffset){
+ this.classpathResourceOffset = classpathOffset;
//first get the root
File root;// = new File(System.getProperty("user.dir"));
if(rootPath != null){
- root = new File(rootPath,DEFAULT_ROOT_PATH);
+ root = new File(rootPath);
} else {
- root = new File(DEFAULT_ROOT_PATH);
+ root = new File(".");
+ }
+ try {
+ root = root.getCanonicalFile();
+ } catch (IOException e) {
+ throw new IllegalStateException("Unable to get canonical file for "
+ +root,e);
}
- log.info("Indexing directory: {}",root.getAbsoluteFile());
+ log.info("Indexing Working Directory: {}",root.getAbsoluteFile());
this.rootDir = root;
- this.configDir = new File(root,CONFIG_PATH);
+ File configDir = getConfigFolder();
if(!configDir.getAbsoluteFile().isDirectory()){
log.info(" > config directory {} does not exist",configDir);
if(!configDir.getAbsoluteFile().mkdirs()){
@@ -242,7 +269,7 @@ public class IndexingConfig {
log.info(" - created");
}
}
- this.sourceDir = new File(root,SOURCE_PATH);
+ File sourceDir = getSourceFolder();
if(!sourceDir.getAbsoluteFile().exists()){
log.info(" > resource folder '{} does not exist ",sourceDir);
if(!sourceDir.getAbsoluteFile().mkdirs()){
@@ -253,7 +280,7 @@ public class IndexingConfig {
log.info(" - created");
}
}
- this.destinationDir = new File(root,DESTINATION_PATH);
+ File destinationDir = getDestinationFolder();
if(!destinationDir.getAbsoluteFile().exists()){
log.debug(" > destination folder '{} does not exist ",destinationDir);
if(!destinationDir.getAbsoluteFile().mkdirs()){
@@ -264,7 +291,7 @@ public class IndexingConfig {
log.debug(" - created");
}
}
- this.distributionDir = new File(root,DISTRIBUTION_PATH);
+ File distributionDir = getDistributionFolder();
if(!distributionDir.getAbsoluteFile().exists()){
log.debug(" > distribution folder '{} does not exist ",distributionDir);
if(!distributionDir.getAbsoluteFile().mkdirs()){
@@ -275,15 +302,6 @@ public class IndexingConfig {
log.debug(" - created");
}
}
- try {
- canonicalDirs.put(rootDir, rootDir.getCanonicalFile());
- canonicalDirs.put(configDir, configDir.getCanonicalFile());
- canonicalDirs.put(sourceDir, sourceDir.getCanonicalFile());
- canonicalDirs.put(destinationDir, destinationDir.getCanonicalFile());
- canonicalDirs.put(distributionDir, distributionDir.getCanonicalFile());
- } catch (IOException e) {
- throw new IllegalStateException("Unable to get canonical indexing directory",e);
- }
//set up the root folder for the classpath
this.classPathRootDir = getConfigClasspathRootFolder();
log.info("Classpath Indexing Root {}",classPathRootDir);
@@ -346,10 +364,10 @@ public class IndexingConfig {
* @throws IOException
*/
public InputStream openConfig(String configFileName) throws IOException {
- return openResource(configDir,configFileName);
+ return openResource(CONFIG_PATH,configFileName);
}
public InputStream openSource(String sourceFileName) throws IOException {
- return openResource(sourceDir,sourceFileName);
+ return openResource(SOURCE_PATH,sourceFileName);
}
/**
* Getter for the config file with the given name. If the file/directory is
@@ -359,7 +377,7 @@ public class IndexingConfig {
* @return
*/
public File getConfigFile(String configName) {
- return getResource(configDir, configName);
+ return getResource(CONFIG_PATH, configName);
}
/**
* Getter for the source file with the given name. If the file/directory is
@@ -369,11 +387,11 @@ public class IndexingConfig {
* @return
*/
public File getSourceFile(String configName) {
- return getResource(sourceDir, configName);
+ return getResource(SOURCE_PATH, configName);
}
- private InputStream openResource(File root,String fileName) throws IOException {
- File resource = getResource(root, fileName);
+ private InputStream openResource(String path,String fileName) throws IOException {
+ File resource = getResource(path, fileName);
InputStream in = null;
if(resource.isFile()){
in = new FileInputStream(resource);
@@ -389,12 +407,13 @@ public class IndexingConfig {
* @param fileName the name of the file (file or directory)
* @return the absolute File or <code>null</code> if not found.
*/
- private File getResource(File root, String fileName) {
- File resource = new File(root,fileName);
- log.info("request for Resource {} (folder: {})",fileName,root);
+ private File getResource(String path, String fileName) {
+ File resourceDir = new File(getWorkingDirectory(),path);
+ File resource = new File(resourceDir,fileName);
+ log.info("request for Resource {} (folder: {})",fileName,resourceDir);
if(resource.getAbsoluteFile().exists()){
log.info(" > rquested Resource present");
- } else if(copyFromClasspath(resource)){
+ } else if(copyFromClasspath(new File(path,fileName))){
log.info(" > rquested Resource copied from Classpath ");
} else {
log.info(" > rquested Resource not found");
@@ -411,16 +430,23 @@ public class IndexingConfig {
* @return <code>true</code> if the resource was found and copied.
*/
private boolean copyFromClasspath(File resource){
+ String resourcePath;
+ if(classpathResourceOffset != null){
+ String rs = resource.getPath();
+ resourcePath = FilenameUtils.concat(classpathResourceOffset, rs);
+ } else {
+ resourcePath = resource.getPath();
+ }
if(classPathRootDir == null){ //not available
return false;
} else if(classPathRootDir.isDirectory()){ // loaded from directory
- File classpathResource = new File(classPathRootDir,resource.getPath());
+ File classpathResource = new File(classPathRootDir,resourcePath);
try {
if(classpathResource.isFile()){
- FileUtils.copyFile(classpathResource, resource.getAbsoluteFile());
+ FileUtils.copyFile(classpathResource, new File(getWorkingDirectory(),resource.getPath()));
return true;
} else if(classpathResource.isDirectory()){
- FileUtils.copyDirectory(classpathResource, resource.getAbsoluteFile());
+ FileUtils.copyDirectory(classpathResource, new File(getWorkingDirectory(),resource.getPath()));
return true;
} else {
return false;
@@ -436,7 +462,7 @@ public class IndexingConfig {
JarFile jar = null;
try {
jar = new JarFile(classPathRootDir);
- String resourceName = resource.getPath();
+ //String resourceName = resource.getPath();
Enumeration<JarEntry> entries = jar.entries();
boolean completed = false;
//we need to iterate over the entries because the resource might
@@ -444,16 +470,16 @@ public class IndexingConfig {
while(entries.hasMoreElements() && !completed){
JarEntry entry = entries.nextElement();
String entryName = entry.getName();
- if(entryName.startsWith(resourceName)){
+ if(entryName.startsWith(resourcePath)){
log.info("found entry : {}[dir={}]",entryName,entry.isDirectory());
- if(entryName.equals(resourceName) && !entry.isDirectory()){
+ if(entryName.equals(resourcePath) && !entry.isDirectory()){
//found the resource and it is an file -> copy and return
completed = true;
}
if(!entry.isDirectory()){ //copy a file
//still check if the target folder exist
//TODO: this depends on user.dir is root dir
- File targetFolder = new File(
+ File targetFolder = new File(getWorkingDirectory(),
FilenameUtils.getPathNoEndSeparator(entryName));
if(targetFolder.exists() || targetFolder.mkdirs()){
File outFile = new File(targetFolder,
@@ -527,12 +553,19 @@ public class IndexingConfig {
*/
private File getConfigClasspathRootFolder() {
//use the indexing.properties file as context
- String contextResource = new File(configDir,INDEXING_PROERTIES).getPath();
+ //STANBOL-
+ String contextResource;
+ if(classpathResourceOffset != null){
+ contextResource = FilenameUtils.concat(classpathResourceOffset,
+ CONFIG_PATH+File.separatorChar+INDEXING_PROERTIES);
+ } else {
+ contextResource = CONFIG_PATH+File.separatorChar+INDEXING_PROERTIES;
+ }
URL contextUrl = loadViaClasspath(contextResource);
if(contextUrl == null){// if indexing.properties is not found via classpath
log.info("No '{}' found via classpath. Loading Resource via" +
"the classpath is deactivated.",
- INDEXING_PROERTIES);
+ contextResource);
return null;
}
String resourcePath;
@@ -648,11 +681,19 @@ public class IndexingConfig {
return configMap;
}
/**
- * Getter for the root folder used for the Indexing
+ * Getter for the working direcotry of the Indexing tool. (the directory
+ * containing the /indexing folder). By defualt htis
+ * @return
+ */
+ public final File getWorkingDirectory(){
+ return rootDir;
+ }
+ /**
+ * Getter for the root folder used for the Indexing (root/indexing)
* @return the root folder (containing the config, resources, target and dist folders)
*/
- public final File getRootFolder() {
- return canonicalDirs.get(rootDir);
+ public final File getIndexingFolder() {
+ return new File(getWorkingDirectory(),DEFAULT_ROOT_PATH);
}
/**
@@ -660,7 +701,7 @@ public class IndexingConfig {
* @return the root folder for the configuration
*/
public final File getConfigFolder() {
- return canonicalDirs.get(configDir);
+ return new File(getIndexingFolder(),CONFIG_FOLDER);
}
/**
@@ -669,7 +710,7 @@ public class IndexingConfig {
* @return the root folder for the resources
*/
public final File getSourceFolder() {
- return canonicalDirs.get(sourceDir);
+ return new File(getIndexingFolder(),SOURCE_FOLDER);
}
/**
@@ -678,14 +719,14 @@ public class IndexingConfig {
* @return the target folder
*/
public final File getDestinationFolder() {
- return canonicalDirs.get(destinationDir);
+ return new File(getIndexingFolder(),DESTINATION_FOLDER);
}
/**
* The root folder for the distribution. Guaranteed to exist.
* @return the distribution folder
*/
public final File getDistributionFolder() {
- return canonicalDirs.get(distributionDir);
+ return new File(getIndexingFolder(),DISTRIBUTION_FOLDER);
}
/**
* Getter for the name as configured by the {@link IndexingConstants#KEY_NAME}
@@ -970,7 +1011,7 @@ public class IndexingConfig {
// }
//if the CONFIG_PARAM is present in the config we assume that a config is required
String name = configEntry.getParams().get(CONFIG_PARAM);
- Map<String,Object> config = loadConfig(name == null ? defaultName : name, configDir, required);
+ Map<String,Object> config = loadConfigFile(name == null ? defaultName : name, required);
//we need to also add the key used to get (this) indexing config
config.put(KEY_INDEXING_CONFIG, this);
return config;
@@ -985,17 +1026,9 @@ public class IndexingConfig {
* @param required if this config is required or optional
* @return the key value mappings as map
*/
- private Map<String,Object> loadConfig(String name, File configDir, boolean required) {
+ private Map<String,Object> loadConfigFile(String name, boolean required) {
Map<String,Object> loadedConfig;
- name = name.endsWith(".properties")? name : name+".properties";
- if(name == null){
- if(required){
- throw new IllegalArgumentException("Missing required parameter'"+
- CONFIG_PARAM+"' Syntax: '"+SYNTAX_ERROR_MESSAGE +"'!");
- } else {
- return new HashMap<String,Object>();
- }
- }
+ name = name.endsWith(".properties") ? name : name+".properties";
loadedConfig = loadConfig(name,required);
return loadedConfig;
}
@@ -1052,7 +1085,7 @@ public class IndexingConfig {
* <code>true</code> was parsed for required
*/
public Map<String,Object> getConfig(String name,boolean required) throws IllegalArgumentException {
- return loadConfig(name, configDir, required);
+ return loadConfigFile(name, required);
}
/**
* Getter for configured properties directly by the key. Typically used
Modified: incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/ConfigTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/ConfigTest.java?rev=1337129&r1=1337128&r2=1337129&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/ConfigTest.java (original)
+++ incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/ConfigTest.java Fri May 11 12:46:36 2012
@@ -93,7 +93,7 @@ public class ConfigTest {
//this should create the specified folder and than throw an
//illegalArgumentException because the indexing.properties file can not
//be found in the classpath under
- new IndexingConfig(CONFIG_ROOT+"noConfig");
+ new IndexingConfig(CONFIG_ROOT+"noConfig",CONFIG_ROOT+"noConfig"){};
}
/**
* In this case the config exists in the classpath, but is not valid because
@@ -101,7 +101,7 @@ public class ConfigTest {
*/
@Test(expected=IllegalArgumentException.class)
public void missingConfigDir(){
- new IndexingConfig(CONFIG_ROOT+"missingconfig");
+ new IndexingConfig(CONFIG_ROOT+"missingconfig",CONFIG_ROOT+"missingconfig"){};
}
/**
* Loads a simple but not functional configuration to test the loading and
@@ -110,13 +110,13 @@ public class ConfigTest {
@Test
public void loadSimpleConfigDir() throws IOException {
String name = CONFIG_ROOT+"simple";
- IndexingConfig config = new IndexingConfig(name);
+ IndexingConfig config = new IndexingConfig(name,name){};
//assert that this directory exists (is created)
File expectedRoot = new File(testRoot,name);
expectedRoot = new File(expectedRoot,"indexing");
assertTrue("Root Dir not created",expectedRoot.isDirectory());
assertEquals("Root dir other the expected ",
- expectedRoot.getCanonicalPath(),config.getRootFolder().getCanonicalPath());
+ expectedRoot.getCanonicalPath(),config.getIndexingFolder().getCanonicalPath());
assertTrue(config.getConfigFolder().isDirectory());
assertTrue(config.getSourceFolder().isDirectory());
assertTrue(config.getDestinationFolder().isDirectory());
Modified: incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/IndexerTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/IndexerTest.java?rev=1337129&r1=1337128&r2=1337129&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/IndexerTest.java (original)
+++ incubator/stanbol/trunk/entityhub/indexing/core/src/test/java/org/apache/stanbol/entityhub/indexing/core/IndexerTest.java Fri May 11 12:46:36 2012
@@ -120,14 +120,14 @@ public class IndexerTest {
@Test
public void testDataInteratingMode(){
- Indexer indexer = factory.create(CONFIG_ROOT+"dataIterating");
+ Indexer indexer = factory.create(CONFIG_ROOT+"dataIterating",CONFIG_ROOT+"idIterating");
indexer.index();
//check that all entities have been indexed
validateAllIndexed();
}
@Test
public void testEntityIdIteratingMode(){
- Indexer indexer = factory.create(CONFIG_ROOT+"idIterating");
+ Indexer indexer = factory.create(CONFIG_ROOT+"idIterating",CONFIG_ROOT+"idIterating");
indexer.index();
//check that all entities have been indexed
validateAllIndexed();
Modified: incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/test/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestinationTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/test/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestinationTest.java?rev=1337129&r1=1337128&r2=1337129&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/test/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestinationTest.java (original)
+++ incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/test/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestinationTest.java Fri May 11 12:46:36 2012
@@ -123,12 +123,12 @@ public class SolrYardIndexingDestination
}
@Test(expected=IllegalArgumentException.class)
public void testMissingBoostConfig(){
- IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"missingBoostConfig");
+ IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"missingBoostConfig",CONFIG_ROOT+"missingBoostConfig"){};
config.getIndexingDestination();
}
@Test(expected=IllegalArgumentException.class)
public void testInvalidBoostConfig(){
- IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"invalidBoostConfig");
+ IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"invalidBoostConfig",CONFIG_ROOT+"invalidBoostConfig"){};
config.getIndexingDestination();
}
/**
@@ -137,7 +137,7 @@ public class SolrYardIndexingDestination
*/
@Test(expected=IllegalArgumentException.class)
public void testMissingDefaultSolrSchemaConfig(){
- IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"missingDefaultSolrConf");
+ IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"missingDefaultSolrConf",CONFIG_ROOT+"missingDefaultSolrConf"){};
config.getIndexingDestination();
}
/**
@@ -146,17 +146,17 @@ public class SolrYardIndexingDestination
*/
@Test(expected=IllegalArgumentException.class)
public void testMissingSolrSchemaConfig(){
- IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"missingSolrConf");
+ IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"missingSolrConf",CONFIG_ROOT+"missingSolrConf"){};
config.getIndexingDestination();
}
@Test
public void testSimple() throws YardException, IOException {
- IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"simple");
+ IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"simple",CONFIG_ROOT+"simple"){};
validateSolrDestination(config);
}
@Test
public void testWithSolrConf() throws YardException, IOException {
- IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"withSolrConf");
+ IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"withSolrConf",CONFIG_ROOT+"withSolrConf"){};
validateSolrDestination(config);
}
Modified: incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/test/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSourceTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/test/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSourceTest.java?rev=1337129&r1=1337128&r2=1337129&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/test/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSourceTest.java (original)
+++ incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/test/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSourceTest.java Fri May 11 12:46:36 2012
@@ -82,7 +82,7 @@ public class RdfIndexingSourceTest {
}
@Test
public void testEntityDataIterable(){
- IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"iterable");
+ IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"iterable",CONFIG_ROOT+"iterable"){};
EntityDataIterable iterable = config.getDataInterable();
assertNotNull(iterable);
assertEquals(iterable.getClass(), RdfIndexingSource.class);
@@ -106,7 +106,7 @@ public class RdfIndexingSourceTest {
}
@Test
public void testEntityDataProvider(){
- IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"provider");
+ IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"provider",CONFIG_ROOT+"provider"){};
EntityIterator entityIdIterator = config.getEntityIdIterator();
assertNotNull("Unable to perform test whithout EntityIterator",entityIdIterator);
if(entityIdIterator.needsInitialisation()){