You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/TraitsTests.java
+49-12
Original file line number
Diff line number
Diff line change
@@ -189,6 +189,25 @@ public void testTraits5() {
189
189
runConformTest(sources, "class Foo");
190
190
}
191
191
192
+
@Test
193
+
publicvoidtestTraits5a() {
194
+
//@formatter:off
195
+
String[] sources = {
196
+
"Script.groovy",
197
+
"trait Introspector {\n" +
198
+
" void whoAmI() { print this }\n" +
199
+
"}\n" +
200
+
"class Foo implements Introspector {\n" +
201
+
" String toString() { 'Foo' }\n" +
202
+
"}\n" +
203
+
"def foo = new Foo()\n" +
204
+
"foo.whoAmI()\n",
205
+
};
206
+
//@formatter:on
207
+
208
+
runConformTest(sources, "Foo");
209
+
}
210
+
192
211
@Test// Interfaces
193
212
publicvoidtestTraits6() {
194
213
//@formatter:off
@@ -939,7 +958,7 @@ public void testTraits36() {
939
958
"----------\n");
940
959
}
941
960
942
-
@Test// Test @Trait annotation
961
+
@Test// @Trait annotation
943
962
publicvoidtestTraits37() {
944
963
//@formatter:off
945
964
String[] sources = {
@@ -958,7 +977,7 @@ public void testTraits37() {
958
977
runConformTest(sources, "a");
959
978
}
960
979
961
-
@Test// Test @Trait annotation
980
+
@Test// @Trait annotation
962
981
publicvoidtestTraits38() {
963
982
//@formatter:off
964
983
String[] sources = {
@@ -978,7 +997,7 @@ public void testTraits38() {
978
997
runConformTest(sources, "a");
979
998
}
980
999
981
-
@Test// Test @Trait annotation
1000
+
@Test// @Trait annotation
982
1001
publicvoidtestTraits39() {
983
1002
//@formatter:off
984
1003
String[] sources = {
@@ -998,7 +1017,7 @@ public void testTraits39() {
998
1017
runConformTest(sources, "a");
999
1018
}
1000
1019
1001
-
@Test// Negative test for @Trait annotation
1020
+
@Test// @Trait annotation
1002
1021
publicvoidtestTraits40() {
1003
1022
//@formatter:off
1004
1023
String[] sources = {
@@ -1022,7 +1041,7 @@ public void testTraits40() {
1022
1041
"----------\n");
1023
1042
}
1024
1043
1025
-
@Test// Negative test for @Trait annotation
1044
+
@Test// @Trait annotation
1026
1045
publicvoidtestTraits41() {
1027
1046
//@formatter:off
1028
1047
String[] sources = {
@@ -1050,7 +1069,7 @@ public void testTraits41() {
1050
1069
"----------\n");
1051
1070
}
1052
1071
1053
-
@Test// Negative test for @Trait annotation
1072
+
@Test// @Trait annotation
1054
1073
publicvoidtestTraits42() {
1055
1074
//@formatter:off
1056
1075
String[] sources = {
@@ -1076,7 +1095,7 @@ public void testTraits42() {
1076
1095
"----------\n");
1077
1096
}
1078
1097
1079
-
@Test// Negative test for @Trait annotation
1098
+
@Test// @Trait annotation
1080
1099
publicvoidtestTraits43() {
1081
1100
//@formatter:off
1082
1101
String[] sources = {
@@ -1218,7 +1237,7 @@ public void testTraits48() {
1218
1237
runConformTest(sources, "a");
1219
1238
}
1220
1239
1221
-
@Test// Test protected method of superclass overriding by trait method - different packages
1240
+
@Test// protected method of superclass overriding by trait method - different packages
1222
1241
publicvoidtestTraits49() {
1223
1242
//@formatter:off
1224
1243
String[] sources = {
@@ -1249,7 +1268,7 @@ public void testTraits49() {
1249
1268
runConformTest(sources, "a");
1250
1269
}
1251
1270
1252
-
@Test// Test protected method of superclass and traits method overriding by class
1271
+
@Test// protected method of superclass and traits method overriding by class
1253
1272
publicvoidtestTraits50() {
1254
1273
//@formatter:off
1255
1274
String[] sources = {
@@ -1297,7 +1316,7 @@ public void testTraits51() {
1297
1316
"----------\n");
1298
1317
}
1299
1318
1300
-
@Test// Test protected method of superclass and traits method overriding by class - positive test
1319
+
@Test// protected method of superclass and traits method overriding by class - positive test
1301
1320
publicvoidtestTraits52() {
1302
1321
//@formatter:off
1303
1322
String[] sources = {
@@ -2125,7 +2144,7 @@ public void testTraits8049() {
2125
2144
runConformTest(sources, "WORKS");
2126
2145
}
2127
2146
2128
-
@Ignore@Test// see also GROOVY-7950
2147
+
@Test// see also GROOVY-7950
2129
2148
publicvoidtestTraits8219() {
2130
2149
//@formatter:off
2131
2150
String[] sources = {
@@ -2142,7 +2161,7 @@ public void testTraits8219() {
0 commit comments