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

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


            return;

        OpenJPAEntityManager pm = getPM(false, false);
        startTx(pm);

        ModRuntimeTest2 b = pm.find(ModRuntimeTest2.class, _id);
        ModRuntimeTest1 parent = b.getSelfOneOne();
        assertNotNull("parent is null", parent);
        pm.remove(b);

        endTx(pm);

        // parent should be valid
        assertEquals("PARENT", parent.getStringField());

        // 'b' should be cleared
        assertNull(b.getStringField());
        assertEquals(0, b.getIntField());
        assertNull(b.getSelfOneOne());
    }
View Full Code Here


            return;

        OpenJPAEntityManager pm = getPM(false, false);
        startTx(pm);

        ModRuntimeTest2 b = pm.find(ModRuntimeTest2.class, _id);
        assertTest2Orig(b);
        pm.remove(b);

        rollbackTx(pm);
View Full Code Here

     * Tests basic state transitions from transient to
     * persistent-transactional and back to transient after rollback.
     */
    public void testOptStateTransitions1()
        throws Exception {
        ModRuntimeTest2 b = createTest2();

        OpenJPAEntityManager pm = getPM(true, false);
        startTx(pm);

        pm.persist(b);
        pm.persist(b.getSelfOneOne());
        assertTest2Orig(b);
        changeTest2(b);

        rollbackTx(pm);

View Full Code Here

     * Tests basic state transitions from transient to
     * persistent-transactional to persistent-nontransactional after commit.
     */
    public void testOptStateTransitions2()
        throws Exception {
        ModRuntimeTest2 b = createTest2();

        OpenJPAEntityManager pm = getPM(true, false);
        startTx(pm);

        pm.persist(b);
View Full Code Here

    public void testOptStateTransitions3()
        throws Exception {
        OpenJPAEntityManager pm = getPM(true, false);
        startTx(pm);

        ModRuntimeTest2 b = pm.find(ModRuntimeTest2.class, _id);
        assertTest2Orig(b);
        changeTest2(b);

        endTx(pm);
View Full Code Here

    public void testOptStateTransitions4()
        throws Exception {
        OpenJPAEntityManager pm = getPM(true, false);
        startTx(pm);

        ModRuntimeTest2 b = pm.find(ModRuntimeTest2.class, _id);
        assertTest2Orig(b);
        changeTest2(b);

        rollbackTx(pm);
View Full Code Here

    public void testOptStateTransitions5()
        throws Exception {
        OpenJPAEntityManager pm = getPM(true, false);
        startTx(pm);

        ModRuntimeTest2 b = pm.find(ModRuntimeTest2.class, _id);
        ModRuntimeTest1 parent = b.getSelfOneOne();
        assertNotNull("parent is null", parent);
        pm.remove(b);

        endTx(pm);

        // parent should be valid
        assertEquals("PARENT", parent.getStringField());

        // 'b' should be cleared
        assertNull(b.getStringField());
        assertEquals(0, b.getIntField());
        assertNull(b.getSelfOneOne());
    }
View Full Code Here

    public void testOptStateTransitions6()
        throws Exception {
        OpenJPAEntityManager pm = getPM(true, false);
        startTx(pm);

        ModRuntimeTest2 b = pm.find(ModRuntimeTest2.class, _id);
        pm.remove(b);

        rollbackTx(pm);

        assertTest2Orig(b);
View Full Code Here

     * Tests basic state transitions from transient to
     * persistent-transactional and back to transient after rollback.
     */
    public void testOptRetainStateTransitions1()
        throws Exception {
        ModRuntimeTest2 b = createTest2();

        OpenJPAEntityManager pm = getPM(true, true);
        startTx(pm);

        pm.persist(b);
        pm.persist(b.getSelfOneOne());
        assertTest2Orig(b);
        changeTest2(b);

        rollbackTx(pm);

View Full Code Here

     * Tests basic state transitions from transient to
     * persistent-transactional to persistent-nontransactional after commit.
     */
    public void testOptRetainStateTransitions2()
        throws Exception {
        ModRuntimeTest2 b = createTest2();

        OpenJPAEntityManager pm = getPM(true, true);
        startTx(pm);

        pm.persist(b);
View Full Code Here

TOP

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

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.