use of org.apache.commons.io.output.NullOutputStream in project webservices-axiom by apache.
the class SerializerTest method testUnmappableCharacterInComment.
@Test(expected = StreamException.class)
public void testUnmappableCharacterInComment() throws Exception {
Serializer handler = new Serializer(new NullOutputStream(), "iso-8859-1");
handler.startFragment();
handler.startComment();
handler.processCharacterData("€", false);
handler.endComment();
handler.completed();
}
use of org.apache.commons.io.output.NullOutputStream in project webservices-axiom by apache.
the class TestWriteToIllegalState method runTest.
@Override
protected void runTest(WritableBlob blob) throws Throwable {
try {
blob.writeTo(new NullOutputStream());
fail("Expected IllegalStateException");
} catch (IllegalStateException ex) {
// Expected
}
}
use of org.apache.commons.io.output.NullOutputStream in project cdap by caskdata.
the class HBaseVersion method main.
/**
* Prints out the HBase {@link Version} enum value for the current version of HBase on the classpath.
*/
public static void main(String[] args) {
// Suppress any output to stdout
PrintStream stdout = System.out;
System.setOut(new PrintStream(new NullOutputStream()));
Version version = HBaseVersion.get();
// Restore stdout
System.setOut(stdout);
System.out.println(version.getMajorVersion());
if (args.length == 1 && "-v".equals(args[0])) {
// Print versionString if verbose
System.out.println("versionString=" + getVersionString());
}
}
use of org.apache.commons.io.output.NullOutputStream in project disunity by ata4.
the class BundleTest method entriesValid.
@Test
public void entriesValid() {
assertEquals("Bundle entry lists must match in size", bundle.entries().size(), bundle.entryInfos().size());
bundle.entries().forEach(uncheck(entry -> {
CountingOutputStream cos = new CountingOutputStream(new NullOutputStream());
IOUtils.copy(entry.inputStream(), cos);
assertEquals("Entry size must match size of InputStream", entry.size(), cos.getCount());
}));
}
use of org.apache.commons.io.output.NullOutputStream in project jackrabbit-oak by apache.
the class S3DataStoreStatsTest method getIdForInputStream.
private String getIdForInputStream(final InputStream in) throws Exception {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
OutputStream output = new DigestOutputStream(new NullOutputStream(), digest);
try {
IOUtils.copyLarge(in, output);
} finally {
IOUtils.closeQuietly(output);
IOUtils.closeQuietly(in);
}
return encodeHexString(digest.digest());
}
Aggregations