8025537: Convert 2 javac/enumdeclarations tests in jtreg for regression ws
Reviewed-by: jjg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/EnumAsIdentifier.java Fri Sep 27 10:39:52 2013 -0700
@@ -0,0 +1,16 @@
+/**
+ * @test /nodynamiccopyright/
+ * @bug 8025537
+ * @author sogoel
+ * @summary enum keyword used as an identifier
+ * @compile/ref=EnumAsIdentifier4.out -XDrawDiagnostics -source 1.4 EnumAsIdentifier.java
+ * @compile/fail/ref=EnumAsIdentifier5.out -XDrawDiagnostics -source 1.5 EnumAsIdentifier.java
+ * @compile/fail/ref=EnumAsIdentifier.out -XDrawDiagnostics EnumAsIdentifier.java
+ */
+
+public class EnumAsIdentifier {
+
+ int enum = 0;
+
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/EnumAsIdentifier.out Fri Sep 27 10:39:52 2013 -0700
@@ -0,0 +1,2 @@
+EnumAsIdentifier.java:13:9: compiler.err.enum.as.identifier
+1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/EnumAsIdentifier4.out Fri Sep 27 10:39:52 2013 -0700
@@ -0,0 +1,6 @@
+- compiler.warn.source.no.bootclasspath: 1.4
+- compiler.warn.option.obsolete.source: 1.4
+- compiler.warn.option.obsolete.target: 1.4
+- compiler.warn.option.obsolete.suppression
+EnumAsIdentifier.java:13:9: compiler.warn.enum.as.identifier
+5 warnings
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/EnumAsIdentifier5.out Fri Sep 27 10:39:52 2013 -0700
@@ -0,0 +1,6 @@
+- compiler.warn.source.no.bootclasspath: 1.5
+- compiler.warn.option.obsolete.source: 1.5
+- compiler.warn.option.obsolete.suppression
+EnumAsIdentifier.java:13:9: compiler.err.enum.as.identifier
+1 error
+3 warnings
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/EnumMembersOrder.java Fri Sep 27 10:39:52 2013 -0700
@@ -0,0 +1,20 @@
+/**
+ * @test /nodynamiccopyright/
+ * @bug 8025537 5028491
+ * @author sogoel
+ * @summary enum constants should precede other enum members
+ * @compile/fail/ref=EnumMembersOrder.out -XDrawDiagnostics EnumMembersOrder.java
+ */
+
+enum Days {
+
+ Days(String d) { day = d; } // constructor
+
+ // enum constants
+ WEEKEND("SAT"),
+ WEEKDAY("MON");
+
+ private String day;
+
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/EnumMembersOrder.out Fri Sep 27 10:39:52 2013 -0700
@@ -0,0 +1,7 @@
+EnumMembersOrder.java:11:16: compiler.err.expected: ')'
+EnumMembersOrder.java:11:17: compiler.err.expected3: ',', '}', ';'
+EnumMembersOrder.java:11:19: compiler.err.expected: '}'
+EnumMembersOrder.java:11:31: compiler.err.expected3: class, interface, enum
+EnumMembersOrder.java:17:13: compiler.err.expected3: class, interface, enum
+EnumMembersOrder.java:19:1: compiler.err.expected3: class, interface, enum
+6 errors