OpenJDK / amber / amber
changeset 57015:821f4cb1f879 records-and-sealed
removing duplicated tests
author | vromero |
---|---|
date | Tue, 20 Aug 2019 14:33:57 -0400 |
parents | befc2bc52f1f |
children | a0077b5b35d8 1f7e5db93261 |
files | test/langtools/tools/javac/records/RecordCompilationTests.java test/langtools/tools/javac/records/fields/IllegalRecordComponentNameTest.java test/langtools/tools/javac/records/fields/IllegalRecordComponentNameTest.out test/langtools/tools/javac/records/mandated_members/RecordsCanReDeclareMembersTest.java test/langtools/tools/javac/records/mandated_members/UserDefinedAccessorsMustBePublic.java test/langtools/tools/javac/records/mandated_members/UserDefinedAccessorsMustBePublic.out test/langtools/tools/javac/records/mandated_members/accessors/BadAccessorsTest.java test/langtools/tools/javac/records/mandated_members/accessors/BadAccessorsTest.out test/langtools/tools/javac/records/mandated_members/canonical_constructor/MismatchTest.java test/langtools/tools/javac/records/mandated_members/canonical_constructor/MismatchTest.out |
diffstat | 10 files changed, 0 insertions(+), 100 deletions(-) [+] |
line wrap: on
line diff
--- a/test/langtools/tools/javac/records/RecordCompilationTests.java Tue Aug 20 13:43:41 2019 -0400 +++ b/test/langtools/tools/javac/records/RecordCompilationTests.java Tue Aug 20 14:33:57 2019 -0400 @@ -134,7 +134,6 @@ } public void testGoodMemberDeclarations() { - // @@@ Duplicates RecordsCanReDeclareMembersTest String template = "public record R(int x) {\n" + " public R(int x) { this.x = x; }\n" + " public int x() { return x; }\n" @@ -146,7 +145,6 @@ } public void testBadComponentNames() { - // @@@ Duplicates IllegalRecordComponentNameTest for (String s : BAD_COMPONENT_NAMES) assertFail("compiler.err.illegal.record.component.name", "record R(int #) { } ", s); } @@ -221,8 +219,6 @@ } public void testAccessorRedeclaration() { - // @@@ Duplicates BadAccessorsTest - // @@@ Duplicates UserDefinedAccessorsMustBePublic assertOK("public record R(int x) {\n" + " public int x() { return x; };" + "}"); @@ -292,7 +288,6 @@ assertOK("record R() { # }", "public R() throws IllegalArgumentException { }"); - // @@@ Duplicates MismatchTest // If types match, names must match assertFail("compiler.err.canonical.with.name.mismatch", "record R(int x, int y) { public R(int y, int x) { this.x = this.y = 0; }}");
--- a/test/langtools/tools/javac/records/fields/IllegalRecordComponentNameTest.java Tue Aug 20 13:43:41 2019 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @summary dont accept illegal record component names - * @compile/fail/ref=IllegalRecordComponentNameTest.out -XDrawDiagnostics IllegalRecordComponentNameTest.java - */ - -public class IllegalRecordComponentNameTest { - record R1(String toString) {} - record R2(String hashCode) {} - record R3(String getClass) {} - record R4(String readObjectNoData) {} - record R5(String readResolve) {} - record R6(String writeReplace) {} - record R7(String serialPersistentFields) {} -}
--- a/test/langtools/tools/javac/records/fields/IllegalRecordComponentNameTest.out Tue Aug 20 13:43:41 2019 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -IllegalRecordComponentNameTest.java:8:22: compiler.err.illegal.record.component.name: toString -IllegalRecordComponentNameTest.java:9:22: compiler.err.illegal.record.component.name: hashCode -IllegalRecordComponentNameTest.java:10:22: compiler.err.illegal.record.component.name: getClass -IllegalRecordComponentNameTest.java:11:22: compiler.err.illegal.record.component.name: readObjectNoData -IllegalRecordComponentNameTest.java:12:22: compiler.err.illegal.record.component.name: readResolve -IllegalRecordComponentNameTest.java:13:22: compiler.err.illegal.record.component.name: writeReplace -IllegalRecordComponentNameTest.java:14:22: compiler.err.illegal.record.component.name: serialPersistentFields -7 errors
--- a/test/langtools/tools/javac/records/mandated_members/RecordsCanReDeclareMembersTest.java Tue Aug 20 13:43:41 2019 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @summary records cannot explicitly declare hashCode or equals - * @compile RecordsCanReDeclareMembersTest.java - */ - -public record RecordsCanReDeclareMembersTest(int i) { - @Override - public int hashCode() { return 0; } - @Override - public boolean equals(Object o) { return true; } - @Override - public String toString() { return ""; } // toString() is OK - - public int i() { return i; } -}
--- a/test/langtools/tools/javac/records/mandated_members/UserDefinedAccessorsMustBePublic.java Tue Aug 20 13:43:41 2019 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @summary smoke negative test for record classes - * @compile/fail/ref=UserDefinedAccessorsMustBePublic.out -XDrawDiagnostics UserDefinedAccessorsMustBePublic.java - */ - -public record UserDefinedAccessorsMustBePublic(int i) { - int i() { return i; } -}
--- a/test/langtools/tools/javac/records/mandated_members/UserDefinedAccessorsMustBePublic.out Tue Aug 20 13:43:41 2019 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -UserDefinedAccessorsMustBePublic.java:8:9: compiler.err.method.must.be.public: i -1 error
--- a/test/langtools/tools/javac/records/mandated_members/accessors/BadAccessorsTest.java Tue Aug 20 13:43:41 2019 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @summary check that the compiler doesn't accept incorrect accessors - * @compile/fail/ref=BadAccessorsTest.out -XDrawDiagnostics BadAccessorsTest.java - */ - -import java.util.List; - -public class BadAccessorsTest { - record R1(int i, int j, int k, List<String> ls) { - // accessors has to be public - int i() { return i; } - private int j() { return j; } - protected int k() { return k; } - // must match type exactly - public List ls() { return ls; } - } -}
--- a/test/langtools/tools/javac/records/mandated_members/accessors/BadAccessorsTest.out Tue Aug 20 13:43:41 2019 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -BadAccessorsTest.java:12:13: compiler.err.method.must.be.public: i -BadAccessorsTest.java:13:21: compiler.err.method.must.be.public: j -BadAccessorsTest.java:14:23: compiler.err.method.must.be.public: k -BadAccessorsTest.java:16:21: compiler.err.accessor.return.type.doesnt.match: java.util.List<java.lang.String>, java.util.List -4 errors
--- a/test/langtools/tools/javac/records/mandated_members/canonical_constructor/MismatchTest.java Tue Aug 20 13:43:41 2019 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @summary check that the compiler doesn't accept canonical constructors with name mismatch - * @compile/fail/ref=MismatchTest.out -XDrawDiagnostics MismatchTest.java - */ - -import java.util.*; - -public class MismatchTest { - record R1(int i, int j) { - public R1(int j, int i) {} // doesn't match by name - } - - record R2(int i, List<String> ls) { - public R2(int i, List ls) {} - } -}
--- a/test/langtools/tools/javac/records/mandated_members/canonical_constructor/MismatchTest.out Tue Aug 20 13:43:41 2019 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -MismatchTest.java:11:16: compiler.err.canonical.with.name.mismatch -MismatchTest.java:15:16: compiler.err.constructor.with.same.erasure.as.canonical -- compiler.note.unchecked.filename: MismatchTest.java -- compiler.note.unchecked.recompile -2 errors