Package org.apache.commons.io.output

Examples of org.apache.commons.io.output.NullOutputStream


    private DaemonConfigurationBuilder daemon = new DaemonConfigurationBuilder();
    private SuiteFactory factory;

    private void createSuiteFactory() {
        factory = new SuiteFactory(daemon.freeze(), new OutputCapturer(), new PrintStream(new NullOutputStream()), new NullMessageListener());
        factory.configure(new SuiteConfiguration());
    }
View Full Code Here


        assertThat(systemOutErr.err(), is(System.err));
    }

    @Test
    public void sets_the_real_stdout() {
        PrintStream newStream = new PrintStream(new NullOutputStream());

        systemOutErr.setOut(newStream);

        assertThat(System.out, is(newStream));
    }
View Full Code Here

        assertThat(System.out, is(newStream));
    }

    @Test
    public void sets_the_real_stderr() {
        PrintStream newStream = new PrintStream(new NullOutputStream());

        systemOutErr.setErr(newStream);

        assertThat(System.err, is(newStream));
    }
View Full Code Here

    protected NetworkServer createNetworkServer() {
        return new NettyNetworkServer(networkDebugLogging);
    }

    protected OutputStream createDaemonOutputListener() {
        return new NullOutputStream();
    }
View Full Code Here

     * monitor of the PrintStream first, before all other locks.
     */
    @Test
    public void does_not_deadlock_if_somebody_locks_in_the_PrintStream_externally() throws Exception {
        final int ITERATIONS = 10;
        PrintStream printStream = SynchronizedPrintStream.create(new NullOutputStream(), Charset.defaultCharset(), lock);

        // will fail with a test timeout if a deadlock happens
        runConcurrently(() -> {
            // what Thread.printStackTrace() would do
            synchronized (printStream) {
View Full Code Here

        });
    }

    @Test
    public void the_class_name_in_stack_traces_gives_a_hint_of_who_generated_the_proxy_class() {
        PrintStream printStream = SynchronizedPrintStream.create(new NullOutputStream(), Charset.defaultCharset(), lock);

        assertThat(printStream.getClass().getName(), startsWith(SynchronizedPrintStream.class.getName()));
    }
View Full Code Here

        assertThat(printStream.getClass().getName(), startsWith(SynchronizedPrintStream.class.getName()));
    }

    @Test
    public void does_not_expose_the_CGLIB_Factory_interface() {
        PrintStream printStream = SynchronizedPrintStream.create(new NullOutputStream(), Charset.defaultCharset(), lock);

        assertThat(printStream, not(instanceOf(Factory.class)));
    }
View Full Code Here

                new SuiteRunner(
                        new DriverFactory(suiteListener, actorThread, outputCapturer, driverFinder, runIdSequence, classLoader),
                        suiteListener,
                        actorThread,
                        testExecutor,
                        new PrintStream(new NullOutputStream())
                ));

        suiteListener.onSuiteStarted();
        testExecutor.execute(new TestFileFinderRunner(new StubTestFileFinder(testClasses), suiteRunner));
        actors.processEventsUntilIdle();
View Full Code Here

     * Test Copying file > 2GB  - see issue# IO-84
     */
    public void testCopy_inputStreamToOutputStream_IO84() throws Exception {
        long size = (long)Integer.MAX_VALUE + (long)1;
        InputStream  in  = new NullInputStream(size);
        OutputStream out = new NullOutputStream();

        // Test copy() method
        assertEquals(-1, IOUtils.copy(in, out));

        // reset the input
View Full Code Here

        // doesn't fail with an OutOfMemoryError, we know that the OMText implementation
        // supports streaming.
        DataSource ds = new TestDataSource('A', Runtime.getRuntime().maxMemory());
        OMText text = factory.createOMText(new DataHandler(ds), false);
        elem.addChild(text);
        elem.serialize(new NullOutputStream());
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.io.output.NullOutputStream

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.