594 |
|
* get(null) throws NPE |
595 |
|
*/ |
596 |
|
public void testGet_NullPointerException() { |
597 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
598 |
|
try { |
598 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
599 |
|
c.get(null); |
600 |
|
shouldThrow(); |
601 |
|
} catch (NullPointerException success) {} |
605 |
|
* containsKey(null) throws NPE |
606 |
|
*/ |
607 |
|
public void testContainsKey_NullPointerException() { |
608 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
609 |
|
try { |
609 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
610 |
|
c.containsKey(null); |
611 |
|
shouldThrow(); |
612 |
|
} catch (NullPointerException success) {} |
616 |
|
* containsValue(null) throws NPE |
617 |
|
*/ |
618 |
|
public void testContainsValue_NullPointerException() { |
619 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
620 |
|
try { |
620 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
621 |
|
c.containsValue(null); |
622 |
|
shouldThrow(); |
623 |
|
} catch (NullPointerException success) {} |
627 |
|
* contains(null) throws NPE |
628 |
|
*/ |
629 |
|
public void testContains_NullPointerException() { |
630 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
631 |
|
try { |
631 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
632 |
|
c.contains(null); |
633 |
|
shouldThrow(); |
634 |
|
} catch (NullPointerException success) {} |
638 |
|
* put(null,x) throws NPE |
639 |
|
*/ |
640 |
|
public void testPut1_NullPointerException() { |
641 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
642 |
|
try { |
642 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
643 |
|
c.put(null, "whatever"); |
644 |
|
shouldThrow(); |
645 |
|
} catch (NullPointerException success) {} |
649 |
|
* put(x, null) throws NPE |
650 |
|
*/ |
651 |
|
public void testPut2_NullPointerException() { |
652 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
653 |
|
try { |
653 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
654 |
|
c.put("whatever", null); |
655 |
|
shouldThrow(); |
656 |
|
} catch (NullPointerException success) {} |
660 |
|
* putIfAbsent(null, x) throws NPE |
661 |
|
*/ |
662 |
|
public void testPutIfAbsent1_NullPointerException() { |
663 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
664 |
|
try { |
664 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
665 |
|
c.putIfAbsent(null, "whatever"); |
666 |
|
shouldThrow(); |
667 |
|
} catch (NullPointerException success) {} |
671 |
|
* replace(null, x) throws NPE |
672 |
|
*/ |
673 |
|
public void testReplace_NullPointerException() { |
674 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
675 |
|
try { |
675 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
676 |
|
c.replace(null, "whatever"); |
677 |
|
shouldThrow(); |
678 |
|
} catch (NullPointerException success) {} |
682 |
|
* replace(null, x, y) throws NPE |
683 |
|
*/ |
684 |
|
public void testReplaceValue_NullPointerException() { |
685 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
686 |
|
try { |
686 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
687 |
|
c.replace(null, one, "whatever"); |
688 |
|
shouldThrow(); |
689 |
|
} catch (NullPointerException success) {} |
693 |
|
* putIfAbsent(x, null) throws NPE |
694 |
|
*/ |
695 |
|
public void testPutIfAbsent2_NullPointerException() { |
696 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
697 |
|
try { |
697 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
698 |
|
c.putIfAbsent("whatever", null); |
699 |
|
shouldThrow(); |
700 |
|
} catch (NullPointerException success) {} |
704 |
|
* replace(x, null) throws NPE |
705 |
|
*/ |
706 |
|
public void testReplace2_NullPointerException() { |
707 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
708 |
|
try { |
708 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
709 |
|
c.replace("whatever", null); |
710 |
|
shouldThrow(); |
711 |
|
} catch (NullPointerException success) {} |
715 |
|
* replace(x, null, y) throws NPE |
716 |
|
*/ |
717 |
|
public void testReplaceValue2_NullPointerException() { |
718 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
719 |
|
try { |
719 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
720 |
|
c.replace("whatever", null, "A"); |
721 |
|
shouldThrow(); |
722 |
|
} catch (NullPointerException success) {} |
726 |
|
* replace(x, y, null) throws NPE |
727 |
|
*/ |
728 |
|
public void testReplaceValue3_NullPointerException() { |
729 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
730 |
|
try { |
730 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
731 |
|
c.replace("whatever", one, null); |
732 |
|
shouldThrow(); |
733 |
|
} catch (NullPointerException success) {} |
737 |
|
* remove(null) throws NPE |
738 |
|
*/ |
739 |
|
public void testRemove1_NullPointerException() { |
740 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
741 |
+ |
c.put("sadsdf", "asdads"); |
742 |
|
try { |
741 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
742 |
– |
c.put("sadsdf", "asdads"); |
743 |
|
c.remove(null); |
744 |
|
shouldThrow(); |
745 |
|
} catch (NullPointerException success) {} |
749 |
|
* remove(null, x) throws NPE |
750 |
|
*/ |
751 |
|
public void testRemove2_NullPointerException() { |
752 |
+ |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
753 |
+ |
c.put("sadsdf", "asdads"); |
754 |
|
try { |
753 |
– |
ConcurrentHashMap c = new ConcurrentHashMap(5); |
754 |
– |
c.put("sadsdf", "asdads"); |
755 |
|
c.remove(null, "whatever"); |
756 |
|
shouldThrow(); |
757 |
|
} catch (NullPointerException success) {} |