Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use junit assert instead of java assert statement in test #4310

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ public void testEnsembleWithThreeRegionsReplaceInternal(int minDurability, boole
try {
BookieId replacedBookie = repp.replaceBookie(6, 6, ackQuorum, null,
ensemble, bookieToReplace, excludedAddrs).getResult();
assert (replacedBookie.equals(replacedBookieExpected));
assertEquals(replacedBookieExpected, replacedBookie);
assertEquals(3, getNumRegionsInEnsemble(ensemble));
} catch (BKNotEnoughBookiesException bnebe) {
fail("Should not get not enough bookies exception even there is only one rack.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void testNonPartitionedWritesInternal(String name, DistributedLogConfigu
long lastTxId = -1;
while (null != record) {
DLMTestUtil.verifyLogRecord(record);
assert (lastTxId < record.getTransactionId());
assertTrue(lastTxId < record.getTransactionId());
lastTxId = record.getTransactionId();
numTrans++;
record = reader.readNext(false);
Expand Down Expand Up @@ -465,7 +465,7 @@ public void testContinuousReaderBulk() throws Exception {
long lastTxId = -1;
while (!recordList.isEmpty()) {
for (LogRecord record : recordList) {
assert (lastTxId < record.getTransactionId());
assertTrue(lastTxId < record.getTransactionId());
lastTxId = record.getTransactionId();
DLMTestUtil.verifyLogRecord(record);
numTrans++;
Expand Down Expand Up @@ -792,7 +792,7 @@ private void markEndOfStreamOnEmptyLogSegment(int numCompletedSegments) throws E
long lastTxId = -1;
while (null != record) {
DLMTestUtil.verifyLogRecord(record);
assert (lastTxId < record.getTransactionId());
assertTrue(lastTxId < record.getTransactionId());
lastTxId = record.getTransactionId();
numTrans++;
record = reader.readNext(false);
Expand Down Expand Up @@ -874,7 +874,7 @@ public void deleteDuringRead() throws Exception {

LogReader reader = dlm.getInputStream(1);
LogRecord record = reader.readNext(false);
assert (null != record);
assertNotNull(record);
DLMTestUtil.verifyLogRecord(record);
long lastTxId = record.getTransactionId();

Expand All @@ -885,7 +885,7 @@ public void deleteDuringRead() throws Exception {
record = reader.readNext(false);
while (null != record) {
DLMTestUtil.verifyLogRecord(record);
assert (lastTxId < record.getTransactionId());
assertTrue(lastTxId < record.getTransactionId());
lastTxId = record.getTransactionId();
record = reader.readNext(false);
}
Expand Down Expand Up @@ -1247,42 +1247,42 @@ public void testTruncationValidation() throws Exception {
for (LogSegmentMetadata segment: cachedSegments) {
if (segment.getLastDLSN().compareTo(truncDLSN) < 0) {
assertTrue(segment.isTruncated());
assertTrue(!segment.isPartiallyTruncated());
assertFalse(segment.isPartiallyTruncated());
} else if (segment.getFirstDLSN().compareTo(truncDLSN) < 0) {
assertTrue(!segment.isTruncated());
assertFalse(segment.isTruncated());
assertTrue(segment.isPartiallyTruncated());
} else {
assertTrue(!segment.isTruncated());
assertTrue(!segment.isPartiallyTruncated());
assertFalse(segment.isTruncated());
assertFalse(segment.isPartiallyTruncated());
}
}

segmentList = DLMTestUtil.readLogSegments(zookeeperClient,
LogMetadata.getLogSegmentsPath(uri, name, conf.getUnpartitionedStreamName()));

assertTrue(segmentList.get(truncDLSN.getLogSegmentSequenceNo())
.getMinActiveDLSN().compareTo(truncDLSN) == 0);
assertEquals(0, segmentList.get(truncDLSN.getLogSegmentSequenceNo())
.getMinActiveDLSN().compareTo(truncDLSN));

{
LogReader reader = dlm.getInputStream(DLSN.InitialDLSN);
LogRecordWithDLSN record = reader.readNext(false);
assertTrue(record != null);
assertNotNull(record);
assertEquals(truncDLSN, record.getDlsn());
reader.close();
}

{
LogReader reader = dlm.getInputStream(1);
LogRecordWithDLSN record = reader.readNext(false);
assertTrue(record != null);
assertNotNull(record);
assertEquals(truncDLSN, record.getDlsn());
reader.close();
}

{
AsyncLogReader reader = dlm.getAsyncLogReader(DLSN.InitialDLSN);
LogRecordWithDLSN record = Utils.ioResult(reader.readNext());
assertTrue(record != null);
assertNotNull(record);
assertEquals(truncDLSN, record.getDlsn());
Utils.close(reader);
}
Expand All @@ -1291,15 +1291,15 @@ public void testTruncationValidation() throws Exception {
{
LogReader reader = dlm.getInputStream(beyondTruncDLSN);
LogRecordWithDLSN record = reader.readNext(false);
assertTrue(record != null);
assertNotNull(record);
assertEquals(beyondTruncDLSN, record.getDlsn());
reader.close();
}

{
LogReader reader = dlm.getInputStream(beyondTruncTxId);
LogRecordWithDLSN record = reader.readNext(false);
assertTrue(record != null);
assertNotNull(record);
assertEquals(beyondTruncDLSN, record.getDlsn());
assertEquals(beyondTruncTxId, record.getTransactionId());
reader.close();
Expand All @@ -1308,7 +1308,7 @@ public void testTruncationValidation() throws Exception {
{
AsyncLogReader reader = dlm.getAsyncLogReader(beyondTruncDLSN);
LogRecordWithDLSN record = Utils.ioResult(reader.readNext());
assertTrue(record != null);
assertNotNull(record);
assertEquals(beyondTruncDLSN, record.getDlsn());
Utils.close(reader);
}
Expand Down
Loading