1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.omid.committable;
19
20 import org.testng.annotations.Test;
21
22 import static org.testng.Assert.assertNull;
23
24
25
26
27 public class NullCommitTableTest {
28
29 private static final long TEST_ST = 1L;
30 private static final long TEST_CT = 2L;
31 private static final long TEST_LWM = 1L;
32
33 @Test(timeOut = 10_000)
34 public void testClientAndWriter() throws Exception {
35
36 CommitTable commitTable = new NullCommitTable();
37
38 CommitTable.Client commitTableClient = commitTable.getClient();
39 CommitTable.Writer commitTableWriter = commitTable.getWriter();
40
41
42 try {
43 commitTableClient.readLowWatermark().get();
44 } catch (UnsupportedOperationException e) {
45
46 }
47
48 try {
49 commitTableClient.getCommitTimestamp(TEST_ST).get();
50 } catch (UnsupportedOperationException e) {
51
52 }
53
54 try {
55 commitTableClient.tryInvalidateTransaction(TEST_ST).get();
56 } catch (UnsupportedOperationException e) {
57
58 }
59
60 assertNull(commitTableClient.deleteCommitEntry(TEST_ST).get());
61
62
63 commitTableWriter.updateLowWatermark(TEST_LWM);
64 commitTableWriter.addCommittedTransaction(TEST_ST, TEST_CT);
65 commitTableWriter.clearWriteBuffer();
66 commitTableWriter.flush();
67 }
68 }