All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class juice.util.Tester

java.lang.Object
   |
   +----juice.util.Tester

public class Tester
extends Object
This class implements standard exit routines for Test classes.
Ideally, every class (e.g. Rsf) will have a corresponding Test class (e.g. RsfTest) which has a main routine which does a few tests to see if the class is working correctly. These tests can also be used as examples of how to use these classes.

Test objects should be able to be run as a main() routine, which will exit with a return value to the shell, and with a callable routine, which executes and returns the value without exiting.

Future work:
We probably want to enforce consistency by creating an interface or abstract class for Test routines.


Constructor Index

 o Tester()

Method Index

 o exit(boolean)
Prints "passed" if passed==true, otherwise prints "failed".
 o exit(int)
Prints "passed" if passed==0, otherwise prints "failed".
 o isApprox(String, float, float)
Compares two floats if they are approximately equally.

Constructors

 o Tester
 public Tester()

Methods

 o exit
 public static void exit(boolean passed)
Prints "passed" if passed==true, otherwise prints "failed". Exits with value 0,1 if passed==true,false, respectively.

 o exit
 public static void exit(int passed)
Prints "passed" if passed==0, otherwise prints "failed". Exits with value of passed

 o isApprox
 public static boolean isApprox(String var,
                                float f1,
                                float f2)
Compares two floats if they are approximately equally. Returns true if they are, false if they are not. Prints a statement to System.out about the comparison.


All Packages  Class Hierarchy  This Package  Previous  Next  Index