This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release18.12 by this push:
new 5ddb2b2 Fixed: DiskFileItem as request attribute creates problems
(OFBIZ-12016)
5ddb2b2 is described below
commit 5ddb2b267f8f2ec617b94c1575d9792a2155dbd6
Author: Jacques Le Roux <[email protected]>
AuthorDate: Tue Oct 19 10:39:11 2021 +0200
Fixed: DiskFileItem as request attribute creates problems (OFBIZ-12016)
With previous commit I removed UtilObject::getBytes but not
UtilObjectTests::testGetBytes_Stream which is related (see OFBIZ-11140)
---
.../ofbiz/base/util/test/UtilObjectTests.java | 25 ----------------------
1 file changed, 25 deletions(-)
diff --git
a/framework/base/src/main/java/org/apache/ofbiz/base/util/test/UtilObjectTests.java
b/framework/base/src/main/java/org/apache/ofbiz/base/util/test/UtilObjectTests.java
index f4425fc..33fdf2b 100644
---
a/framework/base/src/main/java/org/apache/ofbiz/base/util/test/UtilObjectTests.java
+++
b/framework/base/src/main/java/org/apache/ofbiz/base/util/test/UtilObjectTests.java
@@ -156,31 +156,6 @@ public class UtilObjectTests extends GenericTestCaseBase {
in.close();
}
- public void testGetBytes_Stream() {
- boolean errorOn = Debug.isOn(Debug.ERROR);
- try {
- Debug.set(Debug.ERROR, false);
- byte[] source = new byte[] { 0, 1, 2, 3, 4, 5, 6 };
- byte[] result = UtilObject.getBytes(new
ByteArrayInputStream(source));
- assertNotNull("initial result", result);
- assertEquals("initial equals", source, result);
- assertNull("error after read", UtilObject.getBytes(new
ErrorInjector(new ByteArrayInputStream(source), 3)));
- byte[] closeResult = UtilObject.getBytes(new ErrorInjector(new
ByteArrayInputStream(source), true));
- assertNotNull("error on close", closeResult);
- assertEquals("error on close equals", source, result);
- Exception caught = null;
- try {
- UtilObject.getBytes(null);
- } catch (NullPointerException e) {
- caught = e;
- } finally {
- assertNotNull("null stream exception", caught);
- }
- } finally {
- Debug.set(Debug.ERROR, errorOn);
- }
- }
-
@SuppressWarnings("serial")
public static class SerializationInjector implements Serializable {
private boolean onRead;