Use fail() instead of assertTrue(false).

This commit is contained in:
akwizgran
2011-08-03 21:19:04 +01:00
parent 93ee4d004e
commit 5be9d953ee
10 changed files with 26 additions and 26 deletions
@@ -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();
+12 -12
View File
@@ -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();
+1 -1
View File
@@ -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);