コード例 #1
0
 @DataProvider(name = "nonempty")
 public Iterator<Object[]> nonempty() {
   return Arrays.asList(
           a(Maps2.of(0, "a"), genMap(1)),
           a(Maps2.of(0, "a", 1, "b"), genMap(2)),
           a(Maps2.of(0, "a", 1, "b", 2, "c"), genMap(3)),
           a(Maps2.of(0, "a", 1, "b", 2, "c", 3, "d"), genMap(4)),
           a(Maps2.of(0, "a", 1, "b", 2, "c", 3, "d", 4, "e"), genMap(5)),
           a(Maps2.of(0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f"), genMap(6)),
           a(Maps2.of(0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g"), genMap(7)),
           a(Maps2.of(0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h"), genMap(8)),
           a(
               Maps2.of(0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i"),
               genMap(9)),
           a(
               Maps2.of(
                   0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i", 9, "j"),
               genMap(10)),
           a(Maps2.ofEntries(genEntries(MAX_ENTRIES)), genMap(MAX_ENTRIES)))
       .iterator();
 }
コード例 #2
0
 @Test(expectedExceptions = NullPointerException.class)
 public void nullValueDisallowed10() {
   @SuppressWarnings("unused")
   Map<Integer, String> map =
       Maps2.of(0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i", 9, null);
 }
コード例 #3
0
 @DataProvider(name = "empty")
 public Iterator<Object[]> empty() {
   return Collections.singletonList(a(Maps2.of(), genMap(0))).iterator();
 }
コード例 #4
0
 @Test(expectedExceptions = NullPointerException.class)
 public void nullKeyDisallowed7() {
   @SuppressWarnings("unused")
   Map<Integer, String> map = Maps2.of(0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", null, "g");
 }
コード例 #5
0
 @Test(expectedExceptions = NullPointerException.class)
 public void nullValueDisallowed4() {
   @SuppressWarnings("unused")
   Map<Integer, String> map = Maps2.of(0, "a", 1, "b", 2, "c", 3, null);
 }
コード例 #6
0
 @Test(expectedExceptions = NullPointerException.class)
 public void nullKeyDisallowed2() {
   @SuppressWarnings("unused")
   Map<Integer, String> map = Maps2.of(0, "a", null, "b");
 }
コード例 #7
0
 @Test(expectedExceptions = IllegalArgumentException.class)
 public void dupKeysDisallowed10() {
   @SuppressWarnings("unused")
   Map<Integer, String> map =
       Maps2.of(0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i", 0, "j");
 }
コード例 #8
0
 @Test(expectedExceptions = IllegalArgumentException.class)
 public void dupKeysDisallowed4() {
   @SuppressWarnings("unused")
   Map<Integer, String> map = Maps2.of(0, "a", 1, "b", 2, "c", 0, "d");
 }