This repository has been archived by the owner on Jul 15, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "[SLINGCSCF-1959] Improve test coverage in commit-table module"
- Loading branch information
Showing
8 changed files
with
94 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 0 additions & 93 deletions
93
commit-table/src/main/java/com/yahoo/omid/committable/DelayNullCommitTable.java
This file was deleted.
Oops, something went wrong.
File renamed without changes.
45 changes: 45 additions & 0 deletions
45
commit-table/src/test/java/com/yahoo/omid/committable/NullCommitTableTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.yahoo.omid.committable; | ||
|
||
import org.testng.annotations.Test; | ||
import static org.testng.Assert.assertNull; | ||
|
||
/** | ||
* TODO: Remove this class when removing this class from production code | ||
*/ | ||
public class NullCommitTableTest { | ||
|
||
private static final long TEST_ST = 1L; | ||
private static final long TEST_CT = 2L; | ||
private static final long TEST_LWM = 1L; | ||
|
||
@Test | ||
public void testClientAndWriter() throws Exception { | ||
|
||
CommitTable commitTable = new NullCommitTable(); | ||
|
||
try (CommitTable.Client commitTableClient = commitTable.getClient().get(); | ||
CommitTable.Writer commitTableWriter = commitTable.getWriter().get()) { | ||
|
||
// Test client | ||
try { | ||
commitTableClient.readLowWatermark().get(); | ||
} catch (UnsupportedOperationException e) { | ||
// expected | ||
} | ||
|
||
try { | ||
commitTableClient.getCommitTimestamp(TEST_ST).get(); | ||
} catch (UnsupportedOperationException e) { | ||
// expected | ||
} | ||
|
||
assertNull(commitTableClient.completeTransaction(TEST_ST).get()); | ||
|
||
// Test writer | ||
commitTableWriter.updateLowWatermark(TEST_LWM); | ||
commitTableWriter.addCommittedTransaction(TEST_ST, TEST_CT); | ||
assertNull(commitTableWriter.flush().get()); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.