private static ScriptRunner newScriptRunner(Connection connection) { ScriptRunner scriptRunner = new ScriptRunner(connection); scriptRunner.setDelimiter(";"); scriptRunner.setStopOnError(true); scriptRunner.setLogWriter(new PrintWriter(new NullWriter())); return scriptRunner; } }
@Test public void nullCharSequencec() throws Exception { final ProxyWriter proxy = new ProxyWriter(new NullWriter()); proxy.append(null); proxy.close(); }
@Test 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 reader.close(); // Test copyLarge() method assertEquals("copyLarge()", size, IOUtils.copyLarge(reader, writer)); }
@Test public void nullString() throws Exception { final ProxyWriter proxy = new ProxyWriter(new NullWriter()); proxy.write((String) null); proxy.write((String) null, 0, 0); proxy.close(); }
@Test public void nullCharArray() throws Exception { final ProxyWriter proxy = new ProxyWriter(new NullWriter()); proxy.write((char[]) null); proxy.write((char[]) null, 0, 0); proxy.close(); }
@Test public void testNull() { final char[] chars = new char[] {'A', 'B', 'C'}; final NullWriter writer = new NullWriter(); writer.write(1); writer.write(chars); writer.write(chars, 1, 1); writer.write("some string"); writer.write("some string", 2, 2); writer.flush(); writer.close(); }
/** * @param gazetteerOutWriter */ public HgnetMergerFakeWriter(GazetteerOutWriter gazetteerOutWriter) { super(new NullWriter()); this.gazetteerOutWriter = gazetteerOutWriter; }
public PrintWriter getStdOutWriter() { if(roll) return new PrintWriter(new NullWriter()); else return out; } }
/** * @param resultOutput IO Writer for result output * @param messageOutput IO Writer for message output */ 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; }
/** * Shortcut for Null Writer * @param id */ public ProcessLog(String id) { this("processLog.", id, ProcessLog.LogLevel.FATAL, false, new PrintWriter(new NullWriter()) ,true); }
/** * @param resultOutput IO Writer for result output * @param messageOutput IO Writer for message output */ 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; }
/** * Create the Print Writer output */ protected void createOut() { try { out = new PrintWriter(new FileWriter(file, true)); } catch (IOException e) { out = new PrintWriter(new NullWriter()); LOG.error("Error while creating process log", e); } }
private static ScriptRunner newScriptRunner(Connection connection) { ScriptRunner scriptRunner = new ScriptRunner(connection); scriptRunner.setDelimiter(";"); scriptRunner.setStopOnError(true); scriptRunner.setLogWriter(new PrintWriter(new NullWriter())); return scriptRunner; } }
private static ScriptRunner newScriptRunner(Connection connection) { ScriptRunner scriptRunner = new ScriptRunner(connection); scriptRunner.setDelimiter(";"); scriptRunner.setStopOnError(true); scriptRunner.setLogWriter(new PrintWriter(new NullWriter())); return scriptRunner; } }
@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 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 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 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 public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { 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 public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { 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()); }