OpenJDK / amber / amber
changeset 54497:b7c57ef95828
8213932: [TESTBUG] assertEquals is invoked with the arguments in the wrong order
Reviewed-by: lancea
author | mchung |
---|---|
date | Tue, 22 Jan 2019 15:31:47 -0800 |
parents | 1ec56532ae0c |
children | ddfa4bfabdec |
files | test/jdk/java/lang/invoke/CompileThresholdBootstrapTest.java test/jdk/java/lang/invoke/ConstantIdentityMHTest.java test/jdk/java/lang/invoke/FilterArgumentsTest.java test/jdk/java/lang/invoke/lookup/SpecialStatic.java |
diffstat | 4 files changed, 13 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/test/jdk/java/lang/invoke/CompileThresholdBootstrapTest.java Tue Jan 22 12:37:35 2019 -0800 +++ b/test/jdk/java/lang/invoke/CompileThresholdBootstrapTest.java Tue Jan 22 15:31:47 2019 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ @Test public void testBootstrap() throws Throwable { - Assert.assertEquals(0, (int)MethodHandles.constant(int.class, (int)0).invokeExact()); + Assert.assertEquals((int)MethodHandles.constant(int.class, (int)0).invokeExact(), 0); } public static void main(String ... args) {
--- a/test/jdk/java/lang/invoke/ConstantIdentityMHTest.java Tue Jan 22 12:37:35 2019 -0800 +++ b/test/jdk/java/lang/invoke/ConstantIdentityMHTest.java Tue Jan 22 15:31:47 2019 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,11 +31,9 @@ import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; -import java.util.List; import static java.lang.invoke.MethodHandles.*; import static java.lang.invoke.MethodType.*; -import static org.testng.AssertJUnit.*; +import static org.testng.Assert.*; import org.testng.annotations.*; public class ConstantIdentityMHTest { @@ -70,9 +68,9 @@ @Test void testEmpty() throws Throwable { MethodHandle cat = lookup().findVirtual(String.class, "concat", methodType(String.class, String.class)); - assertEquals("xy", (String)cat.invoke("x","y")); + assertEquals((String)cat.invoke("x","y"), "xy"); MethodHandle mhEmpty = MethodHandles.empty(cat.type()); - assertEquals(null, (String)mhEmpty.invoke("x","y")); + assertEquals((String)mhEmpty.invoke("x","y"), null); } @Test
--- a/test/jdk/java/lang/invoke/FilterArgumentsTest.java Tue Jan 22 12:37:35 2019 -0800 +++ b/test/jdk/java/lang/invoke/FilterArgumentsTest.java Tue Jan 22 15:31:47 2019 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,8 +85,8 @@ void run(List<String> expected) throws Throwable { filters.clear(); - assertEquals("x-0-z", (String)mh.invokeExact("x", 0, 'z')); - assertEquals(expected, filters); + assertEquals((String)mh.invokeExact("x", 0, 'z'), "x-0-z"); + assertEquals(filters, expected); } static String filterA(String s) {
--- a/test/jdk/java/lang/invoke/lookup/SpecialStatic.java Tue Jan 22 12:37:35 2019 -0800 +++ b/test/jdk/java/lang/invoke/lookup/SpecialStatic.java Tue Jan 22 15:31:47 2019 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @summary JSR292: invokeSpecial: InternalError attempting to lookup a method * @modules java.base/jdk.internal.org.objectweb.asm * @compile -XDignore.symbol.file SpecialStatic.java - * @run junit test.java.lang.invoke.lookup.SpecialStatic + * @run testng test.java.lang.invoke.lookup.SpecialStatic */ package test.java.lang.invoke.lookup; @@ -34,9 +34,9 @@ import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import jdk.internal.org.objectweb.asm.*; -import org.junit.Test; +import org.testng.annotations.*; import static jdk.internal.org.objectweb.asm.Opcodes.*; -import static org.junit.Assert.*; +import static org.testng.Assert.*; /** * Test case: