NodeContext tests

This commit is contained in:
Vincent Batts 2012-10-31 21:46:59 -04:00
parent d40e41de5a
commit dcc9c50655

View file

@ -1,6 +1,5 @@
package com.redhat.trie;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@ -9,10 +8,26 @@ import org.junit.Test;
public class TestNodeContext {
@Test
public void testNew(){
public void testNew1() {
NodeContext nc = new NodeContext();
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));
}
}