From e826cfa49424dfafbdda1749456aa1ceade99155 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Tue, 1 Oct 2013 14:54:40 +0200 Subject: [PATCH] StreamTests only work on 64Bit JVMs 32bit JVMs have different buffer grow behavior. We simply ingore this since it's a lucene feature that is tested in the upstream project. --- .../elasticsearch/common/io/streams/BytesStreamsTests.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/common/io/streams/BytesStreamsTests.java b/src/test/java/org/elasticsearch/common/io/streams/BytesStreamsTests.java index 170c1b3462c..7f53866c507 100644 --- a/src/test/java/org/elasticsearch/common/io/streams/BytesStreamsTests.java +++ b/src/test/java/org/elasticsearch/common/io/streams/BytesStreamsTests.java @@ -19,6 +19,7 @@ package org.elasticsearch.common.io.streams; +import org.apache.lucene.util.Constants; import org.elasticsearch.common.io.stream.BytesStreamInput; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.junit.Test; @@ -26,6 +27,7 @@ import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assume.assumeTrue; /** * @@ -34,6 +36,7 @@ public class BytesStreamsTests { @Test public void testSimpleStreams() throws Exception { + assumeTrue(Constants.JRE_IS_64BIT); BytesStreamOutput out = new BytesStreamOutput(); out.writeBoolean(false); out.writeByte((byte) 1); @@ -46,7 +49,6 @@ public class BytesStreamsTests { out.writeDouble(2.2); out.writeString("hello"); out.writeString("goodbye"); - BytesStreamInput in = new BytesStreamInput(out.bytes().toBytes(), false); assertThat(in.readBoolean(), equalTo(false)); assertThat(in.readByte(), equalTo((byte) 1)); @@ -63,6 +65,7 @@ public class BytesStreamsTests { @Test public void testGrowLogic() throws Exception { + assumeTrue(Constants.JRE_IS_64BIT); BytesStreamOutput out = new BytesStreamOutput(); out.writeBytes(new byte[BytesStreamOutput.DEFAULT_SIZE - 5]); assertThat(out.bufferSize(), equalTo(2048)); // remains the default