Apparent interface violation in CriteriaBuilderImpl [message #667108] |
Tue, 26 April 2011 14:44  |
Eclipse User |
|
|
|
I am unit testing some stuff that uses eclipselink. I have created my own mock of the MetaModel as passed into the EntityManager.
However when CriteriaBuilderImpl.createQuery executes i get class cast exceptions such as the following, as CriteriaBuilderImpl apparently assumes an implementation of the MetaModel, and does not use the interface. This seems wrong to me, bug?:
java.lang.ClassCastException: com.acme.pgbu.dao.datasource.EntityDataSourceTest$2$1 cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl
at org.eclipse.persistence.internal.jpa.querydef.CriteriaBuilde rImpl.createQuery(CriteriaBuilderImpl.java:81)
at com.acme.pgbu.dao.datasource.EntityDataSource.getDataTOs(Ent ityDataSource.java:88)
at com.acme.pgbu.dao.datasource.EntityDataSourceTest.testGetDat aTOs(EntityDataSourceTest.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl ectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr ameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate( InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(Block JUnit4ClassRunner.java:79)
|
|
|
|
Powered by
FUDForum. Page generated in 0.10649 seconds