001package hw4.test;
002
003import org.junit.runner.RunWith;
004import org.junit.runners.Suite;
005import org.junit.runners.Suite.SuiteClasses;
006
007/**
008 * SpecificationTests is a simple TestSuite that includes and runs all the tests
009 * in {@link RatNumTest}, {@link RatPolyTest}, and {@link RatPolyStackTest}.
010 */
011
012@RunWith(Suite.class)
013@SuiteClasses({ RatNumTest.class,
014  RatTermTest.class,
015  RatPolyTest.class,
016  RatPolyStackTest.class })
017public final class SpecificationTests {
018  // This class is a placeholder for the suite.
019  // The @SuiteClasses annotation lists the elements of the suite.
020
021   /**
022    * Checks that assertions are enabled. If they are not, an error message is printed,
023    * and the system exits.
024    */
025        public static void checkAssertsEnabled() {
026                try {
027                        assert false;
028
029                        // assertions are not enabled
030                        System.err.println("Java Asserts are not currently enabled. Follow homework writeup instructions to enable asserts on all JUnit Test files.");
031                        System.exit(1);
032
033                } catch (AssertionError e) {
034                        // do nothing
035                        // assertions are enabled
036                }
037        }
038}