use of com.infiniteautomation.mango.spring.service.PublishedPointService in project ma-core-public by infiniteautomation.
the class MangoTestBase method createMockPublisher.
/**
* Create a publisher with points
*/
public MockPublisherVO createMockPublisher(boolean enabled, List<MockPublishedPointVO> points) {
MockPublisherVO publisherVO = (MockPublisherVO) ModuleRegistry.getPublisherDefinition(MockPublisherDefinition.TYPE_NAME).baseCreatePublisherVO();
publisherVO.setName(UUID.randomUUID().toString());
publisherVO.setEnabled(enabled);
PublisherService publisherService = Common.getBean(PublisherService.class);
try {
MockPublisherVO pub = (MockPublisherVO) publisherService.insert(publisherVO);
PublishedPointService publishedPointService = Common.getBean(PublishedPointService.class);
for (MockPublishedPointVO point : points) {
publishedPointService.insert(point);
}
return pub;
} catch (ValidationException e) {
fail(e.getValidationErrorMessage(Common.getTranslations()));
return null;
}
}
use of com.infiniteautomation.mango.spring.service.PublishedPointService in project ma-core-public by infiniteautomation.
the class MangoTestBase method createMockPublishedPoint.
/**
* Create a published point
*/
public MockPublishedPointVO createMockPublishedPoint(MockPublisherVO publisher, IDataPoint dataPoint, boolean enabled) {
MockPublishedPointVO pp = publisher.getDefinition().createPublishedPointVO(publisher, dataPoint);
pp.setName(dataPoint.getName());
pp.setEnabled(true);
PublishedPointService publishedPointService = Common.getBean(PublishedPointService.class);
try {
publishedPointService.insert(pp);
} catch (ValidationException e) {
fail(e.getValidationErrorMessage(Common.getTranslations()));
return null;
}
return pp;
}
Aggregations