Search in sources :

Example 16 with Watchdog

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

the class BackendTemplateWatchdogResourceTest 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 17 with Watchdog

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

the class BackendTemplateWatchdogsResourceTest method getModel.

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

Example 18 with Watchdog

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

the class WatchdogMapperTest method mapVmWatchdog.

@Test
public void mapVmWatchdog() {
    VmWatchdog entity = new VmWatchdog();
    entity.setAction(VmWatchdogAction.RESET);
    entity.setModel(VmWatchdogType.i6300esb);
    entity.setId(Guid.Empty);
    Watchdog model = WatchdogMapper.map(entity, null);
    assertNotNull(model);
    assertEquals(WatchdogAction.RESET, model.getAction());
    assertEquals(WatchdogModel.I6300ESB, model.getModel());
}
Also used : VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog) Watchdog(org.ovirt.engine.api.model.Watchdog) VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog) Test(org.junit.Test)

Example 19 with Watchdog

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

the class WatchdogMapperTest method mapWatchdog.

@Test
public void mapWatchdog() {
    Watchdog model = new Watchdog();
    model.setAction(WatchdogAction.RESET);
    model.setModel(WatchdogModel.I6300ESB);
    model.setId(Guid.Empty.toString());
    VmWatchdog entity = WatchdogMapper.map(model, null);
    assertNotNull(entity);
    assertEquals(VmWatchdogAction.RESET, entity.getAction());
    assertEquals(VmWatchdogType.i6300esb, entity.getModel());
}
Also used : VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog) Watchdog(org.ovirt.engine.api.model.Watchdog) VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog) 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