Navigation Menu

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

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: 6d8acd2696f41918d4233ddffe46e6c205f9dbc3
  • Loading branch information
Yuri Nesterenko committed Dec 9, 2021
1 parent 5f1309f commit dd560a5
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 @@ -59,8 +59,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 @@ -73,8 +72,7 @@ void testEmpty() throws Throwable {
assertEquals((String)mhEmpty.invoke("x","y"), null);
}

@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 dd560a5

@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.