Search in sources :

Example 1 with MixedPersistenceStrategy2

use of org.apache.cayenne.testdo.mixed_persistence_strategy.MixedPersistenceStrategy2 in project cayenne by apache.

the class MixedPersistenceStrategyIT method testConflictingField2.

/**
 * This test case reproduces CAY-582 bug.
 */
@Test
public void testConflictingField2() throws Exception {
    createConflictingFieldDataSet();
    MixedPersistenceStrategy2 detail1 = Cayenne.objectForPK(context, MixedPersistenceStrategy2.class, 1);
    MixedPersistenceStrategy2 detail2 = Cayenne.objectForPK(context, MixedPersistenceStrategy2.class, 2);
    // resolve master (this is where CAY-582 exception happens)
    assertEquals("n1", detail1.getMaster().getName());
    assertEquals(2, detail2.getMaster().getDetails().size());
    assertTrue(detail2.getMaster().getDetails() instanceof ValueHolder);
}
Also used : MixedPersistenceStrategy2(org.apache.cayenne.testdo.mixed_persistence_strategy.MixedPersistenceStrategy2) ValueHolder(org.apache.cayenne.ValueHolder) Test(org.junit.Test)

Aggregations

ValueHolder (org.apache.cayenne.ValueHolder)1 MixedPersistenceStrategy2 (org.apache.cayenne.testdo.mixed_persistence_strategy.MixedPersistenceStrategy2)1 Test (org.junit.Test)1