[Minor] there is no getDefaultRealm() method anymore
This commit is contained in:
parent
2f015592d2
commit
262e7e204a
|
@ -22,6 +22,7 @@ import java.io.File;
|
||||||
import li.strolch.model.Order;
|
import li.strolch.model.Order;
|
||||||
import li.strolch.model.Resource;
|
import li.strolch.model.Resource;
|
||||||
import li.strolch.persistence.api.StrolchTransaction;
|
import li.strolch.persistence.api.StrolchTransaction;
|
||||||
|
import li.strolch.runtime.StrolchConstants;
|
||||||
import li.strolch.testbase.runtime.RuntimeMock;
|
import li.strolch.testbase.runtime.RuntimeMock;
|
||||||
|
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
|
@ -43,7 +44,7 @@ public class ExistingDbTest {
|
||||||
File configSrc = new File(CONFIG_SRC);
|
File configSrc = new File(CONFIG_SRC);
|
||||||
runtimeMock = new RuntimeMock();
|
runtimeMock = new RuntimeMock();
|
||||||
runtimeMock.mockRuntime(rootPath, configSrc);
|
runtimeMock.mockRuntime(rootPath, configSrc);
|
||||||
runtimeMock.startContainer(rootPath);
|
runtimeMock.startContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
@ -54,7 +55,7 @@ public class ExistingDbTest {
|
||||||
@Test
|
@Test
|
||||||
public void shouldQueryExistingData() {
|
public void shouldQueryExistingData() {
|
||||||
|
|
||||||
try (StrolchTransaction tx = runtimeMock.getDefaultRealm().openTx()) {
|
try (StrolchTransaction tx = runtimeMock.getRealm(StrolchConstants.DEFAULT_REALM).openTx()) {
|
||||||
Resource resource = tx.getResourceMap().getBy(tx, "MyType", "@1");
|
Resource resource = tx.getResourceMap().getBy(tx, "MyType", "@1");
|
||||||
assertNotNull("Should be able to read existing element from db", resource);
|
assertNotNull("Should be able to read existing element from db", resource);
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import li.strolch.model.Resource;
|
||||||
import li.strolch.model.State;
|
import li.strolch.model.State;
|
||||||
import li.strolch.model.StrolchElement;
|
import li.strolch.model.StrolchElement;
|
||||||
import li.strolch.persistence.api.StrolchTransaction;
|
import li.strolch.persistence.api.StrolchTransaction;
|
||||||
|
import li.strolch.runtime.StrolchConstants;
|
||||||
import li.strolch.runtime.observer.Observer;
|
import li.strolch.runtime.observer.Observer;
|
||||||
import li.strolch.runtime.observer.ObserverHandler;
|
import li.strolch.runtime.observer.ObserverHandler;
|
||||||
import li.strolch.testbase.runtime.RuntimeMock;
|
import li.strolch.testbase.runtime.RuntimeMock;
|
||||||
|
@ -63,7 +64,7 @@ public class ObserverUpdateTest {
|
||||||
runtimeMock = new RuntimeMock();
|
runtimeMock = new RuntimeMock();
|
||||||
runtimeMock.mockRuntime(rootPath, configSrc);
|
runtimeMock.mockRuntime(rootPath, configSrc);
|
||||||
new File(rootPath, DB_STORE_PATH_DIR).mkdir();
|
new File(rootPath, DB_STORE_PATH_DIR).mkdir();
|
||||||
runtimeMock.startContainer(rootPath);
|
runtimeMock.startContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
@ -110,13 +111,13 @@ public class ObserverUpdateTest {
|
||||||
|
|
||||||
// create order
|
// create order
|
||||||
Order newOrder = createOrder("MyTestOrder", "Test Name", "TestType", new Date(), State.CREATED); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
Order newOrder = createOrder("MyTestOrder", "Test Name", "TestType", new Date(), State.CREATED); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
||||||
try (StrolchTransaction tx = runtimeMock.getDefaultRealm().openTx()) {
|
try (StrolchTransaction tx = runtimeMock.getRealm(StrolchConstants.DEFAULT_REALM).openTx()) {
|
||||||
tx.getOrderMap().add(tx, newOrder);
|
tx.getOrderMap().add(tx, newOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create resource
|
// create resource
|
||||||
Resource newResource = createResource("MyTestResource", "Test Name", "TestType"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
Resource newResource = createResource("MyTestResource", "Test Name", "TestType"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
||||||
try (StrolchTransaction tx = runtimeMock.getDefaultRealm().openTx()) {
|
try (StrolchTransaction tx = runtimeMock.getRealm(StrolchConstants.DEFAULT_REALM).openTx()) {
|
||||||
tx.getResourceMap().add(tx, newResource);
|
tx.getResourceMap().add(tx, newResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class XmlCachedDaoTest extends AbstractModelTest {
|
||||||
runtimeMock = new RuntimeMock();
|
runtimeMock = new RuntimeMock();
|
||||||
runtimeMock.mockRuntime(rootPath, configSrc);
|
runtimeMock.mockRuntime(rootPath, configSrc);
|
||||||
new File(rootPath, DB_STORE_PATH_DIR).mkdir();
|
new File(rootPath, DB_STORE_PATH_DIR).mkdir();
|
||||||
runtimeMock.startContainer(rootPath);
|
runtimeMock.startContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class XmlTransactionalDaoTest extends AbstractModelTest {
|
||||||
runtimeMock = new RuntimeMock();
|
runtimeMock = new RuntimeMock();
|
||||||
runtimeMock.mockRuntime(rootPath, configSrc);
|
runtimeMock.mockRuntime(rootPath, configSrc);
|
||||||
new File(rootPath, DB_STORE_PATH_DIR).mkdir();
|
new File(rootPath, DB_STORE_PATH_DIR).mkdir();
|
||||||
runtimeMock.startContainer(rootPath);
|
runtimeMock.startContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
|
Loading…
Reference in New Issue