default sensor test succeed
This commit is contained in:
parent
dc5d5aa56d
commit
d8c8101dba
|
@ -25,11 +25,16 @@ public class CentralSensorItemService implements SensorItemService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CentralSensorService sensorService;
|
private CentralSensorService sensorService;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public SensorItem regist(Sensor sensor, MetaDisplayItemMapping metaDisplayItemMapping) throws OverflowException {
|
public SensorItem regist(Sensor sensor, MetaDisplayItemMapping metaDisplayItemMapping) throws OverflowException {
|
||||||
SensorItem sensorItem = new SensorItem();
|
SensorItem sensorItem = new SensorItem();
|
||||||
sensorItem.setMetaDisplayItemMapping(metaDisplayItemMapping);
|
sensorItem.setMetaDisplayItemMapping(metaDisplayItemMapping);
|
||||||
sensorItem.setSensor(sensor);
|
sensorItem.setSensor(sensor);
|
||||||
return this.sensorItemDAO.save(sensorItem);
|
SensorItem retSensorItem = this.sensorItemDAO.save(sensorItem);
|
||||||
|
if (null != retSensorItem) {
|
||||||
|
this.sensorService.increaseSensorItemCount(sensor.getId());
|
||||||
|
}
|
||||||
|
return retSensorItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -37,6 +37,7 @@ public class CentralSensorService implements SensorService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CentralSensorConfigService sensorConfigService;
|
private CentralSensorConfigService sensorConfigService;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public void registDefaults(List<Target> targets) throws OverflowException {
|
public void registDefaults(List<Target> targets) throws OverflowException {
|
||||||
for (Target target : targets) {
|
for (Target target : targets) {
|
||||||
this.registDefault(target);
|
this.registDefault(target);
|
||||||
|
|
|
@ -44,9 +44,10 @@ public class SensorServiceTest {
|
||||||
InfraService infraService;
|
InfraService infraService;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore
|
||||||
public void registDefault() throws Exception {
|
public void registDefault() throws Exception {
|
||||||
Long tempInfraID = Long.valueOf(1);
|
Long tempInfraID = Long.valueOf(28); // ssh
|
||||||
Long tempProbeID = Long.valueOf(1);
|
Long tempProbeID = Long.valueOf(3);
|
||||||
|
|
||||||
Infra infra = this.infraService.read(tempInfraID);
|
Infra infra = this.infraService.read(tempInfraID);
|
||||||
List<Long> infraIDs = new ArrayList<>();
|
List<Long> infraIDs = new ArrayList<>();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user