diff --git a/src/test/java/li/strolch/persistence/postgresql/dao/test/ObserverUpdateTest.java b/src/test/java/li/strolch/persistence/postgresql/dao/test/ObserverUpdateTest.java index ce20eaee6..aed71ece9 100644 --- a/src/test/java/li/strolch/persistence/postgresql/dao/test/ObserverUpdateTest.java +++ b/src/test/java/li/strolch/persistence/postgresql/dao/test/ObserverUpdateTest.java @@ -46,9 +46,9 @@ import org.junit.Test; */ public class ObserverUpdateTest { - public static final String RUNTIME_PATH = "target/strolchRuntime/"; //$NON-NLS-1$ + public static final String RUNTIME_PATH = "target/observerUpdateStrolchRuntime/"; //$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$ + public static final String CONFIG_SRC = "src/test/resources/cachedruntime"; //$NON-NLS-1$ protected static RuntimeMock runtimeMock; diff --git a/src/test/java/li/strolch/persistence/postgresql/dao/test/XmlCachedDaoTest.java b/src/test/java/li/strolch/persistence/postgresql/dao/test/XmlCachedDaoTest.java index d55057582..69aa2d2f9 100644 --- a/src/test/java/li/strolch/persistence/postgresql/dao/test/XmlCachedDaoTest.java +++ b/src/test/java/li/strolch/persistence/postgresql/dao/test/XmlCachedDaoTest.java @@ -29,9 +29,9 @@ import org.junit.BeforeClass; public class XmlCachedDaoTest extends AbstractModelTest { - public static final String RUNTIME_PATH = "target/strolchRuntime/"; //$NON-NLS-1$ + public static final String RUNTIME_PATH = "target/cachedStrolchRuntime/"; //$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$ + public static final String CONFIG_SRC = "src/test/resources/cachedruntime"; //$NON-NLS-1$ private static final String DB_URL = "jdbc:postgresql://localhost/testdb"; //$NON-NLS-1$ private static final String DB_USERNAME = "testuser"; //$NON-NLS-1$ diff --git a/src/test/java/li/strolch/persistence/postgresql/dao/test/XmlTransactionalDaoTest.java b/src/test/java/li/strolch/persistence/postgresql/dao/test/XmlTransactionalDaoTest.java new file mode 100644 index 000000000..f0fa14d18 --- /dev/null +++ b/src/test/java/li/strolch/persistence/postgresql/dao/test/XmlTransactionalDaoTest.java @@ -0,0 +1,57 @@ +/* + * Copyright 2013 Robert von Burg + * + * Licensed 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 li.strolch.persistence.postgresql.dao.test; + +import java.io.File; +import java.sql.SQLException; + +import li.strolch.testbase.runtime.AbstractModelTest; +import li.strolch.testbase.runtime.RuntimeMock; + +import org.junit.AfterClass; +import org.junit.BeforeClass; + +public class XmlTransactionalDaoTest extends AbstractModelTest { + + public static final String RUNTIME_PATH = "target/transactionalStrolchRuntime/"; //$NON-NLS-1$ + public static final String DB_STORE_PATH_DIR = "dbStore"; //$NON-NLS-1$ + public static final String CONFIG_SRC = "src/test/resources/transactionalruntime"; //$NON-NLS-1$ + + protected static RuntimeMock runtimeMock; + + @Override + protected RuntimeMock getRuntimeMock() { + return runtimeMock; + } + + @BeforeClass + public static void beforeClass() throws SQLException { + + XmlCachedDaoTest.dropSchema(); + + File rootPath = new File(RUNTIME_PATH); + File configSrc = new File(CONFIG_SRC); + runtimeMock = new RuntimeMock(); + runtimeMock.mockRuntime(rootPath, configSrc); + new File(rootPath, DB_STORE_PATH_DIR).mkdir(); + runtimeMock.startContainer(rootPath); + } + + @AfterClass + public static void afterClass() { + runtimeMock.destroyRuntime(); + } +} diff --git a/src/test/resources/runtime/config/StrolchConfiguration.xml b/src/test/resources/cachedruntime/config/StrolchConfiguration.xml similarity index 100% rename from src/test/resources/runtime/config/StrolchConfiguration.xml rename to src/test/resources/cachedruntime/config/StrolchConfiguration.xml diff --git a/src/test/resources/transactionalruntime/config/StrolchConfiguration.xml b/src/test/resources/transactionalruntime/config/StrolchConfiguration.xml new file mode 100644 index 000000000..e7248cfbe --- /dev/null +++ b/src/test/resources/transactionalruntime/config/StrolchConfiguration.xml @@ -0,0 +1,27 @@ + + + + StrolchPersistenceTest + + TRANSACTIONAL + true + + + + PersistenceHandler + li.strolch.persistence.api.PersistenceHandler + li.strolch.persistence.postgresql.PostgreSqlPersistenceHandler + + true + true + jdbc:postgresql://localhost/testdb + testuser + test + + + + ObserverHandler + li.strolch.runtime.observer.ObserverHandler + li.strolch.runtime.observer.DefaultObserverHandler + + \ No newline at end of file