From dcc9c50655b437c3639026b7ed10be6449848186 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 31 Oct 2012 21:46:59 -0400 Subject: [PATCH] NodeContext tests --- .../java/com/redhat/trie/TestNodeContext.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/redhat/trie/TestNodeContext.java b/src/test/java/com/redhat/trie/TestNodeContext.java index a31a1fa..f32b217 100644 --- a/src/test/java/com/redhat/trie/TestNodeContext.java +++ b/src/test/java/com/redhat/trie/TestNodeContext.java @@ -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)); + } }