org.apache.solr.handler.dataimport
Class AbstractDataImportHandlerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.solr.util.AbstractSolrTestCase
              extended by org.apache.solr.handler.dataimport.AbstractDataImportHandlerTest
All Implemented Interfaces:
junit.framework.Test

public abstract class AbstractDataImportHandlerTest
extends AbstractSolrTestCase

Abstract base class for DataImportHandler tests

This API is experimental and subject to change

Since:
solr 1.3
Version:
$Id: AbstractDataImportHandlerTest.java 824910 2009-10-13 20:28:04Z ehatcher $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.solr.util.AbstractSolrTestCase
AbstractSolrTestCase.Doc
 
Field Summary
 
Fields inherited from class org.apache.solr.util.AbstractSolrTestCase
dataDir, h, log, lrf, solrConfig
 
Constructor Summary
AbstractDataImportHandlerTest()
           
 
Method Summary
static Map createMap(Object... args)
          Strings at even index are keys, odd-index strings are values in the returned map
static org.apache.solr.handler.dataimport.AbstractDataImportHandlerTest.TestContext getContext(DataConfig.Entity parentEntity, VariableResolverImpl resolver, DataSource parentDataSource, String currProcess, List<Map<String,String>> entityFields, Map<String,String> entityAttrs)
          Helper for creating a Context instance.
protected  String loadDataConfig(String dataConfigFileName)
           
protected  void runDeltaImport(String dataConfig)
           
protected  void runFullImport(String dataConfig)
           
protected  void runFullImport(String dataConfig, Map<String,String> extraParams)
          Runs a full-import using the given dataConfig and the provided request parameters.
 void setUp()
           
 void tearDown()
          Shuts down the test harness, and makes the best attempt possible to delete dataDir, unless the system property "solr.test.leavedatadir" is set.
 
Methods inherited from class org.apache.solr.util.AbstractSolrTestCase
add, adoc, adoc, assertFailedU, assertFailedU, assertQ, assertQ, assertQEx, assertU, assertU, commit, delI, delQ, doc, getSchemaFile, getSolrConfigFile, optimize, postSetUp, preTearDown, recurseDelete, req, req
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractDataImportHandlerTest

public AbstractDataImportHandlerTest()
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class AbstractSolrTestCase
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Description copied from class: AbstractSolrTestCase
Shuts down the test harness, and makes the best attempt possible to delete dataDir, unless the system property "solr.test.leavedatadir" is set.

Overrides:
tearDown in class AbstractSolrTestCase
Throws:
Exception

loadDataConfig

protected String loadDataConfig(String dataConfigFileName)

runFullImport

protected void runFullImport(String dataConfig)
                      throws Exception
Throws:
Exception

runDeltaImport

protected void runDeltaImport(String dataConfig)
                       throws Exception
Throws:
Exception

runFullImport

protected void runFullImport(String dataConfig,
                             Map<String,String> extraParams)
                      throws Exception
Runs a full-import using the given dataConfig and the provided request parameters. By default, debug=on, clean=true and commit=true are passed which can be overridden.

Parameters:
dataConfig - the data-config xml as a string
extraParams - any extra request parameters needed to be passed to DataImportHandler
Throws:
Exception - in case of any error

getContext

public static org.apache.solr.handler.dataimport.AbstractDataImportHandlerTest.TestContext getContext(DataConfig.Entity parentEntity,
                                                                                                      VariableResolverImpl resolver,
                                                                                                      DataSource parentDataSource,
                                                                                                      String currProcess,
                                                                                                      List<Map<String,String>> entityFields,
                                                                                                      Map<String,String> entityAttrs)
Helper for creating a Context instance. Useful for testing Transformers


createMap

public static Map createMap(Object... args)
Strings at even index are keys, odd-index strings are values in the returned map



Copyright © 2011 Apache Software Foundation. All Rights Reserved.