Search in sources :

Example 1 with ModuleElementDefinition

use of com.serotonin.m2m2.module.ModuleElementDefinition in project ma-core-public by infiniteautomation.

the class MangoTestBase method staticSetup.

@BeforeClass
public static void staticSetup() throws IOException {
    // Configure Log4j2
    ConfigurationSource source = new ConfigurationSource(MangoTestBase.class.getClass().getResource("/test-log4j2.xml").openStream());
    Configurator.initialize(null, source);
    List<ModuleElementDefinition> definitions = new ArrayList<>();
    definitions.add(new MockDataSourceDefinition());
    addModule("BaseTest", definitions);
}
Also used : ModuleElementDefinition(com.serotonin.m2m2.module.ModuleElementDefinition) ConfigurationSource(org.apache.logging.log4j.core.config.ConfigurationSource) ArrayList(java.util.ArrayList) MockDataSourceDefinition(com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceDefinition) BeforeClass(org.junit.BeforeClass)

Example 2 with ModuleElementDefinition

use of com.serotonin.m2m2.module.ModuleElementDefinition in project ma-core-public by infiniteautomation.

the class MangoTestBase method addModule.

/**
 * Add a module to the test.  Before the before() method is called.
 * @param name
 * @param definitions
 * @return
 */
protected static void addModule(String name, List<ModuleElementDefinition> definitions) {
    MangoTestModule module = new MangoTestModule(name);
    for (ModuleElementDefinition definition : definitions) module.addDefinition(definition);
    modules.add(module);
}
Also used : ModuleElementDefinition(com.serotonin.m2m2.module.ModuleElementDefinition)

Example 3 with ModuleElementDefinition

use of com.serotonin.m2m2.module.ModuleElementDefinition in project ma-core-public by infiniteautomation.

the class PublisherAuditTest method addDefinitions.

@BeforeClass
public static void addDefinitions() {
    List<ModuleElementDefinition> definitions = new ArrayList<>();
    definitions.add(new MockPublisherDefinition());
    addModule("mockPublisher", definitions);
}
Also used : ModuleElementDefinition(com.serotonin.m2m2.module.ModuleElementDefinition) MockPublisherDefinition(com.serotonin.m2m2.vo.publish.mock.MockPublisherDefinition) ArrayList(java.util.ArrayList) BeforeClass(org.junit.BeforeClass)

Aggregations

ModuleElementDefinition (com.serotonin.m2m2.module.ModuleElementDefinition)3 ArrayList (java.util.ArrayList)2 BeforeClass (org.junit.BeforeClass)2 MockDataSourceDefinition (com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceDefinition)1 MockPublisherDefinition (com.serotonin.m2m2.vo.publish.mock.MockPublisherDefinition)1 ConfigurationSource (org.apache.logging.log4j.core.config.ConfigurationSource)1