Package org.apache.cayenne.test.parallel

Examples of org.apache.cayenne.test.parallel.ParallelTestContainer.runTest()


                assertTrue(bridge.lastLocalEvent instanceof SnapshotEvent);
                assertEquals(local, bridge.lastLocalEvent.getSubject());
            }
        };

        helper.runTest(5000);

        final SnapshotEvent eventWithSubject = new SnapshotEvent(
                this,
                this,
                null,
View Full Code Here


                assertTrue(bridge.lastLocalEvent instanceof SnapshotEvent);
                assertEquals(local, bridge.lastLocalEvent.getSubject());
            }
        };

        helper1.runTest(5000);
    }

    class TestBridge extends EventBridge {

        CayenneEvent lastLocalEvent;
View Full Code Here

            @Override
            protected void assertResult() throws Exception {
                assertEquals(expected, listener.numberOfReceivedEvents);
            }
        };
        helper.runTest(5000);
    }

    // allows just enough time for the event threads to run
    private static void assertReceivedEventsForClass(final int expected) throws Exception {
        ParallelTestContainer helper = new ParallelTestContainer() {
View Full Code Here

            @Override
            protected void assertResult() throws Exception {
                assertEquals(expected, numberOfReceivedEventsForClass);
            }
        };
        helper.runTest(5000);
    }

}

// dummy class to test for incompatible events
View Full Code Here

            @Override
            protected void assertResult() throws Exception {
                assertTrue("Delegate was not consulted", methodInvoked[0]);
            }
        };
        helper.runTest(3000);
    }

    /**
     * Test case to prove that delegate method can block changes made by ObjectStore.
     *
 
View Full Code Here

            @Override
            protected void assertResult() throws Exception {
                assertTrue("Delegate was not consulted", methodInvoked[0]);
            }
        };
        helper.runTest(3000);
    }

    /**
     * Test case to prove that delegate method is invoked on external change of object in
     * the store, and is able to block further object processing.
View Full Code Here

            @Override
            protected void assertResult() throws Exception {
                assertTrue("Delegate was not consulted", methodInvoked[0]);
            }
        };
        helper.runTest(3000);
        assertEquals(PersistenceState.COMMITTED, altArtist.getPersistenceState());
        assertNotNull(altArtist.getObjectContext());
    }
}
View Full Code Here

                        "Peer object state wasn't refreshed on fetch",
                        newName,
                        artist.getArtistName());
            }
        };
        helper.runTest(3000);
    }

    /**
     * Test case to prove that changes made to an object in one ObjectStore and committed
     * to the database will be reflected in the peer ObjectStore using the same
View Full Code Here

            @Override
            protected void assertResult() throws Exception {
                assertEquals(newName, altArtist.getArtistName());
            }
        };
        helper.runTest(3000);
    }

    /**
     * Test case to prove that changes made to an object in one ObjectStore and committed
     * to the database will be correctly merged in the peer ObjectStore using the same
View Full Code Here

                assertEquals(newAltName, altArtist.getArtistName());
                assertEquals(newDate, altArtist.getDateOfBirth());
                assertEquals(PersistenceState.MODIFIED, altArtist.getPersistenceState());
            }
        };
        helper.runTest(3000);

    }

    /**
     * Test case to prove that deleting an object in one ObjectStore and committing to the
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.