Class STest


  • public class STest
    extends java.lang.Object
    Static config class for tests.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.util.concurrent.atomic.AtomicInteger NETNO  
      static boolean REALTIME
      Global flag to switch between sim and realtime tests.
    • Constructor Summary

      Constructors 
      Constructor Description
      STest()  
    • Field Detail

      • REALTIME

        public static final boolean REALTIME
        Global flag to switch between sim and realtime tests.
      • NETNO

        protected static final java.util.concurrent.atomic.AtomicInteger NETNO
    • Constructor Detail

      • STest

        public STest()
    • Method Detail

      • getLocalTestConfig

        public static IPlatformConfiguration getLocalTestConfig​(java.lang.String name)
        Get local (no communication) test configuration using a generated unique platform name derived from the test name. Uses simulation for speed.
        Parameters:
        name - The test name used for deriving a platform name.
      • getLocalTestConfig

        public static IPlatformConfiguration getLocalTestConfig​(java.lang.Class<?> test)
        Get a local (no communication) test configuration using a unique platform name derived from the test name. Attention: The name is unique and the config can not be reused for multiple platforms!
        Parameters:
        test - The test class.
        Returns:
        The default configuration with a unique platform name.
      • createDefaultTestConfig

        public static IPlatformConfiguration createDefaultTestConfig​(java.lang.Class<?> test)
        Create a test configuration to be used for platforms that should be able to communicate via intravm means. Only platforms created from the same (base) configuration will see each other, i.e., this method should only be used once for each test case and different configs for a single test should be derived via .clone() from a single base conf.
        Parameters:
        test - The test class for generating platform names.
      • runSimLocked

        public static void runSimLocked​(IPlatformConfiguration conf,
                                        java.util.function.Consumer<IInternalAccess> code)
        Start a platform and run the code on a component thread. Preferred way for running test methods to avoid simulation clock advancement while (external) test thread is active.