You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2026/02/08 04:09:02 UTC
(groovy) branch master updated: Convert to JUnit5
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new a1897e0811 Convert to JUnit5
a1897e0811 is described below
commit a1897e0811ea5ec61fe593b74510252c7f881272
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Feb 8 03:27:25 2026 +0900
Convert to JUnit5
---
src/spec/test/BaseScriptSpecTest.groovy | 6 +-
src/spec/test/ClassDesignASTTransformsTest.groovy | 13 +-
src/spec/test/ClassTest.groovy | 10 +-
src/spec/test/CloningASTTransformsTest.groovy | 14 +-
src/spec/test/ClosuresSpecTest.groovy | 29 +-
.../test/CodeGenerationASTTransformsTest.groovy | 31 +-
src/spec/test/CommandChainsTest.groovy | 10 +-
.../CompilerDirectivesASTTransformsTest.groovy | 14 +-
src/spec/test/CustomizersTest.groovy | 42 ++-
.../DeclarativeConcurrencyASTTransformsTest.groovy | 10 +-
src/spec/test/DelegatesToSpecTest.groovy | 24 +-
src/spec/test/DesignPatternsTest.groovy | 6 +-
src/spec/test/DifferencesFromJavaTest.groovy | 16 +-
src/spec/test/ExtensionModuleSpecTest.groovy | 8 +-
src/spec/test/IntegrationTest.groovy | 5 +-
.../test/LogImprovementsASTTransformsTest.groovy | 13 +-
src/spec/test/PrimitiveTest.groovy | 9 +-
src/spec/test/RecordSpecificationTest.groovy | 24 +-
.../test/SaferScriptingASTTransformsTest.groovy | 16 +-
src/spec/test/ScriptsAndClassesSpecTest.groovy | 12 +-
src/spec/test/SealedSpecificationTest.groovy | 5 +-
src/spec/test/SwingASTTransformsTest.groovy | 15 +-
src/spec/test/TestingASTTransformsTest.groovy | 20 +-
src/spec/test/TraitsSpecificationTest.groovy | 48 ++-
src/spec/test/builder/BuilderSpecTest.groovy | 3 +-
src/spec/test/builder/FileTreeBuilderTest.groovy | 6 +-
.../test/builder/ObjectGraphBuilderTest.groovy | 13 +-
src/spec/test/gdk/ConfigSlurperTest.groovy | 11 +-
src/spec/test/gdk/ExpandoTest.groovy | 7 +-
src/spec/test/gdk/ObservableTest.groovy | 6 +-
src/spec/test/gdk/WorkingWithArraysTest.groovy | 2 +-
.../test/gdk/WorkingWithCollectionsTest.groovy | 35 +-
src/spec/test/gdk/WorkingWithIOSpecTest.groovy | 12 +-
.../metaprogramming/ASTMatcherFilteringTest.groovy | 7 +-
.../metaprogramming/ASTMatcherTestingTest.groovy | 15 +-
.../test/metaprogramming/ASTXFormSpecTest.groovy | 12 +-
.../metaprogramming/ExpandoMetaClassTest.groovy | 18 +-
.../test/metaprogramming/GroovyObjectTest.groovy | 16 +-
.../test/metaprogramming/InterceptableTest.groovy | 6 +-
.../InterceptionThroughMetaClassTest.groovy | 6 +-
.../test/metaprogramming/MacroClassTest.groovy | 6 +-
.../metaprogramming/MacroExpressionTest.groovy | 10 +-
.../test/metaprogramming/MacroStatementTest.groovy | 18 +-
.../MacroVariableSubstitutionTest.groovy | 18 +-
.../MethodPropertyMissingTest.groovy | 10 +-
...taticPropertyMissingAndMethodMissingTest.groovy | 9 +-
src/spec/test/objectorientation/MethodsTest.groovy | 25 +-
src/spec/test/semantics/GPathTest.groovy | 8 +-
src/spec/test/semantics/PowerAssertTest.groovy | 2 +-
src/spec/test/semantics/TheGroovyTruthTest.groovy | 11 +-
src/spec/test/testingguide/GDKMethodTests.groovy | 7 +-
.../testingguide/GroovyTestCaseExampleTests.groovy | 30 +-
.../test/testingguide/JUnit4ExampleTests.groovy | 2 +-
.../test/testingguide/MockingExampleTests.groovy | 6 +-
src/spec/test/typing/OptionalTypingTest.groovy | 9 +-
.../typing/TypeCheckingExtensionSpecTest.groovy | 46 ++-
src/spec/test/typing/TypeCheckingJavaTest.java | 4 +-
src/test/groovy/NoPackageTest.groovy | 2 +-
.../groovy/bugs/AmbiguousListOrMethodTest.groovy | 11 +-
src/test/groovy/bugs/AsBoolBug.groovy | 8 +-
.../bugs/AssignmentInsideExpressionBug.groovy | 8 +-
.../groovy/bugs/AttributeSetExpressionBug.groovy | 6 +-
.../groovy/bugs/AutoboxingOfComparisonsBug.groovy | 6 +-
.../bugs/BadLineNumberOnExceptionBugTest.groovy | 9 +-
src/test/groovy/bugs/BadScriptNameBug.groovy | 6 +-
src/test/groovy/bugs/BenchmarkBug.groovy | 6 +-
src/test/groovy/bugs/BlockAsClosureBug.groovy | 8 +-
src/test/groovy/bugs/BooleanBug.groovy | 9 +-
src/test/groovy/bugs/ByteIndexBug.groovy | 6 +-
src/test/groovy/bugs/Bytecode2Bug.groovy | 8 +-
src/test/groovy/bugs/Bytecode3Bug.groovy | 6 +-
src/test/groovy/bugs/Bytecode4Bug.groovy | 8 +-
src/test/groovy/bugs/Bytecode5Bug.groovy | 6 +-
src/test/groovy/bugs/Bytecode6Bug.groovy | 7 +-
src/test/groovy/bugs/Bytecode7Bug.groovy | 7 +-
src/test/groovy/bugs/BytecodeBug.groovy | 6 +-
.../bugs/CallingClosuresWithClosuresBug.groovy | 6 +-
.../groovy/bugs/CastWhenUsingClosuresBug.groovy | 6 +-
src/test/groovy/bugs/ChristofsPropertyBug.groovy | 8 +-
.../groovy/bugs/ClassGeneratorFixesTest.groovy | 10 +-
src/test/groovy/bugs/ClassInNamedParamsBug.groovy | 6 +-
src/test/groovy/bugs/ClosureInClosureBug.groovy | 6 +-
.../groovy/bugs/ClosureTypedVariableBug.groovy | 9 +-
src/test/groovy/bugs/ClosureVariableBug.groovy | 11 +-
.../bugs/ClosureWithBitwiseDefaultParamTest.groovy | 6 +-
src/test/groovy/bugs/ConstructorBug.groovy | 5 +-
.../groovy/bugs/ConstructorParameterBug.groovy | 4 +-
src/test/groovy/bugs/ConstructorThisCallBug.groovy | 8 +-
src/test/groovy/bugs/CustomMetaClassTest.groovy | 14 +-
src/test/groovy/bugs/DefVariableBug.groovy | 6 +-
.../bugs/DirectMethodCallWithVargsTest.groovy | 2 +-
src/test/groovy/bugs/ForLoopBug.groovy | 12 +-
src/test/groovy/bugs/FullyQualifiedClassBug.groovy | 6 +-
.../bugs/FullyQualifiedMethodReturnTypeBug.groovy | 6 +-
.../bugs/FullyQualifiedVariableTypeBug.groovy | 6 +-
src/test/groovy/bugs/GetterBug.groovy | 7 +-
src/test/groovy/bugs/Groovy10094.groovy | 8 +-
src/test/groovy/bugs/Groovy10113.groovy | 16 +-
src/test/groovy/bugs/Groovy10133.groovy | 6 +-
src/test/groovy/bugs/Groovy10143.groovy | 2 +-
src/test/groovy/bugs/Groovy1018_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy10191.groovy | 2 +-
src/test/groovy/bugs/Groovy10199.groovy | 2 +-
src/test/groovy/bugs/Groovy10236.groovy | 2 +-
src/test/groovy/bugs/Groovy10281.groovy | 2 +-
src/test/groovy/bugs/Groovy10302.groovy | 4 +-
src/test/groovy/bugs/Groovy10303.groovy | 2 +-
src/test/groovy/bugs/Groovy10305.groovy | 2 +-
src/test/groovy/bugs/Groovy10381.groovy | 10 +-
src/test/groovy/bugs/Groovy10461.groovy | 2 +-
src/test/groovy/bugs/Groovy10466.groovy | 2 +-
src/test/groovy/bugs/Groovy10467.groovy | 2 +-
src/test/groovy/bugs/Groovy10478.groovy | 2 +-
src/test/groovy/bugs/Groovy10535.groovy | 2 +-
src/test/groovy/bugs/Groovy10587.groovy | 2 +-
src/test/groovy/bugs/Groovy1059_Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy10612.groovy | 2 +-
src/test/groovy/bugs/Groovy10659.groovy | 2 +-
src/test/groovy/bugs/Groovy10676.groovy | 2 +-
src/test/groovy/bugs/Groovy10700.groovy | 2 +-
src/test/groovy/bugs/Groovy10770.groovy | 12 +-
src/test/groovy/bugs/Groovy1081_Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy10920.groovy | 2 +-
src/test/groovy/bugs/Groovy10962.groovy | 2 +-
src/test/groovy/bugs/Groovy10998.groovy | 6 +-
src/test/groovy/bugs/Groovy11046.groovy | 4 +-
src/test/groovy/bugs/Groovy11062.groovy | 2 +-
src/test/groovy/bugs/Groovy11196.groovy | 2 +-
src/test/groovy/bugs/Groovy11203.groovy | 2 +-
src/test/groovy/bugs/Groovy11250.groovy | 2 +-
src/test/groovy/bugs/Groovy11265.groovy | 2 +-
src/test/groovy/bugs/Groovy11272.groovy | 2 +-
src/test/groovy/bugs/Groovy11292.groovy | 2 +-
src/test/groovy/bugs/Groovy11293.groovy | 2 +-
src/test/groovy/bugs/Groovy1407_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy1462_Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy1465.groovy | 4 +-
src/test/groovy/bugs/Groovy1567.java | 2 +-
src/test/groovy/bugs/Groovy1593.groovy | 8 +-
src/test/groovy/bugs/Groovy1617_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy1706_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy1759.groovy | 2 +-
src/test/groovy/bugs/Groovy2271Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy2339Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy2348Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy2350Bug.groovy | 10 +-
src/test/groovy/bugs/Groovy2351Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy2365Base.groovy | 4 +-
src/test/groovy/bugs/Groovy2365Bug.java | 4 +-
src/test/groovy/bugs/Groovy2391.groovy | 2 +-
src/test/groovy/bugs/Groovy239_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy2490Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy252_Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy2549Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy2556Bug.groovy | 18 +-
src/test/groovy/bugs/Groovy2557Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy2558Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy2666Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy2706Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy2773Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy278_Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy2801Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy2816Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy2849Bug.groovy | 4 +-
src/test/groovy/bugs/Groovy2949Bug.groovy | 4 +-
src/test/groovy/bugs/Groovy2951.groovy | 2 +-
src/test/groovy/bugs/Groovy308_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3135Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3139Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy3156And2621Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3163Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3175_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3205Bug.groovy | 4 +-
src/test/groovy/bugs/Groovy3208Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3235Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3238Bug.groovy | 4 +-
src/test/groovy/bugs/Groovy325_Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3304Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3305Bug.groovy | 4 +-
src/test/groovy/bugs/Groovy3311.groovy | 2 +-
src/test/groovy/bugs/Groovy3335Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3339Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3383Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3389Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3403Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy3405Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy3410Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3422.groovy | 2 +-
src/test/groovy/bugs/Groovy3424Bug.groovy | 11 +-
src/test/groovy/bugs/Groovy3426Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy3446Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3462Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3464Bug.groovy | 20 +-
src/test/groovy/bugs/Groovy3465Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3498Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3509Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3511Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3519Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy3560Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3574Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3590Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3679Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3716Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3718Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3719.groovy | 2 +-
src/test/groovy/bugs/Groovy3720Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3723Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3726Bug.groovy | 10 +-
src/test/groovy/bugs/Groovy3749Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3770Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy3776Bug.groovy | 11 +-
src/test/groovy/bugs/Groovy3784Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3799Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3801Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3818Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3827Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy3830Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3831Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3834Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy3839.groovy | 6 +-
src/test/groovy/bugs/Groovy3852.groovy | 16 +-
src/test/groovy/bugs/Groovy3863Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy3868Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3876Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3894Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy389_Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy3904.groovy | 4 +-
src/test/groovy/bugs/Groovy3948Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy3949Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4009Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4018Bug.groovy | 11 +-
src/test/groovy/bugs/Groovy4029Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4035.groovy | 2 +-
src/test/groovy/bugs/Groovy4038Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4046Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4069Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy4075Bug.groovy | 13 +-
src/test/groovy/bugs/Groovy4078Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4080Bug.groovy | 4 +-
src/test/groovy/bugs/Groovy4097.groovy | 2 +-
src/test/groovy/bugs/Groovy4098.groovy | 6 +-
src/test/groovy/bugs/Groovy4104Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy4106Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy4107Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy4111Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy4116Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy4119Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4120Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4121Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy4129Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4131Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4133Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4134Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4139Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4170Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4188Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy4191Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4193.groovy | 2 +-
src/test/groovy/bugs/Groovy4202Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4206.groovy | 2 +-
src/test/groovy/bugs/Groovy4235Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4241Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4243.groovy | 2 +-
src/test/groovy/bugs/Groovy4246Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4247Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4257Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy4264Bug.groovy | 10 +-
src/test/groovy/bugs/Groovy4293Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4349.groovy | 2 +-
src/test/groovy/bugs/Groovy4365.groovy | 4 +-
src/test/groovy/bugs/Groovy4393Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy4414Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy4415Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy4416Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4418.groovy | 2 +-
src/test/groovy/bugs/Groovy4435Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy4449Bug.groovy | 8 +-
...Groovy4457GenericTypeDeclarationLeakTest.groovy | 10 +-
src/test/groovy/bugs/Groovy4471Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4480Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4497Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4584Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4720Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4721.groovy | 8 +-
src/test/groovy/bugs/Groovy4861Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4922Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy4958Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4966Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4967Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4973Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy4980Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4986Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy4989Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy4999Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy5030Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy5033Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy5056Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy5061.groovy | 6 +-
src/test/groovy/bugs/Groovy5101Test.groovy | 9 +-
src/test/groovy/bugs/Groovy5109Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy5122Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy5137Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy513_Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy5150.groovy | 2 +-
src/test/groovy/bugs/Groovy5152Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy5185Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy5210Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy5212.groovy | 4 +-
src/test/groovy/bugs/Groovy5239.groovy | 2 +-
src/test/groovy/bugs/Groovy5260.groovy | 6 +-
src/test/groovy/bugs/Groovy5267.groovy | 2 +-
src/test/groovy/bugs/Groovy5272Bug.groovy | 14 +-
src/test/groovy/bugs/Groovy5318.groovy | 6 +-
src/test/groovy/bugs/Groovy5358.groovy | 2 +-
src/test/groovy/bugs/Groovy5364.groovy | 4 +-
src/test/groovy/bugs/Groovy5396Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy5418Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy5423.groovy | 2 +-
src/test/groovy/bugs/Groovy5425_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy5572Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy558_616_Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy5687Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy5783Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy5806Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy5915Bug.groovy | 15 +-
src/test/groovy/bugs/Groovy596.groovy | 11 +-
src/test/groovy/bugs/Groovy6042Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy6045Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy6097.groovy | 4 +-
src/test/groovy/bugs/Groovy6260.groovy | 2 +-
src/test/groovy/bugs/Groovy6360.groovy | 2 +-
src/test/groovy/bugs/Groovy6374Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy6396Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy6508Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy6522Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy6567.groovy | 2 +-
src/test/groovy/bugs/Groovy662.groovy | 2 +-
src/test/groovy/bugs/Groovy6653.java | 2 +-
src/test/groovy/bugs/Groovy6722Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy674_Bug.groovy | 23 +-
src/test/groovy/bugs/Groovy6755Bug.groovy | 4 +-
src/test/groovy/bugs/Groovy675_Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy6764Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy6808.groovy | 2 +-
src/test/groovy/bugs/Groovy6811Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy6821Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy6830Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy6841Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy6862Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy6932.groovy | 2 +-
src/test/groovy/bugs/Groovy6938.groovy | 2 +-
src/test/groovy/bugs/Groovy6996.groovy | 2 +-
src/test/groovy/bugs/Groovy7031Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy7081Bug.groovy | 16 +-
src/test/groovy/bugs/Groovy7165.groovy | 6 +-
src/test/groovy/bugs/Groovy7204.groovy | 2 +-
src/test/groovy/bugs/Groovy7248Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy7291Bug.groovy | 12 +-
src/test/groovy/bugs/Groovy7520Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy7584.groovy | 2 +-
src/test/groovy/bugs/Groovy7620.groovy | 6 +-
src/test/groovy/bugs/Groovy7709Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy770_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy7721Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy7753.groovy | 2 +-
src/test/groovy/bugs/Groovy779_Bug.groovy | 4 +-
src/test/groovy/bugs/Groovy7867.groovy | 2 +-
src/test/groovy/bugs/Groovy7876Bug.groovy | 11 +-
src/test/groovy/bugs/Groovy7912Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy7916Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy7917Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy7920Bug.groovy | 10 +-
src/test/groovy/bugs/Groovy7921Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy7924Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy7933Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy7937Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy7958Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy7969Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy7970Bug.groovy | 11 +-
src/test/groovy/bugs/Groovy7973.groovy | 2 +-
src/test/groovy/bugs/Groovy7978.groovy | 2 +-
src/test/groovy/bugs/Groovy7985.groovy | 2 +-
src/test/groovy/bugs/Groovy7989.groovy | 2 +-
src/test/groovy/bugs/Groovy7995Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy7996.groovy | 4 +-
src/test/groovy/bugs/Groovy8002.groovy | 2 +-
src/test/groovy/bugs/Groovy8026Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy8030Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy8046.groovy | 8 +-
src/test/groovy/bugs/Groovy8048.groovy | 2 +-
src/test/groovy/bugs/Groovy8055Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy8060Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy8063.groovy | 8 +-
src/test/groovy/bugs/Groovy8085Bug.groovy | 11 +-
src/test/groovy/bugs/Groovy8090.groovy | 2 +-
src/test/groovy/bugs/Groovy8110Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy8138Bug.groovy | 5 +-
src/test/groovy/bugs/Groovy8140Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy8164.java | 2 +-
src/test/groovy/bugs/Groovy8176Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy8212Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy8229Bug.groovy | 10 +-
src/test/groovy/bugs/Groovy8260Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy8298.groovy | 2 +-
src/test/groovy/bugs/Groovy8310.groovy | 2 +-
src/test/groovy/bugs/Groovy8313Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy831_Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy8327.groovy | 2 +-
src/test/groovy/bugs/Groovy8361.groovy | 6 +-
src/test/groovy/bugs/Groovy8383Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy8439.groovy | 2 +-
src/test/groovy/bugs/Groovy8446.groovy | 6 +-
src/test/groovy/bugs/Groovy8468.groovy | 2 +-
src/test/groovy/bugs/Groovy8474.groovy | 10 +-
src/test/groovy/bugs/Groovy8579.groovy | 4 +-
src/test/groovy/bugs/Groovy8600.groovy | 2 +-
src/test/groovy/bugs/Groovy8609Bug.groovy | 19 +-
src/test/groovy/bugs/Groovy8629Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy8648.groovy | 2 +-
src/test/groovy/bugs/Groovy8657.groovy | 2 +-
src/test/groovy/bugs/Groovy8686.groovy | 6 +-
src/test/groovy/bugs/Groovy872Bug.groovy | 9 +-
src/test/groovy/bugs/Groovy8762.groovy | 2 +-
src/test/groovy/bugs/Groovy8764.groovy | 2 +-
src/test/groovy/bugs/Groovy8815.groovy | 2 +-
src/test/groovy/bugs/Groovy8819Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy8833Bug.groovy | 7 +-
src/test/groovy/bugs/Groovy8868Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy8881Bug.groovy | 8 +-
src/test/groovy/bugs/Groovy8943.groovy | 2 +-
src/test/groovy/bugs/Groovy8947.groovy | 4 +-
src/test/groovy/bugs/Groovy8948.groovy | 2 +-
src/test/groovy/bugs/Groovy8962.groovy | 2 +-
src/test/groovy/bugs/Groovy8964.groovy | 2 +-
src/test/groovy/bugs/Groovy9007.groovy | 2 +-
src/test/groovy/bugs/Groovy9010.groovy | 4 +-
src/test/groovy/bugs/Groovy9031.groovy | 2 +-
src/test/groovy/bugs/Groovy9059.groovy | 2 +-
src/test/groovy/bugs/Groovy9063.groovy | 2 +-
src/test/groovy/bugs/Groovy9074.groovy | 4 +-
src/test/groovy/bugs/Groovy9115.groovy | 2 +-
src/test/groovy/bugs/Groovy9120.groovy | 2 +-
src/test/groovy/bugs/Groovy9127.groovy | 6 +-
src/test/groovy/bugs/Groovy9136.groovy | 2 +-
src/test/groovy/bugs/Groovy9141.groovy | 6 +-
src/test/groovy/bugs/Groovy9153.groovy | 2 +-
src/test/groovy/bugs/Groovy9170.groovy | 2 +-
src/test/groovy/bugs/Groovy9176.groovy | 4 +-
src/test/groovy/bugs/Groovy9197.groovy | 2 +-
src/test/groovy/bugs/Groovy9213.groovy | 10 +-
src/test/groovy/bugs/Groovy9215.groovy | 2 +-
src/test/groovy/bugs/Groovy9217.groovy | 2 +-
src/test/groovy/bugs/Groovy9226.groovy | 2 +-
src/test/groovy/bugs/Groovy9236.groovy | 2 +-
src/test/groovy/bugs/Groovy9238.groovy | 2 +-
src/test/groovy/bugs/Groovy9240.groovy | 2 +-
src/test/groovy/bugs/Groovy9244.groovy | 2 +-
src/test/groovy/bugs/Groovy9245.groovy | 2 +-
src/test/groovy/bugs/Groovy9252.groovy | 2 +-
src/test/groovy/bugs/Groovy9259.groovy | 2 +-
src/test/groovy/bugs/Groovy9261.groovy | 2 +-
src/test/groovy/bugs/Groovy9265.groovy | 2 +-
src/test/groovy/bugs/Groovy9270.groovy | 10 +-
src/test/groovy/bugs/Groovy9271.groovy | 2 +-
src/test/groovy/bugs/Groovy9288.groovy | 79 +++--
src/test/groovy/bugs/Groovy9292.groovy | 28 +-
src/test/groovy/bugs/Groovy9293.groovy | 14 +-
src/test/groovy/bugs/Groovy9294.groovy | 2 +-
src/test/groovy/bugs/Groovy9324.groovy | 2 +-
src/test/groovy/bugs/Groovy9327.groovy | 2 +-
src/test/groovy/bugs/Groovy9329.groovy | 2 +-
src/test/groovy/bugs/Groovy9336.groovy | 2 +-
src/test/groovy/bugs/Groovy9338.groovy | 6 +-
src/test/groovy/bugs/Groovy9367.groovy | 2 +-
src/test/groovy/bugs/Groovy9370.groovy | 2 +-
src/test/groovy/bugs/Groovy9387.groovy | 2 +-
src/test/groovy/bugs/Groovy9400.groovy | 4 +-
src/test/groovy/bugs/Groovy9412.groovy | 2 +-
src/test/groovy/bugs/Groovy9413.groovy | 2 +-
src/test/groovy/bugs/Groovy9487.groovy | 2 +-
src/test/groovy/bugs/Groovy9524.groovy | 2 +-
src/test/groovy/bugs/Groovy9556.groovy | 2 +-
src/test/groovy/bugs/Groovy9566.groovy | 2 +-
src/test/groovy/bugs/Groovy9587.groovy | 2 +-
src/test/groovy/bugs/Groovy9589.groovy | 2 +-
src/test/groovy/bugs/Groovy9601.groovy | 2 +-
src/test/groovy/bugs/Groovy9606.groovy | 2 +-
src/test/groovy/bugs/Groovy9607.groovy | 2 +-
src/test/groovy/bugs/Groovy9608.groovy | 2 +-
src/test/groovy/bugs/Groovy9609.groovy | 2 +-
src/test/groovy/bugs/Groovy9611.groovy | 2 +-
src/test/groovy/bugs/Groovy965_Bug.groovy | 10 +-
src/test/groovy/bugs/Groovy9666.groovy | 2 +-
src/test/groovy/bugs/Groovy9691.groovy | 2 +-
src/test/groovy/bugs/Groovy9706.groovy | 8 +-
src/test/groovy/bugs/Groovy9719.groovy | 6 +-
src/test/groovy/bugs/Groovy9790.groovy | 4 +-
src/test/groovy/bugs/Groovy9797.groovy | 20 +-
src/test/groovy/bugs/Groovy9805.groovy | 2 +-
src/test/groovy/bugs/Groovy9815.groovy | 2 +-
src/test/groovy/bugs/Groovy9873.groovy | 2 +-
src/test/groovy/bugs/Groovy9906.groovy | 2 +-
src/test/groovy/bugs/Groovy9911.groovy | 2 +-
src/test/groovy/bugs/Groovy9922.groovy | 2 +-
src/test/groovy/bugs/Groovy9932.groovy | 4 +-
src/test/groovy/bugs/Groovy9966.groovy | 2 +-
src/test/groovy/bugs/Groovy996_Bug.groovy | 6 +-
src/test/groovy/bugs/Groovy9982.groovy | 2 +-
src/test/groovy/bugs/GroovyInnerEnumBug.groovy | 10 +-
src/test/groovy/bugs/GuillaumesBug.groovy | 6 +-
src/test/groovy/bugs/GuillaumesMapBug.groovy | 7 +-
.../groovy/bugs/ImportNodeLineNumberTest.groovy | 2 +-
.../groovy/bugs/InconsistentStackHeightBug.groovy | 8 +-
src/test/groovy/bugs/InterfaceImplBug.groovy | 5 +-
...vokeNormalMethodFromBuilder_Groovy657Bug.groovy | 6 +-
src/test/groovy/bugs/MarkupAndMethodBug.groovy | 6 +-
src/test/groovy/bugs/MetaClassCachingBug.groovy | 13 +-
...MethodCallWithoutParensInStaticMethodBug.groovy | 6 +-
src/test/groovy/bugs/MethodClosureTest.groovy | 4 +-
src/test/groovy/bugs/MethodDispatchBug.groovy | 7 +-
src/test/groovy/bugs/MethodPointerBug.groovy | 9 +-
src/test/groovy/bugs/MorgansBug.groovy | 6 +-
src/test/groovy/bugs/NestedClosureBug.groovy | 6 +-
.../groovy/bugs/NullAsBooleanCoercionTest.groovy | 6 +-
src/test/groovy/bugs/NullCompareBug.groovy | 6 +-
.../groovy/bugs/OverloadInvokeMethodBug.groovy | 6 +-
src/test/groovy/bugs/POJOCallSiteBug.groovy | 12 +-
src/test/groovy/bugs/PrimitivePropertyBug.groovy | 6 +-
src/test/groovy/bugs/PrintlnWithNewBug.groovy | 5 +-
src/test/groovy/bugs/PropertyNameBug.groovy | 7 +-
src/test/groovy/bugs/RodsBooleanBug.groovy | 6 +-
src/test/groovy/bugs/RodsBug.groovy | 7 +-
.../groovy/bugs/RussellsOptionalParenTest.groovy | 6 +-
src/test/groovy/bugs/SingleEvalTest.groovy | 10 +-
.../groovy/bugs/StaticClosurePropertyBug.groovy | 6 +-
src/test/groovy/bugs/StaticMethodCallBug.groovy | 6 +-
src/test/groovy/bugs/StaticMethodImportBug.groovy | 8 +-
.../bugs/StaticMethodImportGroovy935Bug.groovy | 5 +-
src/test/groovy/bugs/StaticPropertyBug.groovy | 10 +-
.../groovy/bugs/SubscriptAndExpressionBug.groovy | 11 +-
src/test/groovy/bugs/SuperMethod2Bug.groovy | 10 +-
src/test/groovy/bugs/SuperMethodBug.groovy | 6 +-
.../groovy/bugs/SynchronizedBytecodeBug.groovy | 12 +-
src/test/groovy/bugs/ToStringBug.groovy | 6 +-
src/test/groovy/bugs/TryCatch2Bug.groovy | 6 +-
src/test/groovy/bugs/TryCatchBug.groovy | 6 +-
src/test/groovy/bugs/UnknownVariableBug.groovy | 8 +-
src/test/groovy/bugs/UseClosureInClosureBug.groovy | 6 +-
src/test/groovy/bugs/UseStaticInClosureBug.groovy | 7 +-
src/test/groovy/bugs/VariablePrecedence.groovy | 9 +-
src/test/groovy/bugs/VariablePrecedenceTest.groovy | 6 +-
src/test/groovy/bugs/VerifyErrorBug.groovy | 11 +-
src/test/groovy/bugs/WriteOnlyPropertyBug.groovy | 6 +-
src/test/groovy/bugs/ZoharsBug.groovy | 6 +-
.../AnnotationCollectorReflectionTest.groovy | 2 +-
.../bugs/groovy5912/otherpkg/Groovy5912Bug.groovy | 7 +-
src/test/groovy/bugs/groovy6742/Groovy6742.groovy | 2 +-
src/test/groovy/bugs/groovy8531/Groovy8531.groovy | 2 +-
src/test/groovy/bugs/groovy8757/UsageTest.groovy | 7 +-
.../SyntheticParameterAnnotationsBug.groovy | 7 +-
src/test/groovy/bugs/groovy8966/Groovy8966.groovy | 7 +-
src/test/groovy/bugs/groovy9204/Groovy9204.groovy | 8 +-
.../groovy/gls/annotations/AnnotationTest.groovy | 8 +-
.../AnnotationClosureExhaustiveTestSupport.groovy | 4 +-
.../AnnotationClosureJavaCompatibilityTest.java | 4 +-
.../AnnotationClosureWithNonLocalVariable.groovy | 11 +-
src/test/groovy/gls/ch06/s05/GName1Test.groovy | 16 +-
.../methods/MethodOverridingAllowedTest.groovy | 43 ++-
.../methods/MethodOverridingDeniedTest.groovy | 35 +-
.../closures/ResolveStrategyPropertyTest.groovy | 7 +-
.../groovy/gls/closures/ResolveStrategyTest.groovy | 7 +-
.../gls/generics/GenericsUsageOrderingTest.groovy | 2 +-
.../groovy/gls/generics/GenericsUsageTest.groovy | 6 +-
.../groovy/gls/innerClass/InnerClassTest.groovy | 26 +-
.../gls/innerClass/InnerInterfaceTest.groovy | 11 +-
.../gls/invocation/ClassDuplicationTest.groovy | 6 +-
.../invocation/ConstructorDelegationTest.groovy | 6 +-
.../gls/invocation/CovariantReturnTest.groovy | 2 +-
.../groovy/gls/invocation/DefaultParamTest.groovy | 26 +-
.../groovy/gls/scope/VariablePrecedenceTest.groovy | 5 +-
.../MultipleAssignmentDeclarationTest.groovy | 2 +-
.../gls/statements/MultipleAssignmentTest.groovy | 2 +-
src/test/groovy/gls/syntax/Gep3OrderDslTest.groovy | 15 +-
src/test/groovy/gls/syntax/Gep3Test.groovy | 54 +++-
src/test/groovy/groovy/ActorTest.groovy | 10 +-
.../groovy/groovy/AmbiguousInvocationTest.groovy | 13 +-
src/test/groovy/groovy/ArrayAutoboxingTest.groovy | 6 +-
src/test/groovy/groovy/ArrayCoerceTest.groovy | 16 +-
src/test/groovy/groovy/ArrayParamMethodTest.groovy | 6 +-
src/test/groovy/groovy/ArrayTest.groovy | 39 ++-
src/test/groovy/groovy/ArrayTypeTest.groovy | 7 +-
src/test/groovy/groovy/AsTest.groovy | 23 +-
src/test/groovy/groovy/AssertNumberTest.groovy | 8 +-
src/test/groovy/groovy/AssertTest.groovy | 11 +-
src/test/groovy/groovy/Base64Test.groovy | 25 +-
src/test/groovy/groovy/BinaryStreamsTest.groovy | 9 +-
src/test/groovy/groovy/BindingTest.groovy | 7 +-
src/test/groovy/groovy/BitSetTest.groovy | 36 ++-
.../groovy/groovy/BreakContinueLabelTest.groovy | 2 +-
.../groovy/groovy/CallInnerClassCtorTest.groovy | 8 +-
src/test/groovy/groovy/CastTest.groovy | 17 +-
.../groovy/groovy/ChainedAssignmentTest.groovy | 6 +-
src/test/groovy/groovy/ClassExpressionTest.groovy | 8 +-
src/test/groovy/groovy/ClassLoaderBug.groovy | 6 +-
src/test/groovy/groovy/ClassTest.groovy | 6 +-
src/test/groovy/groovy/ClosureAsParamTest.groovy | 9 +-
src/test/groovy/groovy/ClosureCloneTest.groovy | 6 +-
.../groovy/groovy/ClosureComparatorTest.groovy | 9 +-
src/test/groovy/groovy/ClosureComposeTest.groovy | 2 +-
src/test/groovy/groovy/ClosureCurryTest.groovy | 2 +-
.../groovy/ClosureDefaultParameterTest.groovy | 7 +-
src/test/groovy/groovy/ClosureInClosureTest.groovy | 6 +-
.../groovy/groovy/ClosureInStaticMethodTest.groovy | 8 +-
.../groovy/groovy/ClosureMethodCallTest.groovy | 2 +-
.../groovy/groovy/ClosureMethodsOnFileTest.groovy | 12 +-
.../groovy/groovy/ClosureMissingMethodTest.groovy | 11 +-
src/test/groovy/groovy/ClosureReturnTest.groovy | 7 +-
.../ClosureReturnWithoutReturnStatementTest.groovy | 7 +-
src/test/groovy/groovy/ClosureSugarTest.groovy | 7 +-
.../groovy/ClosureUsingOuterVariablesTest.groovy | 2 +-
.../groovy/ClosureWithDefaultParamTest.groovy | 20 +-
.../groovy/ClosureWithEmptyParametersTest.groovy | 6 +-
src/test/groovy/groovy/CollateTest.groovy | 25 +-
src/test/groovy/groovy/CompareEqualsTest.groovy | 9 +-
src/test/groovy/groovy/CompareToTest.groovy | 7 +-
src/test/groovy/groovy/CompareTypesTest.groovy | 12 +-
src/test/groovy/groovy/CompileOrderTest.groovy | 7 +-
src/test/groovy/groovy/CompilerErrorTest.groovy | 12 +-
src/test/groovy/groovy/Constructor2Test.groovy | 6 +-
.../groovy/groovy/ConstructorMismatchTest.groovy | 15 +-
src/test/groovy/groovy/ConstructorTest.groovy | 6 +-
.../groovy/groovy/CurlyBracketLayoutTest.groovy | 10 +-
.../groovy/groovy/DefaultParamClosureTest.groovy | 13 +-
src/test/groovy/groovy/DoWhileLoopTest.groovy | 6 +-
src/test/groovy/groovy/DollarEscapingTest.groovy | 6 +-
src/test/groovy/groovy/DownUpStepTest.groovy | 12 +-
src/test/groovy/groovy/DynamicMemberTest.groovy | 6 +-
src/test/groovy/groovy/EscapedUnicodeTest.groovy | 9 +-
.../groovy/groovy/ExceptionInClosureTest.groovy | 8 +-
src/test/groovy/groovy/FileTest.groovy | 29 +-
src/test/groovy/groovy/FilterLineTest.groovy | 10 +-
src/test/groovy/groovy/FinallyTest.groovy | 12 +-
.../groovy/ForLoopWithLocalVariablesTest.groovy | 6 +-
src/test/groovy/groovy/GStringTest.groovy | 2 +-
src/test/groovy/groovy/GeneratorTest.groovy | 9 +-
src/test/groovy/groovy/GlobalPrintlnTest.groovy | 8 +-
.../groovy/GroovyCharSequenceMethodsTest.groovy | 57 +++-
.../groovy/groovy/GroovyClosureMethodsTest.groovy | 18 +-
.../groovy/groovy/GroovyInterceptableTest.groovy | 12 +-
src/test/groovy/groovy/GroovyTruthTest.groovy | 15 +-
src/test/groovy/groovy/HeredocsTest.groovy | 7 +-
src/test/groovy/groovy/HexTest.groovy | 12 +-
src/test/groovy/groovy/HomepageTest.groovy | 6 +-
src/test/groovy/groovy/IdentityClosureTest.groovy | 11 +-
src/test/groovy/groovy/IfElseCompactTest.groovy | 7 +-
src/test/groovy/groovy/IfElseTest.groovy | 15 +-
src/test/groovy/groovy/IfTest.groovy | 9 +-
src/test/groovy/groovy/IfWithMethodCallTest.groovy | 6 +-
src/test/groovy/groovy/IllegalAccessTests.groovy | 2 +-
src/test/groovy/groovy/ImportTest.groovy | 2 +-
src/test/groovy/groovy/InstanceofTest.groovy | 26 +-
src/test/groovy/groovy/InterfaceTest.groovy | 2 +-
.../groovy/InvokeNormalMethodsFirstTest.groovy | 10 +-
.../groovy/KeywordsInPropertyNamesTest.groovy | 9 +-
src/test/groovy/groovy/LeftShiftTest.groovy | 8 +-
src/test/groovy/groovy/ListIteratingTest.groovy | 8 +-
src/test/groovy/groovy/ListTest.groovy | 92 +++++-
src/test/groovy/groovy/LiteralTypesTest.groovy | 8 +-
src/test/groovy/groovy/LittleClosureTest.groovy | 6 +-
src/test/groovy/groovy/LocalFieldTest.groovy | 6 +-
src/test/groovy/groovy/LocalPropertyTest.groovy | 7 +-
src/test/groovy/groovy/LocalVariableTest.groovy | 9 +-
src/test/groovy/groovy/LogicTest.groovy | 9 +-
src/test/groovy/groovy/LoopBreakTest.groovy | 8 +-
src/test/groovy/groovy/MapConstructionTest.groovy | 8 +-
src/test/groovy/groovy/MapPropertyTest.groovy | 9 +-
src/test/groovy/groovy/MapTest.groovy | 2 +-
src/test/groovy/groovy/MethodCallTest.groovy | 9 +-
.../groovy/MethodCallWithoutParenthesisTest.groovy | 9 +-
.../MethodParameterAccessWithinClosureTest.groovy | 17 +-
src/test/groovy/groovy/MinMaxTest.groovy | 8 +-
src/test/groovy/groovy/MinusEqualsTest.groovy | 21 +-
src/test/groovy/groovy/ModuloTest.groovy | 8 +-
src/test/groovy/groovy/MultiCatchTest.groovy | 16 +-
src/test/groovy/groovy/MultiDimArraysTest.groovy | 15 +-
.../groovy/MultilineChainExpressionTest.groovy | 6 +-
src/test/groovy/groovy/MultilineStringTest.groovy | 6 +-
.../groovy/groovy/MultiplyDivideEqualsTest.groovy | 12 +-
src/test/groovy/groovy/NamedParameterTest.groovy | 26 +-
src/test/groovy/groovy/NestedClassTest.groovy | 18 +-
src/test/groovy/groovy/NewExpressionTest.groovy | 11 +-
src/test/groovy/groovy/NullPropertyTest.groovy | 6 +-
src/test/groovy/groovy/OptionalReturnTest.groovy | 13 +-
.../groovy/groovy/OverloadInvokeMethodTest.groovy | 6 +-
.../groovy/OverridePropertyGetterTest.groovy | 8 +-
src/test/groovy/groovy/PlusEqualsTest.groovy | 25 +-
src/test/groovy/groovy/PostfixTest.groovy | 12 +-
src/test/groovy/groovy/PrefixTest.groovy | 12 +-
src/test/groovy/groovy/PrimitiveArraysTest.groovy | 13 +-
.../groovy/groovy/PrimitiveDefaultValueTest.groovy | 12 +-
.../groovy/groovy/PrimitiveTypeFieldTest.groovy | 10 +-
src/test/groovy/groovy/PrimitiveTypesTest.groovy | 9 +-
src/test/groovy/groovy/PrintTest.groovy | 57 ++--
...ateVariableAccessFromAnotherInstanceTest.groovy | 6 +-
src/test/groovy/groovy/ProcessTest.groovy | 15 +-
src/test/groovy/groovy/Property2Test.groovy | 10 +-
src/test/groovy/groovy/PropertyTest.groovy | 4 +-
.../groovy/groovy/PropertyWithoutDotTest.groovy | 6 +-
src/test/groovy/groovy/RangeTest.groovy | 27 +-
src/test/groovy/groovy/ReadLineTest.groovy | 24 +-
.../groovy/groovy/RegularExpressionsTest.groovy | 2 +-
src/test/groovy/groovy/ReturnTest.groovy | 8 +-
src/test/groovy/groovy/SafeNavigationTest.groovy | 12 +-
src/test/groovy/groovy/SerializeTest.groovy | 16 +-
src/test/groovy/groovy/SetTest.groovy | 10 +-
src/test/groovy/groovy/ShellTest.groovy | 8 +-
src/test/groovy/groovy/SimplePostfixTest.groovy | 6 +-
src/test/groovy/groovy/SingletonBugTest.groovy | 5 +-
src/test/groovy/groovy/SliceTest.groovy | 6 +-
src/test/groovy/groovy/SocketTest.groovy | 12 +-
src/test/groovy/groovy/SortTest.groovy | 11 +-
src/test/groovy/groovy/SqlDateTest.groovy | 27 +-
src/test/groovy/groovy/StackTraceTest.groovy | 7 +-
src/test/groovy/groovy/StaticImportTest.groovy | 30 +-
src/test/groovy/groovy/StaticMessageTest.groovy | 7 +-
src/test/groovy/groovy/StringBufferTest.groovy | 7 +-
src/test/groovy/groovy/StringTest.groovy | 36 ++-
src/test/groovy/groovy/SubscriptTest.groovy | 20 +-
src/test/groovy/groovy/SwitchTest.groovy | 21 +-
.../groovy/SwitchWithDifferentTypesTest.groovy | 12 +-
src/test/groovy/groovy/TextPropertyTest.groovy | 13 +-
src/test/groovy/groovy/ThisAndSuperTest.groovy | 8 +-
src/test/groovy/groovy/ThreadMethodsTest.groovy | 7 +-
src/test/groovy/groovy/ThrowTest.groovy | 8 +-
src/test/groovy/groovy/ToArrayBugTest.groovy | 6 +-
.../groovy/groovy/TripleQuotedStringTest.groovy | 6 +-
src/test/groovy/groovy/TypesafeMethodTest.groovy | 6 +-
.../groovy/groovy/UniqueOnCollectionTest.groovy | 17 +-
.../UniqueOnCollectionWithClosureTest.groovy | 11 +-
.../UniqueOnCollectionWithComparatorTest.groovy | 11 +-
src/test/groovy/groovy/UnsafeNavigationTest.groovy | 8 +-
src/test/groovy/groovy/VArgsTest.groovy | 2 +-
src/test/groovy/groovy/ValidNameTest.groovy | 7 +-
src/test/groovy/groovy/VarargsMethodTest.groovy | 2 +-
src/test/groovy/groovy/VerbatimGStringTest.groovy | 10 +-
src/test/groovy/groovy/WhileLoopTest.groovy | 8 +-
.../PackageAndImportAnnotationTest.groovy | 2 +-
.../annotations/ParameterAnnotationTest.groovy | 18 +-
.../groovy/beans/BindableTransformTest.groovy | 2 +-
.../groovy/beans/ListenerListTransformTest.groovy | 32 +-
src/test/groovy/groovy/execute/ExecuteTest.groovy | 12 +-
.../groovy/execute/ExecuteTest_LinuxSolaris.groovy | 16 +-
.../groovy/execute/ExecuteTest_Windows.groovy | 16 +-
.../groovy/generated/AutoCloneGeneratedTest.groovy | 2 +-
.../generated/AutoExternalizeGeneratedTest.groovy | 2 +-
.../groovy/generated/BindableGeneratedTest.groovy | 2 +-
.../groovy/generated/BuilderGeneratedTest.groovy | 2 +-
.../groovy/generated/CanonicalGeneratedTest.groovy | 2 +-
.../groovy/generated/ClosureGeneratedTest.groovy | 2 +-
.../generated/ConstructorsGeneratedTest.groovy | 2 +-
.../groovy/generated/DelegateGeneratedTest.groovy | 2 +-
.../generated/GroovyObjectGeneratedTest.groovy | 2 +-
.../groovy/generated/ImmutableGeneratedTest.groovy | 2 +-
.../generated/IndexedPropertyGeneratedTest.groovy | 2 +-
.../generated/PropertiesGeneratedTest.groovy | 2 +-
.../groovy/generated/SortableGeneratedTest.groovy | 2 +-
.../groovy/generated/VetoableGeneratedTest.groovy | 2 +-
src/test/groovy/groovy/gpath/GPathTest.groovy | 6 +-
src/test/groovy/groovy/gpath/NodeGPathTest.groovy | 8 +-
.../groovy/grape/GrabErrorIsolationTest.groovy | 4 +-
.../groovy/groovy/grape/GrabExcludeTest.groovy | 10 +-
.../groovy/groovy/grape/GrabResolverTest.groovy | 14 +-
.../groovy/grape/GrapeClassLoaderTest.groovy | 6 +-
src/test/groovy/groovy/grape/GrapeIvyTest.groovy | 10 +-
src/test/groovy/groovy/inspect/InspectorTest.java | 10 +-
.../groovy/groovy/io/LineColumnReaderTest.groovy | 11 +-
.../groovy/lang/BenchmarkInterceptorTest.groovy | 10 +-
.../groovy/lang/CategoryAnnotationTest.groovy | 6 +-
.../groovy/groovy/lang/ClassReloadingTest.groovy | 7 +-
.../groovy/groovy/lang/ClosureResolvingTest.groovy | 10 +-
.../groovy/lang/DelegatingMetaClassTest.groovy | 8 +-
src/test/groovy/groovy/lang/ExceptionTest.groovy | 8 +-
.../lang/ExpandoMetaClassConstructorTest.groovy | 8 +-
.../groovy/groovy/lang/ExpandoMetaClassTest.groovy | 82 ++++-
src/test/groovy/groovy/lang/GStringTest.java | 4 +-
src/test/groovy/groovy/lang/GetMethodsTest.groovy | 7 +-
src/test/groovy/groovy/lang/Groovy3406.groovy | 2 +-
.../groovy/lang/GroovyClassLoaderTest.groovy | 2 +-
.../groovy/groovy/lang/GroovyCodeSourceTest.groovy | 13 +-
src/test/groovy/groovy/lang/GroovyShellTest.java | 6 +-
.../groovy/groovy/lang/GroovyShellTest2.groovy | 4 +-
.../groovy/lang/InnerClassResolvingTest.groovy | 8 +-
src/test/groovy/groovy/lang/IntRangeTest.groovy | 31 +-
src/test/groovy/groovy/lang/InterceptorTest.groovy | 16 +-
.../groovy/groovy/lang/MapOfClosureTest.groovy | 5 +-
.../groovy/lang/MetaClassPropertyTest.groovy | 11 +-
.../groovy/lang/MetaClassRegistryTest.groovy | 13 +-
.../groovy/groovy/lang/MethodMissingTest.groovy | 21 +-
.../groovy/groovy/lang/MixinAnnotationTest.groovy | 6 +-
.../groovy/groovy/lang/NumberRangeTestCase.java | 46 +--
src/test/groovy/groovy/lang/ObjectRangeTest.java | 4 +-
.../groovy/groovy/lang/PropertyMissingTest.groovy | 21 +-
.../groovy/lang/ReferenceSerializationTest.groovy | 7 +-
src/test/groovy/groovy/lang/RespondsToTest.groovy | 12 +-
src/test/groovy/groovy/lang/ScriptCacheTest.groovy | 13 +-
.../lang/ScriptSourcePositionInAstTest.groovy | 8 +-
src/test/groovy/groovy/lang/SpreadMapTest.groovy | 42 ++-
.../groovy/groovy/lang/StringConcatTest.groovy | 5 +-
src/test/groovy/groovy/lang/StripMarginTest.groovy | 9 +-
.../groovy/groovy/lang/SyntheticReturnTest.groovy | 2 +
src/test/groovy/groovy/lang/TapMethodTest.groovy | 29 +-
.../groovy/lang/TupleFactoryMethodTest.groovy | 2 +-
src/test/groovy/groovy/lang/TupleTest.java | 10 +-
src/test/groovy/groovy/lang/WithMethodTest.groovy | 28 +-
.../groovy/mock/example/SandwichMakerTest.groovy | 5 +-
.../groovy/mock/interceptor/HalfMockTest.groovy | 15 +-
.../mock/interceptor/MockCallSequenceTest.groovy | 29 +-
.../mock/interceptor/MockNestedCallTest.groovy | 6 +-
.../mock/interceptor/MockSingleCallTest.groovy | 25 +-
.../mock/interceptor/MockWithZeroRangeTest.groovy | 12 +-
.../mock/interceptor/StubCallSequenceTest.groovy | 26 +-
.../groovy/mock/interceptor/StubForJavaTest.groovy | 7 +-
.../mock/interceptor/StubSingleCallTest.groovy | 7 +-
.../groovy/groovy/mock/interceptor/StubTest.groovy | 8 +-
.../groovy/operator/BigDecimalOperatorsTest.groovy | 18 +-
.../operator/BigIntegerOperationsTest.groovy | 11 +-
.../groovy/operator/BitwiseOperatorsTest.groovy | 22 +-
.../groovy/operator/BooleanOperationsTest.groovy | 12 +-
.../groovy/operator/DoubleOperationsTest.groovy | 15 +-
.../groovy/operator/ImplicationOperatorTest.groovy | 15 +-
.../groovy/operator/IntegerOperatorsTest.groovy | 24 +-
.../operator/MyColorOperatorOverloadingTest.groovy | 10 +-
.../groovy/groovy/operator/NegateListsTest.groovy | 12 +-
.../groovy/operator/PowerOperatorsTest.groovy | 10 +-
.../groovy/operator/SpreadListOperatorTest.groovy | 19 +-
.../groovy/operator/SpreadMapOperatorTest.groovy | 12 +-
.../groovy/operator/StringOperatorsTest.groovy | 10 +-
.../groovy/operator/UnaryMinusNumberTests.groovy | 9 +-
.../groovy/operator/UnaryMinusOperatorTest.groovy | 12 +-
.../groovy/script/RuntimeResolveTests.groovy | 4 +-
src/test/groovy/groovy/script/ScriptTest.groovy | 6 +-
src/test/groovy/groovy/time/DurationTest.groovy | 97 ++++--
.../groovy/groovy/time/TimeCategoryTest.groovy | 21 +-
.../transform/AnnotationCollectorLegacyTest.groovy | 2 +-
.../transform/AnnotationCollectorTest.groovy | 2 +-
.../transform/ConditionalInterruptTest.groovy | 2 +-
src/test/groovy/groovy/transform/LazyTest.groovy | 2 +-
.../groovy/transform/ReadWriteLockTest.groovy | 8 +-
.../groovy/transform/ThreadInterruptTest.groovy | 12 +-
.../groovy/transform/TimedInterruptTest.groovy | 2 +-
.../groovy/transform/stc/CoercionSTCTest.groovy | 1 +
.../transform/stc/ConstructorsSTCTest.groovy | 1 +
.../groovy/transform/stc/Groovy7888Bug.groovy | 8 +-
.../groovy/groovy/transform/stc/LambdaTest.groovy | 10 +-
.../groovy/transform/stc/MethodCallsSTCTest.groovy | 1 +
.../transform/stc/MethodReferenceTest.groovy | 24 +-
.../groovy/groovy/transform/stc/POJOTest.groovy | 10 +-
.../groovy/tree/ClosureClassLoaderBug.groovy | 6 +-
.../groovy/groovy/tree/NavigationNodeTest.groovy | 7 +-
.../groovy/groovy/tree/NestedClosureBugTest.groovy | 6 +-
src/test/groovy/groovy/tree/SmallTreeTest.groovy | 6 +-
src/test/groovy/groovy/tree/TreeTest.groovy | 2 +-
src/test/groovy/groovy/tree/VerboseTreeTest.groovy | 7 +-
src/test/groovy/groovy/txn/TransactionTest.groovy | 6 +-
src/test/groovy/groovy/ui/GroovyMainTest.groovy | 6 +-
.../groovy/groovy/util/BufferedIteratorTest.groovy | 20 +-
.../groovy/groovy/util/BuilderSupportTest.groovy | 4 +-
.../groovy/groovy/util/ConfigObjectTest.groovy | 16 +-
.../groovy/groovy/util/ConfigSlurperTest.groovy | 55 +++-
.../groovy/groovy/util/DelegatingScriptTest.groovy | 2 +-
.../groovy/util/FactoryBuilderSupportTest.groovy | 52 ++-
.../groovy/groovy/util/FileTreeBuilderTest.groovy | 10 +-
.../util/GroovyCollectionsStarImportTest.groovy | 15 +-
.../groovy/util/GroovyCollectionsTest.groovy | 2 +-
.../groovy/util/GroovyScriptEngineTest.groovy | 29 +-
.../groovy/groovy/util/IndentPrinterTest.groovy | 11 +-
src/test/groovy/groovy/util/NodeTest.groovy | 83 +++--
.../groovy/util/ObjectGraphBuilderTest.groovy | 23 +-
.../groovy/groovy/util/ObservableListTest.groovy | 19 +-
.../groovy/groovy/util/ObservableMapTest.groovy | 15 +-
.../groovy/groovy/util/ObservableSetTests.groovy | 19 +-
src/test/groovy/groovy/util/OrderByTest.groovy | 11 +-
.../groovy/util/ProxyGeneratorAdapterTest.groovy | 5 +-
.../groovy/groovy/util/ProxyGeneratorTest.groovy | 7 +-
src/test/groovy/groovy/util/ProxyTest.groovy | 14 +-
.../groovy/groovy/util/ResourceBundleTest.groovy | 4 +-
.../groovy/groovy/util/logging/CommonsTest.groovy | 27 +-
.../groovy/groovy/util/logging/Log4jTest.groovy | 37 ++-
src/test/groovy/groovy/util/logging/LogTest.groovy | 38 ++-
.../groovy/util/logging/vm9/PlatformLogTest.groovy | 29 +-
.../groovy/ast/tools/ExpressionUtilsTest.groovy | 4 +-
.../apache/groovy/parser/antlr4/TestUtils.groovy | 72 ++---
.../groovy/plugin/GroovyRunnerRegistryTest.groovy | 21 +-
.../groovy/org/apache/groovy/util/ArraysTest.java | 26 +-
.../org/apache/groovy/util/BeanUtilsTest.groovy | 2 +-
.../org/apache/groovy/util/JavaShellTest.groovy | 2 +-
.../groovy/org/apache/groovy/util/MapsTest.groovy | 2 +-
.../ManagedIdentityConcurrentMapTest.groovy | 2 +-
.../ConcurrentLinkedHashMapTest.java | 8 +-
.../ClosureAndInnerClassNodeStructureTest.groovy | 2 +-
.../codehaus/groovy/antlr/GStringEndTest.groovy | 12 +-
.../org/codehaus/groovy/ast/ClassNodeTest.java | 32 +-
.../codehaus/groovy/ast/GenericsTestCase.groovy | 3 +-
.../groovy/org/codehaus/groovy/ast/Groovy7826.java | 2 +-
.../org/codehaus/groovy/ast/Groovy9871.groovy | 2 +-
.../groovy/ast/LazyInitOnClassNodeTest.groovy | 7 +-
.../codehaus/groovy/ast/LineColumnCheckTest.groovy | 54 ++--
.../org/codehaus/groovy/ast/MethodNodeTest.groovy | 2 +-
.../org/codehaus/groovy/ast/ModuleNodeTest.java | 12 +-
.../groovy/ast/decompiled/AsmDecompilerTest.groovy | 18 +-
.../ast/decompiled/FieldNodeEqualityTest.groovy | 2 +-
.../groovy/ast/expr/ClosureExpressionTest.groovy | 2 +-
.../ast/expr/DeclarationExpressionTest.groovy | 2 +-
.../groovy/ast/expr/MapExpressionTest.groovy | 7 +-
.../ast/expr/MethodCallExpressionTest.groovy | 2 +-
.../groovy/ast/expr/PropertyExpressionTest.groovy | 6 +-
.../groovy/ast/source/SourceBaseTestCase.groovy | 5 +-
.../groovy/ast/stmt/ExpressionStatementTest.groovy | 2 +-
.../groovy/ast/stmt/IfStatementTest.groovy | 11 +-
.../groovy/ast/stmt/ThrowStatementTest.groovy | 2 +-
.../groovy/ast/tools/GenericsUtilsTest.groovy | 2 +-
.../groovy/classgen/BytecodeHelperTest.groovy | 9 +-
.../classgen/CallClosureFieldAsMethodTest.groovy | 10 +-
.../codehaus/groovy/classgen/CallSiteTest.groovy | 10 +-
.../groovy/classgen/CastToStringTest.groovy | 2 +-
.../classgen/ClassCompletionVerifierTest.java | 12 +-
.../classgen/FinalVariableAnalyzerTest.groovy | 50 ++-
.../groovy/classgen/GenericsGenTest.groovy | 11 +-
.../codehaus/groovy/classgen/InterfaceTest.groovy | 2 +-
.../codehaus/groovy/classgen/MetaClassTest.groovy | 9 +-
.../org/codehaus/groovy/classgen/RecordTest.groovy | 2 +-
.../groovy/classgen/ReflectorLoaderTest.groovy | 6 +-
.../org/codehaus/groovy/classgen/SealedTest.groovy | 4 +-
.../groovy/classgen/TransientMetaClassTest.groovy | 8 +-
.../ClosureWriterGeneratedAnnotationTest.groovy | 2 +-
.../asm/InstructionSequenceHelperClassTest.groovy | 9 +-
.../classgen/asm/sc/BugsStaticCompileTest.groovy | 4 +-
.../asm/sc/MethodCallsStaticCompilationTest.groovy | 2 +-
.../classgen/asm/sc/StaticCompilationTest.groovy | 3 +-
...ticCompileClosureGeneratedAnnotationTest.groovy | 2 +-
.../asm/sc/StaticCompileFieldAccessTest.groovy | 2 +
.../asm/sc/StaticCompileFlowTypingTest.groovy | 2 +-
.../classgen/asm/sc/StaticCompileMathTest.groovy | 2 +-
.../TupleConstructorStaticCompilationTest.groovy | 2 +-
.../classgen/asm/sc/bugs/Groovy6670Bug.groovy | 8 +-
.../groovy/classgen/asm/sc/bugs/Groovy6782.groovy | 2 +-
.../classgen/asm/sc/bugs/Groovy7883Bug.groovy | 21 +-
.../groovy/control/CompilerConfigurationTest.java | 24 +-
.../ASTTransformationCustomizerTest.groovy | 2 +-
.../customizers/ImportCustomizerTest.groovy | 6 +-
.../customizers/SecureASTCustomizerTest.groovy | 6 +-
.../CompilerCustomizationBuilderTest.groovy | 22 +-
.../control/io/AbstractReaderSourceTest.java | 21 +-
.../groovy/control/io/FileReaderTest.groovy | 5 +-
.../groovy/control/io/NullWriterTest.groovy | 7 +-
.../control/io/StringReaderSourceTest.groovy | 5 +-
.../groovy/reflection/CachedMethodTest.groovy | 2 +-
.../reflection/GroovyClassValueFactoryTest.groovy | 24 +-
.../reflection/utils/ReflectionUtilsTest.groovy | 3 +-
.../groovy/runtime/AppendableDgmMethodsTest.groovy | 6 +-
.../groovy/runtime/ArrayGroovyMethodsTest.groovy | 2 +-
.../groovy/runtime/CategoryForIteratorTest.groovy | 10 +-
.../runtime/CustomBooleanCoercionTest.groovy | 10 +-
.../runtime/DefaultGroovyMethodsSupportTest.groovy | 23 +-
.../runtime/DefaultGroovyStaticMethodsTest.groovy | 8 +-
.../groovy/runtime/DirectoryDeleteTest.groovy | 6 +-
.../codehaus/groovy/runtime/EachLineTest.groovy | 6 +-
.../EachWithReaderAndInputStreamTest.groovy | 9 +-
.../groovy/runtime/EncodingGroovyMethodsTest.java | 26 +-
.../codehaus/groovy/runtime/FileAppendTest.groovy | 18 +-
.../groovy/runtime/FileLeftShiftTest.groovy | 8 +-
.../runtime/FileStaticGroovyMethodsTest.groovy | 6 +-
.../groovy/runtime/GroovyCategoryTest.groovy | 10 +-
.../groovy/runtime/IOGroovyMethodsTest.groovy | 16 +-
.../groovy/runtime/InterfaceConversionMapTest.java | 8 +-
.../groovy/runtime/InterfaceConversionTest.groovy | 2 +-
.../runtime/InvokerHelperFormattingTest.groovy | 21 +-
.../groovy/runtime/MetaClassHelperTest.java | 4 +-
.../org/codehaus/groovy/runtime/MinusTest.groovy | 48 +--
.../groovy/runtime/NestedCategoryTest.groovy | 13 +-
.../codehaus/groovy/runtime/NullObjectTest.groovy | 2 +-
.../groovy/runtime/PerInstanceMetaClassTest.groovy | 18 +-
.../runtime/ResourceGroovyMethodsTest.groovy | 51 +--
.../groovy/runtime/StringAsClassTest.groovy | 15 +-
.../groovy/runtime/StringGroovyMethodsTest.java | 8 +-
.../codehaus/groovy/runtime/URLGetBytesTest.groovy | 8 +-
.../codehaus/groovy/runtime/URLGetTextTest.groovy | 8 +-
.../runtime/WithResourceStreamClosedTest.groovy | 7 +-
.../groovy/runtime/WriterAppendTest.groovy | 17 +-
.../groovy/runtime/m12n/ExtensionModuleTest.groovy | 2 +-
.../runtime/memoize/AbstractMemoizeTestCase.groovy | 6 +-
.../CacheCleanupCollectedSoftReferencesTest.groovy | 22 +-
.../groovy/runtime/memoize/CacheCleanupTest.groovy | 4 +-
.../groovy/runtime/memoize/CommonCacheTest.java | 63 ++--
.../runtime/memoize/ConcurrentCommonCacheTest.java | 65 ++--
.../memoize/LRUProtectionStorageTest.groovy | 11 +-
.../runtime/memoize/MemoizeAtMostTest.groovy | 2 +
.../runtime/memoize/MemoizeBetweenTest.groovy | 2 +
.../groovy/runtime/memoize/NullValueTest.groovy | 2 +-
.../runtime/memoize/StampedCommonCacheTest.java | 65 ++--
.../memoize/UnlimitedConcurrentCacheTest.java | 42 +--
.../StaticMethodOverloadCompileStaticTest.groovy | 2 +-
.../vm8/StaticMethodOverloadTest.groovy | 8 +-
.../powerassert/AssertionRenderingTest.groovy | 2 +-
.../runtime/powerassert/AssertionTestUtil.groovy | 9 +-
.../AssertionsInDifferentLocationsTest.groovy | 13 +-
.../runtime/powerassert/EvaluationTest.groovy | 47 ++-
.../ImplicitClosureCallRenderingTest.groovy | 15 +-
.../NotTransformedAssertionsTest.groovy | 7 +-
.../runtime/powerassert/ValueRenderingTest.groovy | 2 +-
.../runtime/trampoline/TrampolineTest.groovy | 5 +-
.../DefaultTypeTransformationTest.groovy | 4 +-
.../runtime/typehandling/EqualityTest.groovy | 6 +-
.../runtime/typehandling/NumberMathTest.groovy | 18 +-
.../typehandling/ShortTypeHandlingTest.groovy | 42 ++-
.../org/codehaus/groovy/syntax/TokenTest.groovy | 41 ++-
.../groovy/tools/LoaderConfigurationTest.groovy | 44 ++-
.../codehaus/groovy/tools/StringHelperTest.groovy | 9 +-
.../org/codehaus/groovy/tools/UtilitiesTest.groovy | 7 +-
.../tools/ast/TransformTestHelperTest.groovy | 6 +-
.../rootloadersync/SubclassingInGroovyTest.groovy | 4 +-
.../rootloadersync/SubclassingInJavaTest.java | 4 +-
.../groovy/tools/stubgenerator/StubTestCase.groovy | 18 +-
.../groovy/transform/AutoCloneTransformTest.groovy | 4 +-
.../AutoFinalTransformBlackBoxTest.groovy | 5 +-
.../groovy/transform/AutoFinalTransformTest.groovy | 4 +-
.../transform/AutoImplementTransformTest.groovy | 6 +-
.../transform/BaseScriptTransformTest.groovy | 2 +-
.../groovy/transform/BuilderTransformTest.groovy | 13 +-
.../CanonicalComponentsTransformTest.groovy | 8 +-
.../groovy/transform/DelegateTransformTest.groovy | 10 +-
.../EqualsAndHashCodeTransformTest.groovy | 2 +-
.../ExternalizeMethodsTransformTest.groovy | 2 +-
.../groovy/transform/FieldTransformTest.groovy | 2 +-
.../groovy/transform/FinalTransformTest.groovy | 4 +-
.../transform/GeneratedAnnotationTest.groovy | 2 +-
.../groovy/transform/GlobalTransformTest.groovy | 5 +-
.../groovy/transform/ImmutableTransformTest.groovy | 4 +-
.../transform/IndexedPropertyTransformTest.groovy | 2 +-
.../InheritConstructorsTransformTest.groovy | 2 +-
.../transform/MemoizedASTTransformationTest.groovy | 30 +-
.../transform/NamedVariantTransformTest.groovy | 12 +-
.../transform/NewifyTransformBlackBoxTest.groovy | 14 +-
.../groovy/transform/NewifyTransformTest.groovy | 4 +-
.../groovy/transform/NullCheckTransformTest.groovy | 3 +-
.../transform/ReadWriteLockTransformTest.groovy | 2 +-
.../groovy/transform/SealedTransformTest.groovy | 4 +-
.../transform/SingletonASTTransformationTest.java | 13 +-
.../transform/SynchronizedTransformTest.groovy | 16 +-
.../transform/TupleConstructorTransformTest.groovy | 4 +-
.../TransformsAndCustomClassLoadersTest.groovy | 14 +-
.../packageScope/DifferentPackageTest.groovy | 22 +-
.../packageScope/PackageScopeTransformTest.groovy | 4 +-
.../groovy/transform/stc/SignatureCodecTest.groovy | 31 +-
.../tailrec/InWhileLoopWrapperTest.groovy | 2 +-
.../transform/tailrec/ParameterMappingTest.groovy | 2 +-
.../transform/tailrec/RecursiveListExamples.groovy | 2 +-
.../tailrec/RecursivenessTesterTest.groovy | 6 +-
.../tailrec/ReturnAdderForClosuresTest.groovy | 6 +-
.../ReturnStatementToIterationConverterTest.groovy | 2 +-
.../transform/tailrec/StatementReplacerTest.groovy | 6 +-
.../TailRecursiveCompilationFailuresTest.groovy | 4 +-
.../transform/tailrec/TailRecursiveExamples.groovy | 2 +-
.../TernaryToIfStatementConverterTest.groovy | 2 +-
.../tailrec/VariableExpressionReplacerTest.groovy | 6 +-
.../groovy/transform/traitx/Groovy11776.groovy | 2 +-
.../traitx/TraitASTTransformationTest.groovy | 33 +-
.../src/test/groovy/groovy/ant/AntTest.groovy | 32 +-
.../src/test/groovy/groovy/ant/AntTestCase.groovy | 3 +-
.../test/groovy/groovy/bugs/Groovy5025Bug.groovy | 8 +-
.../groovy/ast/CodeVisitorSupportTest.groovy | 2 +-
.../ast/builder/AstBuilderFromCodeTest.groovy | 51 ++-
.../builder/AstBuilderFromSpecificationTest.groovy | 18 +-
.../ast/builder/AstBuilderFromStringTest.groovy | 20 +-
.../AstBuilderFromCodePackageImportTest.groovy | 5 +-
.../ASTTransformationCustomizerTest.groovy | 11 +-
.../groovy/cli/commons/CliBuilderTest.groovy | 50 ++-
.../src/spec/test/builder/CliBuilderTest.groovy | 7 +-
.../groovy/cli/picocli/CliBuilderTest.groovy | 116 +++++--
.../groovy/console/SwingBuilderConsoleTest.groovy | 11 +-
.../console/ui/AstNodeToScriptAdapterTest.groovy | 4 +-
.../console/ui/ScriptToTreeNodeAdapterTest.groovy | 56 +++-
.../console/ui/text/GroovyFilterTests.groovy | 14 +-
.../groovy/contracts/domain/ContractTests.groovy | 12 +-
.../ContractExecutionTrackerTests.groovy | 2 +-
.../contracts/tests/basic/BaseTestClass.groovy | 8 +-
.../tests/doc/DocumentationExampleTests.groovy | 8 +-
.../tests/doc/RootClassExampleTests.groovy | 50 +--
.../contracts/tests/doc/StackExampleTests.groovy | 2 +-
.../AbstractClassInheritanceTests.groovy | 2 +-
.../tests/interfaces/AbstractClassTests.groovy | 2 +-
.../InterfaceAbstractClassMixturesTests.groovy | 2 +-
.../SimpleInterfaceInheritanceTests.groovy | 2 +-
.../tests/interfaces/StackExampleTests.groovy | 4 +-
.../contracts/tests/inv/InheritanceTests.groovy | 42 +--
.../tests/inv/POGOClassInvariantTests.groovy | 4 +-
.../tests/inv/SimpleClassInvariantTests.groovy | 4 +-
.../tests/other/AbstractClassTests.groovy | 2 +-
.../tests/other/CandidateChecksTests.groovy | 20 +-
.../tests/other/CircularAssertionCallTests.groovy | 2 +-
.../tests/other/ContractLabelTests.groovy | 2 +-
.../contracts/tests/other/ContractedTests.groovy | 2 +-
.../contracts/tests/other/GenericTypeTests.groovy | 2 +-
.../tests/other/MissingLineNumberTests.groovy | 14 +-
.../tests/other/NotContractedTests.groovy | 2 +-
.../contracts/tests/post/InheritanceTests.groovy | 6 +-
.../post/OldVariablePostconditionTests.groovy | 2 +-
.../ResultAndOldVariablePostconditionTests.groovy | 2 +-
.../post/ResultVariablePostconditionTests.groovy | 4 +-
.../tests/post/SimplePostconditionTests.groovy | 27 +-
.../contracts/tests/pre/InheritanceTests.groovy | 4 +-
.../tests/pre/SimplePreconditionTests.groovy | 54 ++--
.../contracts/util/AnnotationUtilsTests.groovy | 2 +-
.../groovy/contracts/util/FieldValuesTests.groovy | 8 +-
.../src/test/java/groovy/DateTimeTest.groovy | 85 ++++-
.../src/test/java/groovy/DateTest.groovy | 28 +-
.../test/org/apache/groovy/ginq/GinqTest.groovy | 12 +-
.../org/apache/groovy/ginq/GinqErrorTest.groovy | 96 +++---
.../collection/runtime/AsciiTableMakerTest.groovy | 2 +-
.../collection/runtime/NamedTupleTest.groovy | 6 +-
.../runtime/QueryableCollectionTest.groovy | 2 +-
.../collection/runtime/SourceRecordTest.groovy | 2 +-
.../groovy/tools/groovydoc/GroovyDocTest.java | 42 ++-
.../groovydoc/SimpleGroovyClassDocTests.groovy | 13 +-
.../groovydoc/SimpleGroovyRootDocTests.groovy | 6 +-
.../groovy/groovysh/ProgrammaticStartTest.groovy | 6 +-
.../groovysh/commands/ConsoleTestSupport.groovy | 7 +-
.../groovysh/commands/GrabCommandTest.groovy | 2 +
.../commands/GroovyCommandTestSupport.groovy | 4 +-
.../jmx/builder/JmxAttributeInfoManagerTest.groovy | 8 +-
.../jmx/builder/JmxBeanExportFactoryTest.groovy | 26 +-
.../groovy/jmx/builder/JmxBeanFactoryTest.groovy | 14 +-
.../jmx/builder/JmxBeanInfoManagerTest.groovy | 12 +-
.../groovy/jmx/builder/JmxBeansFactoryTest.groovy | 9 +-
.../groovy/jmx/builder/JmxBuilderToolsTest.groovy | 15 +-
.../builder/JmxClientConnectorFactoryTest.groovy | 17 +-
.../builder/JmxEmbeddedMetaMapBuilderTest.groovy | 16 +-
.../jmx/builder/JmxEmitterFactoryTest.groovy | 13 +-
.../jmx/builder/JmxListenerFactoryTest.groovy | 12 +-
.../jmx/builder/JmxMetaMapBuilderTest.groovy | 24 +-
.../jmx/builder/JmxOperationInfoManagerTest.groovy | 13 +-
.../builder/JmxServerConnectorFactoryTest.groovy | 12 +-
.../groovy/jmx/builder/JmxTimerFactoryTest.groovy | 19 +-
.../src/spec/test/json/JsonBuilderTest.groovy | 2 +-
.../spec/test/json/StreamingJsonBuilderTest.groovy | 2 +-
.../test/groovy/bugs/groovy9802/Groovy9802.groovy | 13 +-
.../src/test/groovy/groovy/json/CharBufTest.groovy | 8 +-
.../groovy/json/CustomJsonGeneratorTest.groovy | 5 +-
.../groovy/json/DefaultJsonGeneratorTest.groovy | 21 +-
.../src/test/groovy/groovy/json/IOTest.groovy | 8 +-
.../test/groovy/groovy/json/JsonBuilderTest.groovy | 40 ++-
.../test/groovy/groovy/json/JsonLexerTest.groovy | 20 +-
.../test/groovy/groovy/json/JsonOutputTest.groovy | 4 +-
.../groovy/json/JsonSlurperCharSourceTest.groovy | 3 +
.../groovy/json/JsonSlurperIndexOverlayTest.groovy | 3 +
.../groovy/groovy/json/JsonSlurperLaxTest.groovy | 3 +
.../test/groovy/groovy/json/JsonSlurperTest.groovy | 72 ++++-
.../groovy/groovy/json/JsonTokenTypeTest.groovy | 10 +-
.../groovy/groovy/json/JsonTokenValueTest.groovy | 7 +-
.../groovy/groovy/json/RealJsonPayloadsTest.groovy | 8 +-
.../groovy/json/StreamingJsonBuilderTest.groovy | 39 ++-
.../json/DefaultFastStringServiceTest.groovy | 7 +-
.../groovy/json/internal/ArrayUtilsTest.groovy | 6 +-
.../groovy/json/internal/CharScannerTest.groovy | 48 ++-
.../org/apache/groovy/json/internal/ChrTest.groovy | 351 ++++++++++++++++++++-
.../apache/groovy/json/internal/DatesTest.groovy | 47 ++-
.../json/internal/FastStringUtilsTest.groovy | 11 +-
.../apache/groovy/json/internal/LazyMapTest.groovy | 53 +++-
.../json/internal/ReaderCharacterSourceTest.groovy | 15 +-
.../org/apache/groovy/json/internal/ChrTest.java | 347 --------------------
.../src/spec/test/JSR223SpecTest.java | 4 +-
.../org/codehaus/groovy/jsr223/JSR223Test.groovy | 37 ++-
.../codehaus/groovy/jsr223/JavascriptTest.groovy | 7 +-
.../org/codehaus/groovy/jsr223/SugarTest.groovy | 7 +-
.../codehaus/groovy/jsr223/JSR223SecurityTest.java | 26 +-
.../org/apache/groovy/macrolib/MacroLibTest.groovy | 2 +-
.../org/codehaus/groovy/macro/MacroTest.groovy | 18 +-
.../groovy/macro/MacroTransformationTest.groovy | 11 +-
.../groovy/macro/matcher/ASTMatcherTest.groovy | 54 +++-
.../groovy/servlet/AbstractHttpServletTest.groovy | 21 +-
.../groovy/servlet/ServletBindingTest.groovy | 17 +-
.../groovy/servlet/TemplateServletTest.groovy | 16 +-
.../groovy/sql/ExtractIndexAndSqlTest.groovy | 25 +-
.../groovy/groovy/sql/GroovyRowResultTest.groovy | 2 +-
.../src/test/groovy/groovy/sql/SqlTest.groovy | 18 +-
.../groovy/swing/SwingBuilderBindingsTest.groovy | 3 +
.../groovy/groovy/swing/SwingBuilderTest.groovy | 72 ++++-
.../groovy/swing/beans/BindableSwingTest.groovy | 2 +-
.../groovy/swing/beans/VetoableSwingTest.groovy | 2 +-
.../groovy/swing/model/TableModelTest.groovy | 6 +-
.../groovy/SimpleGStringTemplateEngineTest.groovy | 8 +-
.../groovy/groovy/SimpleTemplateEngineTest.groovy | 6 +-
.../groovy/bugs/groovy4585/Groovy4585Bug.groovy | 4 +-
.../groovy/text/GroovyXmlTemplateEngineTest.groovy | 2 +-
.../groovy/text/MarkupTemplateEngineTest.groovy | 22 +-
.../groovy/groovy/text/SimpleTemplateTest.groovy | 16 +-
.../groovy/text/StreamingTemplateEngineTest.groovy | 4 +-
.../groovy/text/markup/TemplateResourceTest.groovy | 22 +-
.../src/test/groovy/JUnit5Test.groovy | 6 +-
.../main/groovy/groovy/test/StringTestUtil.groovy | 4 +-
.../test/JavadocAssertionTestBuilderTest.groovy | 17 +-
.../src/spec/test/FormatStringCheckerTest.groovy | 3 +-
.../src/spec/test/RegexCheckerTest.groovy | 5 +-
.../typecheckers/FormatStringCheckerTest.groovy | 100 +++---
.../groovy/typecheckers/RegexCheckerTest.groovy | 13 +-
.../groovy/groovy/xml/BuilderTestSupport.groovy | 5 +-
.../groovy/groovy/xml/NavigationXmlTest.groovy | 8 +-
.../groovy/xml/SafeNumberXmlParserTest.groovy | 6 +-
.../groovy/xml/SafeNumberXmlSlurperTest.groovy | 6 +-
.../test/groovy/groovy/xml/StaxBuilderTest.groovy | 5 +-
.../groovy/xml/StreamingSAXBuilderTest.groovy | 7 +-
.../groovy/groovy/xml/XmlNodePrinterTest.groovy | 28 +-
.../groovy/groovy/xml/XmlParserFactoryTest.groovy | 2 +-
.../test/groovy/groovy/xml/XmlParserTest.groovy | 26 +-
.../groovy/groovy/xml/XmlSlurperFactoryTest.groovy | 2 +-
.../src/test/groovy/groovy/xml/XmlUtilTest.groovy | 8 +-
.../groovy/xml/benchmark/BuilderPerfTest.groovy | 5 +-
.../groovy/groovy/xml/bugs/Groovy249_Bug.groovy | 6 +-
.../groovy/groovy/xml/bugs/Groovy593_Bug.groovy | 7 +-
.../groovy/groovy/xml/bugs/Groovy_2473Bug.groovy | 9 +-
.../groovy/groovy/xml/bugs/StaticMarkupBug.groovy | 5 +-
.../groovy/groovy/xml/bugs/TedsClosureBug.groovy | 9 +-
.../groovy/groovy/xml/dom/DOMCategoryTest.groovy | 19 +-
.../src/test/groovy/groovy/xml/dom/DOMTest.groovy | 10 +-
.../apache/groovy/xml/tools/DomToGroovyTest.groovy | 14 +-
1225 files changed, 9085 insertions(+), 3972 deletions(-)
diff --git a/src/spec/test/BaseScriptSpecTest.groovy b/src/spec/test/BaseScriptSpecTest.groovy
index 8ab3bea5c1..e94b8db786 100644
--- a/src/spec/test/BaseScriptSpecTest.groovy
+++ b/src/spec/test/BaseScriptSpecTest.groovy
@@ -16,11 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-import groovy.test.GroovyTestCase
+
import groovy.transform.CompileStatic
+import static groovy.test.GroovyAssert.assertScript
+
@CompileStatic
-class BaseScriptSpecTest extends GroovyTestCase {
+class BaseScriptSpecTest {
void testSimpleScript() {
def script = '''
// tag::simple_script[]
diff --git a/src/spec/test/ClassDesignASTTransformsTest.groovy b/src/spec/test/ClassDesignASTTransformsTest.groovy
index 49e2bf8b74..7ea9432b71 100644
--- a/src/spec/test/ClassDesignASTTransformsTest.groovy
+++ b/src/spec/test/ClassDesignASTTransformsTest.groovy
@@ -16,10 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/
-import groovy.test.GroovyTestCase
-class ClassDesignASTTransformsTest extends GroovyTestCase {
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class ClassDesignASTTransformsTest {
+
+ @Test
void testDelegateTransformation() {
assertScript '''
// tag::delegating_class[]
@@ -269,6 +274,7 @@ d.task$() //passes
'''
}
+ @Test
void testImmutable() {
assertScript '''
// tag::immutable_simple[]
@@ -369,6 +375,7 @@ try {
'''
}
+ @Test
void testMemoized() {
assertScript '''
import groovy.transform.Memoized
@@ -407,6 +414,7 @@ assert x!=z
'''
}
+ @Test
void testSingleton() {
assertScript '''
// tag::singleton_simple[]
@@ -451,6 +459,7 @@ assert GreetingService.instance.greeting('Bob') == 'Hello, Bob!'
'''
}
+ @Test
void testTailRecursive() {
assertScript '''
// tag::tailrecursive[]
diff --git a/src/spec/test/ClassTest.groovy b/src/spec/test/ClassTest.groovy
index 1bef94a5ad..2a18cacbd5 100644
--- a/src/spec/test/ClassTest.groovy
+++ b/src/spec/test/ClassTest.groovy
@@ -17,9 +17,8 @@
* under the License.
*/
-import groovy.test.GroovyTestCase
-final class ClassTest extends GroovyTestCase {
+final class ClassTest {
void testClassDefinition() {
assertScript '''
@@ -230,7 +229,7 @@ final class ClassTest extends GroovyTestCase {
}
// end::protected_forbidden[]
'''
- assert err.contains("The method 'greet' must be public as it is declared abstract in interface 'Greeter'")
+ assert err.message.contains("The method 'greet' must be public as it is declared abstract in interface 'Greeter'")
}
void testFields() {
@@ -730,7 +729,7 @@ import java.lang.annotation.Retention
class Evil {}
Evil
'''
- assert err =~ /Attribute 'value' should have type 'java.lang.String'; but found type 'int' in @Foo/
+ assert err.message =~ /Attribute 'value' should have type 'java.lang.String'; but found type 'int' in @Foo/
}
void testCustomProcessor() {
@@ -760,6 +759,9 @@ import java.lang.annotation.Retention
import org.codehaus.groovy.ast.expr.PropertyExpression
import org.codehaus.groovy.control.SourceUnit
import org.codehaus.groovy.transform.AnnotationCollectorTransform
+import org.junit.jupiter.api.Test
+import org.junit.jupiter.api.Timeout
+import static groovy.test.GroovyAssert.*
// tag::compiledynamic_def_fixed[]
@AnnotationCollector(processor = "org.codehaus.groovy.transform.CompileDynamicProcessor")
diff --git a/src/spec/test/CloningASTTransformsTest.groovy b/src/spec/test/CloningASTTransformsTest.groovy
index 25f33e8c19..02193651a9 100644
--- a/src/spec/test/CloningASTTransformsTest.groovy
+++ b/src/spec/test/CloningASTTransformsTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +17,13 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class CloningASTTransformsTest extends GroovyTestCase {
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class CloningASTTransformsTest {
+ @Test
void testAutoCloneAnnotation() {
assertScript '''
// tag::example_autoclone[]
@@ -59,6 +64,7 @@ assert !(book.authors.is(clone.authors))
'''
}
+ @Test
void testAutoCloneAnnotationWithExclude() {
assertScript '''
// tag::example_autoclone_excludes[]
@@ -82,6 +88,7 @@ assert clone.publicationDate==book.publicationDate
'''
}
+ @Test
void testAutoCloneAnnotationWithIncludeFields() {
assertScript '''
// tag::example_autoclone_includeFields[]
@@ -105,6 +112,7 @@ assert clone.publicationDate==book.publicationDate
'''
}
+ @Test
void testAutoExternalize() {
assertScript '''
// tag::example_autoext[]
@@ -168,6 +176,7 @@ assert book.price == 1.5
'''
}
+ @Test
void testAutoExternalizeWithExcludes() {
assertScript '''
// tag::example_autoext_excludes[]
@@ -209,6 +218,7 @@ assert book.title == 'Auto externalization for dummies'
assert book.price == 0 // because price is excluded
'''
}
+ @Test
void testAutoExternalizeWithIncludeFields() {
assertScript '''
// tag::example_autoext_includeFields[]
diff --git a/src/spec/test/ClosuresSpecTest.groovy b/src/spec/test/ClosuresSpecTest.groovy
index 77307b30f2..8a1876e04c 100644
--- a/src/spec/test/ClosuresSpecTest.groovy
+++ b/src/spec/test/ClosuresSpecTest.groovy
@@ -1,4 +1,6 @@
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,9 +20,10 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class ClosuresSpecTest extends GroovyTestCase {
+class ClosuresSpecTest {
static void sink(Closure cl) {}
+ @Test
void testClosureSyntax() {
sink
// tag::closure_syntax_1[]
@@ -61,6 +64,7 @@ class ClosuresSpecTest extends GroovyTestCase {
// end::closure_syntax_6[]
}
+ @Test
void testAssignClosureToAVariable() {
// tag::closure_is_an_instance_of_Closure[]
def listener = { e -> println "Clicked on $e.source" } // <1>
@@ -72,6 +76,7 @@ class ClosuresSpecTest extends GroovyTestCase {
// end::closure_is_an_instance_of_Closure[]
}
+ @Test
void testCallClosure() {
// tag::closure_call_1[]
def code = { 123 }
@@ -94,6 +99,7 @@ class ClosuresSpecTest extends GroovyTestCase {
// end::closure_call_2[]
}
+ @Test
void testClosureParameters() {
// tag::closure_param_declaration[]
def closureWithOneArg = { str -> str.toUpperCase() }
@@ -116,6 +122,7 @@ class ClosuresSpecTest extends GroovyTestCase {
// end::closure_param_declaration[]
}
+ @Test
void testImplicitIt() {
assertScript '''
// tag::implicit_it[]
@@ -146,6 +153,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testClosureVargs() {
// tag::closure_vargs[]
def concat1 = { String... args -> args.join('') } // <1>
@@ -161,6 +169,7 @@ class ClosuresSpecTest extends GroovyTestCase {
}
+ @Test
void testThisObject() {
assertScript '''
// tag::closure_this[]
@@ -217,6 +226,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testOwner() {
assertScript '''
// tag::closure_owner[]
@@ -253,6 +263,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testClosureDelegate() {
assertScript '''
// tag::delegate_is_owner[]
@@ -306,6 +317,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testDelegationStrategy() {
assertScript '''
// tag::delegation_strategy_intro[]
@@ -320,6 +332,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testOwnerFirst() {
assertScript '''
// tag::closure_owner_first[]
@@ -349,6 +362,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testDelegateOnly() {
assertScript '''
// tag::delegate_only[]
@@ -383,6 +397,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testDelegateOnlyPropertyMissing() {
assertScript '''
// tag::delegate_only_prop_missing[]
@@ -408,6 +423,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testGStringEager() {
// tag::gstring_eager_intro[]
def x = 1
@@ -424,6 +440,7 @@ class ClosuresSpecTest extends GroovyTestCase {
assert gs == 'x = 1'
}
+ @Test
void testGStringLazy() {
// tag::gstring_lazy[]
def x = 1
@@ -435,6 +452,7 @@ class ClosuresSpecTest extends GroovyTestCase {
// end::gstring_lazy[]
}
+ @Test
void testGStringWithMutation() {
assertScript '''
// tag::gstring_mutation[]
@@ -455,6 +473,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testGStringWithoutMutation() {
assertScript '''
// tag::gstring_no_mutation[]
@@ -474,6 +493,7 @@ class ClosuresSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testLeftCurry() {
// tag::left_curry[]
def nCopies = { int n, String str -> str*n } // <1>
@@ -483,6 +503,7 @@ class ClosuresSpecTest extends GroovyTestCase {
// end::left_curry[]
}
+ @Test
void testRightCurry() {
// tag::right_curry[]
def nCopies = { int n, String str -> str*n } // <1>
@@ -492,6 +513,7 @@ class ClosuresSpecTest extends GroovyTestCase {
// end::right_curry[]
}
+ @Test
void testNCurry() {
// tag::ncurry[]
def volume = { double l, double w, double h -> l*w*h } // <1>
@@ -502,6 +524,7 @@ class ClosuresSpecTest extends GroovyTestCase {
// end::ncurry[]
}
+ @Test
void testMemoize() {
// tag::naive_fib[]
def fib
@@ -514,6 +537,7 @@ class ClosuresSpecTest extends GroovyTestCase {
// end::memoized_fib[]
}
+ @Test
void testComposition() {
// tag::closure_composition[]
def plus2 = { it + 2 }
@@ -533,6 +557,7 @@ class ClosuresSpecTest extends GroovyTestCase {
}
+ @Test
void testTrampoline() {
// tag::trampoline[]
def factorial
diff --git a/src/spec/test/CodeGenerationASTTransformsTest.groovy b/src/spec/test/CodeGenerationASTTransformsTest.groovy
index 096ff94102..41b5b30de7 100644
--- a/src/spec/test/CodeGenerationASTTransformsTest.groovy
+++ b/src/spec/test/CodeGenerationASTTransformsTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,9 +17,15 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class CodeGenerationASTTransformsTest extends GroovyTestCase {
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class CodeGenerationASTTransformsTest {
// specification tests for the @ToString AST transformation
+ @Test
void testToString() {
assertScript '''
// tag::tostring_import[]
@@ -253,6 +258,7 @@ assert p.toString() == 'acme.Person(Jack)'
}
+ @Test
void testEqualsAndHashCode() {
assertScript '''
// tag::equalshashcode[]
@@ -427,6 +433,7 @@ assert System.currentTimeMillis() - start < SlowHashCode.SLEEP_PERIOD
'''
}
+ @Test
void testTupleConstructor() {
assertScript '''
// tag::tupleconstructor_simple[]
@@ -817,6 +824,7 @@ shouldFail {
'''
}
+ @Test
void testMapConstructor() {
assertScript '''
// tag::mapconstructor_simple[]
@@ -847,6 +855,7 @@ public Person(Map args) {
*/
}
+ @Test
void testCanonical() {
assertScript '''
// tag::canonical_simple[]
@@ -912,6 +921,7 @@ assert p1.hashCode() == p2.hashCode() // Effect of @EqualsAndHashCode(excludes=
'''
}
+ @Test
void testInheritConstructors() {
assertScript '''
// tag::inheritconstructors_simple[]
@@ -969,6 +979,7 @@ assert Child.constructors[0].parameterAnnotations[0][0].annotationType().name ==
'''
}
+ @Test
void testIndexedProperty() {
assertScript '''
import groovy.transform.IndexedProperty
@@ -989,6 +1000,7 @@ assert bean.someList == [123]
'''
}
+ @Test
void testLazy() {
assertScript '''
// tag::lazy_simple[]
@@ -1041,6 +1053,7 @@ assert bean.@$myField == ['a','b','c']
'''
}
+ @Test
void testNewify() {
assertScript '''
class Tree {
@@ -1083,6 +1096,7 @@ def builder = new TreeBuilder()
'''
}
+ @Test
void testCategoryTransformation() {
assertScript '''
// tag::oldstyle_category[]
@@ -1110,6 +1124,7 @@ use (TripleCategory) {
'''
}
+ @Test
void testSortable() {
assertScript '''
// tag::sortable_simple[]
@@ -1294,6 +1309,7 @@ assert finalists.sort()*.name == ['CoCo', 'Venus', 'Serena', 'Mirjana']
'''
}
+ @Test
void testBuilderSimple() {
assertScript '''
// tag::builder_simple[]
@@ -1347,6 +1363,7 @@ assert "$p.first $p.last" == 'Johnny Depp'
'''
}
+ @Test
void testBuilderExternal() {
assertScript '''
// tag::builder_external_buildee[]
@@ -1415,6 +1432,7 @@ assert "$p.first $p.last" == 'Johnny Depp'
'''
}
+ @Test
void testBuilderDefault() {
assertScript '''
// tag::builder_default[]
@@ -1488,6 +1506,7 @@ assert Person.builder().first("Johnny").last('Depp').born(1963).build().toString
'''
}
+ @Test
void testBuilderInitializer() {
assertScript '''
// tag::builder_initializer[]
@@ -1539,6 +1558,7 @@ createFirstLastBorn()
'''
}
+ @Test
void testAutoImplement() {
assertScript '''
// tag::autoimplement_default[]
@@ -1578,13 +1598,13 @@ class MyNames implements Closeable extends AbstractList<String> {
assertScript '''
import groovy.transform.AutoImplement
+import static groovy.test.GroovyAssert.shouldFail
// tag::autoimplement_exception[]
@AutoImplement(exception=IOException)
class MyWriter extends Writer { }
// end::autoimplement_exception[]
// tag::autoimplement_exception_usage[]
-import static groovy.test.GroovyAssert.shouldFail
shouldFail(IOException) {
new MyWriter().flush()
@@ -1614,12 +1634,12 @@ class MyWriter extends Writer {
assertScript '''
import groovy.transform.AutoImplement
+import static groovy.test.GroovyAssert.shouldFail
// tag::autoimplement_exceptionmsg[]
@AutoImplement(exception=UnsupportedOperationException, message='Not supported by MyIterator')
class MyIterator implements Iterator<String> { }
// end::autoimplement_exceptionmsg[]
-import static groovy.test.GroovyAssert.shouldFail
// tag::autoimplement_exceptionmsg_usage[]
def ex = shouldFail(UnsupportedOperationException) {
new MyIterator().hasNext()
@@ -1646,6 +1666,7 @@ class MyIterator implements Iterator<String> {
assertScript '''
import groovy.transform.AutoImplement
+import static groovy.test.GroovyAssert.shouldFail
// tag::autoimplement_code[]
@AutoImplement(code = { throw new UnsupportedOperationException('Should never be called but was called on ' + new Date()) })
class EmptyIterator implements Iterator<String> {
@@ -1653,7 +1674,6 @@ class EmptyIterator implements Iterator<String> {
}
// end::autoimplement_code[]
-import static groovy.test.GroovyAssert.shouldFail
// tag::autoimplement_code_usage[]
def ex = shouldFail(UnsupportedOperationException) {
new EmptyIterator().next()
@@ -1679,6 +1699,7 @@ class EmptyIterator implements java.util.Iterator<String> {
'''
}
+ @Test
void testNullCheck() {
assertScript '''
import groovy.transform.NullCheck
diff --git a/src/spec/test/CommandChainsTest.groovy b/src/spec/test/CommandChainsTest.groovy
index 4ba4625adb..dd35f1a485 100644
--- a/src/spec/test/CommandChainsTest.groovy
+++ b/src/spec/test/CommandChainsTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +17,13 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class CommandChainsTest extends GroovyTestCase {
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class CommandChainsTest {
+ @Test
void testCommandChainEquivalence() {
assertScript '''String left = 'left'
String right = 'right'
@@ -255,6 +260,7 @@ assert m1.thing == 'cookies'
'''
}
+ @Test
void testCommandChainImplementation() {
assertScript '''
// tag::commandchain_impl1[]
diff --git a/src/spec/test/CompilerDirectivesASTTransformsTest.groovy b/src/spec/test/CompilerDirectivesASTTransformsTest.groovy
index 781aa1b2de..92d4df63a9 100644
--- a/src/spec/test/CompilerDirectivesASTTransformsTest.groovy
+++ b/src/spec/test/CompilerDirectivesASTTransformsTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +17,14 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class CompilerDirectivesASTTransformsTest extends GroovyTestCase {
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
+
+class CompilerDirectivesASTTransformsTest {
+ @Test
void testFieldXForm() {
shouldFail(MissingPropertyException) {
assertScript '''
@@ -98,6 +104,7 @@ new MyScript().run()
'''
}
+ @Test
void testAutoFinalClass() {
assertScript '''
// tag::autofinal_class[]
@@ -127,6 +134,7 @@ assert john.greeting('Hello') == 'Hello, John'
'''
}
+ @Test
void testAutoFinalMethod() {
assertScript '''
import groovy.transform.AutoFinal
@@ -144,6 +152,7 @@ assert calc.mult(3, 6) == 18
'''
}
+ @Test
void testFinalAnnotation() {
assertScript '''
import groovy.transform.*
@@ -161,6 +170,7 @@ assert Modifier.isFinal(GreetingService.modifiers)
'''
}
+ @Test
void testPackageScope() {
assertScript '''import java.lang.reflect.Modifier
// tag::packagescope_property[]
diff --git a/src/spec/test/CustomizersTest.groovy b/src/spec/test/CustomizersTest.groovy
index 166dfe9e7f..ed30789bdf 100644
--- a/src/spec/test/CustomizersTest.groovy
+++ b/src/spec/test/CustomizersTest.groovy
@@ -17,38 +17,52 @@
* under the License.
*/
-import groovy.test.GroovyTestCase
-import groovy.transform.ConditionalInterrupt
import groovy.util.logging.Log
import org.codehaus.groovy.ast.ClassNode
-import org.codehaus.groovy.ast.builder.AstBuilder
import org.codehaus.groovy.ast.expr.AttributeExpression
-import org.codehaus.groovy.control.CompilePhase
+import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.SourceUnit
import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer
import org.codehaus.groovy.control.customizers.ImportCustomizer
import org.codehaus.groovy.control.customizers.SecureASTCustomizer
import org.codehaus.groovy.control.customizers.SourceAwareCustomizer
-import org.codehaus.groovy.control.CompilerConfiguration
-import static org.codehaus.groovy.control.customizers.builder.CompilerCustomizationBuilder.withConfig
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
-import static org.codehaus.groovy.syntax.Types.*
-
-class CustomizersTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
+import static org.codehaus.groovy.control.customizers.builder.CompilerCustomizationBuilder.withConfig
+import static org.codehaus.groovy.syntax.Types.COMPARE_EQUAL
+import static org.codehaus.groovy.syntax.Types.COMPARE_GREATER_THAN
+import static org.codehaus.groovy.syntax.Types.COMPARE_GREATER_THAN_EQUAL
+import static org.codehaus.groovy.syntax.Types.COMPARE_LESS_THAN
+import static org.codehaus.groovy.syntax.Types.COMPARE_LESS_THAN_EQUAL
+import static org.codehaus.groovy.syntax.Types.COMPARE_NOT_EQUAL
+import static org.codehaus.groovy.syntax.Types.DIVIDE
+import static org.codehaus.groovy.syntax.Types.MINUS
+import static org.codehaus.groovy.syntax.Types.MINUS_MINUS
+import static org.codehaus.groovy.syntax.Types.MULTIPLY
+import static org.codehaus.groovy.syntax.Types.PLUS
+import static org.codehaus.groovy.syntax.Types.PLUS_PLUS
+import static org.codehaus.groovy.syntax.Types.POWER
+import static org.codehaus.groovy.syntax.Types.REMAINDER
+
+class CustomizersTest {
private CompilerConfiguration config;
private GroovyShell shell;
+ @BeforeEach
void setUp() {
config = new CompilerConfiguration()
shell = new GroovyShell(config)
}
- @Override
protected void assertScript(final String script) throws Exception {
- shell.evaluate(script, getTestClassName())
+ shell.evaluate(script, 'TestScript.groovy')
}
+ @Test
void testImportCustomizer() {
// tag::import_cz[]
@@ -79,6 +93,7 @@ class CustomizersTest extends GroovyTestCase {
'''
}
+ @Test
void testLogCustomizer() {
// tag::ast_cz_simple[]
def acz = new ASTTransformationCustomizer(Log)
@@ -90,6 +105,7 @@ class CustomizersTest extends GroovyTestCase {
'''
}
+ @Test
void testLogCustomizerWithCustomName() {
// tag::ast_cz_customname[]
def acz = new ASTTransformationCustomizer(Log, value: 'LOGGER')
@@ -102,6 +118,7 @@ class CustomizersTest extends GroovyTestCase {
'''
}
+ @Test
void testSecureASTCustomizer() {
// tag::secure_cz[]
def scz = new SecureASTCustomizer()
@@ -164,6 +181,7 @@ class CustomizersTest extends GroovyTestCase {
}
}
+ @Test
void testSecureASTCustomizerWithCustomChecker() {
// tag::secure_cz_custom[]
def scz = new SecureASTCustomizer()
@@ -186,6 +204,7 @@ a.@val // <1>
}
}
+ @Test
void testSourceAwareCustomizer() {
// tag::source_cz[]
def delegate = new ImportCustomizer()
@@ -214,6 +233,7 @@ a.@val // <1>
config.addCompilationCustomizers(sac)
}
+ @Test
void testCustomizerBuilder() {
// tag::customizer_withconfig[]
def conf = new CompilerConfiguration()
diff --git a/src/spec/test/DeclarativeConcurrencyASTTransformsTest.groovy b/src/spec/test/DeclarativeConcurrencyASTTransformsTest.groovy
index 4ba2a716be..356fbffd94 100644
--- a/src/spec/test/DeclarativeConcurrencyASTTransformsTest.groovy
+++ b/src/spec/test/DeclarativeConcurrencyASTTransformsTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +17,13 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class DeclarativeConcurrencyASTTransformsTest extends GroovyTestCase {
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class DeclarativeConcurrencyASTTransformsTest {
+ @Test
void testSynchronizedASTTransform() {
assertScript '''
// tag::example_synchronized[]
@@ -96,6 +101,7 @@ assert c.get() == 1000
'''
}
+ @Test
void testWithReadLockASTTransform() {
assertScript '''
// tag::example_rwlock[]
diff --git a/src/spec/test/DelegatesToSpecTest.groovy b/src/spec/test/DelegatesToSpecTest.groovy
index 6eb65a1a5e..97d78b8c20 100644
--- a/src/spec/test/DelegatesToSpecTest.groovy
+++ b/src/spec/test/DelegatesToSpecTest.groovy
@@ -17,10 +17,15 @@
* under the License.
*/
-import groovy.test.GroovyTestCase
+
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
-class DelegatesToSpecTest extends GroovyTestCase {
+class DelegatesToSpecTest {
+ @Test
void testEmailWithoutDelegatesTo() {
assertScript '''
// tag::emailspec_no_delegatesto[]
@@ -65,6 +70,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testEmailWithoutDelegatesToTypeChecked() {
shouldFail(MultipleCompilationErrorsException) {
assertScript '''
@@ -110,6 +116,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
}
}
+ @Test
void testEmailWithDelegatesTo() {
assertScript '''
class EmailSpec {
@@ -148,6 +155,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testEmailWithDelegatesToAndStrategy() {
assertScript '''
class EmailSpec {
@@ -186,6 +194,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testEmailWithDelegatesToAndStrategyTypeChecked() {
assertScript '''import groovy.transform.TypeChecked
@@ -228,6 +237,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testDelegatesToSimple() {
assertScript '''
class BodySpec {
@@ -252,6 +262,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testDelegatesToWithStrategy() {
shouldFail(MultipleCompilationErrorsException) {
assertScript '''
@@ -288,6 +299,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
}
}
+ @Test
void testDelegatesToTarget() {
assertScript '''
class Email {
@@ -338,6 +350,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
}
'''
}
+ @Test
void testDelegatesToTargetFlowTyping() {
assertScript '''
def exec(@DelegatesTo.Target Object target, @DelegatesTo Closure code) {
@@ -363,6 +376,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testDelegatesToMultipleAnnotations() {
assertScript '''
@@ -400,6 +414,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testDelegatesToMultipleTargets() {
assertScript '''
// tag::foobarbaz_classes[]
@@ -441,6 +456,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testDelegatesToGenericType() {
assertScript '''
// tag::configure_list_method[]
@@ -469,6 +485,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
}
+ @Test
void testDelegatesToGenericTypeAndCompileStatic() {
assertScript '''
@groovy.transform.ToString
@@ -499,6 +516,7 @@ class DelegatesToSpecTest extends GroovyTestCase {
}
+ @Test
void testDelegatesToType() {
def msg = shouldFail '''
@@ -520,7 +538,7 @@ void test() {
// end::delegatestotype_mapper_test[]
}
'''
- assert msg.contains('Static type checking] - Cannot find matching method')
+ assert msg.message.contains('Static type checking] - Cannot find matching method')
assertScript '''
diff --git a/src/spec/test/DesignPatternsTest.groovy b/src/spec/test/DesignPatternsTest.groovy
index f09bce29f7..14d80c9559 100644
--- a/src/spec/test/DesignPatternsTest.groovy
+++ b/src/spec/test/DesignPatternsTest.groovy
@@ -18,6 +18,7 @@
*/
import gls.CompilableTestSupport
+
class DesignPatternsTest extends CompilableTestSupport {
void testAbstractFactory() {
@@ -2189,12 +2190,11 @@ class DesignPatternsTest extends CompilableTestSupport {
}
}
// end::state_variation32[]
- import groovy.test.GroovyTestCase
// tag::state_variation33[]
- class StatePatternDslTest extends GroovyTestCase {
+ class StatePatternDslTest {
private fsm
- protected void setUp() {
+ void setUp() {
fsm = FiniteStateMachine.newInstance('offline')
def recorder = fsm.record()
recorder.on('connect').from('offline').to('online')
diff --git a/src/spec/test/DifferencesFromJavaTest.groovy b/src/spec/test/DifferencesFromJavaTest.groovy
index 5e12d2bcf6..5471c73e57 100644
--- a/src/spec/test/DifferencesFromJavaTest.groovy
+++ b/src/spec/test/DifferencesFromJavaTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,9 +17,16 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class DifferencesFromJavaTest extends GroovyTestCase {
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
+
+class DifferencesFromJavaTest {
+ @Test
void testMultiMethods() {
- assertScript '''import static org.junit.Assert.*
+ assertScript '''import static org.junit.jupiter.api.Assertions.*
// tag::multimethods[]
int method(String arg) {
return 1;
@@ -44,6 +50,7 @@ assertEquals(1, result);
'''
}
+ @Test
void testArrayCreation() {
shouldFail {
assertScript '''
@@ -65,6 +72,7 @@ assertEquals(1, result);
'''
}
+ @Test
void testPackagePrivate() {
assertScript '''
import groovy.transform.ASTTest
@@ -99,6 +107,7 @@ assertEquals(1, result);
'''
}
+ @Test
void testAnonymousAndNestedClasses() {
assertScript '''
// tag::innerclass_1[]
@@ -157,6 +166,7 @@ assert (x.'this$0').is(y)
'''
}
+ @Test
void testStringsAndCharsGotchas() {
assertScript '''
import org.codehaus.groovy.runtime.typehandling.GroovyCastException;
diff --git a/src/spec/test/ExtensionModuleSpecTest.groovy b/src/spec/test/ExtensionModuleSpecTest.groovy
index f1b1ec066b..b095a3ef42 100644
--- a/src/spec/test/ExtensionModuleSpecTest.groovy
+++ b/src/spec/test/ExtensionModuleSpecTest.groovy
@@ -1,4 +1,6 @@
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +20,8 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class ExtensionModuleSpecTest extends GroovyTestCase {
+class ExtensionModuleSpecTest {
+ @Test
void testShouldAddMaxRetriesToInteger() {
assertScript '''// tag::instance_extension_assert[]
int i=0
@@ -39,6 +42,7 @@ try {
'''
}
+ @Test
void testShouldAddStaticMethodToString() {
assertScript '''// tag::static_extension_assert[]
assert String.greeting() == 'Hello, world!'
diff --git a/src/spec/test/IntegrationTest.groovy b/src/spec/test/IntegrationTest.groovy
index 59196102a5..c072bfdda3 100644
--- a/src/spec/test/IntegrationTest.groovy
+++ b/src/spec/test/IntegrationTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +17,7 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class IntegrationTest extends GroovyTestCase {
+class IntegrationTest {
void testEval() {
assertScript '''// tag::eval_me[]
import groovy.util.Eval
@@ -163,6 +162,8 @@ o.doIt() // <
assertScript '''// tag::gcl_distinct_classes[]
import groovy.lang.GroovyClassLoader
+import org.junit.jupiter.api.Test
+import static groovy.test.GroovyAssert.*
def gcl = new GroovyClassLoader()
def clazz1 = gcl.parseClass('class Foo { }') // <1>
diff --git a/src/spec/test/LogImprovementsASTTransformsTest.groovy b/src/spec/test/LogImprovementsASTTransformsTest.groovy
index 8e7ea594db..238de2bb0c 100644
--- a/src/spec/test/LogImprovementsASTTransformsTest.groovy
+++ b/src/spec/test/LogImprovementsASTTransformsTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,8 +17,14 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class LogImprovementsASTTransformsTest extends GroovyTestCase {
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class LogImprovementsASTTransformsTest {
+
+ @Test
void testLogASTTransformation() {
assertScript '''
// tag::log_spec[]
@@ -55,6 +60,7 @@ g.greet()
'''
}
+ @Test
void testCommonsASTTransformation() {
assertScript '''
// tag::commons_spec[]
@@ -89,6 +95,7 @@ g.greet()
'''
}
+ @Test
void testLog4jASTTransformation() {
assertScript '''
// tag::log4j_spec[]
@@ -122,6 +129,7 @@ g.greet()
'''
}
+ @Test
void testLog4j2ASTTransformation() {
assertScript '''
// tag::log4j2_spec[]
@@ -157,6 +165,7 @@ g.greet()
'''
}
+ @Test
void testSlf4jASTTransformation() {
assertScript '''
// tag::slf4j_spec[]
diff --git a/src/spec/test/PrimitiveTest.groovy b/src/spec/test/PrimitiveTest.groovy
index f7b66094e8..f433d3fcf3 100644
--- a/src/spec/test/PrimitiveTest.groovy
+++ b/src/spec/test/PrimitiveTest.groovy
@@ -1,4 +1,6 @@
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,8 +20,9 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class PrimitiveTest extends GroovyTestCase {
+class PrimitiveTest {
+ @Test
void testPrimitiveReferences() {
assertScript '''
// tag::primitive_references[]
@@ -33,6 +36,7 @@ class PrimitiveTest extends GroovyTestCase {
'''
}
+ @Test
void testPrimitiveWideningVsBoxing() {
assertScript '''
// tag::widening_vs_boxing[]
@@ -50,6 +54,7 @@ class PrimitiveTest extends GroovyTestCase {
'''
}
+ @Test
void testPrimitiveVsWrapperPosNegZero() {
assertScript '''
// tag::pos_neg_zero[]
diff --git a/src/spec/test/RecordSpecificationTest.groovy b/src/spec/test/RecordSpecificationTest.groovy
index 31fcebf4f8..1fd22895ca 100644
--- a/src/spec/test/RecordSpecificationTest.groovy
+++ b/src/spec/test/RecordSpecificationTest.groovy
@@ -17,13 +17,18 @@
* under the License.
*/
-import groovy.test.GroovyTestCase
/**
* Specification tests for records
*/
-class RecordSpecificationTest extends GroovyTestCase {
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class RecordSpecificationTest {
+
+ @Test
void testSimpleRecordKeyword() {
assertScript '''
// tag::record_message_defn[]
@@ -57,10 +62,11 @@ final class Message extends Record {
'''
}
+ @Test
void testRecordDefaultsAndNamedArguments() {
assertScript '''
-import static groovy.test.GroovyAssert.shouldFail
import groovy.transform.*
+import static groovy.test.GroovyAssert.shouldFail
// tag::record_point_defn[]
record ColoredPoint(int x, int y = 0, String color = 'white') {}
@@ -95,6 +101,7 @@ assert new ColoredPoint3(y: 5).toString() == 'ColoredPoint3[x=0, y=5, color=whit
'''
}
+ @Test
void testOverrideToString() {
assertScript '''
// tag::record_point3d[]
@@ -109,6 +116,7 @@ assert new Point3D(10, 20, 30).toString() == 'Point3D[coords=10,20,30]'
'''
}
+ @Test
void testCopyWith() {
assertScript '''
import groovy.transform.RecordOptions
@@ -136,6 +144,7 @@ shouldFail(MissingMethodException) {
'''
}
+ @Test
void testImmutable() {
assertScript '''
import groovy.transform.ImmutableProperties
@@ -151,6 +160,7 @@ assert shop.items() == ['bread', 'milk']
'''
}
+ @Test
void testToList() {
assertScript '''
// tag::record_to_list[]
@@ -165,6 +175,7 @@ assert c == 'green'
'''
}
+ @Test
void testToMap() {
assertScript '''
// tag::record_to_map[]
@@ -176,6 +187,7 @@ assert p.toMap() == [x: 100, y: 200, color: 'green']
'''
}
+ @Test
void testSize() {
assertScript '''
// tag::record_size[]
@@ -187,6 +199,7 @@ assert p.size() == 3
'''
}
+ @Test
void testGetAt() {
assertScript '''
// tag::record_get_at[]
@@ -198,6 +211,7 @@ assert p[1] == 200
'''
}
+ @Test
void testGenerics() {
assertScript '''
import groovy.transform.CompileStatic
@@ -220,6 +234,7 @@ method()
'''
}
+ @Test
void testComponents() {
assert '''
// tag::record_components[]
@@ -251,6 +266,7 @@ method()
'''
}
+ @Test
void testRecordCompactConstructor() {
assertScript '''
// tag::record_compact_constructor[]
@@ -267,6 +283,7 @@ assert w.message() == 'HELP'
'''
}
+ @Test
void testToStringAnnotation() {
assertScript '''
// tag::record_point3d_tostring_annotation[]
@@ -296,6 +313,7 @@ assert new Point(10, 20).toString() == 'twod.Point[x=10, y=20]'
'''
}
+ @Test
void testSimpleRecordAnnotation() {
assertScript '''
import groovy.transform.RecordType
diff --git a/src/spec/test/SaferScriptingASTTransformsTest.groovy b/src/spec/test/SaferScriptingASTTransformsTest.groovy
index 2b490d6113..baf5416931 100644
--- a/src/spec/test/SaferScriptingASTTransformsTest.groovy
+++ b/src/spec/test/SaferScriptingASTTransformsTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +17,13 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class SaferScriptingASTTransformsTest extends GroovyTestCase {
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class SaferScriptingASTTransformsTest {
+ @Test
void testThreadInterrupt() {
assertScript '''import groovy.transform.ThreadInterrupt
import org.codehaus.groovy.control.CompilerConfiguration
@@ -63,6 +68,7 @@ if (t.alive) {
assert binding.i > 0'''
}
+ @Test
void testThreadInterruptThrown() {
assertScript '''import groovy.transform.ThreadInterrupt
@@ -106,6 +112,7 @@ assert binding.i == -1'''
// end::threadinterrupt_thrown[]
}
+ @Test
void testTimedInterrupt() {
assertScript '''import groovy.transform.TimedInterrupt
import org.codehaus.groovy.control.CompilerConfiguration
@@ -148,6 +155,7 @@ assert !t.alive
assert binding.result == 0'''
}
+ @Test
void testTimedInterruptDuration() {
assertScript '''import groovy.transform.TimedInterrupt
@@ -169,6 +177,7 @@ assert !t.alive
'''
}
+ @Test
void testTimedInterruptThrown() {
assertScript '''import groovy.transform.InheritConstructors
import groovy.transform.TimedInterrupt
@@ -196,6 +205,7 @@ assert result == -1
'''
}
+ @Test
void testConditionalInterrupt() {
assertScript '''import groovy.transform.ConditionalInterrupt
// tag::conditionalinterrupt_quotaclass[]
@@ -232,6 +242,7 @@ assert Quotas.quotas['user'] < 0
'''
}
+ @Test
void testConditionalInterruptInjected() {
assertScript '''import groovy.transform.ConditionalInterrupt
import org.codehaus.groovy.ast.ClassHelper
@@ -283,6 +294,7 @@ assert Quotas.quotas['user'] < 0
// end::conditionalinterrupt_injected[]
'''
}
+ @Test
void testConditionalInterruptThrown() {
assertScript '''import groovy.transform.ConditionalInterrupt
import groovy.transform.InheritConstructors
diff --git a/src/spec/test/ScriptsAndClassesSpecTest.groovy b/src/spec/test/ScriptsAndClassesSpecTest.groovy
index a97f3f42b2..70295735ac 100644
--- a/src/spec/test/ScriptsAndClassesSpecTest.groovy
+++ b/src/spec/test/ScriptsAndClassesSpecTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +17,13 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class ScriptsAndClassesSpecTest extends GroovyTestCase {
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class ScriptsAndClassesSpecTest {
+ @Test
void testMainMethod() {
assertScript '''
// tag::groovy_class_with_main_method[]
@@ -76,6 +81,7 @@ class ScriptsAndClassesSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testJep445Definition() {
runScript '''
// tag::jep445_barescript[]
@@ -99,6 +105,7 @@ class ScriptsAndClassesSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testMethodDefinition() {
assertScript '''
// tag::method_in_script[]
@@ -136,6 +143,7 @@ class ScriptsAndClassesSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testScriptVariables() {
assertScript '''
// tag::script_with_variables[]
diff --git a/src/spec/test/SealedSpecificationTest.groovy b/src/spec/test/SealedSpecificationTest.groovy
index 8b9d63ba25..1c938f24d5 100644
--- a/src/spec/test/SealedSpecificationTest.groovy
+++ b/src/spec/test/SealedSpecificationTest.groovy
@@ -17,12 +17,11 @@
* under the License.
*/
-import groovy.test.GroovyTestCase
/**
* Specification tests for the traits feature
*/
-class SealedSpecificationTest extends GroovyTestCase {
+class SealedSpecificationTest {
void testSealedADT() {
assertScript '''
@@ -138,6 +137,8 @@ assert forecast.toString() == '[Rainy, Sunny, Cloudy]'
void testSealedWeather() {
assertScript '''
import groovy.transform.*
+import org.junit.jupiter.api.Test
+import static groovy.test.GroovyAssert.*
// tag::weather_sealed[]
sealed abstract class Weather { }
diff --git a/src/spec/test/SwingASTTransformsTest.groovy b/src/spec/test/SwingASTTransformsTest.groovy
index 090e327130..97f78313a3 100644
--- a/src/spec/test/SwingASTTransformsTest.groovy
+++ b/src/spec/test/SwingASTTransformsTest.groovy
@@ -1,4 +1,3 @@
-import groovy.test.GroovyTestCase
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,7 +17,13 @@ import groovy.test.GroovyTestCase
* specific language governing permissions and limitations
* under the License.
*/
-class SwingASTTransformsTest extends GroovyTestCase {
+
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+class SwingASTTransformsTest {
+ @Test
void testBindable() {
assertScript '''// tag::bindable_on_class[]
import groovy.beans.Bindable
@@ -80,6 +85,7 @@ p.age = 145
assert changed == ['name', 'age'] as Set'''
}
+ @Test
void testBindableSingleProperty() {
assertScript '''
// tag::bindable_single_property[]
@@ -101,6 +107,7 @@ assert changed == ['age'] as Set
'''
}
+ @Test
void testListenerList() {
assertScript '''import java.awt.event.ActionEvent
@@ -174,6 +181,7 @@ c.fireActionPerformed(new ActionEvent(this, 0, 'test'))
}
+ @Test
void testListenerListName() {
assertScript '''import java.awt.event.ActionEvent
@@ -196,6 +204,7 @@ c.fireActionPerformed(new ActionEvent(this, 0, 'test'))
}
+ @Test
void testListenerListSynchronized() {
assertScript '''import java.awt.event.ActionEvent
@@ -220,6 +229,7 @@ assert Modifier.isSynchronized(Component.getDeclaredMethod('addActionListener',
'''
}
+ @Test
void testVetoable() {
assertScript '''// tag::vetoable_on_class[]
import groovy.beans.Vetoable
@@ -291,6 +301,7 @@ p.age = 145
assert changed == ['name', 'age'] as Set'''
}
+ @Test
void testVetoableSingleProperty() {
assertScript '''
// tag::vetoable_single_property[]
diff --git a/src/spec/test/TestingASTTransformsTest.groovy b/src/spec/test/TestingASTTransformsTest.groovy
index 47b91d4398..410ca65d4d 100644
--- a/src/spec/test/TestingASTTransformsTest.groovy
+++ b/src/spec/test/TestingASTTransformsTest.groovy
@@ -16,13 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
-import groovy.test.GroovyTestCase
-class TestingASTTransformsTest extends GroovyTestCase {
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
+
+class TestingASTTransformsTest {
+
+ @Test
void testNotYetImplemented() {
assertScript '''// tag::notyetimplemented[]
-import groovy.test.GroovyTestCase
import groovy.test.NotYetImplemented
class Maths {
@@ -31,7 +36,7 @@ class Maths {
}
}
-class MathsTest extends GroovyTestCase {
+class MathsTest {
@NotYetImplemented
void testFib() {
def dataTable = [
@@ -53,6 +58,7 @@ class MathsTest extends GroovyTestCase {
new MathsTest().testFib()'''
}
+ @Test
void testASTTest() {
def err = shouldFail '''// tag::asttest_basic[]
import groovy.transform.ASTTest
@@ -67,9 +73,10 @@ class Person {
// end::asttest_basic[]
def p = new Person()
'''
- assert err =~ /ASTTest phase must be at least SEMANTIC_ANALYSIS/
+ assert err.message =~ /ASTTest phase must be at least SEMANTIC_ANALYSIS/
}
+ @Test
void testASTTestWithPackageScope() {
assertScript '''
// tag::asttest_packagescope[]
@@ -93,6 +100,7 @@ def p = new Person()
'''
}
+ @Test
void testASTTestWithForLoop() {
assertScript '''
// tag::asttest_forloop[]
@@ -124,6 +132,7 @@ def p = new Something()
'''
}
+ @Test
void testDumpASTTransforms() {
assertScript '''
// tag::dump_ast_xforms[]
@@ -156,6 +165,7 @@ Foo
'''
}
+ @Test
void testVariableMemorize() {
assertScript '''
// tag::memorize_in_binding[]
diff --git a/src/spec/test/TraitsSpecificationTest.groovy b/src/spec/test/TraitsSpecificationTest.groovy
index 528d099911..7e6efac2b5 100644
--- a/src/spec/test/TraitsSpecificationTest.groovy
+++ b/src/spec/test/TraitsSpecificationTest.groovy
@@ -17,14 +17,20 @@
* under the License.
*/
-import groovy.test.GroovyTestCase
+
import org.codehaus.groovy.ast.ClassHelper
+import org.junit.jupiter.api.Test
/**
* Specification tests for the traits feature
*/
-class TraitsSpecificationTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
+
+class TraitsSpecificationTest {
+
+ @Test
void testTraitDeclaration() {
assertScript '''// tag::flying_simple[]
trait FlyingAbility { // <1>
@@ -41,6 +47,7 @@ assert b.fly() == "I'm flying!" // <3>
'''
}
+ @Test
void testAbstractMethodInTrait() {
assertScript '''// tag::greetable[]
trait Greetable {
@@ -60,6 +67,7 @@ assert p.greeting() == 'Hello, Bob!' // <3>
'''
}
+ @Test
void testTraitImplementingInterface() {
assertScript '''// tag::trait_implementing_interface[]
interface Named { // <1>
@@ -80,6 +88,7 @@ assert p instanceof Greetable // <7>
'''
}
+ @Test
void testTraitWithProperty() {
assertScript '''// tag::trait_with_property[]
trait Named {
@@ -93,6 +102,7 @@ assert p.getName() == 'Bob' // <5>
'''
}
+ @Test
void testCompositionOfTraits() {
assertScript '''trait FlyingAbility {
String fly() { "I'm flying!" }
@@ -114,6 +124,7 @@ assert d.speak() == "I'm speaking!" // <4>
'''
}
+ @Test
void testOverridableMethod() {
assertScript '''trait FlyingAbility {
String fly() { "I'm flying!" }
@@ -137,6 +148,7 @@ assert d.speak() == "Quack!" // <5>
'''
}
+ @Test
void testPrivateMethodInTrait() {
assertScript '''// tag::private_method_in_trait[]
trait Greeter {
@@ -161,6 +173,7 @@ try {
'''
}
+ @Test
void testTraitWithPrivateField() {
assertScript '''// tag::trait_with_private_field[]
trait Counter {
@@ -175,6 +188,7 @@ assert f.count() == 2
'''
}
+ @Test
void testTraitWithPublicField() {
assertScript '''// tag::trait_with_public_field[]
trait Named {
@@ -187,11 +201,13 @@ p.Named__name = 'Bob' // <4>
'''
}
+ @Test
void testRemappedName() {
def foo = ClassHelper.make("my.package.Foo")
assert org.codehaus.groovy.transform.trait.Traits.remappedFieldName(foo, "bar") == 'my_package_Foo__bar'
}
+ @Test
void testDuckTyping() {
assertScript '''// tag::ducktyping[]
trait SpeakingDuck {
@@ -208,6 +224,7 @@ assert d.speak() == 'Quack!' // <3>
'''
}
+ @Test
void testTraitInheritance() {
assertScript '''// tag::trait_inherit[]
trait Named {
@@ -223,6 +240,7 @@ assert p.introduce() == 'Hello, I am Alice' // <5>
'''
}
+ @Test
void testMultipleTraitInheritance() {
assertScript '''// tag::trait_multiple_inherit[]
trait WithId { // <1>
@@ -238,6 +256,7 @@ def b = new Bean(id: 123, name: 'Foo')
'''
}
+ @Test
void testMethodMissingInTrait() {
assertScript '''// tag::dynamicobject[]
trait DynamicObject { // <1>
@@ -268,6 +287,7 @@ assert d.someMethod() == 'SOMEMETHOD' // <9>
'''
}
+ @Test
void testDefaultMultipleInheritanceResolution() {
assertScript '''// tag::multiple_inherit_default[]
trait A {
@@ -286,6 +306,7 @@ assert c.exec() == 'B'
'''
}
+ @Test
void testUserMultipleInheritanceResolution() {
assertScript '''trait A {
String exec() { 'A' }
@@ -303,6 +324,7 @@ assert c.exec() == 'A' // <2>
'''
}
+ @Test
void testRuntimeCoercion() {
assertScript '''
// tag::runtime_header[]
@@ -329,6 +351,7 @@ s.doSomething() // <3>
'''
}
+ @Test
void testWithTraits() {
assertScript '''// tag::withtraits_header[]
trait A { void methodFromA() {} }
@@ -352,6 +375,7 @@ d.methodFromB() // <5>
'''
}
+ @Test
void testSAMCoercion() {
assertScript '''
// tag::sam_trait[]
@@ -372,16 +396,16 @@ greet { 'Alice' } // <2>
'''
}
+ @Test
void testTraitOverrideBehavior() {
assertScript '''
// tag::forceoverride_header[]
-import groovy.test.GroovyTestCase
import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer
import org.codehaus.groovy.control.customizers.ImportCustomizer
-class SomeTest extends GroovyTestCase {
+class SomeTest {
def config
def shell
@@ -441,6 +465,7 @@ assert !t.config.compilationCustomizers.empty
'''
}
+ @Test
void testRuntimeOverride() {
assertScript '''// tag::runtime_forceoverride[]
class Person {
@@ -458,6 +483,7 @@ assert p2.name == 'Bob' // <5>
'''
}
+ @Test
void testDifferenceWithMixin() {
assertScript '''// tag::diff_mixin[]
class A { String methodFromA() { 'A' } } // <1>
@@ -472,6 +498,7 @@ assert !(o instanceof B) // <7>
'''
}
+ @Test
void testMeaningOfThis() {
assertScript '''// tag::meaningofthis_header[]
trait Introspector {
@@ -489,6 +516,7 @@ assert foo.whoAmI().is(foo)
'''
}
+ @Test
void testPublicStaticFieldInTrait() {
assertScript '''// tag::staticfield_header[]
trait TestHelper {
@@ -518,6 +546,7 @@ assert !Baz.TestHelper__CALLED // <5>
'''
}
+ @Test
void testPrePostfixIsDisallowed() {
def message = shouldFail '''
// tag::prefix_postfix[]
@@ -535,10 +564,11 @@ def c = new Counter()
c.inc()
// end::prefix_postfix[]
'''
- assert message.contains('Postfix expressions on trait fields/properties are not supported')
- assert message.contains('Prefix expressions on trait fields/properties are not supported')
+ assert message.message.contains('Postfix expressions on trait fields/properties are not supported')
+ assert message.message.contains('Prefix expressions on trait fields/properties are not supported')
}
+ @Test
void testStackableTraits() {
assertScript '''import TraitsSpecificationTest.PrintCategory as PC
@@ -661,6 +691,7 @@ PC.reset()
'''
}
+ @Test
void testDecorateFinalClass() {
assertScript '''
// tag::decoratefinalclass[]
@@ -678,6 +709,7 @@ assert sb.toString() == 'Grvy' // <7>
'''
}
+ @Test
void testInheritanceOfState() {
assertScript '''// tag::intcouple[]
trait IntCouple {
@@ -729,6 +761,7 @@ assert elem.f() == 7
'''
}
+ @Test
void testSelfType() {
assertScript '''
// tag::selftype_intro[]
@@ -824,9 +857,10 @@ class SecurityService {
}
'''
- assert message.contains("class 'MyDevice' implements trait 'Communicating' but does not extend self type class 'Device'")
+ assert message.message.contains("class 'MyDevice' implements trait 'Communicating' but does not extend self type class 'Device'")
}
+ @Test
void testSelfTypeWithSealed() {
assertScript '''
import groovy.transform.*
diff --git a/src/spec/test/builder/BuilderSpecTest.groovy b/src/spec/test/builder/BuilderSpecTest.groovy
index cfef70f3dd..f38180f01d 100644
--- a/src/spec/test/builder/BuilderSpecTest.groovy
+++ b/src/spec/test/builder/BuilderSpecTest.groovy
@@ -19,7 +19,8 @@
package builder
import groovy.transform.CompileStatic
-import org.junit.Test
+import org.junit.jupiter.api.Test
+
import static groovy.test.GroovyAssert.assertScript
@CompileStatic
diff --git a/src/spec/test/builder/FileTreeBuilderTest.groovy b/src/spec/test/builder/FileTreeBuilderTest.groovy
index 323a051524..34bcb8cf0e 100644
--- a/src/spec/test/builder/FileTreeBuilderTest.groovy
+++ b/src/spec/test/builder/FileTreeBuilderTest.groovy
@@ -18,14 +18,14 @@
*/
package builder
-import org.junit.After
-import org.junit.Test
+import org.junit.jupiter.api.AfterEach
+import org.junit.jupiter.api.Test
final class FileTreeBuilderTest {
File tmpDir
- @After
+ @AfterEach
void tearDown() {
tmpDir.deleteDir()
}
diff --git a/src/spec/test/builder/ObjectGraphBuilderTest.groovy b/src/spec/test/builder/ObjectGraphBuilderTest.groovy
index 27028e440c..2d010a3ea5 100644
--- a/src/spec/test/builder/ObjectGraphBuilderTest.groovy
+++ b/src/spec/test/builder/ObjectGraphBuilderTest.groovy
@@ -19,15 +19,19 @@
package builder
import asciidoctor.Utils
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
/**
* Tests for ObjectGraphBuilder. The tests directly in this file are specific
* to ObjectGraphBuilder. Functionality in common with other Builders
* is tested in the parent class.
*/
-final class ObjectGraphBuilderTest extends GroovyTestCase {
+final class ObjectGraphBuilderTest {
+ @Test
void testBuilder() {
assertScript '''// tag::domain_classes[]
package com.acme
@@ -78,6 +82,7 @@ assert employee.address instanceof Address
'''
}
+ @Test
void testBuildImmutableFailure() {
def err = shouldFail '''
package com.acme
@@ -99,13 +104,14 @@ builder.classNameResolver = "com.acme"
def person = builder.person(name:'Jon', age:17)
// end::immutable_fail_runtime[]
'''
- assert err == Utils.stripAsciidocMarkup('''
+ assert err.message == Utils.stripAsciidocMarkup('''
// tag::expected_error_immutable[]
Cannot set read-only property: name for class: com.acme.Person
// end::expected_error_immutable[]
''')
}
+ @Test
void testBuildImmutableFixed() {
assertScript '''
package com.acme
@@ -135,6 +141,7 @@ def person = builder.person(name:'Jon', age:17)
'''
}
+ @Test
void testId() {
assertScript '''
package com.acme
diff --git a/src/spec/test/gdk/ConfigSlurperTest.groovy b/src/spec/test/gdk/ConfigSlurperTest.groovy
index 1ac73363b6..242d7246c8 100644
--- a/src/spec/test/gdk/ConfigSlurperTest.groovy
+++ b/src/spec/test/gdk/ConfigSlurperTest.groovy
@@ -18,9 +18,11 @@
*/
package gdk
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class ConfigSlurperTest extends GroovyTestCase {
+
+class ConfigSlurperTest {
+ @Test
void testWithArbitraryTypes() {
// tag::arbitrary_types[]
def config = new ConfigSlurper().parse('''
@@ -37,6 +39,7 @@ class ConfigSlurperTest extends GroovyTestCase {
// end::arbitrary_types[]
}
+ @Test
void testConfigSlurperMustNotReturnNull() {
// tag::never_null[]
def config = new ConfigSlurper().parse('''
@@ -49,6 +52,7 @@ class ConfigSlurperTest extends GroovyTestCase {
// end::never_null[]
}
+ @Test
void testEscapeDot() {
// tag::escape_dot[]
def config = new ConfigSlurper().parse('''
@@ -59,6 +63,7 @@ class ConfigSlurperTest extends GroovyTestCase {
// end::escape_dot[]
}
+ @Test
void testEnvironments() {
// tag::environments[]
def config = new ConfigSlurper('development').parse('''
@@ -81,6 +86,7 @@ class ConfigSlurperTest extends GroovyTestCase {
// end::environments[]
}
+ @Test
void testCustomEnvironment() {
// tag::custom_environments[]
def slurper = new ConfigSlurper()
@@ -100,6 +106,7 @@ class ConfigSlurperTest extends GroovyTestCase {
// end::custom_environments[]
}
+ @Test
void testProperties() {
// tag::properties[]
def config = new ConfigSlurper().parse('''
diff --git a/src/spec/test/gdk/ExpandoTest.groovy b/src/spec/test/gdk/ExpandoTest.groovy
index 200bc3b4b0..8e02c9a622 100644
--- a/src/spec/test/gdk/ExpandoTest.groovy
+++ b/src/spec/test/gdk/ExpandoTest.groovy
@@ -18,9 +18,11 @@
*/
package gdk
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class ExpandoTest extends GroovyTestCase {
+
+class ExpandoTest {
+ @Test
void testExpandoAddProperty() {
// tag::expando_property[]
def expando = new Expando()
@@ -30,6 +32,7 @@ class ExpandoTest extends GroovyTestCase {
// end::expando_property[]
}
+ @Test
void testExpandoAddMethod() {
// tag::expando_method[]
def expando = new Expando()
diff --git a/src/spec/test/gdk/ObservableTest.groovy b/src/spec/test/gdk/ObservableTest.groovy
index a4c94cedf9..0e205902bb 100644
--- a/src/spec/test/gdk/ObservableTest.groovy
+++ b/src/spec/test/gdk/ObservableTest.groovy
@@ -18,12 +18,13 @@
*/
package gdk
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
import java.beans.PropertyChangeListener
-class ObservableTest extends GroovyTestCase {
+class ObservableTest {
+ @Test
void testObservableList() {
// tag::observable_list[]
@@ -50,6 +51,7 @@ class ObservableTest extends GroovyTestCase {
// end::observable_list[]
}
+ @Test
void testObservableListAndClear() {
// tag::observable_list_clear[]
def event
diff --git a/src/spec/test/gdk/WorkingWithArraysTest.groovy b/src/spec/test/gdk/WorkingWithArraysTest.groovy
index 5d46286982..68cf1739bb 100644
--- a/src/spec/test/gdk/WorkingWithArraysTest.groovy
+++ b/src/spec/test/gdk/WorkingWithArraysTest.groovy
@@ -18,7 +18,7 @@
*/
package gdk
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class WorkingWithArraysTest {
diff --git a/src/spec/test/gdk/WorkingWithCollectionsTest.groovy b/src/spec/test/gdk/WorkingWithCollectionsTest.groovy
index 16669c80ef..71a7dc5bf6 100644
--- a/src/spec/test/gdk/WorkingWithCollectionsTest.groovy
+++ b/src/spec/test/gdk/WorkingWithCollectionsTest.groovy
@@ -18,9 +18,13 @@
*/
package gdk
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class WorkingWithCollectionsTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class WorkingWithCollectionsTest {
+ @Test
void testListLiterals() {
// tag::list_literals[]
def list = [5, 6, 7, 8]
@@ -35,6 +39,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_literals[]
}
+ @Test
void testList() {
// tag::list_usecases[]
def list = [5, 6, 7, 8]
@@ -68,6 +73,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_usecases[]
}
+ @Test
void testListsAsBoolean() {
// tag::list_to_bool[]
assert ![] // an empty list evaluates as false
@@ -77,6 +83,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_to_bool[]
}
+ @Test
void testLeftShiftOnList() {
// tag::list_leftshift[]
def list = []
@@ -100,6 +107,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_leftshift[]
}
+ @Test
void testListAdd() {
// tag::list_add[]
assert [1, 2] + 3 + [4, 5] + 6 == [1, 2, 3, 4, 5, 6]
@@ -134,6 +142,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_add[]
}
+ @Test
void testListIteration() {
// tag::list_each[]
[1, 2, 3].each {
@@ -145,6 +154,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_each[]
}
+ @Test
void testListConstruct() {
// tag::list_construct[]
def list1 = ['a', 'b', 'c']
@@ -159,6 +169,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_construct[]
}
+ @Test
void testListCollect() {
// tag::list_collect[]
assert [1, 2, 3].collect { it * 2 } == [2, 4, 6]
@@ -173,6 +184,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_collect[]
}
+ @Test
void testListGDK() {
// tag::list_gdk1[]
assert [1, 2, 3].find { it > 1 } == 2 // find 1st element matching criteria
@@ -304,6 +316,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
}
+ @Test
void testListComparator() {
// tag::list_comparator[]
Comparator mc = { a, b -> a == b ? 0 : (a < b ? -1 : 1) }
@@ -323,6 +336,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_comparator[]
}
+ @Test
void testListSort() {
// tag::list_sort[]
assert [6, 3, 9, 2, 7, 1, 5].sort() == [1, 2, 3, 5, 6, 7, 9]
@@ -352,6 +366,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_sort[]
}
+ @Test
void testListMultiply() {
// tag::list_multiply[]
assert [1, 2, 3] * 3 == [1, 2, 3, 1, 2, 3, 1, 2, 3]
@@ -363,6 +378,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::list_multiply[]
}
+ @Test
void testIntRange() {
// tag::intrange[]
// an inclusive range
@@ -390,6 +406,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::intrange[]
}
+ @Test
void testStringRange() {
// tag::stringrange[]
// an inclusive range
@@ -404,6 +421,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::stringrange[]
}
+ @Test
void testRangeIteration() {
// tag::range_for[]
for (i in 1..10) {
@@ -417,6 +435,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::range_each[]
}
+ @Test
void testRangeInSwitch() {
int years = 1
double interestRate
@@ -431,6 +450,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
}
+ @Test
void testMapLiteral() {
// tag::map_literal[]
def map = [name: 'Gromit', likes: 'cheese', id: 1234]
@@ -448,6 +468,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::map_literal[]
}
+ @Test
void testMapLiteralUsingEscape() {
// tag::map_literal_gotcha[]
def a = 'Bob'
@@ -460,6 +481,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::map_literal_gotcha[]
}
+ @Test
void testMapPropertyNotation() {
// tag::map_property[]
def map = [name: 'Gromit', likes: 'cheese', id: 1234]
@@ -474,6 +496,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::map_property[]
}
+ @Test
void testMapPropertyGotcha() {
// tag::map_property_gotcha[]
def map = [name: 'Gromit', likes: 'cheese', id: 1234]
@@ -496,6 +519,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::map_property_gotcha[]
}
+ @Test
void testMapIteration() {
// tag::map_iteration[]
def map = [
@@ -526,6 +550,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::map_iteration[]
}
+ @Test
void testAddElementsToMap() {
// tag::map_add[]
def defaults = [1: 'a', 2: 'b', 3: 'c', 4: 'd']
@@ -539,6 +564,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::map_add[]
}
+ @Test
void testMapGDK() {
assertScript '''
// tag::map_gdk1[]
@@ -631,6 +657,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
'''
}
+ @Test
void testShouldNotUseGStringAsKey() {
assertScript '''
// tag::gstring_gotcha[]
@@ -643,6 +670,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
'''
}
+ @Test
void testMapConstruct() {
// tag::map_construct[]
def map = [
@@ -657,6 +685,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
// end::map_construct[]
}
+ @Test
void testGPathSupport() {
// tag::gpath_support_1[]
def listOfMaps = [['a': 11, 'b': 12], ['a': 21, 'b': 22]]
@@ -693,6 +722,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
}
+ @Test
void testStarDot() {
// tag::stardot_1[]
assert [1, 3, 5] == ['a', 'few', 'words']*.size()
@@ -709,6 +739,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase {
'''
}
+ @Test
void testSubscriptOperator() {
// tag::subscript[]
def text = 'nice cheese gromit!'
diff --git a/src/spec/test/gdk/WorkingWithIOSpecTest.groovy b/src/spec/test/gdk/WorkingWithIOSpecTest.groovy
index 8ad1cf8b52..d3cf619465 100644
--- a/src/spec/test/gdk/WorkingWithIOSpecTest.groovy
+++ b/src/spec/test/gdk/WorkingWithIOSpecTest.groovy
@@ -20,16 +20,12 @@ package gdk
import groovy.io.FileType
import groovy.io.FileVisitResult
-import groovy.test.GroovyTestCase
import groovy.transform.CompileStatic
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
+import org.junit.jupiter.api.Test
-import static org.junit.Assume.assumeTrue
+import static org.junit.jupiter.api.Assumptions.assumeTrue
-@RunWith(JUnit4)
-class WorkingWithIOSpecTest extends GroovyTestCase {
+class WorkingWithIOSpecTest {
private final static boolean unixlike =
System.getProperty('os.name').contains('Linux') ||
@@ -38,7 +34,7 @@ class WorkingWithIOSpecTest extends GroovyTestCase {
System.getProperty('os.name').contains('Windows')
private assumeUnixLikeSystem() {
- assumeTrue('Test requires unix like system.', unixlike)
+ assumeTrue(unixlike, 'Test requires unix like system.')
}
@CompileStatic
diff --git a/src/spec/test/metaprogramming/ASTMatcherFilteringTest.groovy b/src/spec/test/metaprogramming/ASTMatcherFilteringTest.groovy
index a208f9dedb..a9de1cb1b8 100644
--- a/src/spec/test/metaprogramming/ASTMatcherFilteringTest.groovy
+++ b/src/spec/test/metaprogramming/ASTMatcherFilteringTest.groovy
@@ -19,7 +19,6 @@
package metaprogramming
-import groovy.test.GroovyTestCase
import groovy.transform.CompileStatic
import org.codehaus.groovy.ast.ASTNode
import org.codehaus.groovy.ast.ClassCodeExpressionTransformer
@@ -31,14 +30,18 @@ import org.codehaus.groovy.macro.matcher.ASTMatcher
import org.codehaus.groovy.transform.AbstractASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformationClass
+import org.junit.jupiter.api.Test
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
-class ASTMatcherFilteringTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+class ASTMatcherFilteringTest {
+
+ @Test
void testFilteringNodes() {
assertScript '''
// tag::jokingexample[]
diff --git a/src/spec/test/metaprogramming/ASTMatcherTestingTest.groovy b/src/spec/test/metaprogramming/ASTMatcherTestingTest.groovy
index 16fc0c6f58..86fa13532e 100644
--- a/src/spec/test/metaprogramming/ASTMatcherTestingTest.groovy
+++ b/src/spec/test/metaprogramming/ASTMatcherTestingTest.groovy
@@ -19,16 +19,12 @@
package metaprogramming
-import groovy.test.GroovyTestCase
-import groovy.transform.CompileDynamic
-import groovy.transform.CompileStatic
+
import org.codehaus.groovy.ast.ASTNode
import org.codehaus.groovy.ast.ClassNode
import org.codehaus.groovy.ast.MethodNode
-import org.codehaus.groovy.ast.Parameter
import org.codehaus.groovy.ast.expr.BinaryExpression
import org.codehaus.groovy.ast.expr.Expression
-import org.codehaus.groovy.ast.stmt.BlockStatement
import org.codehaus.groovy.control.CompilePhase
import org.codehaus.groovy.control.SourceUnit
import org.codehaus.groovy.macro.matcher.ASTMatcher
@@ -36,18 +32,20 @@ import org.codehaus.groovy.macro.transform.MacroClass
import org.codehaus.groovy.transform.AbstractASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformationClass
+import org.junit.jupiter.api.Test
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
-import static org.codehaus.groovy.ast.ClassHelper.Integer_TYPE
-import static org.codehaus.groovy.ast.tools.GeneralUtils.*
+import static groovy.test.GroovyAssert.assertScript
+import static org.codehaus.groovy.ast.tools.GeneralUtils.varX
-class ASTMatcherTestingTest extends GroovyTestCase {
+class ASTMatcherTestingTest {
// tag::testexpression[]
+ @Test
void testTestingSumExpression() {
use(ASTMatcher) { // <1>
TwiceASTTransformation sample = new TwiceASTTransformation()
@@ -65,6 +63,7 @@ class ASTMatcherTestingTest extends GroovyTestCase {
// end::testexpression[]
// tag::executiontesting[]
+ @Test
void testASTBehavior() {
assertScript '''
package metaprogramming
diff --git a/src/spec/test/metaprogramming/ASTXFormSpecTest.groovy b/src/spec/test/metaprogramming/ASTXFormSpecTest.groovy
index 7f99191dc2..56603d1358 100644
--- a/src/spec/test/metaprogramming/ASTXFormSpecTest.groovy
+++ b/src/spec/test/metaprogramming/ASTXFormSpecTest.groovy
@@ -19,16 +19,16 @@
package metaprogramming
import asciidoctor.Utils
-import groovy.test.GroovyTestCase
import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilationUnit
import org.codehaus.groovy.control.CompilePhase
import org.codehaus.groovy.control.CompilerConfiguration
+import org.junit.jupiter.api.Test
-import java.lang.annotation.ElementType
-import java.lang.annotation.Target
+import static groovy.test.GroovyAssert.assertScript
-class ASTXFormSpecTest extends GroovyTestCase {
+class ASTXFormSpecTest {
+ @Test
void testLocalTransform() {
def gcl = new GroovyClassLoader()
def gse = new GroovyShell(gcl)
@@ -111,6 +111,7 @@ import org.codehaus.groovy.transform.GroovyASTTransformation
'''
}
+ @Test
void testClassCodeTransformer() {
def gcl = new GroovyClassLoader()
def gse = new GroovyShell(gcl)
@@ -200,6 +201,7 @@ import org.codehaus.groovy.transform.GroovyASTTransformation
void methodToBeTested() {}
}
+ @Test
void testMyTransform() {
def c = new Subject()
c.methodToBeTested()
@@ -207,6 +209,7 @@ import org.codehaus.groovy.transform.GroovyASTTransformation
// end::breakpoint_missed[]
// tag::breakpoint_hit[]
+ @Test
void testMyTransformWithBreakpoint() {
assertScript '''
import metaprogramming.MyTransformToDebug
@@ -231,6 +234,7 @@ import org.codehaus.groovy.transform.GroovyASTTransformation
}
}
+ @Test
void testGlobalTransform() {
doInTmpDir { builder ->
File dir = builder.baseDir
diff --git a/src/spec/test/metaprogramming/ExpandoMetaClassTest.groovy b/src/spec/test/metaprogramming/ExpandoMetaClassTest.groovy
index a3895a894b..bcbc2adf41 100644
--- a/src/spec/test/metaprogramming/ExpandoMetaClassTest.groovy
+++ b/src/spec/test/metaprogramming/ExpandoMetaClassTest.groovy
@@ -18,11 +18,14 @@
*/
package metaprogramming
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+import static groovy.test.GroovyAssert.assertScript
-class ExpandoMetaClassTest extends GroovyTestCase {
+class ExpandoMetaClassTest {
+
+ @Test
void testConstructors() {
assertScript '''
// tag::emc_constructors[]
@@ -37,6 +40,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testMethodPointer() {
assertScript '''
// tag::emc_method_pointer[]
@@ -60,6 +64,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testDynamicMethodNames() {
assertScript '''
// tag::emc_dynamic_method_names[]
@@ -82,6 +87,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testOverrideInvokeMethod() {
assertScript '''
// tag::emc_invoke_method[]
@@ -107,6 +113,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testOverrideGetProperty() {
assertScript '''
// tag::emc_get_property[]
@@ -132,6 +139,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testOverrideInvokeMethodStatic() {
assertScript '''
// tag::emc_invoke_method_static[]
@@ -156,6 +164,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testGetProperty() {
assertScript '''
// tag::emc_getter[]
@@ -171,6 +180,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testSetGetProperty() {
assertScript '''
// tag::emc_getter_setter[]
@@ -190,6 +200,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testProperty() {
assertScript '''
// tag::emc_property[]
@@ -205,6 +216,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testStaticMethod() {
assertScript '''
// tag::emc_static[]
@@ -219,6 +231,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testMethod() {
assertScript '''
// tag::emc_method[]
@@ -235,6 +248,7 @@ class ExpandoMetaClassTest extends GroovyTestCase {
'''
}
+ @Test
void testInterface() {
assertScript '''
// tag::emc_interface[]
diff --git a/src/spec/test/metaprogramming/GroovyObjectTest.groovy b/src/spec/test/metaprogramming/GroovyObjectTest.groovy
index b00dbf8731..fd7e682062 100644
--- a/src/spec/test/metaprogramming/GroovyObjectTest.groovy
+++ b/src/spec/test/metaprogramming/GroovyObjectTest.groovy
@@ -18,9 +18,13 @@
*/
package metaprogramming
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class GroovyObjectTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class GroovyObjectTest {
+ @Test
void testInvokeMethod() {
assertScript '''
// tag::groovy_invoke_method[]
@@ -43,6 +47,7 @@ assert someGroovyClass.someMethod() == 'called invokeMethod someMethod []'
'''
}
+ @Test
void testGetProperty () {
assertScript '''
// tag::groovy_get_property[]
@@ -74,12 +79,13 @@ assert someGroovyClass.field4 == 'hu'
'''
}
+ @Test
void testSetProperty () {
assertScript '''
// tag::groovy_set_property[]
class POGO {
- String property
+ String property
void setProperty(String name, Object value) {
this.@"$name" = 'overridden'
@@ -94,6 +100,7 @@ assert pogo.property == 'overridden'
'''
}
+ @Test
void testGetAttribute () {
assertScript '''
// tag::groovy_get_attribute[]
@@ -115,6 +122,7 @@ assert someGroovyClass.metaClass.getAttribute(someGroovyClass, 'field2') == 'ho'
'''
}
+ @Test
void testSetAttribute () {
assertScript '''
// tag::groovy_set_attribute[]
@@ -137,4 +145,4 @@ assert pogo.property1 == 'ho'
// end::groovy_set_attribute[]
'''
}
-}
\ No newline at end of file
+}
diff --git a/src/spec/test/metaprogramming/InterceptableTest.groovy b/src/spec/test/metaprogramming/InterceptableTest.groovy
index e3fea05796..ef67837476 100644
--- a/src/spec/test/metaprogramming/InterceptableTest.groovy
+++ b/src/spec/test/metaprogramming/InterceptableTest.groovy
@@ -18,11 +18,13 @@
*/
package metaprogramming
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
// tag::groovy_interceptable_test[]
-class InterceptableTest extends GroovyTestCase {
+class InterceptableTest {
+ @Test
void testCheckInterception() {
def interception = new Interception()
diff --git a/src/spec/test/metaprogramming/InterceptionThroughMetaClassTest.groovy b/src/spec/test/metaprogramming/InterceptionThroughMetaClassTest.groovy
index ba5872f8b2..d3097de6d6 100644
--- a/src/spec/test/metaprogramming/InterceptionThroughMetaClassTest.groovy
+++ b/src/spec/test/metaprogramming/InterceptionThroughMetaClassTest.groovy
@@ -18,12 +18,13 @@
*/
package metaprogramming
-import groovy.test.GroovyTestCase
import groovy.xml.Entity
+import org.junit.jupiter.api.Test
// tag::meta_class_interception[]
-class InterceptionThroughMetaClassTest extends GroovyTestCase {
+class InterceptionThroughMetaClassTest {
+ @Test
void testPOJOMetaClassInterception() {
String invoking = 'ha'
invoking.metaClass.invokeMethod = { String name, Object args ->
@@ -34,6 +35,7 @@ class InterceptionThroughMetaClassTest extends GroovyTestCase {
assert invoking.someMethod() == 'invoked'
}
+ @Test
void testPOGOMetaClassInterception() {
Entity entity = new Entity('Hello')
entity.metaClass.invokeMethod = { String name, Object args ->
diff --git a/src/spec/test/metaprogramming/MacroClassTest.groovy b/src/spec/test/metaprogramming/MacroClassTest.groovy
index 1820bbbd77..b8166da4f5 100644
--- a/src/spec/test/metaprogramming/MacroClassTest.groovy
+++ b/src/spec/test/metaprogramming/MacroClassTest.groovy
@@ -19,7 +19,6 @@
package metaprogramming
-import groovy.test.GroovyTestCase
import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
import org.codehaus.groovy.ast.ASTNode
@@ -31,16 +30,19 @@ import org.codehaus.groovy.macro.transform.MacroClass
import org.codehaus.groovy.transform.AbstractASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformationClass
+import org.junit.jupiter.api.Test
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
+import static groovy.test.GroovyAssert.assertScript
import static org.codehaus.groovy.ast.tools.GeneralUtils.constX
-class MacroClassTest extends GroovyTestCase {
+class MacroClassTest {
+ @Test
void testMacroClass() {
assertScript '''
package metaprogramming
diff --git a/src/spec/test/metaprogramming/MacroExpressionTest.groovy b/src/spec/test/metaprogramming/MacroExpressionTest.groovy
index 2b1ffbd710..99196623df 100644
--- a/src/spec/test/metaprogramming/MacroExpressionTest.groovy
+++ b/src/spec/test/metaprogramming/MacroExpressionTest.groovy
@@ -19,7 +19,6 @@
package metaprogramming
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.ast.ASTNode
import org.codehaus.groovy.ast.ClassHelper
import org.codehaus.groovy.ast.ClassNode
@@ -33,14 +32,19 @@ import org.codehaus.groovy.control.SourceUnit
import org.codehaus.groovy.transform.AbstractASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformationClass
+import org.junit.jupiter.api.Test
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
-class MacroExpressionTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static org.objectweb.asm.Opcodes.ACC_PUBLIC
+
+class MacroExpressionTest {
+ @Test
void testCreateExpressions() {
assertScript '''
// add::addgettwosample[]
@@ -64,8 +68,6 @@ class MacroExpressionTest extends GroovyTestCase {
@interface AddGetTwo { }
// end::addgettwoannotation[]
-import static org.objectweb.asm.Opcodes.ACC_PUBLIC
-
// tag::addgettwotransformation[]
@GroovyASTTransformation(phase = CompilePhase.INSTRUCTION_SELECTION)
class AddGetTwoASTTransformation extends AbstractASTTransformation {
diff --git a/src/spec/test/metaprogramming/MacroStatementTest.groovy b/src/spec/test/metaprogramming/MacroStatementTest.groovy
index 2574758f27..81a2233441 100644
--- a/src/spec/test/metaprogramming/MacroStatementTest.groovy
+++ b/src/spec/test/metaprogramming/MacroStatementTest.groovy
@@ -19,8 +19,12 @@
package metaprogramming
-import groovy.test.GroovyTestCase
-import org.codehaus.groovy.ast.*
+
+import org.codehaus.groovy.ast.ASTNode
+import org.codehaus.groovy.ast.ClassHelper
+import org.codehaus.groovy.ast.ClassNode
+import org.codehaus.groovy.ast.MethodNode
+import org.codehaus.groovy.ast.Parameter
import org.codehaus.groovy.ast.expr.ConstantExpression
import org.codehaus.groovy.ast.stmt.ReturnStatement
import org.codehaus.groovy.control.CompilePhase
@@ -28,14 +32,19 @@ import org.codehaus.groovy.control.SourceUnit
import org.codehaus.groovy.transform.AbstractASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformationClass
+import org.junit.jupiter.api.Test
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
-class MacroStatementTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static org.objectweb.asm.Opcodes.ACC_PUBLIC
+
+class MacroStatementTest {
+ @Test
void testOlderASTTransformation() {
assertScript '''
package metaprogramming
@@ -49,6 +58,7 @@ class MacroStatementTest extends GroovyTestCase {
'''
}
+ @Test
void testOlderASTTransformationWithMacros() {
assertScript '''
package metaprogramming
@@ -70,8 +80,6 @@ class MacroStatementTest extends GroovyTestCase {
@interface AddMethod { }
// end::addmethodannotation[]
-import static org.objectweb.asm.Opcodes.ACC_PUBLIC
-
// tag::addmethodtransformationwithoutmacro[]
@GroovyASTTransformation(phase = CompilePhase.INSTRUCTION_SELECTION)
class AddMethodASTTransformation extends AbstractASTTransformation {
diff --git a/src/spec/test/metaprogramming/MacroVariableSubstitutionTest.groovy b/src/spec/test/metaprogramming/MacroVariableSubstitutionTest.groovy
index 79283c1831..116819a35a 100644
--- a/src/spec/test/metaprogramming/MacroVariableSubstitutionTest.groovy
+++ b/src/spec/test/metaprogramming/MacroVariableSubstitutionTest.groovy
@@ -19,8 +19,13 @@
package metaprogramming
-import groovy.test.GroovyTestCase
-import org.codehaus.groovy.ast.*
+
+import org.codehaus.groovy.ast.ASTNode
+import org.codehaus.groovy.ast.ClassHelper
+import org.codehaus.groovy.ast.ClassNode
+import org.codehaus.groovy.ast.FieldNode
+import org.codehaus.groovy.ast.MethodNode
+import org.codehaus.groovy.ast.Parameter
import org.codehaus.groovy.ast.expr.VariableExpression
import org.codehaus.groovy.ast.stmt.BlockStatement
import org.codehaus.groovy.ast.tools.GeneralUtils
@@ -29,14 +34,19 @@ import org.codehaus.groovy.control.SourceUnit
import org.codehaus.groovy.transform.AbstractASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformationClass
+import org.junit.jupiter.api.Test
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
-class MacroVariableSubstitutionTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static org.objectweb.asm.Opcodes.ACC_PUBLIC
+
+class MacroVariableSubstitutionTest {
+ @Test
void testVariableSubstitution() {
assertScript '''
package metaprogramming
@@ -59,8 +69,6 @@ class MacroVariableSubstitutionTest extends GroovyTestCase {
@interface MD5 { }
// end::md5annotation[]
-import static org.objectweb.asm.Opcodes.ACC_PUBLIC
-
// tag::md5transformation[]
@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION)
class MD5ASTTransformation extends AbstractASTTransformation {
diff --git a/src/spec/test/metaprogramming/MethodPropertyMissingTest.groovy b/src/spec/test/metaprogramming/MethodPropertyMissingTest.groovy
index 663a8bffc3..ce3b562960 100644
--- a/src/spec/test/metaprogramming/MethodPropertyMissingTest.groovy
+++ b/src/spec/test/metaprogramming/MethodPropertyMissingTest.groovy
@@ -18,10 +18,14 @@
*/
package metaprogramming
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class MethodPropertyMissingTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class MethodPropertyMissingTest {
+
+ @Test
void testMethodMissing() {
assertScript '''
//tag::method_missing_simple[]
@@ -37,6 +41,7 @@ class MethodPropertyMissingTest extends GroovyTestCase {
'''
}
+ @Test
void testPropertyMissingGetter() {
assertScript '''
//tag::property_missing_getter[]
@@ -49,6 +54,7 @@ class MethodPropertyMissingTest extends GroovyTestCase {
'''
}
+ @Test
void testPropertyMissingGetterSetter() {
assertScript '''
//tag::property_missing_getter_setter[]
diff --git a/src/spec/test/metaprogramming/StaticPropertyMissingAndMethodMissingTest.groovy b/src/spec/test/metaprogramming/StaticPropertyMissingAndMethodMissingTest.groovy
index 57c4a6f8c5..6893a35a55 100644
--- a/src/spec/test/metaprogramming/StaticPropertyMissingAndMethodMissingTest.groovy
+++ b/src/spec/test/metaprogramming/StaticPropertyMissingAndMethodMissingTest.groovy
@@ -18,10 +18,14 @@
*/
package metaprogramming
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class StaticPropertyMissingAndMethodMissingTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class StaticPropertyMissingAndMethodMissingTest {
+
+ @Test
void testStaticMethodMissing() {
assertScript '''
// tag::static_method_missing[]
@@ -36,6 +40,7 @@ class StaticPropertyMissingAndMethodMissingTest extends GroovyTestCase {
'''
}
+ @Test
void testStaticPropertyMissing() {
assertScript '''
// tag::static_property_missing[]
diff --git a/src/spec/test/objectorientation/MethodsTest.groovy b/src/spec/test/objectorientation/MethodsTest.groovy
index 3f2229428c..ec905112a7 100644
--- a/src/spec/test/objectorientation/MethodsTest.groovy
+++ b/src/spec/test/objectorientation/MethodsTest.groovy
@@ -18,10 +18,14 @@
*/
package objectorientation
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class MethodsTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
+class MethodsTest {
+
+ @Test
void testMethodDefinition() {
assertScript '''
// tag::method_definition[]
@@ -33,6 +37,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testNamedArguments() {
assertScript '''
// tag::named_arguments[]
@@ -42,6 +47,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testNamedArgumentsAlongWithOtherArguments() {
assertScript '''
// tag::named_arguments_with_additional_arguments[]
@@ -52,6 +58,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testFailedNamedArgumentsAlongWithOtherArguments() {
shouldFail '''
// tag::failed_named_arguments_with_additional_arguments[]
@@ -61,6 +68,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testExplicitNamedArgumentsAlongWithOtherArguments() {
assertScript '''
// tag::explicit_named_arguments_with_additional_arguments[]
@@ -70,6 +78,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testDefaultArguments() {
assertScript '''
// tag::default_arguments[]
@@ -89,6 +98,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testVarargs() {
assertScript '''
// tag::varargs_example[]
@@ -100,6 +110,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testVarargsArrayNotation() {
assertScript '''
// tag::varargs_array_notation[]
@@ -111,6 +122,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testVarargsNullParameter() {
assertScript '''
// tag::varargs_null_parameter[]
@@ -120,6 +132,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testVarargsArrayParameter() {
assertScript '''
// tag::varargs_array_parameter[]
@@ -130,6 +143,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testVarargsMethodOverloading() {
assertScript '''
// tag::varargs_method_overloading[]
@@ -142,9 +156,10 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testIdiomaticMethodDeclaration() {
- assertScript '''
- import static groovy.test.GroovyAssert.shouldFail
+ assertScript ''' import static groovy.test.GroovyAssert.shouldFail
+
// tag::idiomatic_method_declaration[]
def badRead() {
new File('doesNotExist.txt').text
@@ -157,6 +172,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testMethodDeclarationWithCheckedException() {
assertScript '''
import static groovy.test.GroovyAssert.shouldFail
@@ -172,6 +188,7 @@ class MethodsTest extends GroovyTestCase {
'''
}
+ @Test
void testMultiMethods() {
assertScript '''
// tag::multi_methods[]
diff --git a/src/spec/test/semantics/GPathTest.groovy b/src/spec/test/semantics/GPathTest.groovy
index 2afeff46a6..86ae76d78c 100644
--- a/src/spec/test/semantics/GPathTest.groovy
+++ b/src/spec/test/semantics/GPathTest.groovy
@@ -18,15 +18,16 @@
*/
package semantics
-import groovy.test.GroovyTestCase
import groovy.xml.XmlSlurper
+import org.junit.jupiter.api.Test
-class GPathTest extends GroovyTestCase {
+class GPathTest {
//tag::gpath_on_reflection_1[]
void aMethodFoo() { println "This is aMethodFoo." } // <0>
//end::gpath_on_reflection_1[]
+ @Test
void testGPathOnReflection() {
//tag::gpath_on_reflection_2[]
assert ['aMethodFoo'] == this.class.methods.name.grep(~/.*Foo/)
@@ -39,18 +40,21 @@ class GPathTest extends GroovyTestCase {
void aSecondMethodBar() { println "This is aSecondMethodBar." } // <3>
//end::gpath_on_reflection_3[]
+ @Test
void testGPathOnReflectionWithBarMethods() {
//tag::gpath_on_reflection_4[]
assert ['aMethodBar', 'aSecondMethodBar'] as Set == this.class.methods.name.grep(~/.*Bar/) as Set
//end::gpath_on_reflection_4[]
}
+ @Test
void testGPathArrayAccess() {
//tag::gpath_array_access_1[]
assert 'aSecondMethodBar' == this.class.methods.name.grep(~/.*Bar/).sort()[1]
//end::gpath_array_access_1[]
}
+ @Test
void testGPathOnXml() {
//tag::gpath_on_xml_1[]
def xmlText = """
diff --git a/src/spec/test/semantics/PowerAssertTest.groovy b/src/spec/test/semantics/PowerAssertTest.groovy
index 85d5b6c687..a74bc47cb6 100644
--- a/src/spec/test/semantics/PowerAssertTest.groovy
+++ b/src/spec/test/semantics/PowerAssertTest.groovy
@@ -18,7 +18,7 @@
*/
package semantics
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static asciidoctor.Utils.stripAsciidocMarkup
import static groovy.test.GroovyAssert.shouldFail
diff --git a/src/spec/test/semantics/TheGroovyTruthTest.groovy b/src/spec/test/semantics/TheGroovyTruthTest.groovy
index a9cdcd3560..fef181016c 100644
--- a/src/spec/test/semantics/TheGroovyTruthTest.groovy
+++ b/src/spec/test/semantics/TheGroovyTruthTest.groovy
@@ -18,10 +18,14 @@
*/
package semantics
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class TheGroovyTruthTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class TheGroovyTruthTest {
+
+ @Test
void testGroovyTruth() {
// tag::boolean_truth[]
assert true
@@ -74,6 +78,7 @@ class TheGroovyTruthTest extends GroovyTestCase {
// end::object_truth[]
}
+ @Test
void testAsBoolean() {
assertScript '''
// tag::asBoolean_object[]
@@ -81,7 +86,7 @@ class TheGroovyTruthTest extends GroovyTestCase {
String name
boolean asBoolean(){
- name == 'green' ? true : false
+ name == 'green' ? true : false
}
}
// end::asBoolean_object[]
diff --git a/src/spec/test/testingguide/GDKMethodTests.groovy b/src/spec/test/testingguide/GDKMethodTests.groovy
index e7b589244b..d9aa55d0fa 100644
--- a/src/spec/test/testingguide/GDKMethodTests.groovy
+++ b/src/spec/test/testingguide/GDKMethodTests.groovy
@@ -18,11 +18,13 @@
*/
package testingguide
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class GDKMethodTests extends GroovyTestCase {
+
+class GDKMethodTests {
// tag::combinations[]
+ @Test
void testCombinations() {
def combinations = [[2, 3],[4, 5, 6]].combinations()
assert combinations == [[2, 4], [3, 4], [2, 5], [3, 5], [2, 6], [3, 6]]
@@ -30,6 +32,7 @@ class GDKMethodTests extends GroovyTestCase {
// end::combinations[]
// tag::each_combination[]
+ @Test
void testEachCombination() {
[[2, 3],[4, 5, 6]].eachCombination { println it[0] + it[1] }
}
diff --git a/src/spec/test/testingguide/GroovyTestCaseExampleTests.groovy b/src/spec/test/testingguide/GroovyTestCaseExampleTests.groovy
index 56345382b7..937a915ec3 100644
--- a/src/spec/test/testingguide/GroovyTestCaseExampleTests.groovy
+++ b/src/spec/test/testingguide/GroovyTestCaseExampleTests.groovy
@@ -18,17 +18,26 @@
*/
package testingguide
-import groovy.test.GroovyTestCase
import groovy.test.NotYetImplemented
+import org.junit.jupiter.api.Test
-class GroovyTestCaseExampleTests extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
+import static org.junit.jupiter.api.Assertions.assertEquals
+import static org.junit.jupiter.api.Assertions.assertNotNull
+import static org.junit.jupiter.api.Assertions.assertNull
+import static org.junit.jupiter.api.Assertions.assertSame
+import static org.junit.jupiter.api.Assertions.assertTrue
+
+class GroovyTestCaseExampleTests {
/* // tag::assertions[]
-class MyTestCase extends GroovyTestCase {
+class MyTestCase {
// end::assertions[]
*/
// tag::assertions[]
+ @Test
void testAssertions() {
assertTrue(1 == 1)
assertEquals("test", "test")
@@ -48,6 +57,7 @@ class MyTestCase extends GroovyTestCase {
*/
// tag::assertScript[]
+ @Test
void testScriptAssertions() {
assertScript '''
def x = 1
@@ -59,6 +69,7 @@ class MyTestCase extends GroovyTestCase {
// end::assertScript[]
// tag::should_fail_without_class[]
+ @Test
void testInvalidIndexAccess1() {
def numbers = [1,2,3,4]
shouldFail {
@@ -68,6 +79,7 @@ class MyTestCase extends GroovyTestCase {
// end::should_fail_without_class[]
// tag::should_fail_with_class[]
+ @Test
void testInvalidIndexAccess2() {
def numbers = [1,2,3,4]
shouldFail IndexOutOfBoundsException, {
@@ -77,27 +89,29 @@ class MyTestCase extends GroovyTestCase {
// end::should_fail_with_class[]
// tag::should_fail_with_msg[]
+ @Test
void testInvalidIndexAccess3() {
def numbers = [1,2,3,4]
def msg = shouldFail IndexOutOfBoundsException, {
numbers.get(4)
}
- assert msg.contains('Index: 4, Size: 4') ||
- msg.contains('Index 4 out-of-bounds for length 4') ||
- msg.contains('Index 4 out of bounds for length 4')
+ assert msg.message.contains('Index: 4, Size: 4') ||
+ msg.message.contains('Index 4 out-of-bounds for length 4') ||
+ msg.message.contains('Index 4 out of bounds for length 4')
}
// end::should_fail_with_msg[]
// tag::not_yet_implemented[]
+ @NotYetImplemented // <1>
+ @Test
void testNotYetImplemented1() {
- if (notYetImplemented()) return // <1>
-
assert 1 == 2 // <2>
}
// end::not_yet_implemented[]
// tag::not_yet_implemented_ast[]
@NotYetImplemented
+ @Test
void testNotYetImplemented2() {
assert 1 == 2
}
diff --git a/src/spec/test/testingguide/JUnit4ExampleTests.groovy b/src/spec/test/testingguide/JUnit4ExampleTests.groovy
index dfb4cf7f7f..4e12e3adec 100644
--- a/src/spec/test/testingguide/JUnit4ExampleTests.groovy
+++ b/src/spec/test/testingguide/JUnit4ExampleTests.groovy
@@ -18,7 +18,7 @@
*/
package testingguide
// tag::junit4_example[]
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.shouldFail
diff --git a/src/spec/test/testingguide/MockingExampleTests.groovy b/src/spec/test/testingguide/MockingExampleTests.groovy
index 924c77d43f..798acc5585 100644
--- a/src/spec/test/testingguide/MockingExampleTests.groovy
+++ b/src/spec/test/testingguide/MockingExampleTests.groovy
@@ -20,7 +20,7 @@ package testingguide
import groovy.mock.interceptor.MockFor
import groovy.mock.interceptor.StubFor
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.AfterEach
// tag::map_coercion[]
class TranslationService {
@@ -57,13 +57,13 @@ import groovy.test.GroovyTestCase
// end::emc2[]
-class MockingExampleTests extends GroovyTestCase {
+class MockingExampleTests {
+ @AfterEach
void tearDown() {
GroovySystem.metaClassRegistry.setMetaClass(TranslationService, null)
GroovySystem.metaClassRegistry.setMetaClass(BaseService, null)
GroovySystem.metaClassRegistry.setMetaClass(Book, null)
- super.tearDown()
}
void testMapCoercion() {
diff --git a/src/spec/test/typing/OptionalTypingTest.groovy b/src/spec/test/typing/OptionalTypingTest.groovy
index 4f3fa726f3..258be51cb7 100644
--- a/src/spec/test/typing/OptionalTypingTest.groovy
+++ b/src/spec/test/typing/OptionalTypingTest.groovy
@@ -18,10 +18,14 @@
*/
package typing
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class OptionalTypingTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class OptionalTypingTest {
+
+ @Test
void testOptionalTypingInVariableDeclaration() {
assertScript '''
// tag::optionaltyping_var[]
@@ -36,6 +40,7 @@ class OptionalTypingTest extends GroovyTestCase {
// end::optionaltyping_var_def[]
'''
}
+ @Test
void testOptionalTypingInMethodParameter() {
assertScript '''
// tag::optionaltyping_orig[]
diff --git a/src/spec/test/typing/TypeCheckingExtensionSpecTest.groovy b/src/spec/test/typing/TypeCheckingExtensionSpecTest.groovy
index 67f8bbe8e4..6653174c1b 100644
--- a/src/spec/test/typing/TypeCheckingExtensionSpecTest.groovy
+++ b/src/spec/test/typing/TypeCheckingExtensionSpecTest.groovy
@@ -19,17 +19,20 @@
package typing
import groovy.test.GroovyAssert
-import groovy.test.GroovyTestCase
import groovy.transform.TypeChecked
import groovy.transform.stc.ClosureParams
import groovy.transform.stc.SimpleType
import groovy.xml.MarkupBuilder
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
import static asciidoctor.Utils.stripAsciidocMarkup
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.shouldFail
-final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
+final class TypeCheckingExtensionSpecTest {
+ @Test
void testIntro() {
def out = new PrintWriter(new ByteArrayOutputStream())
// tag::intro_stc_extensions[]
@@ -45,18 +48,21 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
// end::intro_stc_extensions[]
}
+ @Test
void testSetup() {
assertScriptWithExtension 'setup.groovy', '''
1+1
'''
}
+ @Test
void testFinish() {
assertScriptWithExtension 'finish.groovy', '''
1+1
'''
}
+ @Test
void testUnresolvedVariable() {
assertScriptWithExtension 'unresolvedvariable.groovy', '''
assert people.size() == 2
@@ -65,6 +71,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testUnresolvedProperty() {
use (SpecSupport) {
assertScriptWithExtension 'unresolvedproperty.groovy', '''
@@ -73,6 +80,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testUnresolvedAttribute() {
try {
assertScriptWithExtension 'unresolvedattribute.groovy', '''
@@ -84,6 +92,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testBeforeMethodCall() {
try {
assertScriptWithExtension 'beforemethodcall.groovy', '''
@@ -95,6 +104,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testAfterMethodCall() {
try {
assertScriptWithExtension 'aftermethodcall.groovy', '''
@@ -106,6 +116,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testOnMethodSelection() {
try {
assertScriptWithExtension 'onmethodselection.groovy', '''
@@ -119,6 +130,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testMethodNotFound() {
use (SpecSupport) {
assertScriptWithExtension 'methodnotfound.groovy', '''
@@ -127,6 +139,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testBeforeVisitMethod() {
use (SpecSupport) {
assertScriptWithExtension 'beforevisitmethod.groovy', '''
@@ -138,6 +151,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testAfterVisitMethod() {
try {
assertScriptWithExtension 'aftervisitmethod.groovy', '''
@@ -154,6 +168,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testBeforeVisitClass() {
try {
assertScriptWithExtension 'beforevisitclass.groovy', '''
@@ -166,6 +181,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testAfterVisitClass() {
try {
assertScriptWithExtension 'aftervisitclass.groovy', '''
@@ -178,6 +194,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
}
}
+ @Test
void testIncompatibleAssignment() {
assertScriptWithExtension 'incompatibleassignment.groovy', '''
import groovy.transform.TypeChecked
@@ -199,6 +216,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testIncompatibleReturnType() {
assertScriptWithExtension 'incompatiblereturntype.groovy', '''
Closure<Date> c = { '1' }
@@ -206,6 +224,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testAmbiguousMethods() {
def err = shouldFail {
assertScriptWithExtension 'ambiguousmethods.groovy', '''
@@ -215,9 +234,10 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
assert foo(null) == 2
'''
}
- assert err =~ /Cannot resolve which method to invoke for \[null\] due to overlapping prototypes/
+ assert err.message =~ /Cannot resolve which method to invoke for \[null\] due to overlapping prototypes/
}
+ @Test
void testSupportMethods() {
assertScriptWithExtension 'selfcheck.groovy', '''
class Foo {}
@@ -225,6 +245,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testNewMethod() {
assertScriptWithExtension 'newmethod.groovy','''
class Foo {
@@ -235,6 +256,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
'''
}
+ @Test
void testScopingMethods() {
assertScriptWithExtension 'scoping.groovy','''
1+1
@@ -246,6 +268,7 @@ final class TypeCheckingExtensionSpecTest extends GroovyTestCase {
//--------------------------------------------------------------------------
+ @Test
void testRobotExample() {
def err = shouldFail(MultipleCompilationErrorsException, '''import groovy.transform.TypeChecked
import org.codehaus.groovy.control.CompilerConfiguration
@@ -269,13 +292,14 @@ shell.setVariable('robot', robot)
shell.evaluate(script) // <3>
// end::example_robot_setup[]
''')
- assert err.contains(stripAsciidocMarkup('''
+ assert err.message.contains(stripAsciidocMarkup('''
// tag::example_robot_expected_err[]
[Static type checking] - The variable [robot] is undeclared.
// end::example_robot_expected_err[]
'''))
}
+ @Test
void testRobotExampleFixed() {
assertScript '''import groovy.transform.TypeChecked
import org.codehaus.groovy.control.CompilerConfiguration
@@ -301,6 +325,7 @@ shell.evaluate(script)
'''
}
+ @Test
void testRobotExamplePassWithCompileStatic() {
assertScript '''import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilerConfiguration
@@ -326,6 +351,7 @@ shell.evaluate(script)
'''
}
+ @Test
void testRobotExampleDelegatingScript() {
assertScript '''import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilerConfiguration
@@ -349,6 +375,7 @@ runner.run() // <4>
'''
}
+ @Test
void testRobotExampleFailsWithCompileStatic() {
def err = GroovyAssert.shouldFail '''import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilerConfiguration
@@ -381,6 +408,7 @@ java.lang.NoSuchMethodError: java.lang.Object.move()Ltyping/Robot;
''')) || err.contains('java.lang.NoSuchMethodError: \'typing.Robot java.lang.Object.move()\'')
}
+ @Test
void testRobotExamplePassesWithCompileStatic() {
assertScript '''import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilerConfiguration
@@ -405,6 +433,7 @@ runner.run()
'''
}
+ @Test
void testPrecompiledExtensions() {
assertScript '''import groovy.transform.TypeChecked
import org.codehaus.groovy.control.CompilerConfiguration
@@ -517,38 +546,47 @@ assert expected == result
"""
}
+ @Test
void testDelegateResolutionToPropertyWhenReadingUsingDelegateOnly() {
doDelegateResolutionForPropertyReadTest("Closure.DELEGATE_ONLY", "delegate")
}
+ @Test
void testDelegateResolutionToPropertyWhenReadingUsingDelegateFirst() {
doDelegateResolutionForPropertyReadTest("Closure.DELEGATE_FIRST", "delegate")
}
+ @Test
void testDelegateResolutionToPropertyWhenReadingUsingOwnerOnly() {
doDelegateResolutionForPropertyReadTest("Closure.OWNER_ONLY", "owner")
}
+ @Test
void testDelegateResolutionToPropertyWhenReadingUsingOwnerFirst() {
doDelegateResolutionForPropertyReadTest("Closure.OWNER_FIRST", "owner")
}
+ @Test
void testDelegateResolutionToPropertyWhenWritingUsingDelegateOnly() {
doDelegateResolutionForPropertyWriteTest("Closure.DELEGATE_ONLY", "delegate")
}
+ @Test
void testDelegateResolutionToPropertyWhenWritingUsingDelegateFirst() {
doDelegateResolutionForPropertyWriteTest("Closure.DELEGATE_FIRST", "delegate")
}
+ @Test
void testDelegateResolutionToPropertyWhenWritingUsingOwnerOnly() {
doDelegateResolutionForPropertyWriteTest("Closure.OWNER_ONLY", "owner")
}
+ @Test
void testDelegateResolutionToPropertyWhenWritingUsingOwnerFirst() {
doDelegateResolutionForPropertyWriteTest("Closure.OWNER_FIRST", "owner")
}
+ @Test
void testDelegateResolutionToPropertyWhenWritingInsideWith() {
// Failing example provided by Jan Hackel (@jhunovis) in groovy slack
// https://groovy-community.slack.com/files/U9CM8G6AJ/FAR1PJT1U/behavior_of__with__and___compilestatic.groovy
diff --git a/src/spec/test/typing/TypeCheckingJavaTest.java b/src/spec/test/typing/TypeCheckingJavaTest.java
index 27c35165f9..5ec96b25ff 100644
--- a/src/spec/test/typing/TypeCheckingJavaTest.java
+++ b/src/spec/test/typing/TypeCheckingJavaTest.java
@@ -18,8 +18,8 @@
*/
package typing;
-import org.junit.Test;
-import static org.junit.Assert.assertEquals;
+import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class TypeCheckingJavaTest {
@Test
diff --git a/src/test/groovy/NoPackageTest.groovy b/src/test/groovy/NoPackageTest.groovy
index c37ddad9ab..78d02277fb 100644
--- a/src/test/groovy/NoPackageTest.groovy
+++ b/src/test/groovy/NoPackageTest.groovy
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class NoPackageTest {
@Test
diff --git a/src/test/groovy/bugs/AmbiguousListOrMethodTest.groovy b/src/test/groovy/bugs/AmbiguousListOrMethodTest.groovy
index 28d19e7f7f..c1c1494669 100644
--- a/src/test/groovy/bugs/AmbiguousListOrMethodTest.groovy
+++ b/src/test/groovy/bugs/AmbiguousListOrMethodTest.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class AmbiguousListOrMethodTest extends GroovyTestCase {
+import static groovy.test.GroovyAssert.shouldFail
+
+class AmbiguousListOrMethodTest {
+
+ @Test
void testLocalVariableVersion() {
def foo = [3, 2, 3]
@@ -29,12 +33,14 @@ class AmbiguousListOrMethodTest extends GroovyTestCase {
assert val == 3
}
+ @Test
void testUndefinedPropertyVersion() {
shouldFail(MissingPropertyException) {
def val = this.foo [0]
}
}
+ @Test
void testMethodCallVersion() {
def val = foo([0])
assert val == 1
@@ -49,6 +55,7 @@ class AmbiguousListOrMethodTest extends GroovyTestCase {
return myList.size()
}
+ @Test
void testCanFindCorrectMethod() {
def e = new Example()
assert e["", ""] == 2
diff --git a/src/test/groovy/bugs/AsBoolBug.groovy b/src/test/groovy/bugs/AsBoolBug.groovy
index 66574a3af7..4be2b5112a 100644
--- a/src/test/groovy/bugs/AsBoolBug.groovy
+++ b/src/test/groovy/bugs/AsBoolBug.groovy
@@ -18,15 +18,17 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
* Test to fix the Jira issues GROOVY-810 and GROOVY-811.
* Test of "string as Boolean" against the issue GROOVY-812.
*/
-public class AsBoolBug extends GroovyTestCase {
+public class AsBoolBug {
+ @Test
void testMapAsBool() {
def a = ["A":123]
assert a as Boolean == true
@@ -34,6 +36,7 @@ public class AsBoolBug extends GroovyTestCase {
assert a as Boolean == false
}
+ @Test
void testListAsBool() {
def b = [123]
assert b as Boolean == true
@@ -51,6 +54,7 @@ public class AsBoolBug extends GroovyTestCase {
// it has already been decided to handle string-to-boolean conversions
// differently. Commented out temporarily on 10 May 2005.
// This is a test case against GROOVY-812
+ @Test
void testStringAsBool() {
def c = "false"
assert c as Boolean == true
diff --git a/src/test/groovy/bugs/AssignmentInsideExpressionBug.groovy b/src/test/groovy/bugs/AssignmentInsideExpressionBug.groovy
index cf32603148..2b46946fd6 100644
--- a/src/test/groovy/bugs/AssignmentInsideExpressionBug.groovy
+++ b/src/test/groovy/bugs/AssignmentInsideExpressionBug.groovy
@@ -18,12 +18,16 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
+import static org.junit.jupiter.api.Assertions.fail
+
/**
*/
-class AssignmentInsideExpressionBug extends GroovyTestCase {
+class AssignmentInsideExpressionBug {
+ @Test
void testBug() {
def x
if ((x = someMethod()) != null) {
diff --git a/src/test/groovy/bugs/AttributeSetExpressionBug.groovy b/src/test/groovy/bugs/AttributeSetExpressionBug.groovy
index 58876b20a4..48a552963f 100644
--- a/src/test/groovy/bugs/AttributeSetExpressionBug.groovy
+++ b/src/test/groovy/bugs/AttributeSetExpressionBug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class AttributeSetExpressionBug extends GroovyTestCase {
+
+class AttributeSetExpressionBug {
+ @Test
void testAttributeSetAccess() {
def a = new HasStaticFieldSomeClass()
a.name = a.name * 3
diff --git a/src/test/groovy/bugs/AutoboxingOfComparisonsBug.groovy b/src/test/groovy/bugs/AutoboxingOfComparisonsBug.groovy
index f2e8dfa252..e230511928 100644
--- a/src/test/groovy/bugs/AutoboxingOfComparisonsBug.groovy
+++ b/src/test/groovy/bugs/AutoboxingOfComparisonsBug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class AutoboxingOfComparisonsBug extends GroovyTestCase {
+
+class AutoboxingOfComparisonsBug {
+ @Test
void testBug() {
def y = true
def x = y == true
diff --git a/src/test/groovy/bugs/BadLineNumberOnExceptionBugTest.groovy b/src/test/groovy/bugs/BadLineNumberOnExceptionBugTest.groovy
index bdc72c0b44..a675f684c5 100644
--- a/src/test/groovy/bugs/BadLineNumberOnExceptionBugTest.groovy
+++ b/src/test/groovy/bugs/BadLineNumberOnExceptionBugTest.groovy
@@ -18,7 +18,10 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
/**
* Ensure that the correct line information is reported when an exception is thrown.
@@ -27,8 +30,9 @@ import groovy.test.GroovyTestCase
* <li><a href="https://issues.apache.org/jira/browse/GROOVY-3067">GROOVY-3067</a></li>
* <li><a href="https://issues.apache.org/jira/browse/GROOVY-2983">GROOVY-2983</a></li>
*/
-class BadLineNumberOnExceptionBugTest extends GroovyTestCase {
+class BadLineNumberOnExceptionBugTest {
+ @Test
void testGroovy3067() {
assertScript """
class Foo {
@@ -53,6 +57,7 @@ class BadLineNumberOnExceptionBugTest extends GroovyTestCase {
"""
}
+ @Test
void testGroovy2983() {
assertScript """
def foo() {
diff --git a/src/test/groovy/bugs/BadScriptNameBug.groovy b/src/test/groovy/bugs/BadScriptNameBug.groovy
index e7f1948c10..ec30982b3c 100644
--- a/src/test/groovy/bugs/BadScriptNameBug.groovy
+++ b/src/test/groovy/bugs/BadScriptNameBug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class BadScriptNameBug extends GroovyTestCase {
+class BadScriptNameBug {
+
+ @Test
void testBug() {
GroovyClassLoader cl = new GroovyClassLoader();
cl.parseClass("println 'oops!'", "/script.groovy");
diff --git a/src/test/groovy/bugs/BenchmarkBug.groovy b/src/test/groovy/bugs/BenchmarkBug.groovy
index 8d098bc5b1..75434bde14 100644
--- a/src/test/groovy/bugs/BenchmarkBug.groovy
+++ b/src/test/groovy/bugs/BenchmarkBug.groovy
@@ -18,13 +18,15 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
* A little performance test
*/
-class BenchmarkBug extends GroovyTestCase {
+class BenchmarkBug {
+ @Test
void testPerformance() {
def start = System.currentTimeMillis()
diff --git a/src/test/groovy/bugs/BlockAsClosureBug.groovy b/src/test/groovy/bugs/BlockAsClosureBug.groovy
index cbbf48d793..5e115d8135 100644
--- a/src/test/groovy/bugs/BlockAsClosureBug.groovy
+++ b/src/test/groovy/bugs/BlockAsClosureBug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class BlockAsClosureBug extends GroovyTestCase {
+class BlockAsClosureBug {
+
+ @Test
void testBug() {
def c = 0
@@ -32,10 +34,12 @@ class BlockAsClosureBug extends GroovyTestCase {
assert c == 9
}
+ @Test
void testStaticBug() {
staticMethod(null)
}
+ @Test
void testNonVoidMethod() {
foo()
}
diff --git a/src/test/groovy/bugs/BooleanBug.groovy b/src/test/groovy/bugs/BooleanBug.groovy
index 47972c2249..65bcef13e1 100644
--- a/src/test/groovy/bugs/BooleanBug.groovy
+++ b/src/test/groovy/bugs/BooleanBug.groovy
@@ -18,12 +18,16 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
/**
*/
-class BooleanBug extends GroovyTestCase {
+class BooleanBug {
+ @Test
void testBug() {
def x = new BooleanBean(name:'James', foo:true)
def y = new BooleanBean(name:'Bob', foo:false)
@@ -34,6 +38,7 @@ class BooleanBug extends GroovyTestCase {
assert y.foo
}
+ @Test
void testBug2() {
BooleanBean bean = new BooleanBean(name:'Gromit', foo:false)
def value = isApplicableTo(bean)
diff --git a/src/test/groovy/bugs/ByteIndexBug.groovy b/src/test/groovy/bugs/ByteIndexBug.groovy
index 34df4f5b26..1e7ac1861e 100644
--- a/src/test/groovy/bugs/ByteIndexBug.groovy
+++ b/src/test/groovy/bugs/ByteIndexBug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class ByteIndexBug extends GroovyTestCase {
+
+class ByteIndexBug {
// TODO: this tests a string with 128 nulls - is that what is intended?
+ @Test
void testBug() {
def sb = new StringBuffer("\"\"\"\n")
for (j in 0..127){ // 126 is okay.
diff --git a/src/test/groovy/bugs/Bytecode2Bug.groovy b/src/test/groovy/bugs/Bytecode2Bug.groovy
index 21abb86fb8..478eec1299 100644
--- a/src/test/groovy/bugs/Bytecode2Bug.groovy
+++ b/src/test/groovy/bugs/Bytecode2Bug.groovy
@@ -18,18 +18,21 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class Bytecode2Bug extends GroovyTestCase {
+class Bytecode2Bug {
Integer count = 0
+ @Test
void testBytecodeBug() {
getCollection().each { count += it }
}
+ @Test
void testTedsBytecodeBug() {
//doTest(getCollection())
def a = [1, 2, 3, 4]
@@ -50,6 +53,7 @@ class Bytecode2Bug extends GroovyTestCase {
assert i == 5
}
+ @Test
void testTedsBytecode2Bug() {
def m = [:]
def i = 1
diff --git a/src/test/groovy/bugs/Bytecode3Bug.groovy b/src/test/groovy/bugs/Bytecode3Bug.groovy
index d1d46eae7e..3454a9b9fa 100644
--- a/src/test/groovy/bugs/Bytecode3Bug.groovy
+++ b/src/test/groovy/bugs/Bytecode3Bug.groovy
@@ -18,14 +18,16 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class Bytecode3Bug extends GroovyTestCase {
+class Bytecode3Bug {
def count
+ @Test
void testIncrementPropertyInclosure() {
def args = [1, 2, 3]
def m = [:]
diff --git a/src/test/groovy/bugs/Bytecode4Bug.groovy b/src/test/groovy/bugs/Bytecode4Bug.groovy
index 8d53f56c3e..ddc6b7b218 100644
--- a/src/test/groovy/bugs/Bytecode4Bug.groovy
+++ b/src/test/groovy/bugs/Bytecode4Bug.groovy
@@ -18,25 +18,29 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class Bytecode4Bug extends GroovyTestCase {
+class Bytecode4Bug {
def count = 0
+ @Test
void testInject() {
def x = [1, 2, 3].inject(0) { c, s -> c += s }
assert x == 6
}
+ @Test
void testUsingProperty() {
count = 0
getCollection().each { count += it }
assert count == 10
}
+ @Test
void testUsingIncrementingProperty() {
count = 0
getCollection().each { count++ }
diff --git a/src/test/groovy/bugs/Bytecode5Bug.groovy b/src/test/groovy/bugs/Bytecode5Bug.groovy
index 11cae1cab6..6621fbaea7 100644
--- a/src/test/groovy/bugs/Bytecode5Bug.groovy
+++ b/src/test/groovy/bugs/Bytecode5Bug.groovy
@@ -18,12 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class Bytecode5Bug extends GroovyTestCase {
+class Bytecode5Bug {
+ @Test
void testUsingLocalVar() {
def c = 0
getCollection().each { c += it }
diff --git a/src/test/groovy/bugs/Bytecode6Bug.groovy b/src/test/groovy/bugs/Bytecode6Bug.groovy
index b1ba984f10..fcae72d102 100644
--- a/src/test/groovy/bugs/Bytecode6Bug.groovy
+++ b/src/test/groovy/bugs/Bytecode6Bug.groovy
@@ -18,12 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class Bytecode6Bug extends GroovyTestCase {
+class Bytecode6Bug {
+ @Test
void testPostFixReturn() {
def i = 1
def closure = { i++ }
@@ -33,6 +35,7 @@ class Bytecode6Bug extends GroovyTestCase {
assert i == 2
}
+ @Test
void testPreFixReturn() {
def i = 1
def closure = { return ++i }
diff --git a/src/test/groovy/bugs/Bytecode7Bug.groovy b/src/test/groovy/bugs/Bytecode7Bug.groovy
index 8ed36aab1c..a23aa7bcb8 100644
--- a/src/test/groovy/bugs/Bytecode7Bug.groovy
+++ b/src/test/groovy/bugs/Bytecode7Bug.groovy
@@ -18,12 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class Bytecode7Bug extends GroovyTestCase {
+class Bytecode7Bug {
+ @Test
void testDuplicateVariables() {
if (true) {
def a = 123
@@ -33,6 +35,7 @@ class Bytecode7Bug extends GroovyTestCase {
}
}
+ @Test
void testDuplicateVariablesInClosures() {
def coll = [1]
diff --git a/src/test/groovy/bugs/BytecodeBug.groovy b/src/test/groovy/bugs/BytecodeBug.groovy
index a468baae2c..ff49da36db 100644
--- a/src/test/groovy/bugs/BytecodeBug.groovy
+++ b/src/test/groovy/bugs/BytecodeBug.groovy
@@ -18,12 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class BytecodeBug extends GroovyTestCase {
+class BytecodeBug {
+ @Test
void testTedsBytecodeBug() {
//def a = ['tom','dick','harry']
def a = [1, 2, 3, 4]
diff --git a/src/test/groovy/bugs/CallingClosuresWithClosuresBug.groovy b/src/test/groovy/bugs/CallingClosuresWithClosuresBug.groovy
index cdbe7a3f4f..0e756430a7 100644
--- a/src/test/groovy/bugs/CallingClosuresWithClosuresBug.groovy
+++ b/src/test/groovy/bugs/CallingClosuresWithClosuresBug.groovy
@@ -18,12 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class CallingClosuresWithClosuresBug extends GroovyTestCase {
+class CallingClosuresWithClosuresBug {
+ @Test
void testBug() {
def a = {1}
// old workaround
diff --git a/src/test/groovy/bugs/CastWhenUsingClosuresBug.groovy b/src/test/groovy/bugs/CastWhenUsingClosuresBug.groovy
index 34aa64f161..1005abf383 100644
--- a/src/test/groovy/bugs/CastWhenUsingClosuresBug.groovy
+++ b/src/test/groovy/bugs/CastWhenUsingClosuresBug.groovy
@@ -18,12 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class CastWhenUsingClosuresBug extends GroovyTestCase {
+class CastWhenUsingClosuresBug {
+ @Test
void testBug() {
def a = 1
diff --git a/src/test/groovy/bugs/ChristofsPropertyBug.groovy b/src/test/groovy/bugs/ChristofsPropertyBug.groovy
index 2716448268..a32fd590d1 100644
--- a/src/test/groovy/bugs/ChristofsPropertyBug.groovy
+++ b/src/test/groovy/bugs/ChristofsPropertyBug.groovy
@@ -18,12 +18,16 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class ChristofsPropertyBug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.shouldFail
+
+
+class ChristofsPropertyBug {
def mixedCaseProperty
+ @Test
void testChristofsPropertyBug() {
this.mixedCaseProperty = "test"
shouldFail({this.mixedcaseproperty = "test"})
diff --git a/src/test/groovy/bugs/ClassGeneratorFixesTest.groovy b/src/test/groovy/bugs/ClassGeneratorFixesTest.groovy
index 928d9daa4b..36dea0bd5c 100644
--- a/src/test/groovy/bugs/ClassGeneratorFixesTest.groovy
+++ b/src/test/groovy/bugs/ClassGeneratorFixesTest.groovy
@@ -18,10 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class ClassGeneratorFixesTest extends GroovyTestCase {
+
+class ClassGeneratorFixesTest {
def count = 0;
def pf(int p) {
@@ -29,10 +30,12 @@ class ClassGeneratorFixesTest extends GroovyTestCase {
boolean b = true
}
+ @Test
void testPrimitvesInFunc() { // groovy-373, 453, 385, 451, 199
pf(10)
}
+ @Test
void testPlusEqual() { // 372
count += 1
assert count == 1
@@ -50,6 +53,7 @@ class ClassGeneratorFixesTest extends GroovyTestCase {
println x(2.3)
}
+ @Test
void testIfAndSwitchInClosure (){ // 321, 324, 412
def a = 1
@@ -84,10 +88,12 @@ class ClassGeneratorFixesTest extends GroovyTestCase {
return
}
+ @Test
void testReturnVoid() { // groovy-405, 387
returnVoid()
}
+ @Test
void testBooleanValue() { // groovy-385
/** @todo
boolean value
diff --git a/src/test/groovy/bugs/ClassInNamedParamsBug.groovy b/src/test/groovy/bugs/ClassInNamedParamsBug.groovy
index 80bf666479..f688f33ea8 100644
--- a/src/test/groovy/bugs/ClassInNamedParamsBug.groovy
+++ b/src/test/groovy/bugs/ClassInNamedParamsBug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class ClassInNamedParamsBug extends GroovyTestCase {
+class ClassInNamedParamsBug {
+
+ @Test
void testBug() {
def foo = method(class:'cheese', name:'cheddar')
diff --git a/src/test/groovy/bugs/ClosureInClosureBug.groovy b/src/test/groovy/bugs/ClosureInClosureBug.groovy
index cdc1371c52..3763cc5bd3 100644
--- a/src/test/groovy/bugs/ClosureInClosureBug.groovy
+++ b/src/test/groovy/bugs/ClosureInClosureBug.groovy
@@ -18,7 +18,8 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
* Bug illustrating the nested closures variable scope visibility issue.
@@ -31,8 +32,9 @@ import groovy.test.GroovyTestCase
*
* @authour Guillaume Laforge
*/
-class ClosureInClosureBug extends GroovyTestCase {
+class ClosureInClosureBug {
+ @Test
void testInvisibleVariable() {
def text = "test "
diff --git a/src/test/groovy/bugs/ClosureTypedVariableBug.groovy b/src/test/groovy/bugs/ClosureTypedVariableBug.groovy
index 58f0535b96..58e4861cc3 100644
--- a/src/test/groovy/bugs/ClosureTypedVariableBug.groovy
+++ b/src/test/groovy/bugs/ClosureTypedVariableBug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class ClosureTypedVariableBug extends GroovyTestCase {
+class ClosureTypedVariableBug {
+
+ @Test
void testBug2() {
def count = makeClosure(0)
assert count == 1
@@ -43,6 +45,7 @@ class ClosureTypedVariableBug extends GroovyTestCase {
return count
}
+ @Test
void testBug() {
Integer count = 0
def closure = { count = it }
@@ -50,6 +53,7 @@ class ClosureTypedVariableBug extends GroovyTestCase {
assert count == 1
}
+ @Test
void testBug3() {
def closure = getElementClosure("p")
def answer = closure("b")
@@ -68,6 +72,7 @@ class ClosureTypedVariableBug extends GroovyTestCase {
}
}
+ @Test
void testDoubleSlotReference() {
// there was a bug that the local variable index
// was wrong set for a closure shared variable.
diff --git a/src/test/groovy/bugs/ClosureVariableBug.groovy b/src/test/groovy/bugs/ClosureVariableBug.groovy
index eba3ff841f..20110ad146 100644
--- a/src/test/groovy/bugs/ClosureVariableBug.groovy
+++ b/src/test/groovy/bugs/ClosureVariableBug.groovy
@@ -18,12 +18,16 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
/**
*/
-class ClosureVariableBug extends GroovyTestCase {
+class ClosureVariableBug {
+ @Test
void testClosurePassingBug() {
def count = 0
def closure = { assert count == it }
@@ -33,6 +37,7 @@ class ClosureVariableBug extends GroovyTestCase {
closure(1)
}
+ @Test
void testPassingClosureAsNamedParameter() {
def x = 123
@@ -44,6 +49,7 @@ class ClosureVariableBug extends GroovyTestCase {
assert value == 123
}
+ @Test
void testBug() {
def value = callClosure([1, 2])
assert value == 2
@@ -58,6 +64,7 @@ class ClosureVariableBug extends GroovyTestCase {
return x
}
+ @Test
void testLocalVariableWithPrimitiveType() {
assertScript """
int x
diff --git a/src/test/groovy/bugs/ClosureWithBitwiseDefaultParamTest.groovy b/src/test/groovy/bugs/ClosureWithBitwiseDefaultParamTest.groovy
index e2606a1795..e19628e5af 100644
--- a/src/test/groovy/bugs/ClosureWithBitwiseDefaultParamTest.groovy
+++ b/src/test/groovy/bugs/ClosureWithBitwiseDefaultParamTest.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class ClosureWithBitwiseDefaultParamTest extends GroovyTestCase {
+
+class ClosureWithBitwiseDefaultParamTest {
+ @Test
void testAmbiguousStuff() {
def c = { x, y = 1 | 2, z = 0->
println x
diff --git a/src/test/groovy/bugs/ConstructorBug.groovy b/src/test/groovy/bugs/ConstructorBug.groovy
index 389a792918..c4e041d853 100644
--- a/src/test/groovy/bugs/ConstructorBug.groovy
+++ b/src/test/groovy/bugs/ConstructorBug.groovy
@@ -18,11 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.runtime.InvokerHelper
+import org.junit.jupiter.api.Test
-class ConstructorBug extends GroovyTestCase {
+class ConstructorBug {
+ @Test
void testBug() {
def type = new GroovyClassLoader().parseClass(new File("src/test/groovy/bugs/TestBase.groovy"))
assert type != null
diff --git a/src/test/groovy/bugs/ConstructorParameterBug.groovy b/src/test/groovy/bugs/ConstructorParameterBug.groovy
index d63bbd6fd3..0f8a81d560 100644
--- a/src/test/groovy/bugs/ConstructorParameterBug.groovy
+++ b/src/test/groovy/bugs/ConstructorParameterBug.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -54,6 +54,6 @@ final class ConstructorParameterBug {
}
}
'''
- assert err =~ / Cannot reference 'baz' before supertype constructor has been called. /
+ assert err.message =~ / Cannot reference 'baz' before supertype constructor has been called. /
}
}
diff --git a/src/test/groovy/bugs/ConstructorThisCallBug.groovy b/src/test/groovy/bugs/ConstructorThisCallBug.groovy
index 26299143bd..2d07b9ce0b 100644
--- a/src/test/groovy/bugs/ConstructorThisCallBug.groovy
+++ b/src/test/groovy/bugs/ConstructorThisCallBug.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -88,7 +88,7 @@ final class ConstructorThisCallBug {
Base(String arg) {}
}
'''
- assert err =~ / Cannot reference 'getData' before supertype constructor has been called. /
+ assert err.message =~ / Cannot reference 'getData' before supertype constructor has been called. /
}
@Test
@@ -102,7 +102,7 @@ final class ConstructorThisCallBug {
}
}
'''
- assert err =~ / Cannot reference 'getData' before supertype constructor has been called. /
+ assert err.message =~ / Cannot reference 'getData' before supertype constructor has been called. /
}
@Test
@@ -126,7 +126,7 @@ final class ConstructorThisCallBug {
Outer.a = 'ok'
assert o.test() == 'ok'
'''
- assert err =~ / Cannot reference 'myA' before supertype constructor has been called. /
+ assert err.message =~ / Cannot reference 'myA' before supertype constructor has been called. /
}
//
diff --git a/src/test/groovy/bugs/CustomMetaClassTest.groovy b/src/test/groovy/bugs/CustomMetaClassTest.groovy
index c798ef2357..6153eda1ce 100644
--- a/src/test/groovy/bugs/CustomMetaClassTest.groovy
+++ b/src/test/groovy/bugs/CustomMetaClassTest.groovy
@@ -18,13 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
-class CustomMetaClassTest extends GroovyTestCase {
+class CustomMetaClassTest {
- @Override
- protected void setUp() {
- super.setUp()
+ @BeforeEach
+ void setUp() {
ExpandoMetaClass.disableGlobally()
@@ -34,6 +34,7 @@ class CustomMetaClassTest extends GroovyTestCase {
reg.removeMetaClass(this.metaClass.class)
}
+ @Test
void testReplaceMetaClass() {
/*
* Constructing first instance before metaclass replacement
@@ -68,11 +69,13 @@ class CustomMetaClassTest extends GroovyTestCase {
assert stored instanceof MetaClassImpl
}
+ @Test
void testNormalCreated() {
assert groovy.runtime.metaclass.bugs.CustomMetaClassTestMetaClass == metaClass.class
assert MetaClassImpl == metaClass.delegate.class
}
+ @Test
void testEmcCreated() {
GroovySystem.metaClassRegistry.removeMetaClass metaClass.theClass
ExpandoMetaClass.enableGlobally()
@@ -87,6 +90,7 @@ class CustomMetaClassTest extends GroovyTestCase {
assert groovy.runtime.metaclass.bugs.CustomMetaClassTestMetaClass == getMetaClass().delegate.class
}
+ @Test
void testStaticMetaClass() {
// Custom metaclass created
assert groovy.runtime.metaclass.bugs.CustomMetaClassTestMetaClass == metaClass.class
diff --git a/src/test/groovy/bugs/DefVariableBug.groovy b/src/test/groovy/bugs/DefVariableBug.groovy
index aa42d774f8..fe330e33c5 100644
--- a/src/test/groovy/bugs/DefVariableBug.groovy
+++ b/src/test/groovy/bugs/DefVariableBug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class DefVariableBug extends GroovyTestCase {
+class DefVariableBug {
+
+ @Test
void testBug() {
/* cpoirier - "def" can be referred as a variable name,
diff --git a/src/test/groovy/bugs/DirectMethodCallWithVargsTest.groovy b/src/test/groovy/bugs/DirectMethodCallWithVargsTest.groovy
index 1cefd9e77e..0bbbf4baea 100644
--- a/src/test/groovy/bugs/DirectMethodCallWithVargsTest.groovy
+++ b/src/test/groovy/bugs/DirectMethodCallWithVargsTest.groovy
@@ -22,7 +22,7 @@ import org.codehaus.groovy.ast.ClassCodeVisitorSupport
import org.codehaus.groovy.ast.MethodNode
import org.codehaus.groovy.ast.expr.MethodCallExpression
import org.codehaus.groovy.control.SourceUnit
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/ForLoopBug.groovy b/src/test/groovy/bugs/ForLoopBug.groovy
index 531c088e2c..1daa4b48f0 100644
--- a/src/test/groovy/bugs/ForLoopBug.groovy
+++ b/src/test/groovy/bugs/ForLoopBug.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class ForLoopBug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class ForLoopBug {
+
+ @Test
void testBug() {
assertScript """
def list = []
@@ -34,6 +38,7 @@ class ForLoopBug extends GroovyTestCase {
"""
}
+ @Test
void testSeansBug() {
assertScript """
for (i in 1..10) {
@@ -42,6 +47,7 @@ class ForLoopBug extends GroovyTestCase {
"""
}
+ @Test
void testNormalMethod() {
def list = []
def a = 1
@@ -52,6 +58,7 @@ class ForLoopBug extends GroovyTestCase {
assert list == [1, 2, 3, 4, 5]
}
+ @Test
void testBytecodeGenBug() {
def a = 1
def b = 5
@@ -64,6 +71,7 @@ class ForLoopBug extends GroovyTestCase {
assert a == 5
}
+ @Test
void testVisibility() {
assertScript """
def array = [ true, true, true ];
diff --git a/src/test/groovy/bugs/FullyQualifiedClassBug.groovy b/src/test/groovy/bugs/FullyQualifiedClassBug.groovy
index 72af3c8098..98e7598dad 100644
--- a/src/test/groovy/bugs/FullyQualifiedClassBug.groovy
+++ b/src/test/groovy/bugs/FullyQualifiedClassBug.groovy
@@ -18,12 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class FullyQualifiedClassBug extends GroovyTestCase {
+class FullyQualifiedClassBug {
+ @Test
void testBug() {
java.lang.System.err.println("Hello world")
}
diff --git a/src/test/groovy/bugs/FullyQualifiedMethodReturnTypeBug.groovy b/src/test/groovy/bugs/FullyQualifiedMethodReturnTypeBug.groovy
index 14bbefff18..4efd9f668b 100644
--- a/src/test/groovy/bugs/FullyQualifiedMethodReturnTypeBug.groovy
+++ b/src/test/groovy/bugs/FullyQualifiedMethodReturnTypeBug.groovy
@@ -18,12 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class FullyQualifiedMethodReturnTypeBug extends GroovyTestCase {
+class FullyQualifiedMethodReturnTypeBug {
+ @Test
void testBug() {
def s = foo()
assert s.length() == 3
diff --git a/src/test/groovy/bugs/FullyQualifiedVariableTypeBug.groovy b/src/test/groovy/bugs/FullyQualifiedVariableTypeBug.groovy
index 3b14129bd6..c384366fca 100644
--- a/src/test/groovy/bugs/FullyQualifiedVariableTypeBug.groovy
+++ b/src/test/groovy/bugs/FullyQualifiedVariableTypeBug.groovy
@@ -18,12 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class FullyQualifiedVariableTypeBug extends GroovyTestCase {
+class FullyQualifiedVariableTypeBug {
+ @Test
void testBug() {
java.lang.String s = "hey"
assert s.length() == 3
diff --git a/src/test/groovy/bugs/GetterBug.groovy b/src/test/groovy/bugs/GetterBug.groovy
index ee8471493b..d2905a8360 100644
--- a/src/test/groovy/bugs/GetterBug.groovy
+++ b/src/test/groovy/bugs/GetterBug.groovy
@@ -18,11 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class GetterBug extends GroovyTestCase {
+class GetterBug {
String foo
def bar
@@ -38,6 +39,7 @@ class GetterBug extends GroovyTestCase {
this.foo = foo
}
+ @Test
void testTypedGetterAndSetter() {
def value = getFoo()
@@ -62,6 +64,7 @@ class GetterBug extends GroovyTestCase {
}
+ @Test
void testUntypedGetterAndSetter() {
def value = getBar()
diff --git a/src/test/groovy/bugs/Groovy10094.groovy b/src/test/groovy/bugs/Groovy10094.groovy
index 2dbb11ff02..5d8c3d5c00 100644
--- a/src/test/groovy/bugs/Groovy10094.groovy
+++ b/src/test/groovy/bugs/Groovy10094.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.shouldFail
@@ -35,7 +35,7 @@ final class Groovy10094 {
}
'''
- assert err =~ /Cannot assign value of type java.lang.String to variable of type int/
+ assert err.message =~ /Cannot assign value of type java.lang.String to variable of type int/
}
@Test
@@ -49,7 +49,7 @@ final class Groovy10094 {
}
'''
- assert err =~ /Cannot assign value of type java.lang.String to variable of type int/
+ assert err.message =~ /Cannot assign value of type java.lang.String to variable of type int/
}
@Test
@@ -62,6 +62,6 @@ final class Groovy10094 {
}
'''
- assert err =~ /Cannot assign value of type java.lang.String to variable of type int/
+ assert err.message =~ /Cannot assign value of type java.lang.String to variable of type int/
}
}
diff --git a/src/test/groovy/bugs/Groovy10113.groovy b/src/test/groovy/bugs/Groovy10113.groovy
index 23ee1861f0..77ef5c3617 100644
--- a/src/test/groovy/bugs/Groovy10113.groovy
+++ b/src/test/groovy/bugs/Groovy10113.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -31,7 +31,7 @@ final class Groovy10113 {
class C<T extends T> {
}
'''
- assert err =~ /Cycle detected: the type T cannot extend.implement itself or one of its own member types/
+ assert err.message =~ /Cycle detected: the type T cannot extend.implement itself or one of its own member types/
}
@Test
@@ -41,7 +41,7 @@ final class Groovy10113 {
}
'''
// TODO: ^ error is here but refers to T; is there a way to move the error or improve it
- assert err =~ /Cycle detected: the type T cannot extend.implement itself or one of its own member types/
+ assert err.message =~ /Cycle detected: the type T cannot extend.implement itself or one of its own member types/
}
@Test // GROOVY-10125
@@ -61,7 +61,7 @@ final class Groovy10113 {
}
}
'''
- assert err =~ /Cycle detected: the type C cannot extend.implement itself or one of its own member types/
+ assert err.message =~ /Cycle detected: the type C cannot extend.implement itself or one of its own member types/
}
@Test
@@ -74,7 +74,7 @@ final class Groovy10113 {
class D extends C.Inner {
}
'''
- assert err =~ /Cycle detected: a cycle exists in the type hierarchy between D and C/
+ assert err.message =~ /Cycle detected: a cycle exists in the type hierarchy between D and C/
}
@Test
@@ -85,7 +85,7 @@ final class Groovy10113 {
}
}
'''
- assert err =~ /Cycle detected: the type C cannot extend.implement itself or one of its own member types/
+ assert err.message =~ /Cycle detected: the type C cannot extend.implement itself or one of its own member types/
}
@Test
@@ -98,7 +98,7 @@ final class Groovy10113 {
class D implements C.I {
}
'''
- assert err =~ /Cycle detected: a cycle exists in the type hierarchy between D and C/
+ assert err.message =~ /Cycle detected: a cycle exists in the type hierarchy between D and C/
}
@Test
@@ -109,6 +109,6 @@ final class Groovy10113 {
class B extends A {
}
'''
- assert err =~ /Cycle detected: a cycle exists in the type hierarchy between B and A/
+ assert err.message =~ /Cycle detected: a cycle exists in the type hierarchy between B and A/
}
}
diff --git a/src/test/groovy/bugs/Groovy10133.groovy b/src/test/groovy/bugs/Groovy10133.groovy
index db400eafdd..ad55abd219 100644
--- a/src/test/groovy/bugs/Groovy10133.groovy
+++ b/src/test/groovy/bugs/Groovy10133.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -254,7 +254,7 @@ final class Groovy10133 {
}
}
'''
- assert err =~ /The variable \[x\] is undeclared/
+ assert err.message =~ /The variable \[x\] is undeclared/
err = shouldFail '''
class C {
@@ -266,6 +266,6 @@ final class Groovy10133 {
}
}
'''
- assert err =~ /No such property: x for class: C/
+ assert err.message =~ /No such property: x for class: C/
}
}
diff --git a/src/test/groovy/bugs/Groovy10143.groovy b/src/test/groovy/bugs/Groovy10143.groovy
index 391aeaface..164674e04e 100644
--- a/src/test/groovy/bugs/Groovy10143.groovy
+++ b/src/test/groovy/bugs/Groovy10143.groovy
@@ -22,7 +22,7 @@ import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilationUnit
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class Groovy10143 {
@Test
diff --git a/src/test/groovy/bugs/Groovy1018_Bug.groovy b/src/test/groovy/bugs/Groovy1018_Bug.groovy
index 22db82888a..9f2d4e6a8e 100644
--- a/src/test/groovy/bugs/Groovy1018_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy1018_Bug.groovy
@@ -18,7 +18,8 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
* Test to fix the Jira issues GROOVY-1018 and GROOVY-732.
@@ -26,11 +27,12 @@ import groovy.test.GroovyTestCase
* ClassName.fieldName or ClassName.@fieldName.
*/
-class Groovy1018_Bug extends GroovyTestCase {
+class Groovy1018_Bug {
public static Object Class = "bar"
// GROOVY-1018
+ @Test
void testGetPublicStaticField() {
Groovy1018_Bug.Class = 'bar'
def a = new Groovy1018_Bug()
@@ -39,6 +41,7 @@ class Groovy1018_Bug extends GroovyTestCase {
}
// GROOVY-732
+ @Test
void testSetPublicStaticField() {
Groovy1018_Bug.Class = 'bar-'
assert Groovy1018_Bug.Class == "bar-" && Groovy1018_Bug.@Class == "bar-"
diff --git a/src/test/groovy/bugs/Groovy10191.groovy b/src/test/groovy/bugs/Groovy10191.groovy
index a66f48970a..ae940f3184 100644
--- a/src/test/groovy/bugs/Groovy10191.groovy
+++ b/src/test/groovy/bugs/Groovy10191.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10199.groovy b/src/test/groovy/bugs/Groovy10199.groovy
index e9493b9cfa..aa393a8e8b 100644
--- a/src/test/groovy/bugs/Groovy10199.groovy
+++ b/src/test/groovy/bugs/Groovy10199.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10236.groovy b/src/test/groovy/bugs/Groovy10236.groovy
index c9480a34a7..2dea972253 100644
--- a/src/test/groovy/bugs/Groovy10236.groovy
+++ b/src/test/groovy/bugs/Groovy10236.groovy
@@ -19,7 +19,7 @@
package bugs
import groovy.transform.CompileStatic
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10281.groovy b/src/test/groovy/bugs/Groovy10281.groovy
index 9f59928d44..e99f4a8ae2 100644
--- a/src/test/groovy/bugs/Groovy10281.groovy
+++ b/src/test/groovy/bugs/Groovy10281.groovy
@@ -22,7 +22,7 @@ import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilationUnit
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.Phases
-import org.junit.Test
+import org.junit.jupiter.api.Test
@CompileStatic
final class Groovy10281 {
diff --git a/src/test/groovy/bugs/Groovy10302.groovy b/src/test/groovy/bugs/Groovy10302.groovy
index 6f5fefe967..4a9ceffdc7 100644
--- a/src/test/groovy/bugs/Groovy10302.groovy
+++ b/src/test/groovy/bugs/Groovy10302.groovy
@@ -18,11 +18,11 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.isAtLeastJdk
-import static org.junit.Assert.fail
+import static org.junit.jupiter.api.Assertions.fail
final class Groovy10302 {
diff --git a/src/test/groovy/bugs/Groovy10303.groovy b/src/test/groovy/bugs/Groovy10303.groovy
index a54ed531fe..f9618df212 100644
--- a/src/test/groovy/bugs/Groovy10303.groovy
+++ b/src/test/groovy/bugs/Groovy10303.groovy
@@ -19,7 +19,7 @@
package bugs
import org.codehaus.groovy.control.CompilerConfiguration
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class Groovy10303 {
@Test
diff --git a/src/test/groovy/bugs/Groovy10305.groovy b/src/test/groovy/bugs/Groovy10305.groovy
index db2a9b5d25..fa3f26e728 100644
--- a/src/test/groovy/bugs/Groovy10305.groovy
+++ b/src/test/groovy/bugs/Groovy10305.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10381.groovy b/src/test/groovy/bugs/Groovy10381.groovy
index 568bb9b87c..12dcc6b2b3 100644
--- a/src/test/groovy/bugs/Groovy10381.groovy
+++ b/src/test/groovy/bugs/Groovy10381.groovy
@@ -20,7 +20,7 @@ package bugs
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -72,7 +72,7 @@ final class Groovy10381 {
}
}
'''
- assert err =~ /class C inherits unrelated defaults for void m\(java.lang.String\) from types A and B/
+ assert err.message =~ /class C inherits unrelated defaults for void m\(java.lang.String\) from types A and B/
}
@Test
@@ -94,7 +94,7 @@ final class Groovy10381 {
}
}
'''
- assert err =~ /class C inherits unrelated defaults for void m\(java.lang.String\) from types BaseA and BaseB/
+ assert err.message =~ /class C inherits unrelated defaults for void m\(java.lang.String\) from types BaseA and BaseB/
}
@Test
@@ -120,7 +120,7 @@ final class Groovy10381 {
}
}
'''
- assert err =~ /class C inherits unrelated defaults for void m\(java.lang.String\) from types A and B/
+ assert err.message =~ /class C inherits unrelated defaults for void m\(java.lang.String\) from types A and B/
}
@Test
@@ -138,7 +138,7 @@ final class Groovy10381 {
}
}
'''
- assert err =~ /interface C inherits unrelated defaults for void m\(java.lang.String\) from types A and B/
+ assert err.message =~ /interface C inherits unrelated defaults for void m\(java.lang.String\) from types A and B/
}
@Test
diff --git a/src/test/groovy/bugs/Groovy10461.groovy b/src/test/groovy/bugs/Groovy10461.groovy
index a99169f22c..8079eafa72 100644
--- a/src/test/groovy/bugs/Groovy10461.groovy
+++ b/src/test/groovy/bugs/Groovy10461.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10466.groovy b/src/test/groovy/bugs/Groovy10466.groovy
index 572e175e1c..3073f166d4 100644
--- a/src/test/groovy/bugs/Groovy10466.groovy
+++ b/src/test/groovy/bugs/Groovy10466.groovy
@@ -20,7 +20,7 @@ package bugs
import org.codehaus.groovy.control.CompilationUnit
import org.codehaus.groovy.control.CompilerConfiguration
-import org.junit.Test
+import org.junit.jupiter.api.Test
class Groovy10466 {
diff --git a/src/test/groovy/bugs/Groovy10467.groovy b/src/test/groovy/bugs/Groovy10467.groovy
index 680963be6b..6dbccae101 100644
--- a/src/test/groovy/bugs/Groovy10467.groovy
+++ b/src/test/groovy/bugs/Groovy10467.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10478.groovy b/src/test/groovy/bugs/Groovy10478.groovy
index 8a02ed55fa..4c14604ef8 100644
--- a/src/test/groovy/bugs/Groovy10478.groovy
+++ b/src/test/groovy/bugs/Groovy10478.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10535.groovy b/src/test/groovy/bugs/Groovy10535.groovy
index 78e7d8a457..c1ed9b2ec8 100644
--- a/src/test/groovy/bugs/Groovy10535.groovy
+++ b/src/test/groovy/bugs/Groovy10535.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10587.groovy b/src/test/groovy/bugs/Groovy10587.groovy
index 32cce309d7..ce8a4df12a 100644
--- a/src/test/groovy/bugs/Groovy10587.groovy
+++ b/src/test/groovy/bugs/Groovy10587.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy1059_Bug.groovy b/src/test/groovy/bugs/Groovy1059_Bug.groovy
index acd70e6aef..31e71428b8 100644
--- a/src/test/groovy/bugs/Groovy1059_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy1059_Bug.groovy
@@ -18,7 +18,8 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
* GROOVY-1059
@@ -34,8 +35,9 @@ import groovy.test.GroovyTestCase
* have the same meaning.
*/
-class Groovy1059_Bug extends GroovyTestCase {
+class Groovy1059_Bug {
+ @Test
void testClosureAsAttribute() {
def x = new Groovy1059Foo()
diff --git a/src/test/groovy/bugs/Groovy10612.groovy b/src/test/groovy/bugs/Groovy10612.groovy
index d8339b2375..e34937a403 100644
--- a/src/test/groovy/bugs/Groovy10612.groovy
+++ b/src/test/groovy/bugs/Groovy10612.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10659.groovy b/src/test/groovy/bugs/Groovy10659.groovy
index 846aceb157..7f7e70a0b6 100644
--- a/src/test/groovy/bugs/Groovy10659.groovy
+++ b/src/test/groovy/bugs/Groovy10659.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10676.groovy b/src/test/groovy/bugs/Groovy10676.groovy
index bc4bf6b359..cb5f94b3e2 100644
--- a/src/test/groovy/bugs/Groovy10676.groovy
+++ b/src/test/groovy/bugs/Groovy10676.groovy
@@ -19,7 +19,7 @@
package bugs
import org.codehaus.groovy.tools.ErrorReporter
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class Groovy10676 {
@Test
diff --git a/src/test/groovy/bugs/Groovy10700.groovy b/src/test/groovy/bugs/Groovy10700.groovy
index d729cb6029..e5ec1965a6 100644
--- a/src/test/groovy/bugs/Groovy10700.groovy
+++ b/src/test/groovy/bugs/Groovy10700.groovy
@@ -20,7 +20,7 @@ package bugs
import org.codehaus.groovy.control.CompilationUnit
import org.codehaus.groovy.control.CompilerConfiguration
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10770.groovy b/src/test/groovy/bugs/Groovy10770.groovy
index 6ad0534e61..ff8ee8a29d 100644
--- a/src/test/groovy/bugs/Groovy10770.groovy
+++ b/src/test/groovy/bugs/Groovy10770.groovy
@@ -19,7 +19,7 @@
package bugs
import groovy.test.NotYetImplemented
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -44,7 +44,7 @@ final class Groovy10770 {
}
}
'''
- assert err =~ /The variable .bar. is undeclared/
+ assert err.message =~ /The variable .bar. is undeclared/
}
@Test
@@ -59,7 +59,7 @@ final class Groovy10770 {
}
}
'''
- assert err =~ /No such property: baz for class: java.lang.String/
+ assert err.message =~ /No such property: baz for class: java.lang.String/
}
@Test
@@ -94,7 +94,7 @@ final class Groovy10770 {
def c = new C()
def d = new C.D(c)
'''
- assert err =~ /Access to java.lang.String#baz is forbidden/ // passes STC but fails during compilation
+ assert err.message =~ /Access to java.lang.String#baz is forbidden/ // passes STC but fails during compilation
}
@Test
@@ -112,7 +112,7 @@ final class Groovy10770 {
def c = new C()
def d = new C.D(c)
'''
- assert err =~ /Access to java.lang.String#baz is forbidden/ // passes STC but fails during compilation
+ assert err.message =~ /Access to java.lang.String#baz is forbidden/ // passes STC but fails during compilation
}
@Test @NotYetImplemented
@@ -130,7 +130,7 @@ final class Groovy10770 {
def c = new C()
def d = new C.D(c)
'''
- assert err =~ /Access to java.lang.String#baz is forbidden/ // passes STC but fails during compilation
+ assert err.message =~ /Access to java.lang.String#baz is forbidden/ // passes STC but fails during compilation
}
@Test // annotate method
diff --git a/src/test/groovy/bugs/Groovy1081_Bug.groovy b/src/test/groovy/bugs/Groovy1081_Bug.groovy
index 292155c611..7fd3ce3a4d 100644
--- a/src/test/groovy/bugs/Groovy1081_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy1081_Bug.groovy
@@ -18,15 +18,19 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
+import static org.junit.jupiter.api.Assertions.assertTrue
+
/**
* Verifies that DefaultGroovyMethods.transformLine(Reader, Writer, Closure)
* actually writes its output.
*/
-class Groovy1081_Bug extends GroovyTestCase {
+class Groovy1081_Bug {
+ @Test
void testShort() {
def reader = new StringReader('abc')
def writer = new StringWriter()
diff --git a/src/test/groovy/bugs/Groovy10920.groovy b/src/test/groovy/bugs/Groovy10920.groovy
index 78669fdb08..58117bea16 100644
--- a/src/test/groovy/bugs/Groovy10920.groovy
+++ b/src/test/groovy/bugs/Groovy10920.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10962.groovy b/src/test/groovy/bugs/Groovy10962.groovy
index 47f6b436fc..b76457af7b 100644
--- a/src/test/groovy/bugs/Groovy10962.groovy
+++ b/src/test/groovy/bugs/Groovy10962.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy10998.groovy b/src/test/groovy/bugs/Groovy10998.groovy
index aebe93287e..6f35d71bb4 100644
--- a/src/test/groovy/bugs/Groovy10998.groovy
+++ b/src/test/groovy/bugs/Groovy10998.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -30,7 +30,7 @@ final class Groovy10998 {
def err = shouldFail '''
def <T extends T> void test() {}
'''
- assert err =~ /Cycle detected: the type T cannot extend.implement itself or one of its own member types/
+ assert err.message =~ /Cycle detected: the type T cannot extend.implement itself or one of its own member types/
}
@Test
@@ -38,7 +38,7 @@ final class Groovy10998 {
def err = shouldFail '''
def <T extends U, U extends T> void test() {}
'''
- assert err =~ /Cycle detected: the type T cannot extend.implement itself or one of its own member types/
+ assert err.message =~ /Cycle detected: the type T cannot extend.implement itself or one of its own member types/
}
@Test
diff --git a/src/test/groovy/bugs/Groovy11046.groovy b/src/test/groovy/bugs/Groovy11046.groovy
index 0c3268c91b..b960f6b2d4 100644
--- a/src/test/groovy/bugs/Groovy11046.groovy
+++ b/src/test/groovy/bugs/Groovy11046.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -44,7 +44,7 @@ final class Groovy11046 {
log = org.apache.logging.log4j.LogManager.getLogger(getClass()) //XXX
'''
assert err instanceof NoClassDefFoundError // CompilationFailedException (previously)
- assert err =~ /com.lmax.disruptor.EventTranslatorVararg/
+ assert err.message =~ /com.lmax.disruptor.EventTranslatorVararg/
assert err.asString() =~ /at org.apache.logging.log4j.LogManager.getLogger\(/ : 'script should have failed at runtime'
}
}
diff --git a/src/test/groovy/bugs/Groovy11062.groovy b/src/test/groovy/bugs/Groovy11062.groovy
index e50126ced1..e5949fede5 100644
--- a/src/test/groovy/bugs/Groovy11062.groovy
+++ b/src/test/groovy/bugs/Groovy11062.groovy
@@ -22,7 +22,7 @@ import groovy.transform.AnnotationCollector
import groovy.transform.CompileStatic
import groovy.transform.NullCheck
import groovy.transform.RecordType
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy11196.groovy b/src/test/groovy/bugs/Groovy11196.groovy
index 2d3eceb619..463e463ef4 100644
--- a/src/test/groovy/bugs/Groovy11196.groovy
+++ b/src/test/groovy/bugs/Groovy11196.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class Groovy11196 {
diff --git a/src/test/groovy/bugs/Groovy11203.groovy b/src/test/groovy/bugs/Groovy11203.groovy
index fe882635a3..1f758ab172 100644
--- a/src/test/groovy/bugs/Groovy11203.groovy
+++ b/src/test/groovy/bugs/Groovy11203.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.shouldFail
diff --git a/src/test/groovy/bugs/Groovy11250.groovy b/src/test/groovy/bugs/Groovy11250.groovy
index 7f77789bf2..8a17aff615 100644
--- a/src/test/groovy/bugs/Groovy11250.groovy
+++ b/src/test/groovy/bugs/Groovy11250.groovy
@@ -20,7 +20,7 @@ package bugs
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class Groovy11250 {
diff --git a/src/test/groovy/bugs/Groovy11265.groovy b/src/test/groovy/bugs/Groovy11265.groovy
index 0eea02a6e1..defe4fc2bc 100644
--- a/src/test/groovy/bugs/Groovy11265.groovy
+++ b/src/test/groovy/bugs/Groovy11265.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy11272.groovy b/src/test/groovy/bugs/Groovy11272.groovy
index 237359d66c..77404555b6 100644
--- a/src/test/groovy/bugs/Groovy11272.groovy
+++ b/src/test/groovy/bugs/Groovy11272.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy11292.groovy b/src/test/groovy/bugs/Groovy11292.groovy
index afdb025b01..3b5c3dfd09 100644
--- a/src/test/groovy/bugs/Groovy11292.groovy
+++ b/src/test/groovy/bugs/Groovy11292.groovy
@@ -20,7 +20,7 @@ package bugs
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy11293.groovy b/src/test/groovy/bugs/Groovy11293.groovy
index 37ee96e9d0..7760b7839b 100644
--- a/src/test/groovy/bugs/Groovy11293.groovy
+++ b/src/test/groovy/bugs/Groovy11293.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy1407_Bug.groovy b/src/test/groovy/bugs/Groovy1407_Bug.groovy
index b0a8f09ed3..84182564a7 100644
--- a/src/test/groovy/bugs/Groovy1407_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy1407_Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy1407_Bug extends GroovyTestCase {
+
+class Groovy1407_Bug {
+ @Test
void testGPathOnMultiKeyMap(){
// each key is a two-element String list
// each value is a two-element integer list
@@ -32,6 +34,7 @@ class Groovy1407_Bug extends GroovyTestCase {
assert expected == actual
}
+ @Test
void testGPathOnMultiValueMap(){
// each key is a two-element String list
// each value is a two-element integer list
diff --git a/src/test/groovy/bugs/Groovy1462_Bug.groovy b/src/test/groovy/bugs/Groovy1462_Bug.groovy
index 906fab6f88..4d333b5799 100644
--- a/src/test/groovy/bugs/Groovy1462_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy1462_Bug.groovy
@@ -18,14 +18,16 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
* Verifies that the Groovy parser can accept quoted methods.
*/
-class Groovy1462_Bug extends GroovyTestCase {
+class Groovy1462_Bug {
+ @Test
void testShort() {
def smn = new StringMethodName()
assert smn.foo0() == 'foo0'
diff --git a/src/test/groovy/bugs/Groovy1465.groovy b/src/test/groovy/bugs/Groovy1465.groovy
index f0a153d010..04dc56fc93 100644
--- a/src/test/groovy/bugs/Groovy1465.groovy
+++ b/src/test/groovy/bugs/Groovy1465.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.shouldFail
@@ -26,7 +26,7 @@ final class Groovy1465 {
private static void compileAndVerifyCyclicInheritenceCompilationError(String sourceCode) {
def err = shouldFail(sourceCode)
- assert err =~ /Cycle detected/
+ assert err.message =~ /Cycle detected/
}
@Test
diff --git a/src/test/groovy/bugs/Groovy1567.java b/src/test/groovy/bugs/Groovy1567.java
index 5cb008c33f..c104970caa 100644
--- a/src/test/groovy/bugs/Groovy1567.java
+++ b/src/test/groovy/bugs/Groovy1567.java
@@ -21,7 +21,7 @@ package bugs;
import groovy.lang.Binding;
import groovy.lang.GroovyShell;
import groovy.util.GroovyScriptEngine;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.File;
diff --git a/src/test/groovy/bugs/Groovy1593.groovy b/src/test/groovy/bugs/Groovy1593.groovy
index 1c6659ba76..99ef8c4373 100644
--- a/src/test/groovy/bugs/Groovy1593.groovy
+++ b/src/test/groovy/bugs/Groovy1593.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy1593 extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertNull
+
+
+class Groovy1593 {
+ @Test
void testPropertyAccessInSubClassOfHashMap() {
def subclass = new SubClassOfHashMap()
// any of the following caused a MPE previously
diff --git a/src/test/groovy/bugs/Groovy1617_Bug.groovy b/src/test/groovy/bugs/Groovy1617_Bug.groovy
index d77fe4c9f9..d2b9304596 100644
--- a/src/test/groovy/bugs/Groovy1617_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy1617_Bug.groovy
@@ -18,15 +18,18 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy1617_Bug extends GroovyTestCase {
+
+class Groovy1617_Bug {
+ @Test
void testCoerceStringIntoStringArray() {
def expected = ["G","r","o","o","v","y"] as String[]
def actual = "Groovy" as String[]
assert expected == actual
}
+ @Test
void testCoerceGStringIntoStringArray() {
def expected = ["G","r","o","o","v","y"] as String[]
def a = "Gro"
diff --git a/src/test/groovy/bugs/Groovy1706_Bug.groovy b/src/test/groovy/bugs/Groovy1706_Bug.groovy
index c09dd930d9..ff3a41684c 100644
--- a/src/test/groovy/bugs/Groovy1706_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy1706_Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy1706_Bug extends GroovyTestCase {
+
+class Groovy1706_Bug {
+ @Test
void testStaticMethodIsCalledFromSubclass() {
// disclaimer: static methods shouldn't be
// called on instances
@@ -30,6 +32,7 @@ class Groovy1706_Bug extends GroovyTestCase {
assert "B" == b.doit()
}
+ @Test
void testStaticMethodIsCalledInCorrectInstance() {
// disclaimer: static methods shouldn't be
// called on instances
diff --git a/src/test/groovy/bugs/Groovy1759.groovy b/src/test/groovy/bugs/Groovy1759.groovy
index 57355b71c7..b067156689 100644
--- a/src/test/groovy/bugs/Groovy1759.groovy
+++ b/src/test/groovy/bugs/Groovy1759.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class Groovy1759 {
diff --git a/src/test/groovy/bugs/Groovy2271Bug.groovy b/src/test/groovy/bugs/Groovy2271Bug.groovy
index bdd5c95da7..0499b40645 100644
--- a/src/test/groovy/bugs/Groovy2271Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2271Bug.groovy
@@ -19,9 +19,10 @@
package bugs
import groovy.mock.interceptor.StubFor
-import groovy.test.GroovyTestCase
-class Groovy2271Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+class Groovy2271Bug {
static final String TEST_TEXT = "I'm a mock"
def void testClosureMock() {
diff --git a/src/test/groovy/bugs/Groovy2339Bug.groovy b/src/test/groovy/bugs/Groovy2339Bug.groovy
index ab6415c2b8..2fd0bb4e06 100644
--- a/src/test/groovy/bugs/Groovy2339Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2339Bug.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy2339Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.shouldFail
+
+class Groovy2339Bug {
+
+ @Test
void testBug() {
List list = ['groovy', 'java']
Map map = [a: 1, b: 2]
diff --git a/src/test/groovy/bugs/Groovy2348Bug.groovy b/src/test/groovy/bugs/Groovy2348Bug.groovy
index a69c09462f..50ac17999c 100644
--- a/src/test/groovy/bugs/Groovy2348Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2348Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-class Groovy2348Bug extends GroovyTestCase{
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+
+class Groovy2348Bug{
void test () {
assertEquals( ['1.0', '2.0'], Foo.test(['1.0-vers', '2.0-subvers']))
}
diff --git a/src/test/groovy/bugs/Groovy2350Bug.groovy b/src/test/groovy/bugs/Groovy2350Bug.groovy
index 14ee5b4d5f..7694cbefb3 100644
--- a/src/test/groovy/bugs/Groovy2350Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2350Bug.groovy
@@ -18,10 +18,15 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy2350Bug extends GroovyTestCase{
+import static groovy.test.GroovyAssert.shouldFail
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+class Groovy2350Bug{
+
+ @Test
void testNoArg () {
shouldFail (org.codehaus.groovy.runtime.metaclass.MethodSelectionException) {
def a = new DefaultNoArgCtor()
@@ -30,6 +35,7 @@ class Groovy2350Bug extends GroovyTestCase{
assertEquals "NULL", new DefaultNoArgCtor2().value
}
+ @Test
void testNoDefCtor () {
def a = new NoDefaultCtor("first")
assertEquals "toS: first", a.toString()
diff --git a/src/test/groovy/bugs/Groovy2351Bug.groovy b/src/test/groovy/bugs/Groovy2351Bug.groovy
index 2a8978a4d9..702f932c55 100644
--- a/src/test/groovy/bugs/Groovy2351Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2351Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy2351Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+
+class Groovy2351Bug {
+ @Test
void testVarArgs () {
def a = new VarArgs()
diff --git a/src/test/groovy/bugs/Groovy2365Base.groovy b/src/test/groovy/bugs/Groovy2365Base.groovy
index 4488631d5f..8af8042a3a 100644
--- a/src/test/groovy/bugs/Groovy2365Base.groovy
+++ b/src/test/groovy/bugs/Groovy2365Base.groovy
@@ -18,9 +18,8 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-abstract class Groovy2365Base extends GroovyTestCase {
+abstract class Groovy2365Base {
protected String createData () {
@@ -44,6 +43,7 @@ abstract class Groovy2365Base extends GroovyTestCase {
"Script2.groovy" : """
import Util
+import org.junit.jupiter.api.Test
println "Script2 \${Util.NAME}"
"""
diff --git a/src/test/groovy/bugs/Groovy2365Bug.java b/src/test/groovy/bugs/Groovy2365Bug.java
index c295b6ca98..14e7d37527 100644
--- a/src/test/groovy/bugs/Groovy2365Bug.java
+++ b/src/test/groovy/bugs/Groovy2365Bug.java
@@ -24,6 +24,8 @@ import org.codehaus.groovy.runtime.ResourceGroovyMethods;
import java.io.File;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class Groovy2365Bug extends Groovy2365Base {
public void testDeadlock() {
@@ -78,7 +80,7 @@ public class Groovy2365Bug extends Groovy2365Base {
e.printStackTrace();
}
- assertTrue("Potentially deadlock", completed[0] && completed[1]);
+ assertTrue(completed[0] && completed[1], "Potentially deadlock");
}
} finally {
ResourceGroovyMethods.deleteDir(new File(path));
diff --git a/src/test/groovy/bugs/Groovy2391.groovy b/src/test/groovy/bugs/Groovy2391.groovy
index 29c46d51c9..e527d4c275 100644
--- a/src/test/groovy/bugs/Groovy2391.groovy
+++ b/src/test/groovy/bugs/Groovy2391.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy239_Bug.groovy b/src/test/groovy/bugs/Groovy239_Bug.groovy
index f4aca8d4af..48153a176d 100644
--- a/src/test/groovy/bugs/Groovy239_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy239_Bug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy239_Bug extends GroovyTestCase {
+class Groovy239_Bug {
+
+ @Test
void testBug() {
def a = makeClosure()
def b = makeClosure()
@@ -42,6 +44,7 @@ class Groovy239_Bug extends GroovyTestCase {
return { it() }
}
+ @Test
void testBug2() {
def a = { it() }
def b = { it() }
diff --git a/src/test/groovy/bugs/Groovy2490Bug.groovy b/src/test/groovy/bugs/Groovy2490Bug.groovy
index d29ac6e2c2..4f31515578 100644
--- a/src/test/groovy/bugs/Groovy2490Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2490Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-class Groovy2490Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+
+class Groovy2490Bug {
void test () {
assertEquals One.foo, "hello"
assertEquals Two.foo, "goodbye"
diff --git a/src/test/groovy/bugs/Groovy252_Bug.groovy b/src/test/groovy/bugs/Groovy252_Bug.groovy
index 90fae27ee7..b73aa47e3f 100644
--- a/src/test/groovy/bugs/Groovy252_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy252_Bug.groovy
@@ -18,14 +18,16 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
*/
-class Groovy252_Bug extends GroovyTestCase {
+class Groovy252_Bug {
def count = 0
+ @Test
void testBug() {
def value = f()
assert value == null
diff --git a/src/test/groovy/bugs/Groovy2549Bug.groovy b/src/test/groovy/bugs/Groovy2549Bug.groovy
index 5ef9f65d20..e2309776ee 100644
--- a/src/test/groovy/bugs/Groovy2549Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2549Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy2549Bug extends GroovyTestCase {
+
+class Groovy2549Bug {
+ @Test
void test2549() {
def c = 2
def x = 1 + (c as int)
diff --git a/src/test/groovy/bugs/Groovy2556Bug.groovy b/src/test/groovy/bugs/Groovy2556Bug.groovy
index f7e2ed5d09..9a98bb5da8 100644
--- a/src/test/groovy/bugs/Groovy2556Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2556Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
-class Groovy2556Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+
+class Groovy2556Bug {
final String SOME_METHOD_VALUE = 'someMethodValue'
final String TEST_NAME = 'someName'
@@ -28,6 +32,7 @@ class Groovy2556Bug extends GroovyTestCase {
Map names
+ @BeforeEach
void setUp() {
names = [:]
}
@@ -38,6 +43,7 @@ class Groovy2556Bug extends GroovyTestCase {
count++;
}
+ @Test
void testCompile () {
new GroovyShell().parse ("""
def arr = [2:0]
@@ -45,14 +51,17 @@ class Groovy2556Bug extends GroovyTestCase {
""").run ()
}
+ @Test
void testAssignmentWithString() {
assertEquals(SOME_METHOD_VALUE, someMethod())
}
+ @Test
void testAssignmentWithMap() {
assertEquals(TEST_NAME, addName(TEST_NAME))
}
+ @Test
void testAssignmentWithReturnMap() {
assertEquals(TEST_NAME, addNameWithReturn(TEST_NAME))
}
@@ -69,29 +78,34 @@ class Groovy2556Bug extends GroovyTestCase {
return names[name] = name
}
+ @Test
void testArrayAssignment() {
def arr = [*0..4]
assert 33 == (arr[2] = 33)
assert 55 == (arr[2] += 22)
}
+ @Test
void testArrayAssignmentInClosure() {
def arr = [*0..4]
assert 55 == { arr[2] = 55 }.call()
assert 88 == { arr[2] += 33 }.call()
}
+ @Test
void testVarAssignment() {
def var = 1
assert 77 == ( var = 77)
}
+ @Test
void testVarAssignmentInClosure() {
def var = 1
assert 22 == { var = 22 }.call()
assert 55 == { var += 33 }.call()
}
+ @Test
void testReusableExpression() {
def arr = [*1..5]
assert 34 == (arr[getCount()] += 33)
diff --git a/src/test/groovy/bugs/Groovy2557Bug.groovy b/src/test/groovy/bugs/Groovy2557Bug.groovy
index 173d3cc4ef..7ab7d02487 100644
--- a/src/test/groovy/bugs/Groovy2557Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2557Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy2557Bug extends GroovyTestCase{
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+
+class Groovy2557Bug{
+ @Test
void testArray2ListCoercion() {
String[] args = ['a', 'b']
List list = args as List
diff --git a/src/test/groovy/bugs/Groovy2558Bug.groovy b/src/test/groovy/bugs/Groovy2558Bug.groovy
index fe62902cd4..9cc615dadc 100644
--- a/src/test/groovy/bugs/Groovy2558Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2558Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy2558Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+
+class Groovy2558Bug {
+ @Test
void testMe () {
Person person = new Person()
String propertyName = 'name'
diff --git a/src/test/groovy/bugs/Groovy2666Bug.groovy b/src/test/groovy/bugs/Groovy2666Bug.groovy
index 216a8728a2..44331e9700 100644
--- a/src/test/groovy/bugs/Groovy2666Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2666Bug.groovy
@@ -18,15 +18,18 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.GroovyBugError
+import org.junit.jupiter.api.Test
-class Groovy2666Bug extends GroovyTestCase{
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy2666Bug{
private void ex () {
throw new GroovyBugError ("ERR")
}
+ @Test
void testMe () {
try {
diff --git a/src/test/groovy/bugs/Groovy2706Bug.groovy b/src/test/groovy/bugs/Groovy2706Bug.groovy
index 0115b5c6e4..4a86564b71 100644
--- a/src/test/groovy/bugs/Groovy2706Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2706Bug.groovy
@@ -18,11 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-public class Groovy2706Bug extends GroovyTestCase {
+
+public class Groovy2706Bug {
static counter = 0
+ @Test
void testStaticAccessWithIncAndDec() {
++Groovy2706Bug.counter
assert counter == 1
diff --git a/src/test/groovy/bugs/Groovy2773Bug.groovy b/src/test/groovy/bugs/Groovy2773Bug.groovy
index 64425a62d9..4a6fec06e7 100644
--- a/src/test/groovy/bugs/Groovy2773Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2773Bug.groovy
@@ -18,9 +18,8 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-class Groovy2773Bug extends GroovyTestCase {
+class Groovy2773Bug {
void test() {
assertScript '''
class DateTime {
@@ -37,6 +36,8 @@ class Groovy2773Bug extends GroovyTestCase {
}
import static Utils.nowUTC
+import org.junit.jupiter.api.Test
+import static groovy.test.GroovyAssert.*
DateTime baseDate = Utils.nowUTC()
Long now = new Date().getTime()
diff --git a/src/test/groovy/bugs/Groovy278_Bug.groovy b/src/test/groovy/bugs/Groovy278_Bug.groovy
index 7d49bc36db..fd43585bd0 100644
--- a/src/test/groovy/bugs/Groovy278_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy278_Bug.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy278_Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class Groovy278_Bug {
+
+ @Test
void testBug() {
assertScript '''
class MyRange extends IntRange {
diff --git a/src/test/groovy/bugs/Groovy2801Bug.groovy b/src/test/groovy/bugs/Groovy2801Bug.groovy
index dabd9f150d..74ab348478 100644
--- a/src/test/groovy/bugs/Groovy2801Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2801Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy2801Bug extends GroovyTestCase {
+
+class Groovy2801Bug {
+ @Test
void testOverrideToStringInMapOfClosures() {
def proxyImpl = [foo: { "Foo!" }, toString: { "overridden." }] as IGroovy2801Bug
assert proxyImpl.toString() == "overridden."
diff --git a/src/test/groovy/bugs/Groovy2816Bug.groovy b/src/test/groovy/bugs/Groovy2816Bug.groovy
index 2f79fdad43..e8d9513f9b 100644
--- a/src/test/groovy/bugs/Groovy2816Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2816Bug.groovy
@@ -18,15 +18,18 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy2816Bug extends GroovyTestCase{
+
+class Groovy2816Bug{
+ @Test
void testMapWithBigListAsValue () {
[
"037" : [101110,101120,101210,101220,101300,101400,102101,102102,103101,103102,103200,103300,103400,104103,104104,104105,104106,104107,104201,104202,104310,104320,104401,104402,104500,104610,104620,104701,104702,104810,104820,106010,106020,106111,106112,106113,106114,106402,106403,106404,106510,106520,106602,106603,106604,106605,106606,106641,106642,106643,107010,107020,108101,108102,108103,108104,108200,109100,109200,109300,109400,109500,109601,109602,109700,109800,111100,11 [...]
]
}
+ @Test
void testScriptReturningBigListAsResult () {
new GroovyShell().evaluate """
[101110,101120,101210,101220,101300,101400,102101,102102,103101,103102,103200,103300,103400,104103,104104,104105,104106,104107,104201,104202,104310,104320,104401,104402,104500,104610,104620,104701,104702,104810,104820,106010,106020,106111,106112,106113,106114,106402,106403,106404,106510,106520,106602,106603,106604,106605,106606,106641,106642,106643,107010,107020,108101,108102,108103,108104,108200,109100,109200,109300,109400,109500,109601,109602,109700,109800,111100,111201,111202,111 [...]
@@ -34,6 +37,7 @@ class Groovy2816Bug extends GroovyTestCase{
"""
}
+ @Test
void testClassWithMethodReturningMapWithBigListAsValue () {
assert new GroovyShell().parse ("""
class A239 {
diff --git a/src/test/groovy/bugs/Groovy2849Bug.groovy b/src/test/groovy/bugs/Groovy2849Bug.groovy
index 4f2d65bcb3..06c9677f66 100644
--- a/src/test/groovy/bugs/Groovy2849Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2849Bug.groovy
@@ -18,9 +18,7 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-
-class Groovy2849Bug extends GroovyTestCase {
+class Groovy2849Bug {
def void testPropertySelectionConflictInANestedClosure(){
assert c1() == 11
assert p == 11
diff --git a/src/test/groovy/bugs/Groovy2949Bug.groovy b/src/test/groovy/bugs/Groovy2949Bug.groovy
index 9782aa56eb..e974e3c1a3 100644
--- a/src/test/groovy/bugs/Groovy2949Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2949Bug.groovy
@@ -18,9 +18,7 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-
-class Groovy2949Bug extends GroovyTestCase {
+class Groovy2949Bug {
void testBug () {
new GroovyShell().evaluate """
public abstract class A { abstract protected void doIt() }
diff --git a/src/test/groovy/bugs/Groovy2951.groovy b/src/test/groovy/bugs/Groovy2951.groovy
index 1e61cb9e3e..ab11f6aa3b 100644
--- a/src/test/groovy/bugs/Groovy2951.groovy
+++ b/src/test/groovy/bugs/Groovy2951.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class Groovy2951 {
diff --git a/src/test/groovy/bugs/Groovy308_Bug.groovy b/src/test/groovy/bugs/Groovy308_Bug.groovy
index c5f5177f8e..9c94119f22 100644
--- a/src/test/groovy/bugs/Groovy308_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy308_Bug.groovy
@@ -18,14 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-
-import java.io.*
+import org.junit.jupiter.api.Test
/**
*/
-class Groovy308_Bug extends GroovyTestCase {
+class Groovy308_Bug {
+ @Test
void testBug() {
def out = new StringWriter()
out << "hello " << "world!"
diff --git a/src/test/groovy/bugs/Groovy3135Bug.groovy b/src/test/groovy/bugs/Groovy3135Bug.groovy
index 069e4f5957..f8df22d519 100644
--- a/src/test/groovy/bugs/Groovy3135Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3135Bug.groovy
@@ -18,9 +18,10 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3135Bug extends GroovyTestCase {
+
+class Groovy3135Bug {
static Byte b = Byte.parseByte("1")
static Short s = Short.parseShort("2")
static Integer i = Integer.parseInt("3")
@@ -32,6 +33,7 @@ class Groovy3135Bug extends GroovyTestCase {
def values
+ @Test
void testConversionForPrimitiveTypeVarArgs() {
setVarArgsShort("", b, s)
diff --git a/src/test/groovy/bugs/Groovy3139Bug.groovy b/src/test/groovy/bugs/Groovy3139Bug.groovy
index 0567fbb991..16d61fd26d 100644
--- a/src/test/groovy/bugs/Groovy3139Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3139Bug.groovy
@@ -19,10 +19,11 @@
package bugs
import groovy.mock.interceptor.StubFor
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3139Bug extends GroovyTestCase {
+class Groovy3139Bug {
+ @Test
void testStubbingIssueDueToCachingWhenUsing2Stubs() {
def urlStub1 = new StubFor(URL)
urlStub1.demand.openConnection {""}
diff --git a/src/test/groovy/bugs/Groovy3156And2621Bug.groovy b/src/test/groovy/bugs/Groovy3156And2621Bug.groovy
index be18f91bab..98303d39ce 100644
--- a/src/test/groovy/bugs/Groovy3156And2621Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3156And2621Bug.groovy
@@ -18,14 +18,17 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3156And2621Bug extends GroovyTestCase {
+
+class Groovy3156And2621Bug {
+ @Test
void testMethodNameResolutionInANestedClosure() {
assert m() == 'method'
assert c1() == 'method'
}
+ @Test
void testSimilarNamesForMethodAndLocalWithLocalAsMethodArgument() {
failingExecute()
}
diff --git a/src/test/groovy/bugs/Groovy3163Bug.groovy b/src/test/groovy/bugs/Groovy3163Bug.groovy
index 30ca75f023..b230bf1c28 100644
--- a/src/test/groovy/bugs/Groovy3163Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3163Bug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3163Test extends GroovyTestCase {
+class Groovy3163Test {
+
+@Test
void testSuperOverStatic() {
def siws = new Groovy3163SomeImplementorWithStatic()
diff --git a/src/test/groovy/bugs/Groovy3175_Bug.groovy b/src/test/groovy/bugs/Groovy3175_Bug.groovy
index c63619d2c5..2c8e78b0ea 100644
--- a/src/test/groovy/bugs/Groovy3175_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3175_Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3175_Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+class Groovy3175_Bug {
+
+ @Test
void testSyntheticModifier() {
assertScript """
import groovy.transform.Generated
diff --git a/src/test/groovy/bugs/Groovy3205Bug.groovy b/src/test/groovy/bugs/Groovy3205Bug.groovy
index 478ebea0e1..a6aa11e807 100644
--- a/src/test/groovy/bugs/Groovy3205Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3205Bug.groovy
@@ -18,9 +18,7 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-
-class Groovy3205Bug extends GroovyTestCase {
+class Groovy3205Bug {
def void testOverrideToStringInMapOfClosures() {
def proxyImpl = [
control: { "new control" },
diff --git a/src/test/groovy/bugs/Groovy3208Bug.groovy b/src/test/groovy/bugs/Groovy3208Bug.groovy
index f6f1506c99..deff49f176 100644
--- a/src/test/groovy/bugs/Groovy3208Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3208Bug.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3208Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+class Groovy3208Bug {
+
+ @Test
void testBug() {
new Sub().each { assertEquals("ABC", it.doIt()) }
diff --git a/src/test/groovy/bugs/Groovy3235Bug.groovy b/src/test/groovy/bugs/Groovy3235Bug.groovy
index 883e410edf..9031fdad81 100644
--- a/src/test/groovy/bugs/Groovy3235Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3235Bug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3235Bug extends GroovyTestCase {
+class Groovy3235Bug {
+
+@Test
void testBug3235 () {
def d = """This is one line.
diff --git a/src/test/groovy/bugs/Groovy3238Bug.groovy b/src/test/groovy/bugs/Groovy3238Bug.groovy
index 5075cf296f..45eada942e 100644
--- a/src/test/groovy/bugs/Groovy3238Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3238Bug.groovy
@@ -18,9 +18,7 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-
-class Groovy3238Bug extends GroovyTestCase {
+class Groovy3238Bug {
def void testRelativeExactnessToMatchForBigIntegerParam() {
def obj = new Groovy3238Bug()
def bi = new BigInteger("1")
diff --git a/src/test/groovy/bugs/Groovy325_Bug.groovy b/src/test/groovy/bugs/Groovy325_Bug.groovy
index 251aeb3f15..241c000356 100644
--- a/src/test/groovy/bugs/Groovy325_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy325_Bug.groovy
@@ -18,13 +18,15 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy325_Bug extends GroovyTestCase {
+
+class Groovy325_Bug {
static boolean staticMethod() {
return true
}
+ @Test
void testCallStaticMethodFromClosure() {
def c = { staticMethod() }
assert c()
diff --git a/src/test/groovy/bugs/Groovy3304Bug.groovy b/src/test/groovy/bugs/Groovy3304Bug.groovy
index 10389a496d..b91ca1e284 100644
--- a/src/test/groovy/bugs/Groovy3304Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3304Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
-class Groovy3304Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy3304Bug {
+ @Test
void testBreakAfterSwitchCausesSyntaxError() {
try {
new GroovyShell().parse("switch(x) {}\nbreak")
diff --git a/src/test/groovy/bugs/Groovy3305Bug.groovy b/src/test/groovy/bugs/Groovy3305Bug.groovy
index cb51101c51..f9654f2b96 100644
--- a/src/test/groovy/bugs/Groovy3305Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3305Bug.groovy
@@ -18,9 +18,7 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-
-class Groovy3305Bug extends GroovyTestCase {
+class Groovy3305Bug {
def void testSingleListExpandingToMultipleArgs() {
assert foo1([1, "A"]) == "1,A"
assert foo2([BigDecimal.ZERO, "B"]) == "0,B"
diff --git a/src/test/groovy/bugs/Groovy3311.groovy b/src/test/groovy/bugs/Groovy3311.groovy
index 1e9ba76905..8d0b303264 100644
--- a/src/test/groovy/bugs/Groovy3311.groovy
+++ b/src/test/groovy/bugs/Groovy3311.groovy
@@ -19,7 +19,7 @@
package bugs
import groovy.transform.CompileStatic
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy3335Bug.groovy b/src/test/groovy/bugs/Groovy3335Bug.groovy
index 4cc2c30191..c545df933b 100644
--- a/src/test/groovy/bugs/Groovy3335Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3335Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3335Bug extends GroovyTestCase {
+
+class Groovy3335Bug {
+ @Test
void testClassToString() {
// the following call was resulting in a MethodSelectionException
// because Integer class defines static toString(int) and toString(int, int) methods
diff --git a/src/test/groovy/bugs/Groovy3339Bug.groovy b/src/test/groovy/bugs/Groovy3339Bug.groovy
index bacc6d615a..b229d75667 100644
--- a/src/test/groovy/bugs/Groovy3339Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3339Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3339Bug extends GroovyTestCase {
+
+class Groovy3339Bug {
+ @Test
void testConstantCachingInClosureClasses() {
// In all the cases below, the OptimizerVisitor replaces number 10 by
// the cached constant in the closure class, which it is not supposed
diff --git a/src/test/groovy/bugs/Groovy3383Bug.groovy b/src/test/groovy/bugs/Groovy3383Bug.groovy
index ec5bb591b0..92f0d68c61 100644
--- a/src/test/groovy/bugs/Groovy3383Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3383Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3383Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy3383Bug {
+ @Test
void testClassUsageInInterfaceDef() {
assertScript """
interface Groovy3383 {
diff --git a/src/test/groovy/bugs/Groovy3389Bug.groovy b/src/test/groovy/bugs/Groovy3389Bug.groovy
index b0bc612ab3..af3b67c97f 100644
--- a/src/test/groovy/bugs/Groovy3389Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3389Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3389Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy3389Bug {
+ @Test
void testFieldHidingByLocalVariable() {
assertScript """
class Groovy3389 {
diff --git a/src/test/groovy/bugs/Groovy3403Bug.groovy b/src/test/groovy/bugs/Groovy3403Bug.groovy
index 2ac12398ab..91822345f3 100644
--- a/src/test/groovy/bugs/Groovy3403Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3403Bug.groovy
@@ -19,10 +19,11 @@
package bugs
import groovy.mock.interceptor.StubFor
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3403Bug extends GroovyTestCase {
+class Groovy3403Bug {
+ @Test
void testStubIssueForStaticMethodsDueToCallSiteCachingWhenUsing2Stubs() {
def stub1 = new StubFor(Main3403)
stub1.demand.test() {
diff --git a/src/test/groovy/bugs/Groovy3405Bug.groovy b/src/test/groovy/bugs/Groovy3405Bug.groovy
index 6c21b705a1..ee8a1d78bb 100644
--- a/src/test/groovy/bugs/Groovy3405Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3405Bug.groovy
@@ -18,14 +18,17 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.AfterEach
+import org.junit.jupiter.api.Test
-class Groovy3405Bug extends GroovyTestCase {
+class Groovy3405Bug {
- protected void tearDown() {
+ @AfterEach
+ void tearDown() {
String.metaClass = null
}
+ @Test
void testAddingStaticMethodsOnMCWithDefaultParameters() {
// test with 2 params having default values
String.metaClass.'static'.testStaticTwoParams = { first = "foo", second = "bar" -> return "$first - $second" }
diff --git a/src/test/groovy/bugs/Groovy3410Bug.groovy b/src/test/groovy/bugs/Groovy3410Bug.groovy
index 7239fc0bab..1f78813c28 100644
--- a/src/test/groovy/bugs/Groovy3410Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3410Bug.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3410Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class Groovy3410Bug {
+
+ @Test
void testClassVerificationErrorsWithBooleanExpUsingPrimitiveFields() {
assertScript """
class Groovy3405N1 {
diff --git a/src/test/groovy/bugs/Groovy3422.groovy b/src/test/groovy/bugs/Groovy3422.groovy
index 1f10eb76d2..c47f2e1567 100644
--- a/src/test/groovy/bugs/Groovy3422.groovy
+++ b/src/test/groovy/bugs/Groovy3422.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy3424Bug.groovy b/src/test/groovy/bugs/Groovy3424Bug.groovy
index d7e5822380..2ff972d143 100644
--- a/src/test/groovy/bugs/Groovy3424Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3424Bug.groovy
@@ -18,22 +18,27 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.AfterEach
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
-class Groovy3424Bug extends GroovyTestCase {
+class Groovy3424Bug {
MetaClassRegistry registry
MetaClass originalMetaClass
+ @BeforeEach
void setUp() {
registry = GroovySystem.metaClassRegistry
originalMetaClass = registry.getMetaClass(Groovy3424Foo)
}
+ @AfterEach
void tearDown() {
registry.setMetaClass(Groovy3424Foo, originalMetaClass)
}
+ @Test
void testCallSiteShouldBeUpdatedAfterProxyMetaClassIsSet() {
def newFoo = { -> new Groovy3424Foo() }
@@ -47,6 +52,7 @@ class Groovy3424Bug extends GroovyTestCase {
assert 'constructor' == newFoo()
}
+ @Test
void testExpandoCallSiteShouldBeUpdatedAfterProxyMetaClassIsSet() {
Groovy3424Foo.metaClass.constructor << { String test -> 'foo' }
@@ -62,6 +68,7 @@ class Groovy3424Bug extends GroovyTestCase {
assert 'constructor' == newFoo()
}
+ @Test
void testCallSiteShouldBeUpdatedAfterOriginalMetaClassIsRestored() {
def newFoo = { -> new Groovy3424Foo() }
diff --git a/src/test/groovy/bugs/Groovy3426Bug.groovy b/src/test/groovy/bugs/Groovy3426Bug.groovy
index 59afdc18c0..99d8594f88 100644
--- a/src/test/groovy/bugs/Groovy3426Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3426Bug.groovy
@@ -18,22 +18,27 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.AfterEach
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
-class Groovy3426Bug extends GroovyTestCase {
+class Groovy3426Bug {
MetaClassRegistry registry
MetaClass originalMetaClass
+ @BeforeEach
void setUp() {
registry = GroovySystem.metaClassRegistry
originalMetaClass = registry.getMetaClass(Groovy3426Foo)
}
+ @AfterEach
void tearDown() {
registry.setMetaClass(Groovy3426Foo, originalMetaClass)
}
+ @Test
void testCallSiteShouldBeUpdatedAfterOriginalMetaClassIsRestored() {
def getFoo = { -> Groovy3426Foo.get() }
diff --git a/src/test/groovy/bugs/Groovy3446Bug.groovy b/src/test/groovy/bugs/Groovy3446Bug.groovy
index 4f060f3875..f4d50310ad 100644
--- a/src/test/groovy/bugs/Groovy3446Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3446Bug.groovy
@@ -18,11 +18,10 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-import static java.lang.System.currentTimeMillis
-
-class Groovy3446Bug extends GroovyTestCase {
+class Groovy3446Bug {
+ @Test
void testLocalMethodFavoredOverStaticallyImportedMethod() {
assert currentTimeMillis() == "local method called"
}
diff --git a/src/test/groovy/bugs/Groovy3462Bug.groovy b/src/test/groovy/bugs/Groovy3462Bug.groovy
index a826a37ab0..b239a167d3 100644
--- a/src/test/groovy/bugs/Groovy3462Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3462Bug.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3462Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class Groovy3462Bug {
+
+ @Test
void testClosureWithParameterHavingDefaultExpression() {
assertScript """
month = { String date = new Date().format("yyyyMM") ->
diff --git a/src/test/groovy/bugs/Groovy3464Bug.groovy b/src/test/groovy/bugs/Groovy3464Bug.groovy
index 829975a9fb..768434a366 100644
--- a/src/test/groovy/bugs/Groovy3464Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3464Bug.groovy
@@ -18,22 +18,26 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-import org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit
import org.codehaus.groovy.control.CompilerConfiguration
+import org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit
+import org.junit.jupiter.api.AfterEach
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
+
+import static groovy.test.GroovyAssert.shouldFail
/**
* GROOVY-3463:
* Spring/CGLIB proxies throw exception "object is not an instance of declaring class"
*/
-class Groovy3464Bug extends GroovyTestCase {
+class Groovy3464Bug {
GroovyShell shell
CompilerConfiguration config
File targetDir, stubDir
- protected void setUp() {
- super.setUp()
+ @BeforeEach
+ void setUp() {
config = new CompilerConfiguration()
config.with {
@@ -73,15 +77,16 @@ class Groovy3464Bug extends GroovyTestCase {
}
- protected void tearDown() {
+ @AfterEach
+ void tearDown() {
config.targetDirectory?.deleteDir()
config.jointCompilationOptions?.stubDir?.deleteDir()
targetDir?.deleteDir()
stubDir?.deleteDir()
- super.tearDown()
}
+ @Test
void testScenarioOne() {
shouldFail(MissingMethodException) {
shell.evaluate '''
@@ -95,6 +100,7 @@ class Groovy3464Bug extends GroovyTestCase {
}
}
+ @Test
void testScenarioTwo() {
shell.evaluate '''
def t = new GroovyThing()
diff --git a/src/test/groovy/bugs/Groovy3465Bug.groovy b/src/test/groovy/bugs/Groovy3465Bug.groovy
index 401112faa7..98907bf28e 100644
--- a/src/test/groovy/bugs/Groovy3465Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3465Bug.groovy
@@ -18,11 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-import static bugs.Groovy3465Helper.*
+import static bugs.Groovy3465Helper.func
-class Groovy3465Bug extends GroovyTestCase {
+class Groovy3465Bug {
+ @Test
void testCallingAStaticImportedMethodWithNamedParamaters() {
func text: 'Some text', value: 1
diff --git a/src/test/groovy/bugs/Groovy3498Bug.groovy b/src/test/groovy/bugs/Groovy3498Bug.groovy
index 3e61859703..db41540b60 100644
--- a/src/test/groovy/bugs/Groovy3498Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3498Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3498Bug extends GroovyTestCase {
+
+class Groovy3498Bug {
+ @Test
void testClosureExpressionFiltering() {
new GroovyShell().evaluate """
{ -> assert false, 'This statement should not have been executed' }
diff --git a/src/test/groovy/bugs/Groovy3509Bug.groovy b/src/test/groovy/bugs/Groovy3509Bug.groovy
index e21c91d36e..4606361fcc 100644
--- a/src/test/groovy/bugs/Groovy3509Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3509Bug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3509Bug extends GroovyTestCase {
+class Groovy3509Bug {
+
+ @Test
void testGPathInconcistency() {
def data = [
[a: null],
@@ -45,6 +47,7 @@ class Groovy3509Bug extends GroovyTestCase {
assert data.a.b.c.sum() == 3
}
+ @Test
void testOriginalCase() {
// initialize structure
def root = new Root()
diff --git a/src/test/groovy/bugs/Groovy3511Bug.groovy b/src/test/groovy/bugs/Groovy3511Bug.groovy
index 1de4a5c6e2..9bcb61d9da 100644
--- a/src/test/groovy/bugs/Groovy3511Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3511Bug.groovy
@@ -18,11 +18,15 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation
+import org.junit.jupiter.api.Test
-class Groovy3511Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertTrue
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy3511Bug {
final SHOULD_HAVE_FAILED = "The conversion above should have failed"
+ @Test
void testExceptionMessageStringToNumberConversion() {
try {
Double test = "Hello"
diff --git a/src/test/groovy/bugs/Groovy3519Bug.groovy b/src/test/groovy/bugs/Groovy3519Bug.groovy
index 2199e7c75f..6817c19209 100644
--- a/src/test/groovy/bugs/Groovy3519Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3519Bug.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3519Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class Groovy3519Bug {
+
+ @Test
void testShouldSkipPrivateMethodsFromCovariantReturnTypeChecks() {
assertScript '''
class A {
@@ -38,6 +42,7 @@ class Groovy3519Bug extends GroovyTestCase {
'''
}
+ @Test
void testShouldSkipPrivateMethodsFromCovariantReturnTypeChecksCS() {
assertScript '''import groovy.transform.CompileStatic
diff --git a/src/test/groovy/bugs/Groovy3560Bug.groovy b/src/test/groovy/bugs/Groovy3560Bug.groovy
index e5a1f2e751..c50b16d2eb 100644
--- a/src/test/groovy/bugs/Groovy3560Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3560Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3560Bug extends GroovyTestCase {
+
+class Groovy3560Bug {
+ @Test
void testVarArgsWithAnInterfaceAsVarArgArrayType() {
assert Groovy3560Helper.m1(new Groovy3560A(), new Groovy3560B()) == 2
assert Groovy3560Helper.m2("a", "b", new Groovy3560A(), new Groovy3560B()) == 2
diff --git a/src/test/groovy/bugs/Groovy3574Bug.groovy b/src/test/groovy/bugs/Groovy3574Bug.groovy
index 1f272a9ec7..6705b08d6e 100644
--- a/src/test/groovy/bugs/Groovy3574Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3574Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3574Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+
+class Groovy3574Bug {
+ @Test
void testToStringCallDelegationToConvertedClosureProxy() {
Closure failing1 = {
throw new RuntimeException("Call to this closure fails.")
diff --git a/src/test/groovy/bugs/Groovy3590Bug.groovy b/src/test/groovy/bugs/Groovy3590Bug.groovy
index bff5e40a70..78a96dab5e 100644
--- a/src/test/groovy/bugs/Groovy3590Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3590Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3590Bug extends GroovyTestCase {
+
+class Groovy3590Bug {
+ @Test
void testMapDefaultValueGetWithPrevKeyHavingNullValue() {
def map = ['key':null]
assert map.get('key', this) == null
diff --git a/src/test/groovy/bugs/Groovy3679Bug.groovy b/src/test/groovy/bugs/Groovy3679Bug.groovy
index ff85ee7c55..3bc59ff034 100644
--- a/src/test/groovy/bugs/Groovy3679Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3679Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3679Bug extends GroovyTestCase {
+
+class Groovy3679Bug {
+ @Test
void testMapEntryWinOverPvtAndPkgPrivateClassFields() {
// map entry should win over a package-private field
def map1 = new HashMap()
diff --git a/src/test/groovy/bugs/Groovy3716Bug.groovy b/src/test/groovy/bugs/Groovy3716Bug.groovy
index 2df9f5fec6..74e0b41c69 100644
--- a/src/test/groovy/bugs/Groovy3716Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3716Bug.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.ast.ClassHelper
+import org.junit.jupiter.api.Test
-class Groovy3716Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertFalse
+import static org.junit.jupiter.api.Assertions.assertTrue
+
+class Groovy3716Bug {
+ @Test
void testVoidAndObjectDerivedFromResults() {
assertTrue ClassHelper.VOID_TYPE.isDerivedFrom(ClassHelper.VOID_TYPE)
assertFalse ClassHelper.OBJECT_TYPE.isDerivedFrom(ClassHelper.VOID_TYPE)
diff --git a/src/test/groovy/bugs/Groovy3718Bug.groovy b/src/test/groovy/bugs/Groovy3718Bug.groovy
index 052d135abd..8f85a39354 100644
--- a/src/test/groovy/bugs/Groovy3718Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3718Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3718Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertFalse
+
+
+class Groovy3718Bug {
+ @Test
void testPatternMatchOfNull() {
assertFalse null ==~ /[^0-9]+/
diff --git a/src/test/groovy/bugs/Groovy3719.groovy b/src/test/groovy/bugs/Groovy3719.groovy
index 270db63e68..7b74121e37 100644
--- a/src/test/groovy/bugs/Groovy3719.groovy
+++ b/src/test/groovy/bugs/Groovy3719.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.shouldFail
diff --git a/src/test/groovy/bugs/Groovy3720Bug.groovy b/src/test/groovy/bugs/Groovy3720Bug.groovy
index a2bddbea94..5b438eb6bd 100644
--- a/src/test/groovy/bugs/Groovy3720Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3720Bug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.mock.interceptor.*
-import groovy.test.GroovyTestCase
+import groovy.mock.interceptor.MockFor
+import groovy.mock.interceptor.StubFor
-class Groovy3720Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertNotNull
+
+class Groovy3720Bug {
void testCreateStubNode() {
def stubNodeContext1 = new StubFor(AnotherNode3720)
assertNotNull stubNodeContext1.proxyInstance()
diff --git a/src/test/groovy/bugs/Groovy3723Bug.groovy b/src/test/groovy/bugs/Groovy3723Bug.groovy
index cf6d97a919..cf1d778a9e 100644
--- a/src/test/groovy/bugs/Groovy3723Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3723Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3723Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy3723Bug {
+ @Test
void testEMCPropertyAccessWitGetPropertySetProperty() {
assertScript """
class Dummy3723 {}
diff --git a/src/test/groovy/bugs/Groovy3726Bug.groovy b/src/test/groovy/bugs/Groovy3726Bug.groovy
index 3d69319b83..1fe00c9f89 100644
--- a/src/test/groovy/bugs/Groovy3726Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3726Bug.groovy
@@ -18,11 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-import java.lang.reflect.*
+import java.lang.reflect.Modifier
-class Groovy3726Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertFalse
+
+class Groovy3726Bug {
+ @Test
void testVolatilePropertiesResultingInBridgeMethods() {
def scriptStr, clazz, fooGetter, fooSetter
GroovyClassLoader cl = new GroovyClassLoader();
@@ -43,6 +46,7 @@ class Groovy3726Bug extends GroovyTestCase {
assertFalse Modifier.isVolatile(fooSetter.modifiers)
}
+ @Test
void testTransientPropertiesResultingInVarArgsMethods() {
def scriptStr, clazz, barGetter, barSetter
GroovyClassLoader cl = new GroovyClassLoader();
diff --git a/src/test/groovy/bugs/Groovy3749Bug.groovy b/src/test/groovy/bugs/Groovy3749Bug.groovy
index 5c6bcad99c..9f3e09ca68 100644
--- a/src/test/groovy/bugs/Groovy3749Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3749Bug.groovy
@@ -18,9 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3749Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.fail
+
+class Groovy3749Bug {
+ @Test
void testScriptsProvidingStaticMainMethod() {
def scriptStr
@@ -91,6 +94,7 @@ class Groovy3749Bug extends GroovyTestCase {
"""
}
+ @Test
void testScriptsProvidingInstanceMainMethod() {
def scriptStr
diff --git a/src/test/groovy/bugs/Groovy3770Bug.groovy b/src/test/groovy/bugs/Groovy3770Bug.groovy
index ac1908f7d7..452f1c279b 100644
--- a/src/test/groovy/bugs/Groovy3770Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3770Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3770Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy3770Bug {
+ @Test
void testSetDelegateAndResolveStrategyOnACurriedClosure() {
assertScript """
void hello(who) {
@@ -49,6 +53,7 @@ class Groovy3770Bug extends GroovyTestCase {
"""
}
+ @Test
void testCurriedClosuresShouldNotAffectParent() {
// GROOVY-3875
def orig = { tmp -> assert tmp == 1 }
diff --git a/src/test/groovy/bugs/Groovy3776Bug.groovy b/src/test/groovy/bugs/Groovy3776Bug.groovy
index cc411bb200..299c3374e1 100644
--- a/src/test/groovy/bugs/Groovy3776Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3776Bug.groovy
@@ -18,13 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-
-import java.lang.reflect.*
-import org.codehaus.groovy.control.MultipleCompilationErrorsException
import org.codehaus.groovy.GroovyBugError
+import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
+
+import static org.junit.jupiter.api.Assertions.fail
-class Groovy3776Bug extends GroovyTestCase {
+class Groovy3776Bug {
+ @Test
void testInvalidListWithMapEntryExpressions() {
GroovyClassLoader cl = new GroovyClassLoader();
diff --git a/src/test/groovy/bugs/Groovy3784Bug.groovy b/src/test/groovy/bugs/Groovy3784Bug.groovy
index 13f9e52387..d7e0b7e900 100644
--- a/src/test/groovy/bugs/Groovy3784Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3784Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3784Bug extends GroovyTestCase {
+
+class Groovy3784Bug {
+ @Test
void testUseOfDelegateAndThenGenericsSharingTheSameClassHelper() {
GroovyClassLoader gcl = new GroovyClassLoader()
diff --git a/src/test/groovy/bugs/Groovy3799Bug.groovy b/src/test/groovy/bugs/Groovy3799Bug.groovy
index c935e8a6cc..d7c7db2cfb 100644
--- a/src/test/groovy/bugs/Groovy3799Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3799Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy37XXBug extends GroovyTestCase {
+
+class Groovy37XXBug {
+ @Test
void testVarArgsWithAnInterfaceAsVarArgArrayTypeWithInheritenceInArgs() {
def obj
diff --git a/src/test/groovy/bugs/Groovy3801Bug.groovy b/src/test/groovy/bugs/Groovy3801Bug.groovy
index de84272232..4be713753b 100644
--- a/src/test/groovy/bugs/Groovy3801Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3801Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3801Bug extends GroovyTestCase {
+
+class Groovy3801Bug {
+ @Test
void testMainMethodSignature() {
def gcl = new GroovyClassLoader()
def clazz
diff --git a/src/test/groovy/bugs/Groovy3818Bug.groovy b/src/test/groovy/bugs/Groovy3818Bug.groovy
index f344b31380..744db47066 100644
--- a/src/test/groovy/bugs/Groovy3818Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3818Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3818Bug extends GroovyTestCase {
+
+class Groovy3818Bug {
+ @Test
void testCreatingSimilarSetandMapWithComparator() {
def scompare = { a, b -> a.id <=> b.id } as Comparator
diff --git a/src/test/groovy/bugs/Groovy3827Bug.groovy b/src/test/groovy/bugs/Groovy3827Bug.groovy
index b97b1309c3..fef55ee451 100644
--- a/src/test/groovy/bugs/Groovy3827Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3827Bug.groovy
@@ -18,10 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
-class Groovy3827Bug extends GroovyTestCase {
+class Groovy3827Bug {
+ @Test
void testDuplicateCompilationErrorOnProperty() {
GroovyClassLoader cl = new GroovyClassLoader();
diff --git a/src/test/groovy/bugs/Groovy3830Bug.groovy b/src/test/groovy/bugs/Groovy3830Bug.groovy
index 0d3c9b8903..d79c6c67d6 100644
--- a/src/test/groovy/bugs/Groovy3830Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3830Bug.groovy
@@ -18,15 +18,18 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3830Bug extends GroovyTestCase {
+
+class Groovy3830Bug {
+ @Test
void testCallSitesUsageInAnInterface() {
assert I3830.i == 2
assert I3830.i2 == 5
assert I3830.i3 == 6
}
+ @Test
void testCallSitesUsageInNestedInterface() {
assert C3830.I3830.i == 2
assert C3830.I3830.i2 == 5
diff --git a/src/test/groovy/bugs/Groovy3831Bug.groovy b/src/test/groovy/bugs/Groovy3831Bug.groovy
index 90e55313a1..9843f6bd3e 100644
--- a/src/test/groovy/bugs/Groovy3831Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3831Bug.groovy
@@ -18,15 +18,18 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3831Bug extends GroovyTestCase {
+
+class Groovy3831Bug {
+ @Test
void testClosureDefinitionInSpecialCallsInConstructorsV1() {
def test = new Test3831V1('hello', ["world"])
assert test.string == 'hello'
assert test.uris.size() == 1
}
+ @Test
void testClosureDefinitionInSpecialCallsInConstructorsV2() {
// just loading of class is test enough as it was giving VerifyError earlier.
new Test3831V2()
diff --git a/src/test/groovy/bugs/Groovy3834Bug.groovy b/src/test/groovy/bugs/Groovy3834Bug.groovy
index c99a70020f..4938ac64ab 100644
--- a/src/test/groovy/bugs/Groovy3834Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3834Bug.groovy
@@ -18,9 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3834Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.shouldFail
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+
+class Groovy3834Bug {
+ @Test
void testDuplicateCallsToMissingMethod() {
def instance = new AClassWithMethodMissingMethod()
shouldFail MissingMethodException, { instance.someMissingMethod() }
diff --git a/src/test/groovy/bugs/Groovy3839.groovy b/src/test/groovy/bugs/Groovy3839.groovy
index 7ab364e969..83fe8a39e7 100644
--- a/src/test/groovy/bugs/Groovy3839.groovy
+++ b/src/test/groovy/bugs/Groovy3839.groovy
@@ -19,7 +19,7 @@
package bugs
import groovy.transform.CompileStatic
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -61,7 +61,7 @@ final class Groovy3839 {
class G3839V3 {}
new G3839V3()
'''
- assert err =~ '@GroovyASTTransformationClass in bugs.G3839A3 does not specify any transform class names or types'
+ assert err.message =~ '@GroovyASTTransformationClass in bugs.G3839A3 does not specify any transform class names or types'
}
@Test
@@ -73,6 +73,6 @@ final class Groovy3839 {
class G3839V4 {}
new G3839V4()
'''
- assert err =~ '@GroovyASTTransformationClass in bugs.G3839A4 should specify transforms by name or by type, not by both'
+ assert err.message =~ '@GroovyASTTransformationClass in bugs.G3839A4 should specify transforms by name or by type, not by both'
}
}
diff --git a/src/test/groovy/bugs/Groovy3852.groovy b/src/test/groovy/bugs/Groovy3852.groovy
index 2faa898d69..7c78c52ca2 100644
--- a/src/test/groovy/bugs/Groovy3852.groovy
+++ b/src/test/groovy/bugs/Groovy3852.groovy
@@ -19,8 +19,8 @@
package bugs
import groovy.transform.CompileStatic
-import org.junit.Assert
-import org.junit.Test
+import org.junit.jupiter.api.Assertions
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
@@ -37,7 +37,7 @@ final class Groovy3852 {
class A {}
'''
- assert err =~ /Cannot specify duplicate annotation/
+ assert err.message =~ /Cannot specify duplicate annotation/
}
@Test
@@ -49,7 +49,7 @@ final class Groovy3852 {
@interface B {}
'''
- assert err =~ /Cannot specify duplicate annotation/
+ assert err.message =~ /Cannot specify duplicate annotation/
}
@Test
@@ -63,7 +63,7 @@ final class Groovy3852 {
}
'''
- assert err =~ /Cannot specify duplicate annotation/
+ assert err.message =~ /Cannot specify duplicate annotation/
err = shouldFail '''
class D {
@@ -74,7 +74,7 @@ final class Groovy3852 {
}
'''
- assert err =~ /Cannot specify duplicate annotation/
+ assert err.message =~ /Cannot specify duplicate annotation/
}
@Test
@@ -90,7 +90,7 @@ final class Groovy3852 {
}
'''
} catch (any) {
- Assert.fail('Compilation should have succeeded as it has duplication annotations but with retention policy "not RUNTIME"')
+ Assertions.fail('Compilation should have succeeded as it has duplication annotations but with retention policy "not RUNTIME"')
}
}
@@ -109,7 +109,7 @@ final class Groovy3852 {
}
'''
} catch (any) {
- Assert.fail('Compilation should have succeeded as it has duplication annotations but with retention policy "not RUNTIME"')
+ Assertions.fail('Compilation should have succeeded as it has duplication annotations but with retention policy "not RUNTIME"')
}
}
}
diff --git a/src/test/groovy/bugs/Groovy3863Bug.groovy b/src/test/groovy/bugs/Groovy3863Bug.groovy
index 78f30cff8f..2843d9fa3e 100644
--- a/src/test/groovy/bugs/Groovy3863Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3863Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3863Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy3863Bug {
+ @Test
void testClassNameAccessInMainMethod() {
assertScript """
class Foo3863 {
diff --git a/src/test/groovy/bugs/Groovy3868Bug.groovy b/src/test/groovy/bugs/Groovy3868Bug.groovy
index 73059efb82..0118ffa706 100644
--- a/src/test/groovy/bugs/Groovy3868Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3868Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3868Bug extends GroovyTestCase {
+
+class Groovy3868Bug {
+ @Test
void testAsTypeCallWithPrimitiveType() {
callAndcheckResults(Long)
callAndcheckResults(Integer)
diff --git a/src/test/groovy/bugs/Groovy3876Bug.groovy b/src/test/groovy/bugs/Groovy3876Bug.groovy
index aabd8a0419..9d416ec27e 100644
--- a/src/test/groovy/bugs/Groovy3876Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3876Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.runtime.typehandling.GroovyCastException
+import org.junit.jupiter.api.Test
-class Groovy3876Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy3876Bug {
+ @Test
void testGStringToNumberConversion() {
def a
diff --git a/src/test/groovy/bugs/Groovy3894Bug.groovy b/src/test/groovy/bugs/Groovy3894Bug.groovy
index d8c64425e6..2d9778a37b 100644
--- a/src/test/groovy/bugs/Groovy3894Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3894Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3894Bug extends GroovyTestCase {
+
+class Groovy3894Bug {
+ @Test
void testInfinityToBigDecimalConversion() {
BigDecimal x = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
assert x ** 5 == Double.POSITIVE_INFINITY
diff --git a/src/test/groovy/bugs/Groovy389_Bug.groovy b/src/test/groovy/bugs/Groovy389_Bug.groovy
index 9a0cc23f4c..0a84817128 100644
--- a/src/test/groovy/bugs/Groovy389_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy389_Bug.groovy
@@ -18,14 +18,16 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
+
/**
* Verifies that closures work inside case blocks.
*
*/
-class Groovy389_Bug extends GroovyTestCase {
+class Groovy389_Bug {
+ @Test
void testBug() {
def a = [10, 11, 12]
def b = 0
diff --git a/src/test/groovy/bugs/Groovy3904.groovy b/src/test/groovy/bugs/Groovy3904.groovy
index b3b9fcb07f..b04051791d 100644
--- a/src/test/groovy/bugs/Groovy3904.groovy
+++ b/src/test/groovy/bugs/Groovy3904.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.shouldFail
@@ -26,7 +26,7 @@ final class Groovy3904 {
private static void compileAndVerifyCyclicInheritenceCompilationError(String sourceCode) {
def err = shouldFail(sourceCode)
- assert err =~ /Cycle detected/
+ assert err.message =~ /Cycle detected/
}
@Test
diff --git a/src/test/groovy/bugs/Groovy3948Bug.groovy b/src/test/groovy/bugs/Groovy3948Bug.groovy
index af9e3aa9c5..08bf69865b 100644
--- a/src/test/groovy/bugs/Groovy3948Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3948Bug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3948Bug extends GroovyTestCase {
+class Groovy3948Bug {
+
+ @Test
void testBug1() {
Expando.metaClass.foo = { -> delegate.bar() }
@@ -34,6 +36,7 @@ class Groovy3948Bug extends GroovyTestCase {
assert e.foo() == 2
}
+ @Test
void testBug2() {
Foo f = new Foo()
def results = []
diff --git a/src/test/groovy/bugs/Groovy3949Bug.groovy b/src/test/groovy/bugs/Groovy3949Bug.groovy
index 376e9548a6..62e512d30a 100644
--- a/src/test/groovy/bugs/Groovy3949Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3949Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy3949Bug extends GroovyTestCase {
+
+class Groovy3949Bug {
+ @Test
void testClosureCallInStaticContextForClassWithStaticCallMethod() {
assert Class3949.m { "$it 123" } == "1234 123"
}
diff --git a/src/test/groovy/bugs/Groovy4009Bug.groovy b/src/test/groovy/bugs/Groovy4009Bug.groovy
index 20f5656ef7..868c827f2a 100644
--- a/src/test/groovy/bugs/Groovy4009Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4009Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4009Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.fail
+
+class Groovy4009Bug {
+ @Test
void testNoOfTimesResolveCallIsMade() {
try {
assertScript """
diff --git a/src/test/groovy/bugs/Groovy4018Bug.groovy b/src/test/groovy/bugs/Groovy4018Bug.groovy
index d22e016559..b66baf692b 100644
--- a/src/test/groovy/bugs/Groovy4018Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4018Bug.groovy
@@ -18,10 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4018Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+class Groovy4018Bug {
+
+ @Test
void testFloatAsBoolean() {
assertScript '''
assert 0.1f
@@ -34,6 +38,7 @@ class Groovy4018Bug extends GroovyTestCase {
'''
}
+ @Test
void testDoubleAsBoolean() {
assertScript '''
assert 0.1d
@@ -46,6 +51,7 @@ class Groovy4018Bug extends GroovyTestCase {
'''
}
+ @Test
void testFloatAsBooleanSTC() {
assertScript '''
@groovy.transform.CompileStatic
@@ -57,6 +63,7 @@ class Groovy4018Bug extends GroovyTestCase {
'''
}
+ @Test
void testDoubleAsBooleanSTC() {
assertScript '''
@groovy.transform.CompileStatic
diff --git a/src/test/groovy/bugs/Groovy4029Bug.groovy b/src/test/groovy/bugs/Groovy4029Bug.groovy
index 75b4f107a3..877ac7afc3 100644
--- a/src/test/groovy/bugs/Groovy4029Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4029Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4029Bug extends GroovyTestCase {
+
+class Groovy4029Bug {
+ @Test
void testAddNullKeyEntryInMapUsingSubscriptNotation() {
Map m = [:]
m[null] = null
diff --git a/src/test/groovy/bugs/Groovy4035.groovy b/src/test/groovy/bugs/Groovy4035.groovy
index 3150ae1d24..7d590e02a9 100644
--- a/src/test/groovy/bugs/Groovy4035.groovy
+++ b/src/test/groovy/bugs/Groovy4035.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy4038Bug.groovy b/src/test/groovy/bugs/Groovy4038Bug.groovy
index 2afc4d7e74..a4ba4f91c6 100644
--- a/src/test/groovy/bugs/Groovy4038Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4038Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4038Bug extends GroovyTestCase {
+
+class Groovy4038Bug {
+ @Test
void testResondsToOnClosures() {
def c = {String x -> }
assert c.metaClass.respondsTo(c, "doCall", "Hello")
diff --git a/src/test/groovy/bugs/Groovy4046Bug.groovy b/src/test/groovy/bugs/Groovy4046Bug.groovy
index 2db2d2c459..80051a4a37 100644
--- a/src/test/groovy/bugs/Groovy4046Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4046Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4046Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertFalse
+
+
+class Groovy4046Bug {
+ @Test
void testComparableOnLeftObjectOnRight() {
assertFalse MyEnum4046.A == new Object()
diff --git a/src/test/groovy/bugs/Groovy4069Bug.groovy b/src/test/groovy/bugs/Groovy4069Bug.groovy
index 43ec14a7e2..4dcf3a3161 100644
--- a/src/test/groovy/bugs/Groovy4069Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4069Bug.groovy
@@ -18,10 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4069Bug extends GroovyTestCase {
+class Groovy4069Bug {
+
+ @Test
void testEMCConstructorWithSubClassingTest1V1() {
def shell = new GroovyShell()
shell.evaluate """
@@ -50,6 +52,7 @@ class Groovy4069Bug extends GroovyTestCase {
"""
}
+ @Test
void testEMCConstructorWithSubClassingTest1V2() {
def shell = new GroovyShell()
shell.evaluate """
@@ -78,6 +81,7 @@ class Groovy4069Bug extends GroovyTestCase {
"""
}
+ @Test
void testEMCConstructorWithSubClassingTest2V1() {
def shell = new GroovyShell()
shell.evaluate """
@@ -106,6 +110,7 @@ class Groovy4069Bug extends GroovyTestCase {
"""
}
+ @Test
void testEMCConstructorWithSubClassingTest2V2() {
def shell = new GroovyShell()
shell.evaluate """
diff --git a/src/test/groovy/bugs/Groovy4075Bug.groovy b/src/test/groovy/bugs/Groovy4075Bug.groovy
index aae3868daf..aa4c85d103 100644
--- a/src/test/groovy/bugs/Groovy4075Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4075Bug.groovy
@@ -18,9 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4075Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.shouldFailWithCause
+
+
+class Groovy4075Bug {
static void failChecked() throws Exception {
throw new Exception(new IllegalArgumentException(new NullPointerException("NPE in failChecked")))
}
@@ -29,15 +32,17 @@ class Groovy4075Bug extends GroovyTestCase {
throw new RuntimeException(new IllegalArgumentException("IAE in failUnchecked", new NullPointerException()))
}
+ @Test
void testCheckedFailure() {
assert shouldFailWithCause(NullPointerException) {
Groovy4075Bug.failChecked()
- } == "NPE in failChecked"
+ }.message == "NPE in failChecked"
}
+ @Test
void testUncheckedFailure() {
assert shouldFailWithCause(IllegalArgumentException) {
Groovy4075Bug.failUnchecked()
- } == "IAE in failUnchecked"
+ }.message == "IAE in failUnchecked"
}
}
diff --git a/src/test/groovy/bugs/Groovy4078Bug.groovy b/src/test/groovy/bugs/Groovy4078Bug.groovy
index 8063393213..b2a92696da 100644
--- a/src/test/groovy/bugs/Groovy4078Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4078Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4078Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+
+class Groovy4078Bug {
+ @Test
void testInfiniteLoopDetectionInStepUsage() {
(2..2).step 0, {assert it != null} //IntRange
diff --git a/src/test/groovy/bugs/Groovy4080Bug.groovy b/src/test/groovy/bugs/Groovy4080Bug.groovy
index 7fa0a49261..7b0b53b984 100644
--- a/src/test/groovy/bugs/Groovy4080Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4080Bug.groovy
@@ -18,14 +18,14 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-class Groovy4080Bug extends GroovyTestCase {
+class Groovy4080Bug {
public void testClassGeneratedWithAnnotationHavingGrabOnImport() {
GroovyShell shell = new GroovyShell(new GroovyClassLoader())
shell.evaluate """
@Grab(group='commons-primitives', module='commons-primitives', version='1.0')
import java.lang.annotation.*
+import org.junit.jupiter.api.Test
@Retention(RetentionPolicy.RUNTIME)
@interface Require {
diff --git a/src/test/groovy/bugs/Groovy4097.groovy b/src/test/groovy/bugs/Groovy4097.groovy
index ae5d667458..06a3360221 100644
--- a/src/test/groovy/bugs/Groovy4097.groovy
+++ b/src/test/groovy/bugs/Groovy4097.groovy
@@ -19,7 +19,7 @@
package bugs
import groovy.test.NotYetImplemented
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy4098.groovy b/src/test/groovy/bugs/Groovy4098.groovy
index c9fd8b568b..42721dd62f 100644
--- a/src/test/groovy/bugs/Groovy4098.groovy
+++ b/src/test/groovy/bugs/Groovy4098.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.shouldFail
import static java.lang.reflect.Modifier.isFinal
@@ -105,7 +105,7 @@ final class Groovy4098 {
def err = shouldFail {
metaProperty.setProperty(this, 'five mop')
}
- assert err =~ /Cannot set read-only property: propertyFive/
+ assert err.message =~ /Cannot set read-only property: propertyFive/
}
@Test
@@ -117,7 +117,7 @@ final class Groovy4098 {
def err = shouldFail {
metaProperty.setProperty(this, 'six mop')
}
- assert err =~ /Cannot set the property 'propertySix' because the backing field is final./
+ assert err.message =~ /Cannot set the property 'propertySix' because the backing field is final./
}
//
diff --git a/src/test/groovy/bugs/Groovy4104Bug.groovy b/src/test/groovy/bugs/Groovy4104Bug.groovy
index 14934d000e..437102ced5 100644
--- a/src/test/groovy/bugs/Groovy4104Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4104Bug.groovy
@@ -18,10 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.runtime.MethodClosure
+import org.junit.jupiter.api.Test
-class Groovy4104Bug extends GroovyTestCase {
+class Groovy4104Bug {
+ @Test
void testMethodClosureWithProtectedMethodInSuperClass() {
MethodClosure mc1 = new Groovy4104A().createMethodClosure();
MethodClosure mc2 = new Groovy4104B().createMethodClosure();
diff --git a/src/test/groovy/bugs/Groovy4106Bug.groovy b/src/test/groovy/bugs/Groovy4106Bug.groovy
index 6344d1b6b9..4684aee303 100644
--- a/src/test/groovy/bugs/Groovy4106Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4106Bug.groovy
@@ -19,9 +19,10 @@
package bugs
import groovy.lang.MetaClassRegistry.MetaClassCreationHandle
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4106Bug extends GroovyTestCase {
+class Groovy4106Bug {
+ @Test
void testStackOverflowError() {
MetaClassCreationHandle handle = new ExpandoMetaClassCreationHandle()
handle.create(ExpandoMetaClass, GroovySystem.getMetaClassRegistry())
diff --git a/src/test/groovy/bugs/Groovy4107Bug.groovy b/src/test/groovy/bugs/Groovy4107Bug.groovy
index 3b87c297ba..6d6bc2fed1 100644
--- a/src/test/groovy/bugs/Groovy4107Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4107Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
-class Groovy4107Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy4107Bug {
+ @Test
void testUnqualifiedImportResolveBug() {
try {
new GroovyShell().parse """
diff --git a/src/test/groovy/bugs/Groovy4111Bug.groovy b/src/test/groovy/bugs/Groovy4111Bug.groovy
index 27cbba16df..be0f8294d6 100644
--- a/src/test/groovy/bugs/Groovy4111Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4111Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
-class Groovy4111Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy4111Bug {
+ @Test
void testConstructorCallOnAnAbstractType() {
try {
new GroovyShell().parse """
diff --git a/src/test/groovy/bugs/Groovy4116Bug.groovy b/src/test/groovy/bugs/Groovy4116Bug.groovy
index 04abaa994a..c090656f33 100644
--- a/src/test/groovy/bugs/Groovy4116Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4116Bug.groovy
@@ -18,10 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
-final class Groovy4116Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.shouldFail
+
+final class Groovy4116Bug {
void testAnInterfaceMethodNotImplementedPublic() {
def err = shouldFail MultipleCompilationErrorsException, '''
@@ -32,7 +33,7 @@ final class Groovy4116Bug extends GroovyTestCase {
def foo()
}
'''
- assert err =~ /The method foo should be public as it implements the corresponding method from interface I4116/
+ assert err.message =~ /The method foo should be public as it implements the corresponding method from interface I4116/
}
void testAnInterfaceMethodNotImplementedPublicV2SuperClassInterface() {
@@ -46,6 +47,6 @@ final class Groovy4116Bug extends GroovyTestCase {
def foo()
}
'''
- assert err =~ /The method foo should be public as it implements the corresponding method from interface I4116/
+ assert err.message =~ /The method foo should be public as it implements the corresponding method from interface I4116/
}
}
diff --git a/src/test/groovy/bugs/Groovy4119Bug.groovy b/src/test/groovy/bugs/Groovy4119Bug.groovy
index 92612757d3..2f5d2b66e4 100644
--- a/src/test/groovy/bugs/Groovy4119Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4119Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-class Groovy4119Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy4119Bug {
void testThis$0PassingInSuperCallWithinInnerClasses() {
assertScript """
class Test4119 {
diff --git a/src/test/groovy/bugs/Groovy4120Bug.groovy b/src/test/groovy/bugs/Groovy4120Bug.groovy
index 6a985260b5..bcdf8dfad6 100644
--- a/src/test/groovy/bugs/Groovy4120Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4120Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
-class Groovy4120Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy4120Bug {
+ @Test
void testInitCallOnNonStaticInnerClassWOEnclosingInstance() {
try {
new GroovyShell().parse """
@@ -42,6 +45,7 @@ class Groovy4120Bug extends GroovyTestCase {
}
}
+ @Test
void testInitCallOnNonStaticInnerClassWithEnclosingInstance() {
new GroovyShell().parse """
class Test4120B {
diff --git a/src/test/groovy/bugs/Groovy4121Bug.groovy b/src/test/groovy/bugs/Groovy4121Bug.groovy
index 5740eb115d..cf9349a24c 100644
--- a/src/test/groovy/bugs/Groovy4121Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4121Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
-class Groovy4121Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy4121Bug {
+ @Test
void testAssignmentToAFieldMadeFinalByImmutable() {
try {
new GroovyShell().parse """
diff --git a/src/test/groovy/bugs/Groovy4129Bug.groovy b/src/test/groovy/bugs/Groovy4129Bug.groovy
index 6448e241ae..635caed4b7 100644
--- a/src/test/groovy/bugs/Groovy4129Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4129Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4129Bug extends GroovyTestCase {
+
+class Groovy4129Bug {
+ @Test
void testImplicitThisPassingInObjInitBlock() {
new GroovyShell().parse """
class Test4129 {
diff --git a/src/test/groovy/bugs/Groovy4131Bug.groovy b/src/test/groovy/bugs/Groovy4131Bug.groovy
index 2e6fcc519b..0c29c4b5c9 100644
--- a/src/test/groovy/bugs/Groovy4131Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4131Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4131Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+
+class Groovy4131Bug {
+ @Test
void testTwoMainMethodsInAScript() {
try {
new GroovyShell().parse """
diff --git a/src/test/groovy/bugs/Groovy4133Bug.groovy b/src/test/groovy/bugs/Groovy4133Bug.groovy
index 82f723eae1..4999bef973 100644
--- a/src/test/groovy/bugs/Groovy4133Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4133Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4133Bug extends GroovyTestCase {
+
+class Groovy4133Bug {
+ @Test
void testDelegateAnnotationWithNativeMethods() {
new GroovyShell().evaluate """
class String4133 {
diff --git a/src/test/groovy/bugs/Groovy4134Bug.groovy b/src/test/groovy/bugs/Groovy4134Bug.groovy
index b97f68b41f..c06dbb38fe 100644
--- a/src/test/groovy/bugs/Groovy4134Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4134Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4134Bug extends GroovyTestCase {
+
+class Groovy4134Bug {
+ @Test
void testClosureParamsWithDefaultValues() {
def c = {Integer maxRows = Integer.MAX_VALUE -> maxRows}
assert c() == Integer.MAX_VALUE
diff --git a/src/test/groovy/bugs/Groovy4139Bug.groovy b/src/test/groovy/bugs/Groovy4139Bug.groovy
index f8c39153ae..beb69fcb16 100644
--- a/src/test/groovy/bugs/Groovy4139Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4139Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4139Bug extends GroovyTestCase {
+
+class Groovy4139Bug {
+ @Test
void testEmptyStringAsMapEntryKey() {
use (groovy.time.TimeCategory) {
def topics = [:]
diff --git a/src/test/groovy/bugs/Groovy4170Bug.groovy b/src/test/groovy/bugs/Groovy4170Bug.groovy
index 798e3a1835..c51b1e3a5a 100644
--- a/src/test/groovy/bugs/Groovy4170Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4170Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4170Bug extends GroovyTestCase {
+
+class Groovy4170Bug {
+ @Test
void testClosureCurrying() {
new CurryFoo4170().bar()
}
diff --git a/src/test/groovy/bugs/Groovy4188Bug.groovy b/src/test/groovy/bugs/Groovy4188Bug.groovy
index 7be3cd5cdd..095d8d8617 100644
--- a/src/test/groovy/bugs/Groovy4188Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4188Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
-class Groovy4188Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy4188Bug {
+ @Test
void testClassProvidingMetaClassFieldOfWrongType() {
try {
new GroovyShell().parse """
diff --git a/src/test/groovy/bugs/Groovy4191Bug.groovy b/src/test/groovy/bugs/Groovy4191Bug.groovy
index 47391b6772..2eea7f6fc1 100644
--- a/src/test/groovy/bugs/Groovy4191Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4191Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4191Bug extends GroovyTestCase {
+
+class Groovy4191Bug {
+ @Test
void testPutIntoArray() {
recreateProblem()
recreateProblem()
diff --git a/src/test/groovy/bugs/Groovy4193.groovy b/src/test/groovy/bugs/Groovy4193.groovy
index 94f4e93e26..81842c7704 100644
--- a/src/test/groovy/bugs/Groovy4193.groovy
+++ b/src/test/groovy/bugs/Groovy4193.groovy
@@ -20,7 +20,7 @@ package bugs
import groovy.transform.CompileStatic
import org.codehaus.groovy.ast.ImportNode
-import org.junit.Test
+import org.junit.jupiter.api.Test
@CompileStatic
final class Groovy4193 {
diff --git a/src/test/groovy/bugs/Groovy4202Bug.groovy b/src/test/groovy/bugs/Groovy4202Bug.groovy
index ca82ce6465..6a5f9998a9 100644
--- a/src/test/groovy/bugs/Groovy4202Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4202Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4202Bug extends GroovyTestCase {
+
+class Groovy4202Bug {
+ @Test
void testSuccessiveMCModificationFirstClassThenInstance() {
def inst0 = new Foo4202()
def inst1 = new Foo4202()
diff --git a/src/test/groovy/bugs/Groovy4206.groovy b/src/test/groovy/bugs/Groovy4206.groovy
index 255b09e34c..018579621d 100644
--- a/src/test/groovy/bugs/Groovy4206.groovy
+++ b/src/test/groovy/bugs/Groovy4206.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
diff --git a/src/test/groovy/bugs/Groovy4235Bug.groovy b/src/test/groovy/bugs/Groovy4235Bug.groovy
index 3b8a2081a3..da0e93eb68 100644
--- a/src/test/groovy/bugs/Groovy4235Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4235Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4235Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy4235Bug {
+ @Test
void testAccessStaticPropInsideClosure() {
assertScript """
class Foo4235 {
diff --git a/src/test/groovy/bugs/Groovy4241Bug.groovy b/src/test/groovy/bugs/Groovy4241Bug.groovy
index bee0a3f71b..015ac7725c 100644
--- a/src/test/groovy/bugs/Groovy4241Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4241Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4241Bug extends GroovyTestCase {
+
+class Groovy4241Bug {
+ @Test
void testAsTypeWithinvokeMethodOverridden() {
Foo4241.metaClass.invokeMethod = { String name, args ->
println name
diff --git a/src/test/groovy/bugs/Groovy4243.groovy b/src/test/groovy/bugs/Groovy4243.groovy
index 22fb4ca440..3248d7d435 100644
--- a/src/test/groovy/bugs/Groovy4243.groovy
+++ b/src/test/groovy/bugs/Groovy4243.groovy
@@ -19,7 +19,7 @@
package bugs
import org.codehaus.groovy.control.CompilerConfiguration
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class Groovy4243 {
diff --git a/src/test/groovy/bugs/Groovy4246Bug.groovy b/src/test/groovy/bugs/Groovy4246Bug.groovy
index 0a922e7706..fb1547897e 100644
--- a/src/test/groovy/bugs/Groovy4246Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4246Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4246Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy4246Bug {
+ @Test
void testPostFixExpEvaluations() {
assertScript """
class Bug4246 {
diff --git a/src/test/groovy/bugs/Groovy4247Bug.groovy b/src/test/groovy/bugs/Groovy4247Bug.groovy
index 789eef3e6c..d384ca3f2e 100644
--- a/src/test/groovy/bugs/Groovy4247Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4247Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4247Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+
+class Groovy4247Bug {
+ @Test
void testNewFileRenameToMethod() {
def file = new File('blah_blah')
diff --git a/src/test/groovy/bugs/Groovy4257Bug.groovy b/src/test/groovy/bugs/Groovy4257Bug.groovy
index c04224c5fc..38b3069e1b 100644
--- a/src/test/groovy/bugs/Groovy4257Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4257Bug.groovy
@@ -18,9 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4257Bug extends GroovyTestCase {
+
+class Groovy4257Bug {
+ @Test
void testSetUnique() {
Set orig = [[3035, 26972], [2795, 34412]]
Set clone = orig.clone()
@@ -30,6 +32,7 @@ class Groovy4257Bug extends GroovyTestCase {
assert orig == clone
}
+ @Test
void testNumberCoercion() {
def orig = [3, 3L, 3.0] as Set
def expected = [3] as Set
diff --git a/src/test/groovy/bugs/Groovy4264Bug.groovy b/src/test/groovy/bugs/Groovy4264Bug.groovy
index 6122bf334b..c932b7a088 100644
--- a/src/test/groovy/bugs/Groovy4264Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4264Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4264Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.fail
+
+class Groovy4264Bug {
+ @Test
void testSubClassHavingMainEntryPoint() {
try {
assertScript """
@@ -39,6 +43,7 @@ class Groovy4264Bug extends GroovyTestCase {
}
// this scenario used to work correctly. Just added to ensure that there is no change in its behavior
+ @Test
void testScriptExecutionTakingPreferenceOverClasses() {
try {
assertScript """
@@ -58,6 +63,7 @@ class Groovy4264Bug extends GroovyTestCase {
}
// this scenario used to work correctly. Just added to ensure that there is no change in its behavior
+ @Test
void testExecutionOfJustAScript() {
try {
assertScript """
diff --git a/src/test/groovy/bugs/Groovy4293Bug.groovy b/src/test/groovy/bugs/Groovy4293Bug.groovy
index 02e8536740..ba6f502347 100644
--- a/src/test/groovy/bugs/Groovy4293Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4293Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4293Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.fail
+
+class Groovy4293Bug {
+ @Test
void testNoBUGMessageForNullScriptPassedToCompiler() {
try {
assertScript """
diff --git a/src/test/groovy/bugs/Groovy4349.groovy b/src/test/groovy/bugs/Groovy4349.groovy
index feaaaea67d..e2894770d2 100644
--- a/src/test/groovy/bugs/Groovy4349.groovy
+++ b/src/test/groovy/bugs/Groovy4349.groovy
@@ -20,7 +20,7 @@ package bugs
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit
-import org.junit.Test
+import org.junit.jupiter.api.Test
final class Groovy4349 {
@Test
diff --git a/src/test/groovy/bugs/Groovy4365.groovy b/src/test/groovy/bugs/Groovy4365.groovy
index 1f0f90c01d..35e90759df 100644
--- a/src/test/groovy/bugs/Groovy4365.groovy
+++ b/src/test/groovy/bugs/Groovy4365.groovy
@@ -18,7 +18,7 @@
*/
package bugs
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.shouldFail
@@ -31,6 +31,6 @@ final class Groovy4365 {
}
}
'''
- assert err =~ /unable to resolve class HashMap.Entry/
+ assert err.message =~ /unable to resolve class HashMap.Entry/
}
}
diff --git a/src/test/groovy/bugs/Groovy4393Bug.groovy b/src/test/groovy/bugs/Groovy4393Bug.groovy
index d378966f5a..65df59d39d 100644
--- a/src/test/groovy/bugs/Groovy4393Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4393Bug.groovy
@@ -18,11 +18,12 @@
*/
package bugs
-import groovy.test.GroovyTestCase
-import org.junit.Ignore
+import org.junit.jupiter.api.Disabled
+import org.junit.jupiter.api.Test
-@Ignore('requires a specific configuration, see: https://issues.apache.org/jira/browse/GROOVY-4393 for details')
-class Groovy4393Bug extends GroovyTestCase {
+@Disabled('requires a specific configuration, see: https://issues.apache.org/jira/browse/GROOVY-4393 for details')
+class Groovy4393Bug {
+ @Test
void testIfSourceFilesWithOtherExtensionsGotCompiledFine() {
assert Groovy4393BugV1 != null
}
diff --git a/src/test/groovy/bugs/Groovy4414Bug.groovy b/src/test/groovy/bugs/Groovy4414Bug.groovy
index de4f4c8762..f07b7e888b 100644
--- a/src/test/groovy/bugs/Groovy4414Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4414Bug.groovy
@@ -18,10 +18,11 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.runtime.InvokerHelper
-class Groovy4414Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+class Groovy4414Bug {
public void testUnaryMinus() {
assertEquals(-1, InvokerHelper.unaryMinus(1)); // relying here on boxing for Integer
assertEquals(-1l, InvokerHelper.unaryMinus(1l));
diff --git a/src/test/groovy/bugs/Groovy4415Bug.groovy b/src/test/groovy/bugs/Groovy4415Bug.groovy
index b61e25518d..24e7417031 100644
--- a/src/test/groovy/bugs/Groovy4415Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4415Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4415Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy4415Bug {
+ @Test
void testCompilerShouldFindMethod() {
// interface defined in Groovy
assertScript '''
@@ -42,6 +46,7 @@ class Groovy4415Bug extends GroovyTestCase {
'''
}
+ @Test
void testGroovy4645() {
assertScript '''
interface CovariantReturns {
diff --git a/src/test/groovy/bugs/Groovy4416Bug.groovy b/src/test/groovy/bugs/Groovy4416Bug.groovy
index ad8c7446e5..7662aecf76 100644
--- a/src/test/groovy/bugs/Groovy4416Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4416Bug.groovy
@@ -18,9 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
-class Groovy4416Bug extends GroovyTestCase {
+import static groovy.test.GroovyAssert.assertScript
+
+
+class Groovy4416Bug {
+ @Test
void testImplicitThisPassingInNonStaticInnerClassesBug() {
assertScript """
class Dummy4416 {
diff --git a/src/test/groovy/bugs/Groovy4418.groovy b/src/test/groovy/bugs/Groovy4418.groovy
index d6184f9f1f..26503661bc 100644
--- a/src/test/groovy/bugs/Groovy4418.groovy
+++ b/src/test/groovy/bugs/Groovy4418.groovy
@@ -19,7 +19,7 @@
package bugs
import groovy.transform.CompileStatic
-import org.junit.Test
+import org.junit.jupiter.api.Test
import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.shouldFail
diff --git a/src/test/groovy/bugs/Groovy4435Bug.groovy b/src/test/groovy/bugs/Groovy4435Bug.groovy
index ace9f953a6..016460b86b 100644
--- a/src/test/groovy/bugs/Groovy4435Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4435Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
-class Groovy4435Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy4435Bug {
+ @Test
void testAssignmentToAFinalFieldThroughPropertyAccess() {
try {
new GroovyShell().parse """
diff --git a/src/test/groovy/bugs/Groovy4449Bug.groovy b/src/test/groovy/bugs/Groovy4449Bug.groovy
index 09be54d734..c88f6e81f8 100644
--- a/src/test/groovy/bugs/Groovy4449Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4449Bug.groovy
@@ -18,10 +18,13 @@
*/
package bugs
-import groovy.test.GroovyTestCase
import org.codehaus.groovy.control.MultipleCompilationErrorsException
+import org.junit.jupiter.api.Test
-class Groovy4449Bug extends GroovyTestCase {
+import static org.junit.jupiter.api.Assertions.fail
+
+class Groovy4449Bug {
+ @Test
... 45115 lines suppressed ...