orientechnologies/orientdb — pull request #2802 by srgg (2014-09-15 04:36:18+00:00)
Title: Junit initial support

@lvca Here is an initial integration with JUnit. I would like you to look on a test wich is currently ignored EmbeddedOrientDBRuleTest.checkThatNewlyCreatedClassIsAvailableOnEachClusterNode, it fails because of an internal ClassCastException:

```
The database 'testdb' has been created (on behalf of user 'admin') and ready to use.
The following command might be used to establish connection: connect remote:localhost:2424/testdb admin admin [com.orientechnologies.orient.unit.EmbeddedOrientDBRule#before]

com.orientechnologies.orient.core.exception.ODatabaseException: Cannot open database
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:340)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:49)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTxPooled.(ODatabaseDocumentTxPooled.java:47)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentPool.createResource(ODatabaseDocumentPool.java:44)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentPool.createResource(ODatabaseDocumentPool.java:20)
at com.orientechnologies.orient.core.db.ODatabasePoolBase$1.createNewResource(ODatabasePoolBase.java:72)
at com.orientechnologies.orient.core.db.ODatabasePoolBase$1.createNewResource(ODatabasePoolBase.java:61)
at com.orientechnologies.common.concur.resource.OResourcePool.getResource(OResourcePool.java:82)
at com.orientechnologies.common.concur.resource.OReentrantResourcePool.getResource(OReentrantResourcePool.java:63)
at com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:149)
at com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:134)
at com.orientechnologies.orient.core.db.ODatabasePoolBase.acquire(ODatabasePoolBase.java:119)
at com.orientechnologies.orient.unit.ODBTestSupportRule.remoteDocumentDBFromGPool(ODBTestSupportRule.java:60)
at com.orientechnologies.orient.unit.ODBTestSupportRule.remoteDocumentDBFromGPool(ODBTestSupportRule.java:66)
at com.orientechnologies.orient.unit.ODBTestSupportRule.executeSQLCommandWithParams(ODBTestSupportRule.java:81)
at com.orientechnologies.orient.unit.EmbeddedOrientDBRuleTest.checkThatNewlyCreatedClassIsAvailableOnEachClusterNode(EmbeddedOrientDBRuleTest.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
Caused by: java.lang.ClassCastException: com.orientechnologies.orient.client.remote.OStorageRemoteThread cannot be cast to com.orientechnologies.orient.core.storage.OStorageEmbedded
at com.orientechnologies.orient.server.distributed.ODistributedAbstractPlugin.onOpen(ODistributedAbstractPlugin.java:157)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.callOnOpenListeners(ODatabaseRecordAbstract.java:1532)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:333)
... 38 more

```