Search in sources :

Example 6 with MockDataSourceVO

use of com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO in project ma-core-public by infiniteautomation.

the class PublisherAuditTest method createPoints.

protected List<MockPublishedPointVO> createPoints() {
    List<MockPublishedPointVO> points = new ArrayList<MockPublishedPointVO>(pointCount);
    // Create data source?
    MockDataSourceVO ds = new MockDataSourceVO();
    ds.setXid("DS_TEST1");
    ds.setName("TEST");
    DataSourceDao.instance.save(ds);
    for (int i = 1; i < pointCount + 1; i++) {
        DataPointVO dp = new DataPointVO();
        dp.setXid("DP_" + i);
        dp.setPointLocator(new MockPointLocatorVO(DataTypes.NUMERIC, true));
        dp.setDataSourceId(ds.getId());
        DataPointDao.instance.save(dp);
        MockPublishedPointVO vo = new MockPublishedPointVO();
        vo.setDataPointId(i);
        points.add(vo);
    }
    return points;
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) MockDataSourceVO(com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO) ArrayList(java.util.ArrayList) MockPublishedPointVO(com.serotonin.m2m2.vo.publish.mock.MockPublishedPointVO) MockPointLocatorVO(com.serotonin.m2m2.vo.dataPoint.MockPointLocatorVO)

Aggregations

MockDataSourceVO (com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO)6 ObjectWriter (com.fasterxml.jackson.databind.ObjectWriter)2 DataPointVO (com.serotonin.m2m2.vo.DataPointVO)2 User (com.serotonin.m2m2.vo.User)2 MockPointLocatorVO (com.serotonin.m2m2.vo.dataPoint.MockPointLocatorVO)2 DataSourceVO (com.serotonin.m2m2.vo.dataSource.DataSourceVO)2 JsonViews (com.serotonin.m2m2.web.mvc.rest.v1.mapping.JsonViews)2 MockDataSourceModel (com.serotonin.m2m2.web.mvc.rest.v1.model.MockDataSourceModel)2 ArrayList (java.util.ArrayList)2 PointValueDao (com.serotonin.m2m2.db.dao.PointValueDao)1 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)1 MockPointLocatorRT (com.serotonin.m2m2.rt.dataSource.MockPointLocatorRT)1 MockPublishedPointVO (com.serotonin.m2m2.vo.publish.mock.MockPublishedPointVO)1 DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)1 SimulationTimer (com.serotonin.timer.SimulationTimer)1 Test (org.junit.Test)1