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 })
017@SuppressWarnings("nullness")
018public final class SpecificationTests {
019  // This class is a placeholder for the suite.
020  // The @SuiteClasses annotation lists the elements of the suite.
021
022   /**
023    * Checks that assertions are enabled. If they are not, an error message is printed,
024    * and the system exits.
025    */
026        public static void checkAssertsEnabled() {
027                try {
028                        assert false;
029
030                        // assertions are not enabled
031                        System.err.println("Java Asserts are not currently enabled. Follow homework writeup instructions to enable asserts on all JUnit Test files.");
032                        System.exit(1);
033
034                } catch (AssertionError e) {
035                        // do nothing
036                        // assertions are enabled
037                }
038        }
039}