mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-04-21 07:24:34 +02:00
Use fail() instead of assertTrue(false).
This commit is contained in:
@@ -34,7 +34,7 @@ public class DatabaseCleanerImplTest extends TestCase {
|
||||
try {
|
||||
assertTrue(latch.await(5, TimeUnit.SECONDS));
|
||||
} catch(InterruptedException e) {
|
||||
assertTrue(false);
|
||||
fail();
|
||||
}
|
||||
// Stop the cleaner (it should be waiting between sweeps)
|
||||
cleaner.stopCleaning();
|
||||
|
||||
@@ -470,63 +470,63 @@ public abstract class DatabaseComponentTest extends TestCase {
|
||||
|
||||
try {
|
||||
db.generateAck(contactId, ackWriter);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.generateBatch(contactId, batchWriter);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.generateBatch(contactId, batchWriter,
|
||||
Collections.<MessageId>emptyList());
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.generateOffer(contactId, offerWriter);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.generateSubscriptions(contactId, subscriptionWriter);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.generateTransports(contactId, transportWriter);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.hasSendableMessages(contactId);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.receiveAck(contactId, ack);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.receiveBatch(contactId, batch);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.receiveOffer(contactId, offer, requestWriter);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.receiveSubscriptions(contactId, subscriptionsUpdate);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
try {
|
||||
db.receiveTransports(contactId, transportsUpdate);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(NoSuchContactException expected) {}
|
||||
|
||||
context.assertIsSatisfied();
|
||||
|
||||
@@ -1119,7 +1119,7 @@ public class H2DatabaseTest extends TestCase {
|
||||
try {
|
||||
// Ask for a nonexistent message - an exception should be thrown
|
||||
db.getMessage(txn, messageId);
|
||||
assertTrue(false);
|
||||
fail();
|
||||
} catch(DbException expected) {
|
||||
// It should be possible to abort the transaction without error
|
||||
db.abortTransaction(txn);
|
||||
|
||||
Reference in New Issue
Block a user