Navigation Menu

Skip to content

Commit

Permalink
8256066: Tests use deprecated TestNG API that is no longer available …
Browse files Browse the repository at this point in the history
…in new versions

Backport-of: 6d8acd2
  • Loading branch information
TheRealMDoerr committed Sep 20, 2021
1 parent 0a40175 commit 18e519c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions test/jdk/java/lang/invoke/ConstantIdentityMHTest.java
Expand Up @@ -61,8 +61,7 @@ public void testZero(Class<?> expectedtype, String expected) throws Throwable {
assertEquals(MethodHandles.zero(expectedtype).type().toString(), expected);
}

@Test
@ExpectedExceptions(NullPointerException.class)
@Test(expectedExceptions={ NullPointerException.class })
public void testZeroNPE() {
MethodHandle mh = MethodHandles.zero(null);
}
Expand All @@ -75,8 +74,7 @@ void testEmpty() throws Throwable {
assertEquals(null, (String)mhEmpty.invoke("x","y"));
}

@Test
@ExpectedExceptions(NullPointerException.class)
@Test(expectedExceptions = { NullPointerException.class })
void testEmptyNPE() {
MethodHandle lenEmptyMH = MethodHandles.empty(null);
}
Expand Down
9 changes: 3 additions & 6 deletions test/jdk/java/lang/invoke/DropArgumentsTest.java
Expand Up @@ -65,8 +65,7 @@ private Object[][] dropArgumentsToMatchNPEData()
};
}

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

@Test(dataProvider = "dropArgumentsToMatchIAEData")
@ExpectedExceptions(IllegalArgumentException.class)
@Test(dataProvider = "dropArgumentsToMatchIAEData", expectedExceptions = { IllegalArgumentException.class })
public void dropArgumentsToMatchIAE(MethodHandle target, int pos, List<Class<?>> valueType, int skip) {
MethodHandles.dropArgumentsToMatch(target, pos, valueType , skip);
}

@Test
@ExpectedExceptions(IllegalArgumentException.class)
@Test(expectedExceptions = { IllegalArgumentException.class })
public void dropArgumentsToMatchTestWithVoid() throws Throwable {
MethodHandle cat = lookup().findVirtual(String.class, "concat",
MethodType.methodType(String.class, String.class));
Expand Down
3 changes: 1 addition & 2 deletions test/jdk/java/lang/invoke/VarArgsTest.java
Expand Up @@ -69,8 +69,7 @@ public void testWithVarargs2() throws Throwable {
assertEquals("[two, too]", asListWithVarargs.invoke("two", "too").toString());
}

@Test
@ExpectedExceptions(IllegalArgumentException.class)
@Test(expectedExceptions = { IllegalArgumentException.class })
public void testWithVarargsIAE() throws Throwable {
MethodHandle lenMH = publicLookup()
.findVirtual(String.class, "length", methodType(int.class));
Expand Down

1 comment on commit 18e519c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.