Exemplo n.º 1
0
 /**
  * Test method for {@link com.googlecode.socofo.common.impl.IOHelperImpl#read(java.io.InputStream,
  * byte[])} .
  */
 @Test
 public final void testRead() {
   final byte[] buffer = new byte[5000];
   final BufferedInputStream bis =
       new BufferedInputStream(getClass().getResourceAsStream("/buffertest.txt"));
   final int read = to.read(bis, buffer);
   Assert.assertTrue(read > 0);
   to.closeInputstream(bis);
   String str = to.createString(buffer, "utf-8");
   Assert.assertNotNull(str);
   str = str.trim();
   Assert.assertEquals("test", str);
 }
Exemplo n.º 2
0
 /**
  * Test method for {@link
  * com.googlecode.socofo.common.impl.IOHelperImpl#closeInputstream(java.io.InputStream)} .
  */
 @Test
 public final void testCloseInputstream() {
   to.closeInputstream(null);
 }