mirror of https://github.com/apache/openjpa.git
fix more broken tests due to lazy Id generation
This commit is contained in:
parent
ba7b8493ca
commit
eaecedf328
|
@ -32,10 +32,17 @@
|
|||
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
||||
<validation-mode>CALLBACK</validation-mode>
|
||||
<properties>
|
||||
<!--
|
||||
this is only needed when not passing in the connection via
|
||||
either passing in via EntityManagerFactory or
|
||||
environment variable.
|
||||
In our case this is already properly setup in the
|
||||
OpenJPA parent pom.
|
||||
<property name="openjpa.ConnectionDriverName"
|
||||
value="org.apache.derby.jdbc.EmbeddedDriver" />
|
||||
<property name="openjpa.ConnectionURL"
|
||||
value="jdbc:derby:target/database/ImageDB;create=true" />
|
||||
-->
|
||||
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
|
||||
<property name="openjpa.DynamicEnhancementAgent" value="false"/>
|
||||
|
||||
|
|
|
@ -114,7 +114,9 @@ public class TestMany2ManyMapEx1 extends SQLListenerTestCase {
|
|||
rs = q.getResultList();
|
||||
Map.Entry me = (Map.Entry) rs.get(0);
|
||||
|
||||
assertTrue(d.equals(me.getKey()));
|
||||
Division other = (Division) me.getKey();
|
||||
assertEquals(d.getId(), other.getId());
|
||||
assertEquals(d.getName(), other.getName());
|
||||
|
||||
// test navigation thru KEY
|
||||
em.clear();
|
||||
|
|
|
@ -99,7 +99,9 @@ public class TestSpec10_1_27_Ex3 extends SQLListenerTestCase {
|
|||
rs = q.getResultList();
|
||||
Map.Entry me = (Map.Entry) rs.get(0);
|
||||
|
||||
assertTrue(d.equals(me.getKey()));
|
||||
Division other = (Division) me.getKey();
|
||||
assertEquals(d.getId(), other.getId());
|
||||
assertEquals(d.getName(), other.getName());
|
||||
|
||||
em.clear();
|
||||
query = "select KEY(e) from Company c " +
|
||||
|
|
|
@ -122,7 +122,9 @@ public class TestSpec10_1_27_Ex8 extends SQLListenerTestCase {
|
|||
setCandidate(q, Company.class);
|
||||
rs = q.getResultList();
|
||||
me = (Map.Entry) rs.get(0);
|
||||
|
||||
assertTrue(d.equals(me.getKey()));
|
||||
|
||||
assertEquals(v.getId(), ((VicePresident) me.getValue()).getId());
|
||||
|
||||
em.close();
|
||||
|
|
|
@ -125,7 +125,10 @@ public class TestSpec10_1_29_Ex1 extends SQLListenerTestCase {
|
|||
setCandidate(q, Company.class);
|
||||
rs = q.getResultList();
|
||||
me = (Map.Entry) rs.get(0);
|
||||
assertTrue(d.equals(me.getKey()));
|
||||
Division other = (Division) me.getKey();
|
||||
assertEquals(d.getId(), other.getId());
|
||||
assertEquals(d.getName(), other.getName());
|
||||
|
||||
assertEquals(v.getId(), ((VicePresident) me.getValue()).getId());
|
||||
|
||||
em.close();
|
||||
|
|
Loading…
Reference in New Issue