Permalink
Browse files

Move static compilation tests from @Mixin to trait

  • Loading branch information...
1 parent a765121 commit 0c9e914fd3033eef3060e2090a63f4c694c5b5b6 @melix committed Mar 28, 2014
Showing with 73 additions and 300 deletions.
  1. +3 −0 src/test/groovy/transform/stc/StaticTypeCheckingTestCase.groovy
  2. +1 −10 src/test/org/codehaus/groovy/classgen/asm/sc/AnonymousInnerClassStaticCompileTest.groovy
  3. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/ArraysAndCollectionsStaticCompileTest.groovy
  4. +1 −10 src/test/org/codehaus/groovy/classgen/asm/sc/AssignmentsStaticCompileTest.groovy
  5. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/BugsStaticCompileTest.groovy
  6. +1 −10 src/test/org/codehaus/groovy/classgen/asm/sc/ClosureParamTypeInferrenceStaticCompileTest.groovy
  7. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/ClosuresStaticCompileTest.groovy
  8. +1 −7 src/test/org/codehaus/groovy/classgen/asm/sc/CompatWithASTXFormStaticCompileTest.groovy
  9. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/CompileDynamicTest.groovy
  10. +1 −9 src/test/org/codehaus/groovy/classgen/asm/sc/DelegatesToStaticCompileTest.groovy
  11. +2 −8 src/test/org/codehaus/groovy/classgen/asm/sc/FieldsAndPropertiesStaticCompileTest.groovy
  12. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/GenericsStaticCompileTest.groovy
  13. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/IOGMClosureParamTypeInferrenceStaticCompileTest.groovy
  14. +1 −9 src/test/org/codehaus/groovy/classgen/asm/sc/LoopsStaticCompileTest.groovy
  15. +1 −7 src/test/org/codehaus/groovy/classgen/asm/sc/MethodCallsStaticCompilationTest.groovy
  16. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/MiscStaticCompileTest.groovy
  17. +1 −3 src/test/org/codehaus/groovy/classgen/asm/sc/MixedModeStaticCompilationTest.groovy
  18. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/NaryExpressionTestStaticCompileTest.groovy
  19. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/RangesStaticCompileTest.groovy
  20. +1 −8 .../org/codehaus/groovy/classgen/asm/sc/ResourceGMClosureParamTypeInferrenceStaticCompileTest.groovy
  21. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/ReturnsStaticCompileTest.groovy
  22. +1 −8 ...st/org/codehaus/groovy/classgen/asm/sc/SocketGMClosureParamTypeInferrenceStaticCompileTest.groovy
  23. +33 −17 src/test/org/codehaus/groovy/classgen/asm/sc/StaticCompilationTestSupport.groovy
  24. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/StaticCompileConstructorsTest.groovy
  25. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/StaticCompileDGMTest.groovy
  26. +1 −8 ...st/org/codehaus/groovy/classgen/asm/sc/StringGMClosureParamTypeInferrenceStaticCompileTest.groovy
  27. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/TypeCheckingModeStaticCompileTest.groovy
  28. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/TypeInferenceStaticCompileTest.groovy
  29. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/UnaryOperatorStaticCompileTest.groovy
  30. +1 −7 src/test/org/codehaus/groovy/classgen/asm/sc/WithStaticCompileTest.groovy
  31. +1 −7 src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6411Bug.groovy
  32. +1 −9 src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6475Bug.groovy
  33. +1 −7 src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6533Bug.groovy
  34. +1 −7 src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6541Bug.groovy
  35. +1 −7 src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6558Bug.groovy
  36. +1 −7 src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6564Bug.groovy
  37. +1 −8 src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6568Bug.groovy
  38. +1 −7 src/test/org/codehaus/groovy/classgen/asm/sc/vm6/MethodCallsStaticCompilationTest.groovy
@@ -46,8 +46,11 @@ abstract class StaticTypeCheckingTestCase extends GroovyTestCase {
config.addCompilationCustomizers(new ASTTransformationCustomizer(TypeChecked), imports)
configure()
shell = new GroovyShell(config)
+ extraSetup()
}
+ protected void extraSetup() {}
+
protected void configure() {}
@Override
@@ -23,14 +23,5 @@ import groovy.transform.stc.AnonymousInnerClassSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class AnonymousInnerClassStaticCompileTest extends AnonymousInnerClassSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
-
-}
+class AnonymousInnerClassStaticCompileTest extends AnonymousInnerClassSTCTest implements StaticCompilationTestSupport {}
@@ -22,14 +22,7 @@ import groovy.transform.stc.ArraysAndCollectionsSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class ArraysAndCollectionsStaticCompileTest extends ArraysAndCollectionsSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class ArraysAndCollectionsStaticCompileTest extends ArraysAndCollectionsSTCTest implements StaticCompilationTestSupport {
void testListStarWithMethodReturningVoid() {
assertScript '''
@@ -22,14 +22,5 @@ import groovy.transform.stc.STCAssignmentTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class AssignmentsStaticCompileTest extends STCAssignmentTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
-
-}
+class AssignmentsStaticCompileTest extends STCAssignmentTest implements StaticCompilationTestSupport {}
@@ -22,14 +22,7 @@ import groovy.transform.stc.BugsSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class BugsStaticCompileTest extends BugsSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class BugsStaticCompileTest extends BugsSTCTest implements StaticCompilationTestSupport {
void testGroovy5498PropertyAccess() {
assertScript '''
@@ -22,14 +22,5 @@ import groovy.transform.stc.ClosureParamTypeInferenceSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class ClosureParamTypeInferrenceStaticCompileTest extends ClosureParamTypeInferenceSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
-
-}
+class ClosureParamTypeInferrenceStaticCompileTest extends ClosureParamTypeInferenceSTCTest implements StaticCompilationTestSupport { }
@@ -22,14 +22,7 @@ import groovy.transform.stc.ClosuresSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class ClosuresStaticCompileTest extends ClosuresSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class ClosuresStaticCompileTest extends ClosuresSTCTest implements StaticCompilationTestSupport {
// GROOVY-5584
void testEachOnMapClosure() {
@@ -24,13 +24,7 @@ import groovy.transform.stc.StaticTypeCheckingTestCase
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class CompatWithASTXFormStaticCompileTest extends StaticTypeCheckingTestCase {
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class CompatWithASTXFormStaticCompileTest extends StaticTypeCheckingTestCase implements StaticCompilationTestSupport {
void testShouldNotThrowArrayIndexOutOfBoundsError() {
assertScript '''import groovy.transform.Immutable
@@ -21,14 +21,7 @@ import groovy.transform.stc.StaticTypeCheckingTestCase
/**
* Test case for {@link groovy.transform.CompileDynamic}.
*/
-@Mixin(StaticCompilationTestSupport)
-
-class CompileDynamicTest extends StaticTypeCheckingTestCase {
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class CompileDynamicTest extends StaticTypeCheckingTestCase implements StaticCompilationTestSupport {
void testCompileDynamic() {
assertScript '''import groovy.transform.CompileDynamic
@@ -24,13 +24,5 @@ import groovy.transform.stc.DelegatesToSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class DelegatesToStaticCompileTest extends DelegatesToSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
-
+class DelegatesToStaticCompileTest extends DelegatesToSTCTest implements StaticCompilationTestSupport {
}
@@ -17,14 +17,8 @@ package org.codehaus.groovy.classgen.asm.sc
import groovy.transform.stc.FieldsAndPropertiesSTCTest
-@Mixin(StaticCompilationTestSupport)
-class FieldsAndPropertiesStaticCompileTest extends FieldsAndPropertiesSTCTest {
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
-
+class FieldsAndPropertiesStaticCompileTest extends FieldsAndPropertiesSTCTest implements StaticCompilationTestSupport{
+
void testMapGetAt() {
assertScript '''
Map map = [a: 1, b:2]
@@ -22,14 +22,7 @@ import groovy.transform.stc.GenericsSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class GenericsStaticCompileTest extends GenericsSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class GenericsStaticCompileTest extends GenericsSTCTest implements StaticCompilationTestSupport {
}
@@ -26,14 +26,7 @@ import groovy.transform.stc.IOGMClosureParamTypeInferenceSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class IOGMClosureParamTypeInferrenceStaticCompileTest extends IOGMClosureParamTypeInferenceSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class IOGMClosureParamTypeInferrenceStaticCompileTest extends IOGMClosureParamTypeInferenceSTCTest implements StaticCompilationTestSupport {
}
@@ -22,14 +22,6 @@ import groovy.transform.stc.LoopsSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class LoopsStaticCompileTest extends LoopsSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
-
+class LoopsStaticCompileTest extends LoopsSTCTest implements StaticCompilationTestSupport {
}
@@ -18,13 +18,7 @@ package org.codehaus.groovy.classgen.asm.sc;
import groovy.transform.stc.MethodCallsSTCTest
import org.codehaus.groovy.control.MultipleCompilationErrorsException
-@Mixin(StaticCompilationTestSupport)
-public class MethodCallsStaticCompilationTest extends MethodCallsSTCTest {
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+public class MethodCallsStaticCompilationTest extends MethodCallsSTCTest implements StaticCompilationTestSupport {
void testCallToSuper() {
assertScript '''
@@ -22,14 +22,7 @@ import groovy.transform.stc.MiscSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class MiscStaticCompileTest extends MiscSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class MiscStaticCompileTest extends MiscSTCTest implements StaticCompilationTestSupport {
void testEachFileRecurse() {
assertScript '''import groovy.io.FileType
@@ -19,12 +19,10 @@ package org.codehaus.groovy.classgen.asm.sc
import groovy.transform.stc.StaticTypeCheckingTestCase
import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer
-@Mixin(StaticCompilationTestSupport)
-class MixedModeStaticCompilationTest extends StaticTypeCheckingTestCase {
+class MixedModeStaticCompilationTest extends StaticTypeCheckingTestCase implements StaticCompilationTestSupport {
@Override
protected void setUp() {
super.setUp()
- extraSetup()
removeCustomizer()
}
@@ -22,14 +22,7 @@ import groovy.transform.stc.STCnAryExpressionTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class NaryExpressionTestStaticCompileTest extends STCnAryExpressionTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class NaryExpressionTestStaticCompileTest extends STCnAryExpressionTest implements StaticCompilationTestSupport {
}
@@ -22,14 +22,7 @@ import groovy.transform.stc.RangesSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class RangesStaticCompileTest extends RangesSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class RangesStaticCompileTest extends RangesSTCTest implements StaticCompilationTestSupport {
// GROOVY-6482
void testShouldReturnAnEmptyList() {
@@ -23,14 +23,7 @@ import groovy.transform.stc.ResourceGMClosureParamTypeInferenceSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class ResourceGMClosureParamTypeInferrenceStaticCompileTest extends ResourceGMClosureParamTypeInferenceSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class ResourceGMClosureParamTypeInferrenceStaticCompileTest extends ResourceGMClosureParamTypeInferenceSTCTest implements StaticCompilationTestSupport {
}
@@ -22,14 +22,7 @@ import groovy.transform.stc.ReturnsSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class ReturnsStaticCompileTest extends ReturnsSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class ReturnsStaticCompileTest extends ReturnsSTCTest implements StaticCompilationTestSupport {
void testReturnTypeInferenceWithInheritance() {
assertScript '''
@@ -23,14 +23,7 @@ import groovy.transform.stc.SocketGMClosureParamTypeInferenceSTCTest
*
* @author Cedric Champeau
*/
-@Mixin(StaticCompilationTestSupport)
-class SocketGMClosureParamTypeInferrenceStaticCompileTest extends SocketGMClosureParamTypeInferenceSTCTest {
-
- @Override
- protected void setUp() {
- super.setUp()
- extraSetup()
- }
+class SocketGMClosureParamTypeInferrenceStaticCompileTest extends SocketGMClosureParamTypeInferenceSTCTest implements StaticCompilationTestSupport {
}
Oops, something went wrong.

0 comments on commit 0c9e914

Please sign in to comment.