MCPcopy Create free account
hub / github.com/apache/poi / testSize

Method testSize

src/testcases/org/apache/poi/util/TestBinaryTree.java:32–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30public final class TestBinaryTree extends TestCase {
31
32 public void testSize() {
33 Map m = new BinaryTree();
34
35 assertEquals(0, m.size());
36 LocalTestNode nodes[] = makeLocalNodes();
37
38 for (int k = 0; k < nodes.length; k++)
39 {
40 m.put(nodes[ k ].getKey(), nodes[ k ].getValue());
41 assertEquals(k + 1, m.size());
42 }
43 int count = m.size();
44
45 for (int k = 0; k < nodes.length; k++)
46 {
47 m.remove(nodes[ k ].getKey());
48 --count;
49 assertEquals(count, m.size());
50
51 // failed remove should not affect size
52 m.remove(nodes[ k ].getKey());
53 assertEquals(count, m.size());
54 }
55 }
56
57 public void testIsEmpty() {
58 Map m = new BinaryTree();

Callers

nothing calls this directly

Calls 7

sizeMethod · 0.95
makeLocalNodesMethod · 0.95
putMethod · 0.95
removeMethod · 0.95
getValueMethod · 0.65
assertEqualsMethod · 0.45
getKeyMethod · 0.45

Tested by

no test coverage detected