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

Method testClear

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

Source from the content-addressed store, hash-verified

365 }
366
367 public void testClear() {
368 Map m = new BinaryTree();
369 LocalTestNode nodes[] = makeLocalNodes();
370
371 for (int k = 0; k < nodes.length; k++)
372 {
373 m.put(nodes[ k ].getKey(), nodes[ k ].getValue());
374 assertTrue(!m.isEmpty());
375 }
376 assertTrue(!m.isEmpty());
377 for (int k = 0; k < nodes.length; k++)
378 {
379 assertTrue(m.containsKey(nodes[ k ].getKey()));
380 assertTrue(m.containsValue(nodes[ k ].getValue()));
381 }
382 m.clear();
383 assertTrue(m.isEmpty());
384 for (int k = 0; k < nodes.length; k++)
385 {
386 assertTrue(!m.containsKey(nodes[ k ].getKey()));
387 assertTrue(!m.containsValue(nodes[ k ].getValue()));
388 }
389 }
390
391 public void testKeySet() {
392 testKeySet(new BinaryTree());

Callers

nothing calls this directly

Calls 8

makeLocalNodesMethod · 0.95
putMethod · 0.95
containsKeyMethod · 0.95
containsValueMethod · 0.95
clearMethod · 0.95
getValueMethod · 0.65
isEmptyMethod · 0.65
getKeyMethod · 0.45

Tested by

no test coverage detected