Search in sources :

Example 16 with DataSourceService

use of com.infiniteautomation.mango.spring.service.DataSourceService in project ma-core-public by MangoAutomation.

the class DataPointEventsTest method stopAllDataSources.

@After
public void stopAllDataSources() {
    // Since we don't shutdown the runtime between tests we need to do this
    DataSourceService service = Common.getBean(DataSourceService.class);
    service.list(ds -> service.delete(ds.getId()));
}
Also used : DataSourceService(com.infiniteautomation.mango.spring.service.DataSourceService) After(org.junit.After)

Example 17 with DataSourceService

use of com.infiniteautomation.mango.spring.service.DataSourceService in project ma-core-public by MangoAutomation.

the class RateOfChangeDetectorTest method configure.

@Before
public void configure() {
    this.listener = new EventDetectorEventListener();
    Common.eventManager.addUserEventListener(this.listener);
    dataSourceService = Common.getBean(DataSourceService.class);
    dsVo = new MockDataSourceVO("test", "DS_1");
    dsVo.setEnabled(true);
    dsVo.setUpdatePeriods(1);
    dsVo.setUpdatePeriodType(TimePeriods.SECONDS);
    validate(dsVo);
    dataSourceService.insert(dsVo);
}
Also used : MockDataSourceVO(com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO) DataSourceService(com.infiniteautomation.mango.spring.service.DataSourceService) Before(org.junit.Before)

Aggregations

DataSourceService (com.infiniteautomation.mango.spring.service.DataSourceService)17 MockDataSourceVO (com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO)14 PermissionService (com.infiniteautomation.mango.spring.service.PermissionService)10 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)10 MutableObject (org.apache.commons.lang3.mutable.MutableObject)10 Test (org.junit.Test)10 MockPointLocatorVO (com.serotonin.m2m2.vo.dataPoint.MockPointLocatorVO)8 DataPointService (com.infiniteautomation.mango.spring.service.DataPointService)5 EventHandlerService (com.infiniteautomation.mango.spring.service.EventHandlerService)4 ExtendedJdbcTemplate (com.serotonin.db.spring.ExtendedJdbcTemplate)4 DatabaseProxy (com.serotonin.m2m2.db.DatabaseProxy)4 ProcessEventHandlerDefinition (com.serotonin.m2m2.module.definitions.event.handlers.ProcessEventHandlerDefinition)4 DataSourceEventType (com.serotonin.m2m2.rt.event.type.DataSourceEventType)4 EventTypeMatcher (com.serotonin.m2m2.rt.event.type.EventTypeMatcher)4 DataPointVO (com.serotonin.m2m2.vo.DataPointVO)4 AbstractEventHandlerVO (com.serotonin.m2m2.vo.event.AbstractEventHandlerVO)4 ProcessEventHandlerVO (com.serotonin.m2m2.vo.event.ProcessEventHandlerVO)4 DataSource (javax.sql.DataSource)4 JdbcConnectionPool (org.h2.jdbcx.JdbcConnectionPool)4 Role (com.serotonin.m2m2.vo.role.Role)3