This is an automated email from the ASF dual-hosted git repository.

paulk 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 818f459857 minor refactor: junit 5
818f459857 is described below

commit 818f4598577b37657b1b875d1ff4dd5f4ae4cb77
Author: Paul King <[email protected]>
AuthorDate: Mon Apr 13 16:08:40 2026 +1000

    minor refactor: junit 5
---
 .../src/spec/test/groovy/csv/CsvBuilderTest.groovy         | 12 ++++++++++--
 .../src/spec/test/groovy/csv/CsvSlurperTest.groovy         | 14 ++++++++++++--
 .../src/spec/test/groovy/toml/TomlBuilderTest.groovy       |  7 +++++--
 .../src/spec/test/groovy/toml/TomlParserTest.groovy        | 12 ++++++++++--
 .../src/spec/test/groovy/yaml/YamlBuilderTest.groovy       |  7 +++++--
 .../src/spec/test/groovy/yaml/YamlParserTest.groovy        | 13 +++++++++++--
 6 files changed, 53 insertions(+), 12 deletions(-)

diff --git 
a/subprojects/groovy-csv/src/spec/test/groovy/csv/CsvBuilderTest.groovy 
b/subprojects/groovy-csv/src/spec/test/groovy/csv/CsvBuilderTest.groovy
index 989bd6afcf..9247517049 100644
--- a/subprojects/groovy-csv/src/spec/test/groovy/csv/CsvBuilderTest.groovy
+++ b/subprojects/groovy-csv/src/spec/test/groovy/csv/CsvBuilderTest.groovy
@@ -18,10 +18,11 @@
  */
 package groovy.csv
 
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
 
-class CsvBuilderTest extends GroovyTestCase {
+class CsvBuilderTest {
 
+    @Test
     void testToCsvFromMaps() {
         // tag::to_csv_maps[]
         def data = [
@@ -35,11 +36,13 @@ class CsvBuilderTest extends GroovyTestCase {
         // end::to_csv_maps[]
     }
 
+    @Test
     void testToCsvEmpty() {
         assert CsvBuilder.toCsv([]) == ''
         assert CsvBuilder.toCsv(null) == ''
     }
 
+    @Test
     void testToCsvQuotesSpecialChars() {
         def data = [[name: 'Alice, Jr.', note: 'said "hi"']]
         def csv = CsvBuilder.toCsv(data)
@@ -47,6 +50,7 @@ class CsvBuilderTest extends GroovyTestCase {
         assert csv.contains('"said ""hi"""')
     }
 
+    @Test
     void testBuilderInstance() {
         def builder = new CsvBuilder()
         builder.call([[name: 'Alice', age: 30], [name: 'Bob', age: 25]])
@@ -55,6 +59,7 @@ class CsvBuilderTest extends GroovyTestCase {
         assert csv.contains('Alice,30')
     }
 
+    @Test
     void testWritable() {
         def builder = new CsvBuilder()
         builder.call([[x: 1, y: 2]])
@@ -63,6 +68,7 @@ class CsvBuilderTest extends GroovyTestCase {
         assert out.toString().contains('x,y')
     }
 
+    @Test
     void testRoundTrip() {
         // tag::round_trip[]
         def original = [[name: 'Alice', age: '30'], [name: 'Bob', age: '25']]
@@ -80,6 +86,7 @@ class CsvBuilderTest extends GroovyTestCase {
     }
     // end::typed_writing[]
 
+    @Test
     void testToCsvFromTypedObjects() {
         // tag::typed_writing_usage[]
         def products = [new Product(name: 'Widget', price: 9.99),
@@ -91,6 +98,7 @@ class CsvBuilderTest extends GroovyTestCase {
         // end::typed_writing_usage[]
     }
 
+    @Test
     void testTypedRoundTrip() {
         def products = [new Product(name: 'Widget', price: 9.99)]
         def csv = CsvBuilder.toCsv(products, Product)
diff --git 
a/subprojects/groovy-csv/src/spec/test/groovy/csv/CsvSlurperTest.groovy 
b/subprojects/groovy-csv/src/spec/test/groovy/csv/CsvSlurperTest.groovy
index 9a19dabcb7..40c17f306d 100644
--- a/subprojects/groovy-csv/src/spec/test/groovy/csv/CsvSlurperTest.groovy
+++ b/subprojects/groovy-csv/src/spec/test/groovy/csv/CsvSlurperTest.groovy
@@ -18,10 +18,11 @@
  */
 package groovy.csv
 
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
 
-class CsvSlurperTest extends GroovyTestCase {
+class CsvSlurperTest {
 
+    @Test
     void testParseText() {
         // tag::parse_text[]
         def csv = new CsvSlurper().parseText('name,age\nAlice,30\nBob,25')
@@ -32,6 +33,7 @@ class CsvSlurperTest extends GroovyTestCase {
         // end::parse_text[]
     }
 
+    @Test
     void testPropertyAccess() {
         // tag::property_access[]
         def csv = new CsvSlurper().parseText('''\
@@ -43,6 +45,7 @@ class CsvSlurperTest extends GroovyTestCase {
         // end::property_access[]
     }
 
+    @Test
     void testCustomSeparator() {
         // tag::custom_separator[]
         def csv = new CsvSlurper().setSeparator((char) 
'\t').parseText('name\tage\nAlice\t30')
@@ -51,6 +54,7 @@ class CsvSlurperTest extends GroovyTestCase {
         // end::custom_separator[]
     }
 
+    @Test
     void testQuotedFields() {
         // tag::quoted_fields[]
         def csv = new CsvSlurper().parseText('name,note\nAlice,"hello, 
world"\nBob,"say ""hi"""')
@@ -59,22 +63,26 @@ class CsvSlurperTest extends GroovyTestCase {
         // end::quoted_fields[]
     }
 
+    @Test
     void testEmptyInput() {
         def csv = new CsvSlurper().parseText('')
         assert csv.isEmpty()
     }
 
+    @Test
     void testSingleRow() {
         def csv = new CsvSlurper().parseText('name,age\nAlice,30')
         assert csv.size() == 1
         assert csv[0].name == 'Alice'
     }
 
+    @Test
     void testSemicolonSeparator() {
         def csv = new CsvSlurper().setSeparator((char) 
';').parseText('name;age\nAlice;30')
         assert csv[0].name == 'Alice'
     }
 
+    @Test
     void testParseFromReader() {
         def reader = new StringReader('name,age\nAlice,30')
         def csv = new CsvSlurper().parse(reader)
@@ -88,6 +96,7 @@ class CsvSlurperTest extends GroovyTestCase {
     }
     // end::typed_parsing[]
 
+    @Test
     void testTypedParsing() {
         // tag::typed_parsing_usage[]
         def sales = new CsvSlurper().parseAs(Sale, 
'customer,amount\nAcme,1500.00\nGlobex,250.50')
@@ -98,6 +107,7 @@ class CsvSlurperTest extends GroovyTestCase {
         // end::typed_parsing_usage[]
     }
 
+    @Test
     void testTypedParsingMultipleFields() {
         def items = new CsvSlurper().parseAs(Sale, 
'customer,amount\nAlice,99.99')
         assert items[0] instanceof Sale
diff --git 
a/subprojects/groovy-toml/src/spec/test/groovy/toml/TomlBuilderTest.groovy 
b/subprojects/groovy-toml/src/spec/test/groovy/toml/TomlBuilderTest.groovy
index 8bca0bc248..e4fdb2d88c 100644
--- a/subprojects/groovy-toml/src/spec/test/groovy/toml/TomlBuilderTest.groovy
+++ b/subprojects/groovy-toml/src/spec/test/groovy/toml/TomlBuilderTest.groovy
@@ -18,10 +18,11 @@
  */
 package groovy.toml
 
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
 
-class TomlBuilderTest extends GroovyTestCase {
+class TomlBuilderTest {
 
+    @Test
     void testBuild() {
         // tag::build_text[]
         def builder = new TomlBuilder()
@@ -57,6 +58,7 @@ records.car.record.description = 'production pickup truck 
with speed of 271kph'
         int port
     }
 
+    @Test
     void testToToml() {
         def config = new ServerConfig(host: 'localhost', port: 8080)
         def toml = TomlBuilder.toToml(config)
@@ -67,6 +69,7 @@ records.car.record.description = 'production pickup truck 
with speed of 271kph'
     }
     // end::typed_writing[]
 
+    @Test
     void testTypedRoundTrip() {
         def original = new ServerConfig(host: 'example.com', port: 443)
         def toml = TomlBuilder.toToml(original)
diff --git 
a/subprojects/groovy-toml/src/spec/test/groovy/toml/TomlParserTest.groovy 
b/subprojects/groovy-toml/src/spec/test/groovy/toml/TomlParserTest.groovy
index 7bcaaeb329..4e7c6df900 100644
--- a/subprojects/groovy-toml/src/spec/test/groovy/toml/TomlParserTest.groovy
+++ b/subprojects/groovy-toml/src/spec/test/groovy/toml/TomlParserTest.groovy
@@ -19,10 +19,11 @@
 package groovy.toml
 
 
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
 
-class TomlParserTest extends GroovyTestCase {
+class TomlParserTest {
 
+    @Test
     void testParse() {
         // tag::parse_text[]
         def ts = new TomlSlurper()
@@ -50,6 +51,7 @@ jdk = "oraclejdk8"
         // end::parse_text[]
     }
 
+    @Test
     void testBuildAndParse() {
         def builder = new TomlBuilder()
         builder.records {
@@ -79,6 +81,7 @@ jdk = "oraclejdk8"
     }
 
 
+    @Test
     void testParsePath() {
         def file = File.createTempFile('test','yml')
         file.deleteOnExit()
@@ -115,6 +118,7 @@ jdk = "oraclejdk8"
     }
     // end::typed_class[]
 
+    @Test
     void testParseTextAs() {
         // tag::typed_parsing[]
         def config = new TomlSlurper().parseTextAs(ServerConfig, '''
@@ -126,6 +130,7 @@ port = 8080
         // end::typed_parsing[]
     }
 
+    @Test
     void testParseAsFromReader() {
         def reader = new StringReader('host = "localhost"\nport = 8080')
         def config = new TomlSlurper().parseAs(ServerConfig, reader)
@@ -134,6 +139,7 @@ port = 8080
         assert config.port == 8080
     }
 
+    @Test
     void testParseAsFromFile() {
         def file = File.createTempFile('test', '.toml')
         file.deleteOnExit()
@@ -142,6 +148,7 @@ port = 8080
         assert config.port == 9090
     }
 
+    @Test
     void testParseAsFromPath() {
         def file = File.createTempFile('test', '.toml')
         file.deleteOnExit()
@@ -150,6 +157,7 @@ port = 8080
         assert config.host == 'example.com'
     }
 
+    @Test
     void testParseAsFromInputStream() {
         def stream = new ByteArrayInputStream('host = "localhost"\nport = 
3000'.bytes)
         def config = new TomlSlurper().parseAs(ServerConfig, stream)
diff --git 
a/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlBuilderTest.groovy 
b/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlBuilderTest.groovy
index 8dbb5efe6c..a8ab18ec86 100644
--- a/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlBuilderTest.groovy
+++ b/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlBuilderTest.groovy
@@ -18,10 +18,11 @@
  */
 package groovy.yaml
 
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
 
-class YamlBuilderTest extends GroovyTestCase {
+class YamlBuilderTest {
 
+    @Test
     void testBuild() {
         // tag::build_text[]
         def builder = new YamlBuilder()
@@ -60,6 +61,7 @@ records:
         int port
     }
 
+    @Test
     void testToYaml() {
         def config = new ServerConfig(host: 'localhost', port: 8080)
         def yaml = YamlBuilder.toYaml(config)
@@ -70,6 +72,7 @@ records:
     }
     // end::typed_writing[]
 
+    @Test
     void testTypedRoundTrip() {
         def original = new ServerConfig(host: 'example.com', port: 443)
         def yaml = YamlBuilder.toYaml(original)
diff --git 
a/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlParserTest.groovy 
b/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlParserTest.groovy
index 6f289d7fca..e614dfe281 100644
--- a/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlParserTest.groovy
+++ b/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlParserTest.groovy
@@ -19,10 +19,11 @@
 package groovy.yaml
 
 
-import groovy.test.GroovyTestCase
+import org.junit.jupiter.api.Test
 
-class YamlParserTest extends GroovyTestCase {
+class YamlParserTest {
 
+    @Test
     void testParse() {
         // tag::parse_text[]
         def ys = new YamlSlurper()
@@ -51,6 +52,7 @@ before_script:
         // end::parse_text[]
     }
 
+    @Test
     void testBuildAndParse() {
         def builder = new YamlBuilder()
         builder.records {
@@ -80,6 +82,7 @@ before_script:
     }
 
 
+    @Test
     void testParsePath() {
         def file = File.createTempFile('test','yml')
         file.deleteOnExit()
@@ -113,6 +116,7 @@ matrix:
     }
     // end::typed_class[]
 
+    @Test
     void testParseTextAs() {
         // tag::typed_parsing[]
         def config = new YamlSlurper().parseTextAs(ServerConfig, '''\
@@ -124,6 +128,7 @@ port: 8080
         // end::typed_parsing[]
     }
 
+    @Test
     void testParseAsFromReader() {
         def reader = new StringReader('host: localhost\nport: 8080')
         def config = new YamlSlurper().parseAs(ServerConfig, reader)
@@ -132,6 +137,7 @@ port: 8080
         assert config.port == 8080
     }
 
+    @Test
     void testParseAsFromFile() {
         def file = File.createTempFile('test', '.yml')
         file.deleteOnExit()
@@ -140,6 +146,7 @@ port: 8080
         assert config.port == 9090
     }
 
+    @Test
     void testParseAsFromPath() {
         def file = File.createTempFile('test', '.yml')
         file.deleteOnExit()
@@ -148,12 +155,14 @@ port: 8080
         assert config.host == 'example.com'
     }
 
+    @Test
     void testParseAsFromInputStream() {
         def stream = new ByteArrayInputStream('host: localhost\nport: 
3000'.bytes)
         def config = new YamlSlurper().parseAs(ServerConfig, stream)
         assert config.port == 3000
     }
 
+    @Test
     void testParseMultiDocs() {
         def ys = new YamlSlurper()
         def yaml = ys.parseText '''\

Reply via email to