Package jadex.base.test.util
Class STest
- java.lang.Object
-
- jadex.base.test.util.STest
-
public class STest extends java.lang.Object
Static config class for tests.
-
-
Constructor Summary
Constructors Constructor Description STest()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.static IPlatformConfiguration
getLocalTestConfig(java.lang.Class<?> test)
Get a local (no communication) test configuration using a unique platform name derived from the test name.static IPlatformConfiguration
getLocalTestConfig(java.lang.String name)
Get local (no communication) test configuration using a generated unique platform name derived from the test name.static void
runSimLocked(IPlatformConfiguration conf, java.util.function.Consumer<IInternalAccess> code)
Start a platform and run the code on a component thread.
-
-
-
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.
-
-