Package org.apache.commons.io.output

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


     * Test Copying file > 2GB  - see issue# IO-84
     */
    public void testCopy_readerToWriter_IO84() throws Exception {
        final long size = (long)Integer.MAX_VALUE + (long)1;
        final Reader reader = new NullReader(size);
        final Writer writer = new NullWriter();

        // Test copy() method
        assertEquals(-1, IOUtils.copy(reader, writer));

        // reset the input
View Full Code Here


      @Override
      public void process(final Resource resource, final Reader reader, final Writer writer)
          throws IOException {
        getProgressIndicator().onProcessingResource(resource);
        // use StringWriter to discard the merged processed result (linting is useful only for reporting errors).
        super.process(resource, reader, new NullWriter());
      }

      @Override
      protected void onException(final WroRuntimeException e) {
        CssLintMojo.this.onException(e);
View Full Code Here

        getProgressIndicator().onProcessingResource(resource);
        if (resource != null) {
          getLog().info("processing resource: " + resource.getUri());
        }
        // use StringWriter to discard the merged processed result (linting is useful only for reporting errors).
        super.process(resource, reader, new NullWriter());
      }

      @Override
      protected void onException(final WroRuntimeException e) {
        JsLintMojo.this.onException(e);
View Full Code Here

      @Override
      public void process(final Resource resource, final Reader reader, final Writer writer)
          throws IOException {
        getProgressIndicator().onProcessingResource(resource);
        // use StringWriter to discard the merged processed result (linting is useful only for reporting errors).
        super.process(resource, reader, new NullWriter());
      }

      @Override
      protected void onException(final WroRuntimeException e) {
        JsHintMojo.this.onException(e);
View Full Code Here

      throws Exception {
    WroTestUtils.runConcurrently(ContextPropagatingCallable.decorate(new Callable<Void>() {
      @Override
      public Void call()
          throws Exception {
        victim.process(new StringReader(""), new NullWriter());
        return null;
      }
    }));
  }
View Full Code Here

  private static ScriptRunner newScriptRunner(Connection connection) {
    ScriptRunner scriptRunner = new ScriptRunner(connection);
    scriptRunner.setDelimiter(";");
    scriptRunner.setStopOnError(true);
    scriptRunner.setLogWriter(new PrintWriter(new NullWriter()));
    return scriptRunner;
  }
View Full Code Here

            HttpURLConnection con = (HttpURLConnection) ProxyConfiguration.open(url);
            cookie = con.getHeaderField("Set-Cookie");
            LOGGER.fine("Cookie="+cookie);

            Tidy tidy = new Tidy();
            tidy.setErrout(new PrintWriter(new NullWriter()));
            DOMReader domReader = new DOMReader();
            Document dom = domReader.read(tidy.parseDOM(con.getInputStream(), null));

            form = null;
            for (Element e : (List<Element>)dom.selectNodes("//form")) {
View Full Code Here

    public void setUp()
    {
        context = new Mockery();
        con = context.mock( JMXConnector.class );
        session =
            new SessionImpl( new WriterCommandOutput( new NullWriter() ), null,
                             new UnsupportedJavaProcessManager( "testing" ) )
            {
                @Override
                protected JMXConnector doConnect( JMXServiceURL url, Map<String, Object> env )
                    throws IOException
View Full Code Here

     */
    public WriterCommandOutput( Writer resultOutput, Writer messageOutput )
    {
        Validate.notNull( resultOutput, "Result output can't be NULL" );
        this.resultOutput = resultOutput;
        this.messageOutput = messageOutput == null ? new NullWriter() : messageOutput;
    }
View Full Code Here

public class TemplateBasedApplierTest {

  @Test
  public void shouldThrowUsageExceptionWhenTemplateNotFound() throws Exception {
    TemplateBasedApplier applier = new TemplateBasedApplier(new NullWriter(), "some_complete_rubbish", null, ";", DelimiterType.normal, null);
    try {
      applier.apply(null);
      Assert.fail("expected exception");
    } catch (UsageException e) {
      assertThat(e.getMessage(), is("Could not find template named some_complete_rubbish_apply.ftl\n" +
View Full Code Here

TOP

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

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.