use of org.ovirt.engine.api.model.GlusterBricks in project ovirt-engine by oVirt.
the class BackendGlusterBricksResourceTest method testActivate.
@Test
public void testActivate() throws Exception {
GlusterBrick brick = new GlusterBrick();
GlusterVolume volume = new GlusterVolume();
brick.setName(serverName + ":" + brickDir);
volume.setId(volumeId.toString());
brick.setGlusterVolume(volume);
GlusterBricks bricks = mock(GlusterBricks.class);
when(bricks.getGlusterBricks()).thenReturn(Collections.singletonList(brick));
setUriInfo(setUpActionExpectations(ActionType.StopRemoveGlusterVolumeBricks, GlusterVolumeRemoveBricksParameters.class, new String[] {}, new Object[] {}, true, true));
Action action = new Action();
action.setBricks(bricks);
collection.stopMigrate(action);
}
use of org.ovirt.engine.api.model.GlusterBricks in project ovirt-engine by oVirt.
the class BackendGlusterBricksResourceTest method testStopMigrate.
@Test
public void testStopMigrate() throws Exception {
GlusterBrick brick = new GlusterBrick();
GlusterVolume volume = new GlusterVolume();
brick.setName(serverName + ":" + brickDir);
volume.setId(volumeId.toString());
brick.setGlusterVolume(volume);
GlusterBricks bricks = mock(GlusterBricks.class);
when(bricks.getGlusterBricks()).thenReturn(Collections.singletonList(brick));
setUriInfo(setUpActionExpectations(ActionType.StopRemoveGlusterVolumeBricks, GlusterVolumeRemoveBricksParameters.class, new String[] {}, new Object[] {}, true, true));
Action action = new Action();
action.setBricks(bricks);
collection.stopMigrate(action);
}
use of org.ovirt.engine.api.model.GlusterBricks in project ovirt-engine by oVirt.
the class BackendGlusterBricksResourceTest method getBrickModelsToRemove.
private GlusterBricks getBrickModelsToRemove() {
GlusterBricks bricks = new GlusterBricks();
GlusterBrick brick = new GlusterBrick();
brick.setId(GUIDS[0].toString());
bricks.getGlusterBricks().add(brick);
return bricks;
}
use of org.ovirt.engine.api.model.GlusterBricks in project ovirt-engine by oVirt.
the class BackendGlusterBricksResourceTest method createModel.
private GlusterBricks createModel() {
GlusterBricks bricks = new GlusterBricks();
GlusterBrick brick = new GlusterBrick();
brick.setId(GUIDS[0].toString());
brick.setGlusterVolume(new GlusterVolume());
brick.getGlusterVolume().setId(volumeId.toString());
brick.setServerId(serverId.toString());
brick.setBrickDir(brickDir);
bricks.getGlusterBricks().add(brick);
return bricks;
}
use of org.ovirt.engine.api.model.GlusterBricks in project ovirt-engine by oVirt.
the class BackendGlusterBricksResourceTest method testAdd.
@Test
public void testAdd() throws Exception {
UriInfo uriInfo = setUpBasicUriExpectations();
when(uriInfo.getPath()).thenReturn("clusters/" + clusterId + "/glustervolumes/" + volumeId + "/bricks");
setUriInfo(uriInfo);
setUpBrickCreationExpectation(false);
Response response = collection.add(createModel());
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof GlusterBricks);
verifyModel(((GlusterBricks) response.getEntity()).getGlusterBricks().get(0), 0);
}
Aggregations