*ChannelBuffer* -> *ByteBuf* and ChannelBuffersTest -> UnpooledTest
This commit is contained in:
parent
7b6cbdbb1e
commit
ee9f30a2b9
@ -35,7 +35,7 @@ import static org.junit.Assert.*;
|
|||||||
/**
|
/**
|
||||||
* An abstract test class for channel buffers
|
* An abstract test class for channel buffers
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractChannelBufferTest {
|
public abstract class AbstractByteBufTest {
|
||||||
|
|
||||||
private static final int CAPACITY = 4096; // Must be even
|
private static final int CAPACITY = 4096; // Must be even
|
||||||
private static final int BLOCK_SIZE = 128;
|
private static final int BLOCK_SIZE = 128;
|
@ -28,12 +28,12 @@ import static org.junit.Assert.*;
|
|||||||
/**
|
/**
|
||||||
* An abstract test class for composite channel buffers
|
* An abstract test class for composite channel buffers
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractCompositeChannelBufferTest extends
|
public abstract class AbstractCompositeByteBufTest extends
|
||||||
AbstractChannelBufferTest {
|
AbstractByteBufTest {
|
||||||
|
|
||||||
private final ByteOrder order;
|
private final ByteOrder order;
|
||||||
|
|
||||||
protected AbstractCompositeChannelBufferTest(ByteOrder order) {
|
protected AbstractCompositeByteBufTest(ByteOrder order) {
|
||||||
if (order == null) {
|
if (order == null) {
|
||||||
throw new NullPointerException("order");
|
throw new NullPointerException("order");
|
||||||
}
|
}
|
@ -19,8 +19,8 @@ package io.netty.buffer;
|
|||||||
/**
|
/**
|
||||||
* Tests big-endian composite channel buffers
|
* Tests big-endian composite channel buffers
|
||||||
*/
|
*/
|
||||||
public class BigEndianCompositeChannelBufferTest extends AbstractCompositeChannelBufferTest {
|
public class BigEndianCompositeByteBufTest extends AbstractCompositeByteBufTest {
|
||||||
public BigEndianCompositeChannelBufferTest() {
|
public BigEndianCompositeByteBufTest() {
|
||||||
super(Unpooled.BIG_ENDIAN);
|
super(Unpooled.BIG_ENDIAN);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,7 +22,7 @@ import java.nio.ByteOrder;
|
|||||||
/**
|
/**
|
||||||
* Tests big-endian direct channel buffers
|
* Tests big-endian direct channel buffers
|
||||||
*/
|
*/
|
||||||
public class BigEndianDirectChannelBufferTest extends AbstractChannelBufferTest {
|
public class BigEndianDirectByteBufTest extends AbstractByteBufTest {
|
||||||
|
|
||||||
private ByteBuf buffer;
|
private ByteBuf buffer;
|
||||||
|
|
@ -22,7 +22,7 @@ import static org.junit.Assert.*;
|
|||||||
/**
|
/**
|
||||||
* Tests big-endian heap channel buffers
|
* Tests big-endian heap channel buffers
|
||||||
*/
|
*/
|
||||||
public class BigEndianHeapChannelBufferTest extends AbstractChannelBufferTest {
|
public class BigEndianHeapByteBufTest extends AbstractByteBufTest {
|
||||||
|
|
||||||
private ByteBuf buffer;
|
private ByteBuf buffer;
|
||||||
|
|
@ -24,7 +24,7 @@ import org.junit.Test;
|
|||||||
/**
|
/**
|
||||||
* Tests the index-finding capabilities of channel buffers
|
* Tests the index-finding capabilities of channel buffers
|
||||||
*/
|
*/
|
||||||
public class ChannelBufferIndexFinderTest {
|
public class ByteBufIndexFinderTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testForward() {
|
public void testForward() {
|
@ -26,7 +26,7 @@ import org.junit.Test;
|
|||||||
/**
|
/**
|
||||||
* Tests channel buffer streams
|
* Tests channel buffer streams
|
||||||
*/
|
*/
|
||||||
public class ChannelBufferStreamTest {
|
public class ByteBufStreamTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAll() throws Exception {
|
public void testAll() throws Exception {
|
@ -22,7 +22,7 @@ import static org.junit.Assert.*;
|
|||||||
/**
|
/**
|
||||||
* Tests duplicated channel buffers
|
* Tests duplicated channel buffers
|
||||||
*/
|
*/
|
||||||
public class DuplicateChannelBufferTest extends AbstractChannelBufferTest {
|
public class DuplicateByteBufTest extends AbstractByteBufTest {
|
||||||
|
|
||||||
private ByteBuf buffer;
|
private ByteBuf buffer;
|
||||||
|
|
@ -19,8 +19,8 @@ package io.netty.buffer;
|
|||||||
/**
|
/**
|
||||||
* Tests little-endian composite channel buffers
|
* Tests little-endian composite channel buffers
|
||||||
*/
|
*/
|
||||||
public class LittleEndianCompositeChannelBufferTest extends AbstractCompositeChannelBufferTest {
|
public class LittleEndianCompositeByteBufTest extends AbstractCompositeByteBufTest {
|
||||||
public LittleEndianCompositeChannelBufferTest() {
|
public LittleEndianCompositeByteBufTest() {
|
||||||
super(Unpooled.LITTLE_ENDIAN);
|
super(Unpooled.LITTLE_ENDIAN);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,7 +22,7 @@ import java.nio.ByteOrder;
|
|||||||
/**
|
/**
|
||||||
* Tests little-endian direct channel buffers
|
* Tests little-endian direct channel buffers
|
||||||
*/
|
*/
|
||||||
public class LittleEndianDirectChannelBufferTest extends AbstractChannelBufferTest {
|
public class LittleEndianDirectByteBufTest extends AbstractByteBufTest {
|
||||||
|
|
||||||
private ByteBuf buffer;
|
private ByteBuf buffer;
|
||||||
|
|
@ -22,7 +22,7 @@ import java.nio.ByteOrder;
|
|||||||
/**
|
/**
|
||||||
* Tests little-endian heap channel buffers
|
* Tests little-endian heap channel buffers
|
||||||
*/
|
*/
|
||||||
public class LittleEndianHeapChannelBufferTest extends AbstractChannelBufferTest {
|
public class LittleEndianHeapByteBufTest extends AbstractByteBufTest {
|
||||||
|
|
||||||
private ByteBuf buffer;
|
private ByteBuf buffer;
|
||||||
|
|
@ -31,7 +31,7 @@ import static org.junit.Assert.*;
|
|||||||
/**
|
/**
|
||||||
* Tests read-only channel buffers
|
* Tests read-only channel buffers
|
||||||
*/
|
*/
|
||||||
public class ReadOnlyChannelBufferTest {
|
public class ReadOnlyByteBufTest {
|
||||||
|
|
||||||
@Test(expected = NullPointerException.class)
|
@Test(expected = NullPointerException.class)
|
||||||
public void shouldNotAllowNullInConstructor() {
|
public void shouldNotAllowNullInConstructor() {
|
@ -24,7 +24,7 @@ import org.junit.Test;
|
|||||||
/**
|
/**
|
||||||
* Tests sliced channel buffers
|
* Tests sliced channel buffers
|
||||||
*/
|
*/
|
||||||
public class SlicedChannelBufferTest extends AbstractChannelBufferTest {
|
public class SlicedByteBufTest extends AbstractByteBufTest {
|
||||||
|
|
||||||
private final Random random = new Random();
|
private final Random random = new Random();
|
||||||
private ByteBuf buffer;
|
private ByteBuf buffer;
|
@ -34,7 +34,7 @@ import static org.junit.Assert.*;
|
|||||||
* Tests channel buffers
|
* Tests channel buffers
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("ZeroLengthArrayAllocation")
|
@SuppressWarnings("ZeroLengthArrayAllocation")
|
||||||
public class ChannelBuffersTest {
|
public class UnpooledTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCompositeWrappedBuffer() {
|
public void testCompositeWrappedBuffer() {
|
Loading…
x
Reference in New Issue
Block a user