Package org.apache.openjpa.event

Examples of org.apache.openjpa.event.RemoteCommitEvent


        // simulate an add
        Set s = new HashSet();
        s.add(oid);
        ((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
            .getRemoteCommitEventManager().fireEvent(
            new RemoteCommitEvent(RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS,
                s, null, null, null));

        boolean pass = false;
        for (Iterator iter = transactionListener.added.iterator(); iter
            .hasNext();) {
            if (iter.next().equals(oid)) {
                pass = true;
                break;
            }
        }
        assertTrue(pass);
        assertTrue(transactionListener.updated.size() == 0);
        assertTrue(transactionListener.deleted.size() == 0);

        // simulate modifications
        ((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
            .getRemoteCommitEventManager().fireEvent(
            new RemoteCommitEvent(RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS,
                null, null, s, null));

        pass = false;
        for (Iterator iter = transactionListener.updated.iterator(); iter
            .hasNext();) {
            if (iter.next().equals(oid)) {
                pass = true;
                break;
            }
        }
        assertTrue(pass);
        assertTrue(transactionListener.added.size() == 0);
        assertTrue(transactionListener.deleted.size() == 0);

        // simulate a delete
        ((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
            .getRemoteCommitEventManager().fireEvent(
            new RemoteCommitEvent(RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS,
                null, null, null, s));

        pass = false;
        for (Iterator iter = transactionListener.deleted.iterator(); iter
            .hasNext();) {
View Full Code Here


        // simulate an add
        Set s = new HashSet();
        s.add(oid);
        ((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
            .getRemoteCommitEventManager().fireEvent(
            new RemoteCommitEvent(RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS,
                s, null, null, null));

        boolean pass = false;
        for (Iterator iter = transactionListener.added.iterator(); iter
            .hasNext();) {
            if (iter.next().equals(oid)) {
                pass = true;
                break;
            }
        }
        assertTrue(pass);
        assertTrue(transactionListener.updated.size() == 0);
        assertTrue(transactionListener.deleted.size() == 0);

        // simulate modifications
        ((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
            .getRemoteCommitEventManager().fireEvent(
            new RemoteCommitEvent(RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS,
                null, null, s, null));

        pass = false;
        for (Iterator iter = transactionListener.updated.iterator(); iter
            .hasNext();) {
            if (iter.next().equals(oid)) {
                pass = true;
                break;
            }
        }
        assertTrue(pass);
        assertTrue(transactionListener.added.size() == 0);
        assertTrue(transactionListener.deleted.size() == 0);

        // simulate a delete
        ((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
            .getRemoteCommitEventManager().fireEvent(
            new RemoteCommitEvent(RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS,
                null, null, null, s));

        pass = false;
        for (Iterator iter = transactionListener.deleted.iterator(); iter
            .hasNext();) {
View Full Code Here

TOP

Related Classes of org.apache.openjpa.event.RemoteCommitEvent

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.