Fix test failures due to JPEG CMYK support in OpenJDK

Resolves: RHEL-5354
This commit is contained in:
Mikolaj Izdebski 2024-06-13 13:09:31 +02:00
parent 708ff4c025
commit 9bc91dc2bc
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,29 @@
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageIOTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageIOTest.java
index 537a4e8ffaf3af22..bfc8a011ad4b21f8 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageIOTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageIOTest.java
@@ -28,6 +28,7 @@ import org.junit.rules.ExpectedException;
import java.io.File;
+import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
@@ -132,13 +133,13 @@ public class ImageIOTest {
@Test
public void testFailOnError() {
- final String message = "Unsupported Image Type";
thrown.expect(BuildException.class);
- thrown.expectMessage(message);
try {
buildRule.executeTarget("testFailOnError");
} finally {
- assertThat(buildRule.getLog(), containsString(message));
+ assertThat(buildRule.getLog(),
+ anyOf(containsString("Unsupported Image Type"),
+ containsString("Unknown image type")));
}
}

View File

@ -34,7 +34,7 @@
Name: ant
Version: 1.10.9
Release: 7%{?dist}
Release: 8%{?dist}
Summary: Java build tool
Summary(it): Tool per la compilazione di programmi java
Summary(fr): Outil de compilation pour java
@ -46,6 +46,7 @@ Source2: apache-ant-1.8.ant.conf
Source3: ant.asciidoc
Patch0: %{name}-build.xml.patch
Patch1: %{name}-openjdk-jpeg-cmyk.patch
BuildRequires: asciidoc
BuildRequires: xmlto
@ -327,6 +328,7 @@ Javadoc pour %{name}.
%prep
%setup -q -n apache-ant-%{version}
%patch0 -p0
%patch1 -p1
# clean jar files
find . -name "*.jar" | xargs -t rm
@ -636,6 +638,10 @@ LC_ALL=C.UTF-8 %{ant} test
# -----------------------------------------------------------------------------
%changelog
* Thu Jun 13 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.10.9-8
- Fix test failures due to JPEG CMYK support in OpenJDK
- Resolves: RHEL-5354
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.10.9-7
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688