You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by ma...@apache.org on 2026/08/05 08:14:36 UTC
(grails-core) branch remove-decommissioned-test-code created (now 8ac14e97a5)
This is an automated email from the ASF dual-hosted git repository.
matrei pushed a change to branch remove-decommissioned-test-code
in repository https://gitbox.apache.org/repos/asf/grails-core.git
at 8ac14e97a5 chore: remove test dependencies as there are no tests
This branch includes the following new commits:
new ae3c52c65f chore: remove decommissioned code and its dependencies
new 8ac14e97a5 chore: remove test dependencies as there are no tests
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(grails-core) 01/02: chore: remove decommissioned code and its dependencies
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matrei pushed a commit to branch remove-decommissioned-test-code
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit ae3c52c65f8b0276d29cdd2ab285d28c8ab2c3a4
Author: Mattias Reichel <ma...@gmail.com>
AuthorDate: Wed Aug 5 10:13:15 2026 +0200
chore: remove decommissioned code and its dependencies
This code was used for generating test reports prior to the switch to Gradle.
---
grails-test-core/build.gradle | 3 -
.../org/grails/test/report/junit/JUnitReports.java | 90 -----------------
.../test/report/junit/JUnitReportsFactory.java | 75 --------------
.../grails/test/report/junit/PlainFormatter.java | 110 ---------------------
.../org/grails/test/report/junit/XMLFormatter.java | 62 ------------
5 files changed, 340 deletions(-)
diff --git a/grails-test-core/build.gradle b/grails-test-core/build.gradle
index 10570622c2..64de9588d3 100644
--- a/grails-test-core/build.gradle
+++ b/grails-test-core/build.gradle
@@ -53,9 +53,6 @@ dependencies {
api project(':grails-converters')
api 'org.apache.groovy:groovy'
- // Ant
- api 'org.apache.ant:ant'
- api 'org.apache.ant:ant-junit'
// needed for Spock
api 'org.objenesis:objenesis'
diff --git a/grails-test-core/src/main/groovy/org/grails/test/report/junit/JUnitReports.java b/grails-test-core/src/main/groovy/org/grails/test/report/junit/JUnitReports.java
deleted file mode 100644
index eae7155520..0000000000
--- a/grails-test-core/src/main/groovy/org/grails/test/report/junit/JUnitReports.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.grails.test.report.junit;
-
-import java.io.OutputStream;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import org.apache.tools.ant.taskdefs.optional.junit.JUnitResultFormatter;
-import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
-
-/**
- * Simply propagates to the underlying reports.
- */
-public class JUnitReports implements JUnitResultFormatter {
-
- protected JUnitResultFormatter[] reports;
-
- public JUnitReports(JUnitResultFormatter[] reports) {
- this.reports = reports;
- }
-
- public void setOutput(OutputStream out) {
- throw new IllegalStateException("This should not be reached");
- }
-
- public void startTestSuite(JUnitTest suite) {
- for (JUnitResultFormatter report : reports) {
- report.startTestSuite(suite);
- }
- }
-
- public void startTest(Test test) {
- for (JUnitResultFormatter report : reports) {
- report.startTest(test);
- }
- }
-
- public void addError(Test test, Throwable t) {
- for (JUnitResultFormatter report : reports) {
- report.addError(test, t);
- }
- }
-
- public void addFailure(Test test, AssertionFailedError t) {
- for (JUnitResultFormatter report : reports) {
- report.addFailure(test, t);
- }
- }
-
- public void endTest(Test test) {
- for (JUnitResultFormatter report : reports) {
- report.endTest(test);
- }
- }
-
- public void setSystemError(String err) {
- for (JUnitResultFormatter report : reports) {
- report.setSystemError(err);
- }
- }
-
- public void setSystemOutput(String out) {
- for (JUnitResultFormatter report : reports) {
- report.setSystemOutput(out);
- }
- }
-
- public void endTestSuite(JUnitTest suite) {
- for (JUnitResultFormatter report : reports) {
- report.endTestSuite(suite);
- }
- }
-}
diff --git a/grails-test-core/src/main/groovy/org/grails/test/report/junit/JUnitReportsFactory.java b/grails-test-core/src/main/groovy/org/grails/test/report/junit/JUnitReportsFactory.java
deleted file mode 100644
index dfffd4cceb..0000000000
--- a/grails-test-core/src/main/groovy/org/grails/test/report/junit/JUnitReportsFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.grails.test.report.junit;
-
-import java.io.File;
-import java.util.List;
-
-import groovy.lang.Binding;
-
-import org.apache.tools.ant.taskdefs.optional.junit.JUnitResultFormatter;
-
-public class JUnitReportsFactory {
-
- public static final String XML = "xml";
- public static final String PLAIN = "plain";
-
- protected final String phaseName;
- protected final String typeName;
- protected final File reportsDir;
- protected final List<String> formats;
-
- @SuppressWarnings("unchecked")
- public static JUnitReportsFactory createFromBuildBinding(Binding buildBinding) {
- // This is not great, the phase and type names probably shouldn't be sourced from the binding.
- return new JUnitReportsFactory(
- (String) buildBinding.getProperty("currentTestPhaseName"),
- (String) buildBinding.getProperty("currentTestTypeName"),
- (File) buildBinding.getProperty("testReportsDir"),
- (List<String>) buildBinding.getProperty("reportFormats"));
- }
-
- public JUnitReportsFactory(String phaseName, String typeName, File reportsDir, List<String> formats) {
- this.phaseName = phaseName;
- this.typeName = typeName;
- this.reportsDir = reportsDir;
- this.formats = formats;
- }
-
- public JUnitReports createReports(String name) {
- JUnitResultFormatter formatters[] = new JUnitResultFormatter[formats.size()];
- for (int i = 0; i < formats.size(); ++i) {
- formatters[i] = createReport(formats.get(i), name);
- }
- return new JUnitReports(formatters);
- }
-
- protected JUnitResultFormatter createReport(String format, String name) {
- String prefix = "TEST-" + phaseName + "-" + typeName + "-" + name;
- if (format.equals(PLAIN)) {
- return new PlainFormatter(prefix, new File(reportsDir, "plain/" + prefix + ".txt"));
- }
-
- if (format.equals(XML)) {
- return new XMLFormatter(new File(reportsDir, prefix + ".xml"));
- }
-
- throw new IllegalArgumentException("Unknown format type: " + format);
- }
-}
diff --git a/grails-test-core/src/main/groovy/org/grails/test/report/junit/PlainFormatter.java b/grails-test-core/src/main/groovy/org/grails/test/report/junit/PlainFormatter.java
deleted file mode 100644
index 160edc7155..0000000000
--- a/grails-test-core/src/main/groovy/org/grails/test/report/junit/PlainFormatter.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.grails.test.report.junit;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import junit.framework.Test;
-import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
-import org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter;
-
-import org.grails.test.support.TestStacktraceSanitizer;
-
-/**
- * Sanitises the stack traces generated by tests.
- */
-public class PlainFormatter extends PlainJUnitResultFormatter {
-
- protected String name;
- protected File file;
-
- protected String systemOutput;
- protected String systemError;
-
- public PlainFormatter(String name, File file) {
- this.name = name;
- this.file = file;
- try {
- super.setOutput(new BufferedOutputStream(new FileOutputStream(file)));
- }
- catch (FileNotFoundException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void setOutput(OutputStream out) {
- throw new IllegalStateException("This should not be called");
- }
-
- @Override
- public void setSystemError(String out) {
- systemError = out;
- super.setSystemError(out);
- }
-
- @Override
- public void setSystemOutput(String out) {
- systemOutput = out;
- super.setSystemOutput(out);
- }
-
- @Override
- public void addFailure(Test test, Throwable throwable) {
- TestStacktraceSanitizer.sanitize(throwable);
- super.addFailure(test, throwable);
- }
-
- @Override
- public void addError(Test test, Throwable throwable) {
- TestStacktraceSanitizer.sanitize(throwable);
- super.addError(test, throwable);
- }
-
- @Override
- public void endTestSuite(JUnitTest suite) {
- super.endTestSuite(suite);
- File parentFile = file.getParentFile();
- writeToFile(new File(parentFile, name + "-out.txt"), systemOutput);
- writeToFile(new File(parentFile, name + "-err.txt"), systemError);
- }
-
- protected void writeToFile(File f, String text) {
- FileWriter writer = null;
- try {
- writer = new FileWriter(f);
- writer.write(text);
- writer.close();
- }
- catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- finally {
- if (writer != null) {
- try { writer.close(); } catch (IOException ex) { /*ignored*/ }
- }
- }
- }
-}
diff --git a/grails-test-core/src/main/groovy/org/grails/test/report/junit/XMLFormatter.java b/grails-test-core/src/main/groovy/org/grails/test/report/junit/XMLFormatter.java
deleted file mode 100644
index a4a5b9d08d..0000000000
--- a/grails-test-core/src/main/groovy/org/grails/test/report/junit/XMLFormatter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.grails.test.report.junit;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.OutputStream;
-
-import junit.framework.Test;
-import org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter;
-
-import org.grails.test.support.TestStacktraceSanitizer;
-
-/**
- * Sanitises the stack traces generated by tests.
- */
-public class XMLFormatter extends XMLJUnitResultFormatter {
-
- public XMLFormatter(File file) {
- try {
- super.setOutput(new BufferedOutputStream(new FileOutputStream(file)));
- }
- catch (FileNotFoundException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void setOutput(OutputStream out) {
- throw new IllegalStateException("This should not be called");
- }
-
- @Override
- public void addFailure(Test test, Throwable throwable) {
- TestStacktraceSanitizer.sanitize(throwable);
- super.addFailure(test, throwable);
- }
-
- @Override
- public void addError(Test test, Throwable throwable) {
- TestStacktraceSanitizer.sanitize(throwable);
- super.addError(test, throwable);
- }
-}
(grails-core) 02/02: chore: remove test dependencies as there are no tests
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matrei pushed a commit to branch remove-decommissioned-test-code
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 8ac14e97a5b8b27526cf4de9c81b9e14450cf995
Author: Mattias Reichel <ma...@gmail.com>
AuthorDate: Wed Aug 5 10:14:00 2026 +0200
chore: remove test dependencies as there are no tests
---
grails-test-core/build.gradle | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/grails-test-core/build.gradle b/grails-test-core/build.gradle
index 64de9588d3..e10348b9d6 100644
--- a/grails-test-core/build.gradle
+++ b/grails-test-core/build.gradle
@@ -63,25 +63,9 @@ dependencies {
// MockHttpServletRequest/Response/Context used in many classes
}
- testImplementation 'jakarta.servlet:jakarta.servlet-api'
- testImplementation 'org.springframework:spring-test'
-
- testImplementation 'org.apache.groovy:groovy-test-junit5'
- testImplementation 'org.junit.jupiter:junit-jupiter-api'
- testImplementation 'org.junit.platform:junit-platform-suite'
-
- testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
-
// Logging
api 'org.slf4j:slf4j-api'
api 'org.slf4j:jcl-over-slf4j'
-
- // Testing
- testImplementation 'org.slf4j:slf4j-simple'
- testImplementation 'org.spockframework:spock-core'
- // Required by Spock's Mocking
- testRuntimeOnly 'net.bytebuddy:byte-buddy'
- testImplementation 'org.objenesis:objenesis'
}
apply {