JUnit-addons
version 1.4

junitx.framework
Class FileAssert

java.lang.Object
  |
  +--junitx.framework.FileAssert

public class FileAssert
extends java.lang.Object

A set of assert methods specially targetted to asserting files.

Version:
$Revision: 1.8 $ $Date: 2003/04/28 02:47:32 $
Author:
Vladimir R. Bossicard, Dean Chalker

Method Summary
static void assertBinaryEquals(java.io.File expected, java.io.File actual)
          Asserts that two binary files are equal.
static void assertBinaryEquals(java.lang.String message, java.io.File expected, java.io.File actual)
          Asserts that two binary files are equal.
static void assertEquals(java.io.File expected, java.io.File actual)
          Asserts that two files are equal.
static void assertEquals(java.lang.String message, java.io.File expected, java.io.File actual)
          Asserts that two files are equal.
protected static void assertEquals(java.lang.String message, java.io.Reader expected, java.io.Reader actual)
          Testing only Asserts that two readers are equal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertEquals

public static void assertEquals(java.lang.String message,
                                java.io.File expected,
                                java.io.File actual)
Asserts that two files are equal. Throws an AssertionFailedError if they are not.

Note: This assertion method rely on the standard junit.framework.Assert(String expected, String actual) method to compare the lines of the files. JUnit > 3.8 provides a nicer way to display differences between two strings but since only lines are compared (and not entire paragraphs) you can still use JUnit 3.7.


assertEquals

public static void assertEquals(java.io.File expected,
                                java.io.File actual)
Asserts that two files are equal. Throws an AssertionFailedError if they are not.


assertEquals

protected static void assertEquals(java.lang.String message,
                                   java.io.Reader expected,
                                   java.io.Reader actual)
Testing only Asserts that two readers are equal. Throws an AssertionFailedError if they are not.


assertBinaryEquals

public static void assertBinaryEquals(java.io.File expected,
                                      java.io.File actual)
Asserts that two binary files are equal. Throws an AssertionFailedError if they are not.


assertBinaryEquals

public static void assertBinaryEquals(java.lang.String message,
                                      java.io.File expected,
                                      java.io.File actual)
Asserts that two binary files are equal. Throws an AssertionFailedError if they are not.


JUnit-addons
version 1.4

Copyright © 2002-2003 Vladimir R. Bossicard. All Rights Reserved.