Class Tester

  • Direct Known Subclasses:
    Calculator, HubTester

    public class Tester
    extends java.lang.Object
    No-frills test case superclass.
    Since:
    18 Jul 2008
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      Tester()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertEquals​(int i1, int i2)
      Tests integer equality.
      static void assertEquals​(java.lang.Object o1, java.lang.Object o2)
      Tests object equality.
      static void assertTrue​(boolean test)
      Tests an assertion.
      static void fail()
      Fails a test.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Tester

        public Tester()
    • Method Detail

      • assertTrue

        public static void assertTrue​(boolean test)
                               throws TestException
        Tests an assertion.
        Parameters:
        test - asserted condition
        Throws:
        TestException - if test is false
      • assertEquals

        public static void assertEquals​(java.lang.Object o1,
                                        java.lang.Object o2)
                                 throws TestException
        Tests object equality.
        Parameters:
        o1 - object 1
        o2 - object 2
        Throws:
        TestException - unless o1 and o2 are both null or are equal in the sense of Object.equals(java.lang.Object)
      • assertEquals

        public static void assertEquals​(int i1,
                                        int i2)
                                 throws TestException
        Tests integer equality.
        Parameters:
        i1 - integer 1
        i2 - integer 2
        Throws:
        TestException - iff i1 != i2