Search in sources :

Example 6 with Watchdog

use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.

the class BackendTemplateWatchdogResourceTest method testUpdate.

@Test
public void testUpdate() throws Exception {
    setUpEntityQueryExpectations(2);
    setUriInfo(setUpActionExpectations(ActionType.UpdateWatchdog, WatchdogParameters.class, new String[] { "Id" }, new Object[] { TEMPLATE_ID }, true, true));
    Watchdog wd = resource.update(getUpdate());
    assertTrue(wd.isSetAction());
}
Also used : VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog) Watchdog(org.ovirt.engine.api.model.Watchdog) WatchdogParameters(org.ovirt.engine.core.common.action.WatchdogParameters) Test(org.junit.Test)

Example 7 with Watchdog

use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.

the class BackendTemplateWatchdogResourceTest method getUpdate.

private Watchdog getUpdate() {
    Watchdog watchdog = new Watchdog();
    watchdog.setId(WATCHDOG_ID.toString());
    watchdog.setAction(WatchdogAction.RESET);
    watchdog.setModel(WatchdogModel.I6300ESB);
    return watchdog;
}
Also used : VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog) Watchdog(org.ovirt.engine.api.model.Watchdog)

Example 8 with Watchdog

use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.

the class BackendTemplateWatchdogsResourceTest 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[] { INSTANCE_TYPE_ID }, getEntity());
    Watchdog model = getModel();
    Response response = collection.add(model);
    assertEquals(201, response.getStatus());
    assertTrue(response.getEntity() instanceof Watchdog);
    verifyModel((Watchdog) response.getEntity());
}
Also used : Response(javax.ws.rs.core.Response) Watchdog(org.ovirt.engine.api.model.Watchdog) VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog) Test(org.junit.Test)

Example 9 with Watchdog

use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.

the class BackendVmWatchdogResourceTest method testGet.

@Test
public void testGet() throws Exception {
    setUriInfo(setUpBasicUriExpectations());
    setUpEntityQueryExpectations(1);
    Watchdog watchdog = resource.get();
    verifyModel(watchdog);
}
Also used : VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog) Watchdog(org.ovirt.engine.api.model.Watchdog) Test(org.junit.Test)

Example 10 with Watchdog

use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.

the class BackendVmWatchdogResourceTest method testUpdate.

@Test
public void testUpdate() throws Exception {
    setUpEntityQueryExpectations(2);
    setUriInfo(setUpActionExpectations(ActionType.UpdateWatchdog, WatchdogParameters.class, new String[] { "Id" }, new Object[] { VM_ID }, true, true));
    Watchdog wd = resource.update(getUpdate());
    assertTrue(wd.isSetAction());
}
Also used : VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog) Watchdog(org.ovirt.engine.api.model.Watchdog) WatchdogParameters(org.ovirt.engine.core.common.action.WatchdogParameters) Test(org.junit.Test)

Aggregations

Watchdog (org.ovirt.engine.api.model.Watchdog)19 VmWatchdog (org.ovirt.engine.core.common.businessentities.VmWatchdog)18 Test (org.junit.Test)11 Response (javax.ws.rs.core.Response)3 WatchdogParameters (org.ovirt.engine.core.common.action.WatchdogParameters)3 Vms (org.ovirt.engine.api.model.Vms)1