//----------------------------------------------------------------------------
// $Id: StreamCopyTest.java,v 1.1 2005/10/07 19:26:14 enz Exp $
// $Source: /cvsroot/gogui/gogui/test/junit/src/net/sf/gogui/utils/StreamCopyTest.java,v $
//----------------------------------------------------------------------------

package net.sf.gogui.utils;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

//----------------------------------------------------------------------------

public class StreamCopyTest
    extends junit.framework.TestCase
{
    public static void main(String args[])
    {
        junit.textui.TestRunner.run(suite());
    }

    public static junit.framework.Test suite()
    {
        return new junit.framework.TestSuite(StreamCopyTest.class);
    }

    public void testBasic() throws ErrorMessage
    {
        String input = "This is a test text\n";
        InputStream src = new ByteArrayInputStream(input.getBytes());
        OutputStream dest = new ByteArrayOutputStream();
        StreamCopy copy = new StreamCopy(false, src, dest, true);
        copy.run();
        assertEquals(input, dest.toString());
    }
}

//----------------------------------------------------------------------------
