Package org.apache.cayenne.test.parallel

Examples of org.apache.cayenne.test.parallel.ParallelTestContainer


    a1.setArtistName("Y");
    assertEquals("X", a2.getArtistName());
    peer1.commitChangesToParent();

    // pause to let the context events propagate
    new ParallelTestContainer() {

      @Override
      protected void assertResult() throws Exception {
        assertEquals("Y", a2.getArtistName());
        assertFalse(
View Full Code Here


    p1.setToArtist(altA1);
    assertSame(a2, p2.getToArtist());
    peer1.commitChangesToParent();

    // pause to let the context events propagate
    new ParallelTestContainer() {

      @Override
      protected void assertResult() throws Exception {
        assertEquals(altA2, p2.getToArtist());
View Full Code Here

    a1.addToPaintingArray(py1);
    assertEquals(1, a2.getPaintingArray().size());
    assertFalse(a2.getPaintingArray().contains(py2));
    peer1.commitChangesToParent();
    // pause to let the context events propagate
    new ParallelTestContainer() {

      @Override
      protected void assertResult() throws Exception {
        assertEquals(2, a2.getPaintingArray().size());
        assertTrue(a2.getPaintingArray().contains(py2));
View Full Code Here

        assertEquals(0, context.getObjectStore().registeredObjectsCount());
        context.performQuery(new SelectQuery(Artist.class));
        assertEquals(1, context.getObjectStore().registeredObjectsCount());

        // allow for slow GC
        new ParallelTestContainer() {

            @Override
            protected void assertResult() throws Exception {
                System.gc();
                assertEquals(0, context.getObjectStore().registeredObjectsCount());
View Full Code Here

        a.setArtistName("X");
        a = null;
        assertEquals(1, context.getObjectStore().registeredObjectsCount());

        // allow for slow GC
        new ParallelTestContainer() {

            @Override
            protected void assertResult() throws Exception {
                System.gc();
                assertEquals(1, context.getObjectStore().registeredObjectsCount());
            }
        }.runTest(2000);

        assertEquals(1, context.getObjectStore().registeredObjectsCount());
        context.commitChanges();
        new ParallelTestContainer() {

            @Override
            protected void assertResult() throws Exception {
                System.gc();
                assertEquals(0, context.getObjectStore().registeredObjectsCount());
View Full Code Here

        Artist a = Cayenne.objectForPK(context, Artist.class, 1);
        a.setArtistName("Y");
        a = null;
        assertEquals(1, context.getObjectStore().registeredObjectsCount());

        new ParallelTestContainer() {

            @Override
            protected void assertResult() throws Exception {
                System.gc();
                assertEquals(1, context.getObjectStore().registeredObjectsCount());
            }
        }.runTest(2000);

        context.commitChanges();
        new ParallelTestContainer() {

            @Override
            protected void assertResult() throws Exception {
                System.gc();
                assertEquals(0, context.getObjectStore().registeredObjectsCount());
View Full Code Here

TOP

Related Classes of org.apache.cayenne.test.parallel.ParallelTestContainer

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.