Package org.pentaho.platform.engine.core.output

Examples of org.pentaho.platform.engine.core.output.MultiOutputStream


    ByteArrayOutputStream out1 = new ByteArrayOutputStream();
    ByteArrayOutputStream out2 = new ByteArrayOutputStream();

    ByteArrayOutputStream[] outs = new ByteArrayOutputStream[] { out1, out2 };

    MultiOutputStream multi = new MultiOutputStream( outs );
    byte[] in = "abcd".getBytes();
    String outStr1 = "";
    String outStr2 = "";

    try {
      multi.write( 'a' );
      multi.write( in, 1, 2 );
      multi.write( in );
      multi.close();
    } catch ( IOException e ) {
      // we should not get here
      assertEquals( "IOException", null, e );
    }
    outStr1 = new String( out1.toByteArray() );
View Full Code Here


    MockExceptionOutputStream out2 = new MockExceptionOutputStream();
    ByteArrayOutputStream out3 = new ByteArrayOutputStream();

    OutputStream[] outs = new OutputStream[] { out1, out2, out3 };

    MultiOutputStream multi = new MultiOutputStream( outs );
    byte[] in = "abcd".getBytes();
    String outStr1 = "";
    String outStr2 = "";

    try {
      multi.write( 'a' );
    } catch ( IOException e ) {
      // we expect to get here
      assertEquals( "IOException", "Test Exception", e.getMessage() );
    }
    try {
      multi.write( in, 1, 2 );
    } catch ( IOException e ) {
      // we expect to get here
      assertEquals( "IOException", "Test Exception", e.getMessage() );
    }
    try {
      multi.write( in );
    } catch ( IOException e ) {
      // we expect to get here
      assertEquals( "IOException", "Test Exception", e.getMessage() );
    }
    try {
      multi.close();
    } catch ( IOException e ) {
      // we expect to get here
      assertEquals( "IOException", "Test Exception", e.getMessage() );
    }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.engine.core.output.MultiOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.