Repository: activemq-artemis
Updated Branches:
  refs/heads/master c8fc7c64f -> d2063131f


ARTEMIS-1482 Enhance test to ensure len check is done before byte[] init

Set the int to Integer.MAX_VALUE thus if the len check is not done before 
byte[] initialization the test would blow with an OOM.

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

Branch: refs/heads/master
Commit: 5d8079845ee3fe1092b84533ae63438d79ad353c
Parents: c8fc7c6
Author: Michael André Pearce <[email protected]>
Authored: Thu Aug 9 15:54:32 2018 +0100
Committer: Michael André Pearce <[email protected]>
Committed: Thu Aug 9 15:54:54 2018 +0100

----------------------------------------------------------------------
 .../java/org/apache/activemq/artemis/utils/SimpleStringTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5d807984/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java
----------------------------------------------------------------------
diff --git 
a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java
 
b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java
index 0498cab..85e5794 100644
--- 
a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java
+++ 
b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java
@@ -28,7 +28,7 @@ public class SimpleStringTest {
    @Test
    public void testOutOfBoundsThrownOnMalformedString() {
       ByteBuf byteBuffer = ByteBufAllocator.DEFAULT.buffer(5);
-      byteBuffer.writeInt(100);
+      byteBuffer.writeInt(Integer.MAX_VALUE);
 
       Exception e = null;
       try {

Reply via email to