[New] Added Unit tests to test the bulk operations

This commit is contained in:
Robert von Burg 2013-12-24 02:12:38 +01:00
parent 38d1cf61dd
commit 76d8d24ebd
2 changed files with 31 additions and 6 deletions

View File

@ -25,13 +25,12 @@ import org.junit.BeforeClass;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*
*/
public abstract class AbstractDaoImplTest extends RuntimeMock {
private static final String RUNTIME_PATH = "target/strolchRuntime/"; //$NON-NLS-1$
private static final String DB_STORE_PATH_DIR = "dbStore"; //$NON-NLS-1$
private static final String CONFIG_SRC = "src/test/resources/runtime/config"; //$NON-NLS-1$
public static final String RUNTIME_PATH = "target/strolchRuntime/"; //$NON-NLS-1$
public static final String DB_STORE_PATH_DIR = "dbStore"; //$NON-NLS-1$
public static final String CONFIG_SRC = "src/test/resources/runtime/config"; //$NON-NLS-1$
protected static PersistenceHandler persistenceHandler;
@BeforeClass

View File

@ -15,14 +15,40 @@
*/
package li.strolch.persistence.impl.dao.test;
import li.strolch.persistence.api.StrolchTransaction;
import java.io.File;
import li.strolch.persistence.api.PersistenceHandler;
import li.strolch.persistence.api.StrolchTransaction;
import li.strolch.testbase.runtime.RuntimeMock;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*/
public class XmlContainerTest extends AbstractDaoImplTest {
public class XmlContainerTest extends RuntimeMock {
protected static PersistenceHandler persistenceHandler;
@BeforeClass
public static void beforeClass() {
File rootPath = new File(AbstractDaoImplTest.RUNTIME_PATH);
File configSrc = new File(AbstractDaoImplTest.CONFIG_SRC);
RuntimeMock.mockRuntime(rootPath, configSrc);
new File(rootPath, AbstractDaoImplTest.DB_STORE_PATH_DIR).mkdir();
RuntimeMock.startContainer(rootPath);
// initialize the component configuration
persistenceHandler = getContainer().getComponent(PersistenceHandler.class);
}
@AfterClass
public static void afterClass() {
RuntimeMock.destroyRuntime();
}
@Test
public void shouldStartContainer() {