@ -78,8 +78,9 @@ public class SideBandOutputStreamTest {
@Test
@Test
public void testWrite_CH_DATA ( ) throws IOException {
public void testWrite_CH_DATA ( ) throws IOException {
final SideBandOutputStream out ;
@SuppressWarnings ( "resource" /* java 7 */ )
out = new SideBandOutputStream ( CH_DATA , SMALL_BUF , rawOut ) ;
final SideBandOutputStream out = new SideBandOutputStream ( CH_DATA ,
SMALL_BUF , rawOut ) ;
out . write ( new byte [ ] { 'a' , 'b' , 'c' } ) ;
out . write ( new byte [ ] { 'a' , 'b' , 'c' } ) ;
out . flush ( ) ;
out . flush ( ) ;
assertBuffer ( "0008\001abc" ) ;
assertBuffer ( "0008\001abc" ) ;
@ -87,8 +88,9 @@ public class SideBandOutputStreamTest {
@Test
@Test
public void testWrite_CH_PROGRESS ( ) throws IOException {
public void testWrite_CH_PROGRESS ( ) throws IOException {
final SideBandOutputStream out ;
@SuppressWarnings ( "resource" /* java 7 */ )
out = new SideBandOutputStream ( CH_PROGRESS , SMALL_BUF , rawOut ) ;
final SideBandOutputStream out = new SideBandOutputStream ( CH_PROGRESS ,
SMALL_BUF , rawOut ) ;
out . write ( new byte [ ] { 'a' , 'b' , 'c' } ) ;
out . write ( new byte [ ] { 'a' , 'b' , 'c' } ) ;
out . flush ( ) ;
out . flush ( ) ;
assertBuffer ( "0008\002abc" ) ;
assertBuffer ( "0008\002abc" ) ;
@ -96,8 +98,9 @@ public class SideBandOutputStreamTest {
@Test
@Test
public void testWrite_CH_ERROR ( ) throws IOException {
public void testWrite_CH_ERROR ( ) throws IOException {
final SideBandOutputStream out ;
@SuppressWarnings ( "resource" /* java 7 */ )
out = new SideBandOutputStream ( CH_ERROR , SMALL_BUF , rawOut ) ;
final SideBandOutputStream out = new SideBandOutputStream ( CH_ERROR ,
SMALL_BUF , rawOut ) ;
out . write ( new byte [ ] { 'a' , 'b' , 'c' } ) ;
out . write ( new byte [ ] { 'a' , 'b' , 'c' } ) ;
out . flush ( ) ;
out . flush ( ) ;
assertBuffer ( "0008\003abc" ) ;
assertBuffer ( "0008\003abc" ) ;
@ -105,8 +108,9 @@ public class SideBandOutputStreamTest {
@Test
@Test
public void testWrite_Small ( ) throws IOException {
public void testWrite_Small ( ) throws IOException {
final SideBandOutputStream out ;
@SuppressWarnings ( "resource" /* java 7 */ )
out = new SideBandOutputStream ( CH_DATA , SMALL_BUF , rawOut ) ;
final SideBandOutputStream out = new SideBandOutputStream ( CH_DATA ,
SMALL_BUF , rawOut ) ;
out . write ( 'a' ) ;
out . write ( 'a' ) ;
out . write ( 'b' ) ;
out . write ( 'b' ) ;
out . write ( 'c' ) ;
out . write ( 'c' ) ;
@ -116,8 +120,9 @@ public class SideBandOutputStreamTest {
@Test
@Test
public void testWrite_SmallBlocks1 ( ) throws IOException {
public void testWrite_SmallBlocks1 ( ) throws IOException {
final SideBandOutputStream out ;
@SuppressWarnings ( "resource" /* java 7 */ )
out = new SideBandOutputStream ( CH_DATA , 6 , rawOut ) ;
final SideBandOutputStream out = new SideBandOutputStream ( CH_DATA , 6 ,
rawOut ) ;
out . write ( 'a' ) ;
out . write ( 'a' ) ;
out . write ( 'b' ) ;
out . write ( 'b' ) ;
out . write ( 'c' ) ;
out . write ( 'c' ) ;
@ -127,8 +132,9 @@ public class SideBandOutputStreamTest {
@Test
@Test
public void testWrite_SmallBlocks2 ( ) throws IOException {
public void testWrite_SmallBlocks2 ( ) throws IOException {
final SideBandOutputStream out ;
@SuppressWarnings ( "resource" /* java 7 */ )
out = new SideBandOutputStream ( CH_DATA , 6 , rawOut ) ;
final SideBandOutputStream out = new SideBandOutputStream ( CH_DATA , 6 ,
rawOut ) ;
out . write ( new byte [ ] { 'a' , 'b' , 'c' } ) ;
out . write ( new byte [ ] { 'a' , 'b' , 'c' } ) ;
out . flush ( ) ;
out . flush ( ) ;
assertBuffer ( "0006\001a0006\001b0006\001c" ) ;
assertBuffer ( "0006\001a0006\001b0006\001c" ) ;
@ -136,8 +142,9 @@ public class SideBandOutputStreamTest {
@Test
@Test
public void testWrite_SmallBlocks3 ( ) throws IOException {
public void testWrite_SmallBlocks3 ( ) throws IOException {
final SideBandOutputStream out ;
@SuppressWarnings ( "resource" /* java 7 */ )
out = new SideBandOutputStream ( CH_DATA , 7 , rawOut ) ;
final SideBandOutputStream out = new SideBandOutputStream ( CH_DATA , 7 ,
rawOut ) ;
out . write ( 'a' ) ;
out . write ( 'a' ) ;
out . write ( new byte [ ] { 'b' , 'c' } ) ;
out . write ( new byte [ ] { 'b' , 'c' } ) ;
out . flush ( ) ;
out . flush ( ) ;
@ -152,8 +159,9 @@ public class SideBandOutputStreamTest {
buf [ i ] = ( byte ) i ;
buf [ i ] = ( byte ) i ;
}
}
final SideBandOutputStream out ;
@SuppressWarnings ( "resource" /* java 7 */ )
out = new SideBandOutputStream ( CH_DATA , MAX_BUF , rawOut ) ;
final SideBandOutputStream out = new SideBandOutputStream ( CH_DATA ,
MAX_BUF , rawOut ) ;
out . write ( buf ) ;
out . write ( buf ) ;
out . flush ( ) ;
out . flush ( ) ;
@ -167,6 +175,7 @@ public class SideBandOutputStreamTest {
}
}
}
}
@SuppressWarnings ( "resource" /* java 7 */ )
@Test
@Test
public void testFlush ( ) throws IOException {
public void testFlush ( ) throws IOException {
final int [ ] flushCnt = new int [ 1 ] ;
final int [ ] flushCnt = new int [ 1 ] ;