Hi all, im have some problems when working with wounittest2, when i
run one test here junit show me this error:
java.lang.IllegalStateException: Unable to get the name of the
class to instantiate for the adaptor framework JavaNoneAdaptor. The
possible causes for this error are: the adaptor framework is not
installed on your system, the adaptor framework is not linked into
your application, or the info dictionary for this adaptor is
corrupted.
at com.webobjects.eoaccess.EOAdaptor.classForAdaptorNamed
(EOAdaptor.java:273)
[...]
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecificatio
n(EOEditingContext.java:4500)
at moleque.espacoFisicoFramework.EoPavimento.setNumber
(EoPavimento.java:43)
at
moleque.espacoFisicoFramework.interfaces.EdificacaoTest.adicionaPavime
ntoComAndar (EdificacaoTest.java:31)
[...]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:196)
I'm already set JDBC adaptor into eomodel.
Are you sure you did? You'd get this exception when trying to access
the DB via an EOModel that doesn't have an adaptor configuration. So
make sure that your EOModel has a valid adaptor configuration, or
that you invoke some functionality that configures your EOModel
before the test run like in:
@BeforeClass
public static void loadAndInitModels() throws
MalformedURLException {
if (EOModelGroup.defaultGroup().modelNamed("foo") == null) {
EOModelGroup.defaultGroup().addModelWithPathURL( foo );
YourModelHelper.initAdaptoConfigs();
}
}
Or, and this is your third and my favorite option, don't use an
EOEditingContext in your unit tests. Use the mockEditingContext()
instead. If EoPavimento is an EO, create it with the
mockEditingContext so that when setNumber() invokes editingContext
().objectsWithFetchSpecification(), it'll get the mockEditingContext
which won't go to the DB, i.e. won't be bothered by the adaptor not
being configured.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden
This email sent to email@hidden