/*
 * Jaudiotagger Copyright (C)2004,2005
 *
 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
 * General Public  License as published by the Free Software Foundation; either version 2.1 of the License,
 * or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with this library; if not,
 * you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
package org.jaudiotagger;

import junit.framework.TestCase;

import java.io.*;

/**
 * 
 */
public class AbstractTestCase extends TestCase
{
    /**
     * Copy a File
     *
     * @param fromFile The existing File
     * @param toFile   The new File
     * @return <code>true</code> if and only if the renaming
     *         succeeded;
     *         <code>false</code> otherwise
     */
    private static boolean copy(File fromFile, File toFile)
    {
        try
        {
            FileInputStream in = new FileInputStream(fromFile);
            FileOutputStream out = new FileOutputStream(toFile);
            BufferedInputStream inBuffer = new BufferedInputStream
                (in);
            BufferedOutputStream outBuffer = new
                BufferedOutputStream(out);

            int theByte;

            while ((theByte = inBuffer.read()) > -1)
            {
                outBuffer.write(theByte);
            }

            outBuffer.close();
            inBuffer.close();
            out.close();
            in.close();

            // cleanupif files are not the same length
            if (fromFile.length() != toFile.length())
            {
                toFile.delete();

                return false;
            }

            return true;
        }
        catch (IOException e)
        {
            e.printStackTrace();
            return false;
        }

    }

    public static File copyAudioToTmp(String fileName)
    {
        File inputFile = new File("testdata", fileName);
        File outputFile = new File("testdatatmp", fileName);
        boolean result = copy(inputFile, outputFile);
        assertTrue(result);
        return outputFile;
    }
}

@@ -2262,213 +2262,1953 @@
     
-public static File copyAudioToTmp(String fileName)%0A    %7B%0A        File inputFile = new File(%22testdata%22, fileName);%0A        File outputFile = new File(%22testdatatmp%22, fileName);%0A        boolean result = copy(
+ private static boolean append(File fromFile1,File fromFile2, File toFile)%0A    %7B%0A        try%0A        %7B%0A            FileInputStream in = new FileInputStream(fromFile1);%0A            FileInputStream in2 = new FileInputStream(fromFile2);%0A            FileOutputStream out = new FileOutputStream(toFile);%0A            BufferedInputStream inBuffer = new BufferedInputStream   (in);%0A            BufferedInputStream inBuffer2 = new BufferedInputStream   (in2);%0A            BufferedOutputStream outBuffer = new BufferedOutputStream(out);%0A%0A            int theByte;%0A%0A            while ((theByte = inBuffer.read()) %3E -1)%0A            %7B%0A                outBuffer.write(theByte);%0A            %7D%0A%0A              while ((theByte = inBuffer2.read()) %3E -1)%0A            %7B%0A                outBuffer.write(theByte);%0A            %7D%0A%0A            outBuffer.close();%0A            inBuffer.close();%0A            inBuffer2.close();%0A            out.close();%0A            in.close();%0A            in2.close();%0A%0A            // cleanupif files are not the same length%0A            if ((fromFile1.length() + fromFile2.length())!= toFile.length())%0A            %7B%0A                toFile.delete();%0A%0A                return false;%0A            %7D%0A%0A            return true;%0A        %7D%0A        catch (IOException e)%0A        %7B%0A            e.printStackTrace();%0A            return false;%0A        %7D%0A    %7D%0A%0A    public static File copyAudioToTmp(String fileName)%0A    %7B%0A        File inputFile = new File(%22testdata%22, fileName);%0A        File outputFile = new File(%22testdatatmp%22, fileName);%0A        boolean result = copy(inputFile, outputFile);%0A        assertTrue(result);%0A        return outputFile;%0A    %7D%0A%0A     public static File copyAudioToTmp(String tagfile,String fileName)%0A    %7B%0A        File inputTagFile = new File(%22testtagdata%22, tagfile);%0A        File inputFile = new File(%22testdata%22, fileName);%0A        File outputFile = new File(%22testdatatmp%22, fileName);%0A        boolean result = append(inputTagFile,
 inpu

Test infrastructure now supports testing raw id3 tags