private void assertAreEqual(Object expected, Object actual) {
   if (new Short(Short.MAX_VALUE).equals(expected) && db4oHandlerVersion() == 0) {
     // Bug in the oldest format: It treats Short.MAX_VALUE as null.
     expected = null;
   }
   Assert.areEqual(expected, actual);
 }
 private void assertAreEqual(short expected, short actual) {
   if (expected == Short.MAX_VALUE && db4oHandlerVersion() == 0) {
     // Bug in the oldest format: It treats Short.MAX_VALUE as null.
     expected = 0;
   }
   Assert.areEqual(expected, actual);
 }
예제 #3
0
  public void _testKillingClients() throws InterruptedException {

    final int CLIENT_COUNT = 3;

    final StringBuffer results = new StringBuffer();

    ThreadServices.spawnAndJoin(
        "ClientProcessesTestCase.testKillingClients",
        CLIENT_COUNT,
        new CodeBlock() {
          public void run() throws Throwable {
            results.append(
                JavaServices.startAndKillJavaProcess(
                    clientRunnerCommand(), CLIENT_STARTED_OK, 10000));
          }
        });

    Assert.areEqual(1, connectedClients());
    System.out.println(results);
  }
예제 #4
0
 private void assertInstanceOK(ABar bar) {
   Assert.areEqual("foo", bar.foo);
   Assert.areEqual("bar", bar.bar);
 }
예제 #5
0
 private void asserItemCount(final int expectedCount) {
   Query query = db().query();
   query.constrain(Item.class);
   int itemCount = query.execute().size();
   Assert.areEqual(expectedCount, itemCount);
 }