use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendVmWatchdogsResourceTest method testAdd.
@Test
public void testAdd() {
setUriInfo(setUpBasicUriExpectations());
setUpCreationExpectations(ActionType.AddWatchdog, WatchdogParameters.class, new String[] {}, new Object[] {}, true, true, WATCHDOG_ID, QueryType.GetWatchdog, IdQueryParameters.class, new String[] { "Id" }, new Object[] { VM_ID }, getEntity());
Watchdog model = getModel();
Response response = collection.add(model);
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof Watchdog);
verifyModel((Watchdog) response.getEntity());
}
use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendVmWatchdogResourceTest method getUpdate.
private Watchdog getUpdate() {
Watchdog watchdog = new Watchdog();
watchdog.setId(WATCHDOG_ID.toString());
watchdog.setAction(WatchdogAction.RESET);
watchdog.setModel(WatchdogModel.I6300ESB);
return watchdog;
}
use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendVmWatchdogsResourceTest method getModel.
private Watchdog getModel() {
Watchdog watchDog = new Watchdog();
watchDog.setAction(WatchdogAction.RESET);
watchDog.setModel(WatchdogModel.I6300ESB);
watchDog.setId(WATCHDOG_ID.toString());
return watchDog;
}
use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class V3WatchDogInAdapter method adapt.
@Override
public Watchdog adapt(V3WatchDog from) {
Watchdog to = new Watchdog();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetAction()) {
to.setAction(WatchdogAction.fromValue(from.getAction()));
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetInstanceType()) {
to.setInstanceType(adaptIn(from.getInstanceType()));
}
if (from.isSetModel()) {
to.setModel(WatchdogModel.fromValue(from.getModel()));
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetTemplate()) {
to.setTemplate(adaptIn(from.getTemplate()));
}
if (from.isSetVm()) {
to.setVm(adaptIn(from.getVm()));
}
if (from.isSetVms()) {
to.setVms(new Vms());
to.getVms().getVms().addAll(adaptIn(from.getVms().getVMs()));
}
return to;
}
use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendInstanceTypeWatchdogResourceTest method testGet.
@Test
public void testGet() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(1);
Watchdog watchdog = resource.get();
verifyModel(watchdog);
}
Aggregations