Examples of assertWithTimeout()


Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

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

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

Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

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

}

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

Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

                        "Snapshot change is not propagated: " + freshSnapshot,
                        NEW_NAME,
                        a2.getArtistName());
            }
        };
        helper.assertWithTimeout(3000);
    }
}
View Full Code Here

Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

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

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

Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

            @Override
            protected void assertResult() throws Exception {
                assertTrue("Delegate was not consulted", methodInvoked[0]);
            }
        };
        helper.assertWithTimeout(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

Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

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

Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

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

        helper.assertWithTimeout(5000);

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

Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

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

        helper1.assertWithTimeout(5000);
    }

    class TestBridge extends EventBridge {

        CayenneEvent lastLocalEvent;
View Full Code Here

Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

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

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

Examples of org.apache.cayenne.unit.util.ThreadedTestHelper.assertWithTimeout()

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

}

// dummy class to test for incompatible events
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.