00001 package net.threebit.utils.sosc.test;
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 import java.io.*;
00023 import java.sql.*;
00024 import java.util.*;
00025 import java.util.logging.*;
00026 import junit.framework.*;
00027 import net.threebit.utils.sosc.*;
00028
00032 public class StreamToolTest extends TestCase {
00033
00034 public void test1() throws Exception {
00035
00036 String s = "This is a test string of bytes";
00037 byte[] bytes = s.getBytes();
00038 InputStream i = new ByteArrayInputStream(bytes);
00039 ByteArrayOutputStream o = new ByteArrayOutputStream();
00040 long transferred = StreamTool.dumpStream(i,o);
00041 assertTrue(transferred == bytes.length);
00042 assertTrue(o.toString().equals(s));
00043 }
00044
00045 }