use of com.orientechnologies.orient.core.engine.OEngine in project orientdb by orientechnologies.
the class Orient method registerEngine.
protected void registerEngine(final OEngine iEngine) throws IllegalArgumentException {
OEngine oEngine = engines.get(iEngine.getName());
if (oEngine != null) {
if (!oEngine.getClass().isAssignableFrom(iEngine.getClass())) {
throw new IllegalArgumentException("Cannot replace storage " + iEngine.getName());
}
}
engines.put(iEngine.getName(), iEngine);
}
use of com.orientechnologies.orient.core.engine.OEngine in project orientdb by orientechnologies.
the class PostponedEngineStartTest method testEngineRestart.
// @Test(dependsOnMethods = "testGetRunningEngineShouldStartEngine")
public void testEngineRestart() {
OEngine engine = ORIENT.getRunningEngine(ENGINE1.getName());
engine.shutdown();
Assert.assertFalse(engine.isRunning());
engine = ORIENT.getEngineIfRunning(ENGINE1.getName());
Assert.assertNull(engine);
engine = ORIENT.getEngine(ENGINE1.getName());
Assert.assertFalse(engine.isRunning());
engine = ORIENT.getRunningEngine(ENGINE1.getName());
Assert.assertTrue(engine.isRunning());
}
use of com.orientechnologies.orient.core.engine.OEngine in project orientdb by orientechnologies.
the class PostponedEngineStartTest method testEngineShouldNotStartAtRuntimeStart.
// @Test
public void testEngineShouldNotStartAtRuntimeStart() {
final OEngine engine = ORIENT.getEngine(ENGINE1.getName());
Assert.assertFalse(engine.isRunning());
}
use of com.orientechnologies.orient.core.engine.OEngine in project orientdb by orientechnologies.
the class PostponedEngineStartTest method testGetRunningEngineShouldThrowIfEngineIsUnableToStart.
//@Test
public void testGetRunningEngineShouldThrowIfEngineIsUnableToStart() {
OEngine engine = ORIENT.getEngine(FAULTY_ENGINE.getName());
Assert.assertNotNull(engine, "engine should be registered");
Assert.assertThrows(IllegalStateException.class, new Assert.ThrowingRunnable() {
@Override
public void run() throws Throwable {
ORIENT.getRunningEngine(FAULTY_ENGINE.getName());
}
});
engine = ORIENT.getEngine(FAULTY_ENGINE.getName());
Assert.assertNull(engine, "engine should be unregistered");
}
use of com.orientechnologies.orient.core.engine.OEngine in project orientdb by orientechnologies.
the class PostponedEngineStartTest method testGetEngineIfRunningShouldReturnNullEngineIfNotRunning.
// @Test(dependsOnMethods = "testEngineShouldNotStartAtRuntimeStart")
public void testGetEngineIfRunningShouldReturnNullEngineIfNotRunning() {
final OEngine engine = ORIENT.getEngineIfRunning(ENGINE1.getName());
Assert.assertNull(engine);
}
Aggregations