Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit dd560a5

Browse files
author
Yuri Nesterenko
committed
8256066: Tests use deprecated TestNG API that is no longer available in new versions
Backport-of: 6d8acd2696f41918d4233ddffe46e6c205f9dbc3
1 parent 5f1309f commit dd560a5

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

test/jdk/java/lang/invoke/ConstantIdentityMHTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ public void testZero(Class<?> expectedtype, String expected) throws Throwable {
5959
assertEquals(MethodHandles.zero(expectedtype).type().toString(), expected);
6060
}
6161

62-
@Test
63-
@ExpectedExceptions(NullPointerException.class)
62+
@Test(expectedExceptions={ NullPointerException.class })
6463
public void testZeroNPE() {
6564
MethodHandle mh = MethodHandles.zero(null);
6665
}
@@ -73,8 +72,7 @@ void testEmpty() throws Throwable {
7372
assertEquals((String)mhEmpty.invoke("x","y"), null);
7473
}
7574

76-
@Test
77-
@ExpectedExceptions(NullPointerException.class)
75+
@Test(expectedExceptions = { NullPointerException.class })
7876
void testEmptyNPE() {
7977
MethodHandle lenEmptyMH = MethodHandles.empty(null);
8078
}

test/jdk/java/lang/invoke/DropArgumentsTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ private Object[][] dropArgumentsToMatchNPEData()
6565
};
6666
}
6767

68-
@Test(dataProvider = "dropArgumentsToMatchNPEData")
69-
@ExpectedExceptions(NullPointerException.class)
68+
@Test(dataProvider = "dropArgumentsToMatchNPEData", expectedExceptions = { NullPointerException.class })
7069
public void dropArgumentsToMatchNPE(MethodHandle target, int pos, List<Class<?>> valueType, int skip) {
7170
MethodHandles.dropArgumentsToMatch(target, pos, valueType , skip);
7271
}
@@ -85,14 +84,12 @@ private Object[][] dropArgumentsToMatchIAEData()
8584
};
8685
}
8786

88-
@Test(dataProvider = "dropArgumentsToMatchIAEData")
89-
@ExpectedExceptions(IllegalArgumentException.class)
87+
@Test(dataProvider = "dropArgumentsToMatchIAEData", expectedExceptions = { IllegalArgumentException.class })
9088
public void dropArgumentsToMatchIAE(MethodHandle target, int pos, List<Class<?>> valueType, int skip) {
9189
MethodHandles.dropArgumentsToMatch(target, pos, valueType , skip);
9290
}
9391

94-
@Test
95-
@ExpectedExceptions(IllegalArgumentException.class)
92+
@Test(expectedExceptions = { IllegalArgumentException.class })
9693
public void dropArgumentsToMatchTestWithVoid() throws Throwable {
9794
MethodHandle cat = lookup().findVirtual(String.class, "concat",
9895
MethodType.methodType(String.class, String.class));

test/jdk/java/lang/invoke/VarArgsTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ public void testWithVarargs2() throws Throwable {
6969
assertEquals("[two, too]", asListWithVarargs.invoke("two", "too").toString());
7070
}
7171

72-
@Test
73-
@ExpectedExceptions(IllegalArgumentException.class)
72+
@Test(expectedExceptions = { IllegalArgumentException.class })
7473
public void testWithVarargsIAE() throws Throwable {
7574
MethodHandle lenMH = publicLookup()
7675
.findVirtual(String.class, "length", methodType(int.class));

0 commit comments

Comments
 (0)