Examples of assertWithTimeout()


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

            @Override
            protected void assertResult() throws Exception {
                assertEquals(PersistenceState.NEW, altArtist.getPersistenceState());
            }
        };
        helper.assertWithTimeout(3000);

        // check if now we can save this object again, and with the original
        // ObjectId
        ObjectId id = altArtist.getObjectId();
        assertNotNull(id);
View Full Code Here

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

            protected void assertResult() throws Exception {
                assertEquals(PersistenceState.TRANSIENT, altArtist.getPersistenceState());
                assertNull(altArtist.getObjectContext());
            }
        };
        helper.assertWithTimeout(3000);

        assertFalse(altContext.hasChanges());
    }

    /**
 
View Full Code Here

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

                Collection list = altArtist.getPaintingArray();
                assertEquals(1, list.size());
                assertFalse(list.contains(altPainting1));
            }
        };
        helper.assertWithTimeout(3000);
    }

    /**
     * Test case to prove that inserting an object in one ObjectStore and committing to
     * the database will be reflected in the peer ObjectStore using the same DataRowCache.
View Full Code Here

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

                Object value = altArtist.readPropertyDirectly("paintingArray");
                assertTrue("Unexpected: " + value, value instanceof ToManyList);
                assertTrue(((ToManyList) value).isFault());
            }
        };
        helper.assertWithTimeout(2000);
        List list = altArtist.getPaintingArray();
        assertEquals(2, list.size());
    }

    /**
 
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
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.