cvs commit: jakarta-commons-sandbox/io/src/test/org/apache/commons/io IOUtilsTestCase.java

2004-01-01 Thread bayard
bayard  2004/01/01 22:18:40

  Modified:io/src/test/org/apache/commons/io IOUtilsTestCase.java
  Log:
  removed test cases that only test CopyUtils methods, as these methods now have their 
own tests in the CopyUtilsTest class
  
  Revision  ChangesPath
  1.7   +3 -101
jakarta-commons-sandbox/io/src/test/org/apache/commons/io/IOUtilsTestCase.java
  
  Index: IOUtilsTestCase.java
  ===
  RCS file: 
/home/cvs/jakarta-commons-sandbox/io/src/test/org/apache/commons/io/IOUtilsTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- IOUtilsTestCase.java  30 Dec 2003 15:26:59 -  1.6
  +++ IOUtilsTestCase.java  2 Jan 2004 06:18:40 -   1.7
  @@ -139,54 +139,6 @@
   assertTrue( "Content not equal according to java.util.Arrays#equals()", 
Arrays.equals( b0, b1 ) );
   }
   
  -public void testInputStreamToOutputStream()
  -throws Exception
  -{
  -File destination = newFile( "copy1.txt" );
  -FileInputStream fin = new FileInputStream( m_testFile );
  -try {
  -FileOutputStream fout = new FileOutputStream( destination );
  -try {
  -int count = CopyUtils.copy( fin, fout );
  -assertTrue( "Not all bytes were read", fin.available() == 0 );
  -assertEquals( "Number of bytes read should equal file size", 
m_testFile.length(), count );
  -fout.flush();
  -
  -checkFile( destination, m_testFile );
  -checkWrite( fout );
  -} finally {
  -fout.close();
  -}
  -deleteFile( destination );
  -} finally {
  -fin.close();
  -}
  -}
  -
  -public void testInputStreamToWriter()
  -throws Exception
  -{
  -File destination = newFile( "copy2.txt" );
  -FileInputStream fin = new FileInputStream( m_testFile );
  -try {
  -FileWriter fout = new FileWriter( destination );
  -try {
  -CopyUtils.copy( fin, fout );
  -
  -assertTrue( "Not all bytes were read", fin.available() == 0 );
  -fout.flush();
  -
  -checkFile( destination, m_testFile );
  -checkWrite( fout );
  -} finally {
  -fout.close();
  -}
  -deleteFile( destination );
  -} finally {
  - fin.close();
  -}
  -}
  -
   public void testInputStreamToString()
   throws Exception
   {
  @@ -197,56 +149,6 @@
   assertTrue( "Not all bytes were read", fin.available() == 0 );
   assertTrue( "Wrong output size: out.length()=" + out.length() +
   "!=" + FILE_SIZE, out.length() == FILE_SIZE );
  -} finally {
  -fin.close();
  -}
  -}
  -
  -public void testReaderToOutputStream()
  -throws Exception
  -{
  -File destination = newFile( "copy3.txt" );
  -FileReader fin = new FileReader( m_testFile );
  -try {
  -FileOutputStream fout = new FileOutputStream( destination );
  -try {
  -CopyUtils.copy( fin, fout );
  -//Note: this method *does* flush. It is equivalent to:
  -//  OutputStreamWriter _out = new OutputStreamWriter(fout);
  -//  CopyUtils.copy( fin, _out, 4096 ); // copy( Reader, Writer, int 
);
  -//  _out.flush();
  -//  out = fout;
  -
  -// Note: rely on the method to flush
  -checkFile( destination, m_testFile );
  -checkWrite( fout );
  -} finally {
  -fout.close();
  -}
  -deleteFile( destination );
  -} finally {
  -fin.close();
  -}
  -}
  -
  -public void testReaderToWriter()
  -throws Exception
  -{
  -File destination = newFile( "copy4.txt" );
  -FileReader fin = new FileReader( m_testFile );
  -try {
  -FileWriter fout = new FileWriter( destination );
  -try {
  -int count = CopyUtils.copy( fin, fout );
  -assertEquals( "The number of characters returned by copy is wrong", 
m_testFile.length(), count);
  -
  -fout.flush();
  -checkFile( destination, m_testFile );
  -checkWrite( fout );
  -} finally {
  -fout.close();
  -}
  -deleteFile( destination );
   } finally {
   fin.close();
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PR

cvs commit: jakarta-commons-sandbox/io/src/test/org/apache/commons/io IOUtilsTestCase.java IOTestSuite.java IOUtilTestCase.java

2003-07-27 Thread jeremias
jeremias2003/07/27 10:10:18

  Modified:io/src/test/org/apache/commons/io IOTestSuite.java
  Added:   io/src/test/org/apache/commons/io IOUtilsTestCase.java
  Removed: io/src/test/org/apache/commons/io IOUtilTestCase.java
  Log:
  Renamed IOUtilTestCase to IOUtilsTestCase.
  
  Revision  ChangesPath
  1.5   +4 -4  
jakarta-commons-sandbox/io/src/test/org/apache/commons/io/IOTestSuite.java
  
  Index: IOTestSuite.java
  ===
  RCS file: 
/home/cvs/jakarta-commons-sandbox/io/src/test/org/apache/commons/io/IOTestSuite.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- IOTestSuite.java  25 Jul 2003 07:51:26 -  1.4
  +++ IOTestSuite.java  27 Jul 2003 17:10:18 -  1.5
  @@ -84,7 +84,7 @@
   {
   final TestSuite suite = new TestSuite( "IO Utilities" );
   suite.addTest( new TestSuite( FileUtilsTestCase.class ) );
  -suite.addTest( new TestSuite( IOUtilTestCase.class ) );
  +suite.addTest( new TestSuite( IOUtilsTestCase.class ) );
   suite.addTest( new TestSuite( FileFilterTestCase.class ) );
   suite.addTest( new TestSuite( DemuxTestCase.class ) );
   suite.addTest( new TestSuite( HexDumpTest.class ) );
  
  
  
  1.1  
jakarta-commons-sandbox/io/src/test/org/apache/commons/io/IOUtilsTestCase.java
  
  Index: IOUtilsTestCase.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/io/src/test/org/apache/commons/io/IOUtilsTestCase.java,v
 1.1 2003/07/27 17:10:18 jeremias Exp $
   * $Revision: 1.1 $
   * $Date: 2003/07/27 17:10:18 $
   *
   * 
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:
   *   "This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/)."
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *Foundation" must not be used to endorse or promote products derived
   *from this software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *nor may "Apache" appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * .
   *
   */
  
  package org.apache.commons.io;
  
  import java.io.BufferedOutputStream;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.FileReader;
  import java.io.FileWriter;
  import java.io.IOException;
  import java.io.OutputStream;
  import java.io.PrintStream;
  import java.io.PrintWriter;
  import java.io.Writer;
  import java.util.Arrays;
  import junit.framework.AssertionFailedError;
  import junit.framework.TestCase;
  
  // No