Bug#1069839: libcommons-fileupload-java: FTBFS: failing tests
Bastian Germann
bage at debian.org
Tue Mar 25 20:16:45 GMT 2025
Control: tags -1 patch
I am uploading a NMU to deal with this to DELAYED/5.
Please find the debdiff attached.
-------------- next part --------------
diff -Nru libcommons-fileupload-java-1.5/debian/changelog libcommons-fileupload-java-1.5/debian/changelog
--- libcommons-fileupload-java-1.5/debian/changelog 2024-02-27 05:48:48.000000000 +0100
+++ libcommons-fileupload-java-1.5/debian/changelog 2025-03-25 21:12:11.000000000 +0100
@@ -1,3 +1,10 @@
+libcommons-fileupload-java (1.5-1.1) unstable; urgency=medium
+
+ * Non-maintainer upload
+ * Backport two upstream patches to deal with exception (Closes: #1069839)
+
+ -- Bastian Germann <bage at debian.org> Tue, 25 Mar 2025 21:12:11 +0100
+
libcommons-fileupload-java (1.5-1) unstable; urgency=medium
* Team upload.
diff -Nru libcommons-fileupload-java-1.5/debian/patches/003_assertThrows.patch libcommons-fileupload-java-1.5/debian/patches/003_assertThrows.patch
--- libcommons-fileupload-java-1.5/debian/patches/003_assertThrows.patch 1970-01-01 01:00:00.000000000 +0100
+++ libcommons-fileupload-java-1.5/debian/patches/003_assertThrows.patch 2025-03-25 21:03:36.000000000 +0100
@@ -0,0 +1,34 @@
+Origin: upstream, 2317552993fd5180a84083d599b8cbdb05a07bab
+From: Allon Murienik <mureinik at gmail.com>
+Date: Mon, 7 Oct 2019 16:28:36 +0300
+Subject: FILEUPLOAD-302: JUnit Jupiter migration (#23)
+
+Debian: Backport one assertThrows of the original commit.
+---
+--- a/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java
++++ b/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java
+@@ -19,6 +19,7 @@ package org.apache.commons.fileupload;
+ import static org.junit.Assert.assertEquals;
+ import static org.junit.Assert.assertFalse;
+ import static org.junit.Assert.assertNotNull;
++import static org.junit.Assert.assertThrows;
+ import static org.junit.Assert.assertTrue;
+ import static org.junit.Assert.fail;
+
+@@ -146,13 +147,13 @@ public void testValidRepository() {
+ /**
+ * Test deserialization fails when repository contains a null character.
+ */
+- @Test(expected=IOException.class)
+- public void testInvalidRepositoryWithNullChar() throws Exception {
++ @Test
++ public void testInvalidRepositoryWithNullChar() {
+ // Create the FileItem
+ byte[] testFieldValueBytes = createContentBytes(threshold);
+ File repository = new File(System.getProperty("java.io.tmpdir"), "\0");
+ FileItem item = createFileItem(testFieldValueBytes, repository);
+- deserialize(serialize(item));
++ assertThrows(IOException.class, () -> deserialize(serialize(item)));
+ }
+
+ /**
diff -Nru libcommons-fileupload-java-1.5/debian/patches/004_Fail-fast-when-a-repository-contains-a-null-character.patch libcommons-fileupload-java-1.5/debian/patches/004_Fail-fast-when-a-repository-contains-a-null-character.patch
--- libcommons-fileupload-java-1.5/debian/patches/004_Fail-fast-when-a-repository-contains-a-null-character.patch 1970-01-01 01:00:00.000000000 +0100
+++ libcommons-fileupload-java-1.5/debian/patches/004_Fail-fast-when-a-repository-contains-a-null-character.patch 2025-03-25 20:59:55.000000000 +0100
@@ -0,0 +1,33 @@
+Origin: upstream, 76e1e8e88d03df0795cc8f327482922e9154f02c
+From: Gary Gregory <garydgregory at gmail.com>
+Date: Tue, 4 Apr 2023 17:56:29 -0400
+Subject: Fail fast when a repository contains a null character.
+---
+--- a/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java
++++ b/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java
+@@ -29,6 +29,7 @@
+ import java.io.ObjectInputStream;
+ import java.io.ObjectOutputStream;
+ import java.io.OutputStream;
++import java.nio.file.InvalidPathException;
+
+ import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+ import org.apache.commons.io.FileUtils;
+@@ -209,15 +210,14 @@ public void testInvalidRepository() throws Exception {
+ }
+
+ /**
+- * Test deserialization fails when repository contains a null character.
++ * Fails when repository contains a null character.
+ */
+ @Test
+ public void testInvalidRepositoryWithNullChar() {
+ // Create the FileItem
+ byte[] testFieldValueBytes = createContentBytes(threshold);
+ File repository = new File(System.getProperty("java.io.tmpdir"), "\0");
+- FileItem item = createFileItem(testFieldValueBytes, repository);
+- assertThrows(IOException.class, () -> deserialize(serialize(item)));
++ assertThrows(InvalidPathException.class, () -> createFileItem(testFieldValueBytes, repository));
+ }
+
+ /**
diff -Nru libcommons-fileupload-java-1.5/debian/patches/series libcommons-fileupload-java-1.5/debian/patches/series
--- libcommons-fileupload-java-1.5/debian/patches/series 2024-02-27 05:48:48.000000000 +0100
+++ libcommons-fileupload-java-1.5/debian/patches/series 2025-03-25 21:11:56.000000000 +0100
@@ -1,2 +1,4 @@
001_update-tests-for-servlet3-api.patch
002_portlet-api-compatibility.patch
+003_assertThrows.patch
+004_Fail-fast-when-a-repository-contains-a-null-character.patch
More information about the pkg-java-maintainers
mailing list