org.freehep.util
Class Assert

java.lang.Object
  extended by junit.framework.Assert
      extended by org.freehep.util.Assert

public class Assert
extends junit.framework.Assert

Additional assert methods to the junit.framework.Assert class.

Version:
$Id: Assert.java 8584 2006-08-10 23:06:37Z duns $
Author:
Mark Donszelmann

Constructor Summary
protected Assert()
          static class only
 
Method Summary
static void assertEquals(File expected, File actual, boolean isBinary)
          Compares two files.
static void assertEquals(InputStream expected, InputStream actual, boolean isBinary, String filename)
          Compares two streams.
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assert

protected Assert()
static class only

Method Detail

assertEquals

public static void assertEquals(File expected,
                                File actual,
                                boolean isBinary)
                         throws FileNotFoundException,
                                IOException
Compares two files. The files may be gzipped, and will then be uncompressed on the fly.

Parameters:
expected - reference file
actual - file to be tested
isBinary - when true will do byte-by-byte comparison rather than line by line.
Throws:
FileNotFoundException - if one of the files cannot be found.
IOException - if one of the files cannot read.
junit.framework.AssertionFailedError - if the files are not equal.

assertEquals

public static void assertEquals(InputStream expected,
                                InputStream actual,
                                boolean isBinary,
                                String filename)
                         throws IOException
Compares two streams.

Parameters:
expected - reference stream
actual - stream to be tested
filename - an prefix for the error message (normally filename associated with the actual stream)
isBinary - when true will do byte-by-byte comparison rather than line by line (Reader).
Throws:
IOException - if one of the streams cannot read.
junit.framework.AssertionFailedError - if the streams are not equal.


Copyright © 2012. All Rights Reserved.