@ -59,7 +59,7 @@ import org.junit.Test;
public class TemporaryBufferTest {
public class TemporaryBufferTest {
@Test
@Test
public void testEmpty ( ) throws IOException {
public void testEmpty ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
try {
try {
b . close ( ) ;
b . close ( ) ;
assertEquals ( 0 , b . length ( ) ) ;
assertEquals ( 0 , b . length ( ) ) ;
@ -73,7 +73,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testOneByte ( ) throws IOException {
public void testOneByte ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final byte test = ( byte ) new TestRng ( getName ( ) ) . nextInt ( ) ;
final byte test = ( byte ) new TestRng ( getName ( ) ) . nextInt ( ) ;
try {
try {
b . write ( test ) ;
b . write ( test ) ;
@ -100,7 +100,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testOneBlock_BulkWrite ( ) throws IOException {
public void testOneBlock_BulkWrite ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final byte [ ] test = new TestRng ( getName ( ) )
final byte [ ] test = new TestRng ( getName ( ) )
. nextBytes ( TemporaryBuffer . Block . SZ ) ;
. nextBytes ( TemporaryBuffer . Block . SZ ) ;
try {
try {
@ -131,7 +131,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testOneBlockAndHalf_BulkWrite ( ) throws IOException {
public void testOneBlockAndHalf_BulkWrite ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final byte [ ] test = new TestRng ( getName ( ) )
final byte [ ] test = new TestRng ( getName ( ) )
. nextBytes ( TemporaryBuffer . Block . SZ * 3 / 2 ) ;
. nextBytes ( TemporaryBuffer . Block . SZ * 3 / 2 ) ;
try {
try {
@ -162,7 +162,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testOneBlockAndHalf_SingleWrite ( ) throws IOException {
public void testOneBlockAndHalf_SingleWrite ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final byte [ ] test = new TestRng ( getName ( ) )
final byte [ ] test = new TestRng ( getName ( ) )
. nextBytes ( TemporaryBuffer . Block . SZ * 3 / 2 ) ;
. nextBytes ( TemporaryBuffer . Block . SZ * 3 / 2 ) ;
try {
try {
@ -191,7 +191,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testOneBlockAndHalf_Copy ( ) throws IOException {
public void testOneBlockAndHalf_Copy ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final byte [ ] test = new TestRng ( getName ( ) )
final byte [ ] test = new TestRng ( getName ( ) )
. nextBytes ( TemporaryBuffer . Block . SZ * 3 / 2 ) ;
. nextBytes ( TemporaryBuffer . Block . SZ * 3 / 2 ) ;
try {
try {
@ -221,7 +221,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testLarge_SingleWrite ( ) throws IOException {
public void testLarge_SingleWrite ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final byte [ ] test = new TestRng ( getName ( ) )
final byte [ ] test = new TestRng ( getName ( ) )
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 3 ) ;
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 3 ) ;
try {
try {
@ -263,7 +263,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testInCoreLimit_SwitchOnAppendByte ( ) throws IOException {
public void testInCoreLimit_SwitchOnAppendByte ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final byte [ ] test = new TestRng ( getName ( ) )
final byte [ ] test = new TestRng ( getName ( ) )
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT + 1 ) ;
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT + 1 ) ;
try {
try {
@ -292,7 +292,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testInCoreLimit_SwitchBeforeAppendByte ( ) throws IOException {
public void testInCoreLimit_SwitchBeforeAppendByte ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final byte [ ] test = new TestRng ( getName ( ) )
final byte [ ] test = new TestRng ( getName ( ) )
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 3 ) ;
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 3 ) ;
try {
try {
@ -321,7 +321,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testInCoreLimit_SwitchOnCopy ( ) throws IOException {
public void testInCoreLimit_SwitchOnCopy ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final byte [ ] test = new TestRng ( getName ( ) )
final byte [ ] test = new TestRng ( getName ( ) )
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 2 ) ;
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 2 ) ;
try {
try {
@ -354,7 +354,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testDestroyWhileOpen ( ) throws IOException {
public void testDestroyWhileOpen ( ) throws IOException {
@SuppressWarnings ( "resource" /* java 7 */ )
@SuppressWarnings ( "resource" /* java 7 */ )
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
try {
try {
b . write ( new TestRng ( getName ( ) )
b . write ( new TestRng ( getName ( ) )
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 2 ) ) ;
. nextBytes ( TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 2 ) ) ;
@ -365,7 +365,7 @@ public class TemporaryBufferTest {
@Test
@Test
public void testRandomWrites ( ) throws IOException {
public void testRandomWrites ( ) throws IOException {
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( ) ;
final TemporaryBuffer b = new TemporaryBuffer . LocalFile ( null ) ;
final TestRng rng = new TestRng ( getName ( ) ) ;
final TestRng rng = new TestRng ( getName ( ) ) ;
final int max = TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 2 ;
final int max = TemporaryBuffer . DEFAULT_IN_CORE_LIMIT * 2 ;
final byte [ ] expect = new byte [ max ] ;
final byte [ ] expect = new byte [ max ] ;