hi,
I want open database connection for create unit testing initialization with database access.
I have test:
@Test
public void test(){
ERXExtensions.initApp(Application.class, new String[0]);
this.connexionProperties = new NSMutableDictionary(model.connectionDictionary());
this.tconnexionProperties.addEntriesFromDictionary(new NSDictionary(new Object[] {
"xxxx",
"xxxx",
"jdbc:oracle:thin:@xxx.xxx.xxx.xxx:xxxx:SID",
"oracle.jdbc.driver.OracleDriver",
"MyOraclePlugIn"
}, new Object[] {
"username",
"password",
"URL",
"driver",
"plugin"
}));
model.setConnectionDictionary(this.connexionProperties);
EOModelGroup.defaultGroup().addModel(model);
}
and when i execute the last line i have:
avr. 16 14:02:54 test[-1] WARN er.extensions.eof.ERXModelGroup - The EOModel 'erprototypes' has an empty connection dictionary.
avr. 16 14:02:54 test[-1] WARN er.extensions.eof.ERXModelGroup - The EOModel 'erprototypes' has an empty connection dictionary.
avr. 16 14:02:54 test[-1] ERROR er.extensions.eof.ERXEntityClassDescription - Error registering model: EOMODELNAME
ClassNotFoundException: CLASSNAME
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at er.extensions.eof.ERXEntityClassDescription$Factory.registerDescriptionForEntity(ERXEntityClassDescription.java:580)
at er.extensions.eof.ERXEntityClassDescription$Factory.registerDescriptionForEntitiesInModel(ERXEntityClassDescription.java:534)
at er.extensions.eof.ERXEntityClassDescription$Factory.modelWasAdded(ERXEntityClassDescription.java:343)
... skipped 8 stack elements
at er.extensions.eof.ERXModelGroup.addModel(ERXModelGroup.java:445)
at er.extensions.eof.ERXModelGroup.addModelWithPathURL(ERXModelGroup.java:537)
at er.extensions.eof.ERXModelGroup.loadModelsFromLoadedBundles(ERXModelGroup.java:271)
at er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:145)
... skipped 5 stack elements
at com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:225)
at com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:158)
at com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:365)
at your.app.testApplication.test(testApplication.java:118)
... skipped 4 stack elements
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
but the class "CLASSNAME" exist so i don't know if the problem is a ClassNotFoundException. And i don't know if the database access is correctly opened.
best regards G.ALEXANDRE