Examples of closeAll()


Examples of org.apache.openjpa.persistence.Extent.closeAll()

        BaseSub1 pc = (BaseSub1) itr.next();
        assertEquals(2, pc.getBaseField());
        assertEquals(3, pc.getBaseSub1Field());
        assertEquals(BaseSub1.class, pc.getClass());
        assertTrue(!itr.hasNext());
        extent.closeAll();
        pm.close();
       
        assertEquals(1, sql.size());
        assertSQL(_outer);
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.Extent.closeAll()

        Extent extent = em.createExtent(RuntimeTest1.class, true);

        Iterator i = extent.iterator();
        if (!(i.hasNext()))
            fail("Iterator should have had next()");
        extent.closeAll();

        if (i.hasNext())
            fail("Iterator obtained from Extent should return false "
                + "for hasNext() after Extent has been closed");
View Full Code Here

Examples of org.apache.openjpa.persistence.Extent.closeAll()

        Extent extent = em.createExtent(RuntimeTest1.class, true);

        Iterator i = extent.iterator();
        if (!(i.hasNext()))
            fail("Iterator should have had next()");
        extent.closeAll();

        try {
            i.next();
            fail("Iterator.next() should have thrown Exception "
                + "after Extent.closeAll() was called");
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAQuery.closeAll()

        OpenJPAQuery q1 = pm1.createNativeQuery("",StateImagePC2.class);
        //FIXME  jthomas
        //q1.setOrdering("intField ascending");
        StateImagePC2 pc1 = (StateImagePC2) ((Collection) q1.getCandidateCollection()).
                iterator().next();
        q1.closeAll();
       
        OpenJPAQuery q2 = pm2.createNativeQuery("",StateImagePC2.class);
        //FIXME jthomas
        //q2.setOrdering("intField ascending");
        StateImagePC2 pc2 = (StateImagePC2) ((Collection) q2.getCandidateCollection()).
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAQuery.closeAll()

        OpenJPAQuery q2 = pm2.createNativeQuery("",StateImagePC2.class);
        //FIXME jthomas
        //q2.setOrdering("intField ascending");
        StateImagePC2 pc2 = (StateImagePC2) ((Collection) q2.getCandidateCollection()).
                iterator().next();
        q2.closeAll();
       
        pm1.getTransaction().begin();
        pc1.setStringField("changed1");
        pc1.setStateImage(null);
       
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAQuery.closeAll()

        OpenJPAQuery q = em.createQuery("SELECT o FROM RuntimeTest1 o");
        List c = q.getResultList();
        Iterator i = c.iterator();
        if (!(i.hasNext()))
            fail("Iterator should have had next()");
        q.closeAll();
        endTx(em);
        endEm(em);

        if (i.hasNext())
            fail("Iterator obtained from Query should return false "
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAQuery.closeAll()

        OpenJPAQuery q = em.createQuery("SELECT o FROM RuntimeTest1 o");
        List c = q.getResultList();
        Iterator i = c.iterator();
        if (!(i.hasNext()))
            fail("Iterator should have had next()");
        q.closeAll();
        endTx(em);
        endEm(em);

        try {
            i.next();
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAQuery.closeAll()

        List l = q.getResultList();
        assertNotNull(
            "expecting l to be null since there is no RuntimeTest1 instance with stringfield=xxxx",
            l);

        q.closeAll();
        endTx(em);
        endEm(em);
    }

    public void testUniqueThrowsExceptionIfMultipleResults() {
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAQuery.closeAll()

            Object l = q.getSingleResult();
            fail("Unique query matched multiple results.");
        }
        catch (Exception jue) {
        }
        q.closeAll();
        endTx(em);
        endEm(em);
    }

    public void testImpossibleRangeReturnsEmptyList() {
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAQuery.closeAll()

        List results = q.getResultList();

        assertEquals(0, results.size());
        assertFalse(results.iterator().hasNext());
        q.closeAll();
        endTx(em);
        endEm(em);
    }

    public void testImpossibleUniqueRangeReturnsNull() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.