Class TestSuite

  • All Implemented Interfaces:
    MainClass

    public abstract class TestSuite
    extends MainWindow
    JUnit implementation for TotalCross, to be used in the device (or in the desktop). It simulates the same output that you get when using JUnit under Eclipse. To use it, you must extend this class and add the test cases using the addTestCase method.

    You can also create a test suite without this user interface. Here's a sample:
       public class Testes extends TestSuite
       {
          public Testes()
          {
             super("UI Tests");
             Settings.showDebugTimestamp = false;
             addTestCase(Teste1.class);
             addTestCase(TesteChamado509.class);
             runTests();
             Settings.showDebugTimestamp = true;
          }
       }
     
    • Field Detail

      • assertionFailed

        protected static boolean assertionFailed
    • Constructor Detail

      • TestSuite

        public TestSuite​(java.lang.String title)
    • Method Detail

      • addTestCase

        public void addTestCase​(java.lang.Class<?> c)
        Add a new testcase.
      • runTests

        protected void runTests()
      • initUI

        public void initUI()
        If you override this method, you must call super.initUI(); this call must be the first statement
        Overrides:
        initUI in class Container
      • updateMem

        public static void updateMem()
        Updates the label with the available memory.
      • onEvent

        public void onEvent​(Event e)
        If you override this method, you must call super.onEvent(); this call must be the first statement
        Overrides:
        onEvent in class Control
        Parameters:
        e - the event to process
        See Also:
        Event, KeyEvent, PenEvent