NodeContext tests
This commit is contained in:
parent
d40e41de5a
commit
dcc9c50655
1 changed files with 17 additions and 2 deletions
|
@ -1,6 +1,5 @@
|
||||||
package com.redhat.trie;
|
package com.redhat.trie;
|
||||||
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
|
@ -9,10 +8,26 @@ import org.junit.Test;
|
||||||
public class TestNodeContext {
|
public class TestNodeContext {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNew(){
|
public void testNew1() {
|
||||||
NodeContext nc = new NodeContext();
|
NodeContext nc = new NodeContext();
|
||||||
assertNotNull(nc);
|
assertNotNull(nc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testNew2() {
|
||||||
|
NodeContext nc = new NodeContext(1);
|
||||||
|
assertNotNull(nc);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCounter() {
|
||||||
|
NodeContext nc = new NodeContext();
|
||||||
|
assertEquals(nc.getId(), 0);
|
||||||
|
|
||||||
|
long next = nc.nextId();
|
||||||
|
assertEquals(nc.getId(), 1);
|
||||||
|
assertEquals(nc.getId(), (next + 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue