Author: elecharny Date: Wed Jan 13 14:15:35 2010 New Revision: 898756 URL: http://svn.apache.org/viewvc?rev=898756&view=rev Log: Added a test for IoBuffer
Modified: mina/trunk/core/src/test/java/org/apache/mina/core/buffer/IoBufferTest.java Modified: mina/trunk/core/src/test/java/org/apache/mina/core/buffer/IoBufferTest.java URL: http://svn.apache.org/viewvc/mina/trunk/core/src/test/java/org/apache/mina/core/buffer/IoBufferTest.java?rev=898756&r1=898755&r2=898756&view=diff ============================================================================== --- mina/trunk/core/src/test/java/org/apache/mina/core/buffer/IoBufferTest.java (original) +++ mina/trunk/core/src/test/java/org/apache/mina/core/buffer/IoBufferTest.java Wed Jan 13 14:15:35 2010 @@ -20,6 +20,8 @@ package org.apache.mina.core.buffer; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.nio.ByteBuffer; @@ -89,6 +91,18 @@ time2 = System.currentTimeMillis(); System.out.println("Time for performance test 2: " + (time2 - time) + "ms"); } + + @Test + public void autoExpand() { + IoBuffer buffer = IoBuffer.allocate(8, false); + buffer.setAutoExpand(true); + + assertTrue("Should AutoExpand", buffer.isAutoExpand()); + + IoBuffer slice = buffer.slice(); + assertFalse("Should *NOT* AutoExpand", buffer.isAutoExpand()); + assertFalse("Should *NOT* AutoExpand", slice.isAutoExpand()); + } /** * This class extends the AbstractIoBuffer class to have direct access to