You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2016/12/07 18:10:30 UTC

[2/3] activemq git commit: Fixes AMQ-6441 where a negative value can be returned with large AWS EFS files systems when calling java.io.File.getTotalSpace()

Fixes AMQ-6441 where a negative value can be returned with large AWS EFS files systems when calling java.io.File.getTotalSpace()


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/f225120f
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/f225120f
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/f225120f

Branch: refs/heads/master
Commit: f225120f61c9acfbe64b5f7590fbd72bb668525f
Parents: dc68ad8
Author: William Crowell <wi...@roguewave.com>
Authored: Thu Sep 29 08:22:46 2016 -0400
Committer: gtully <ga...@gmail.com>
Committed: Wed Dec 7 10:45:12 2016 +0000

----------------------------------------------------------------------
 .../org/apache/activemq/util/LargeFile.java     | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/f225120f/activemq-unit-tests/src/test/java/org/apache/activemq/util/LargeFile.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/util/LargeFile.java b/activemq-unit-tests/src/test/java/org/apache/activemq/util/LargeFile.java
new file mode 100644
index 0000000..a050608
--- /dev/null
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/util/LargeFile.java
@@ -0,0 +1,25 @@
+package org.apache.activemq.util;
+
+import java.io.File;
+
+/**
+ * @author wcrowell
+ * 
+ * LargeFile is used to simulate a large file system (e.g. exabytes in size).
+ * The getTotalSpace() method is intentionally set to exceed the largest 
+ * value of a primitive long which is 9,223,372,036,854,775,807.  A negative
+ * number will be returned when getTotalSpace() is called.  This class is for
+ * test purposes only.  Using a mocking framework to mock the behavior of 
+ * java.io.File was a lot of work.
+ * 
+ */
+public class LargeFile extends File {
+	public LargeFile(File parent, String child) {
+		super(parent, child);
+	}
+	
+	@Override
+	public long getTotalSpace() {
+		return Long.MAX_VALUE + 4193L;
+	}
+}