Package org.apache.openjpa.persistence.kernel.common.apps

Examples of org.apache.openjpa.persistence.kernel.common.apps.InstanceCallbacksTest


//  }

    public void testFlushNoChange() {
        EntityManager em = currentEntityManager();
        startTx(em);
        InstanceCallbacksTest a = new InstanceCallbacksTest("foo", 10);
        em.persist(a);
        em.flush();
        endTx(em);
        //assertTrue (a.preStoreCalled);
        assertEquals(10, a.getIntField());

        endTx(em);
        endEm(em);
    }
View Full Code Here


    public void setUp() throws Exception {
        deleteAll(InstanceCallbacksTest.class);
        deleteAll(RuntimeTest1.class);
        _pm = getPM(true, true);
        startTx(_pm);
        _callbacks = new InstanceCallbacksTest();
        _callbacks.setStringField("foo");
        _pm.persist(_callbacks);
        Object id = _pm.getObjectId(_callbacks);
        endTx(_pm);
        endEm(_pm);
View Full Code Here

                _pm.flush();
            endTx(_pm);
        }

        OpenJPAEntityManager pm = getPM();
        InstanceCallbacksTest callbacks = (InstanceCallbacksTest)
            pm.find(InstanceCallbacksTest.class, oid);
        assertNoCallbacksInvoked(callbacks);
        assertEquals("getonetoone strng is not jdoprestore", "jdoPreStore",
            callbacks.getOneOne().getStringField());
        endEm(pm);
    }
View Full Code Here

        endTx(_pm);
    }

    public void testSetRelatedReferenceInPreStore() {
        assertNull(_callbacks.getRelId());
        InstanceCallbacksTest callbacks2 = new InstanceCallbacksTest();
        callbacks2.setRelId(_pm.getObjectId(_callbacks));
        startTx(_pm);
        _pm.persist(callbacks2);
        _pm.flush();
        endTx(_pm);
        assertEquals(8888, _callbacks.getIntField());
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.kernel.common.apps.InstanceCallbacksTest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.