Search in sources :

Example 11 with GlusterBrick

use of org.ovirt.engine.api.model.GlusterBrick 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);
}
Also used : Action(org.ovirt.engine.api.model.Action) GlusterVolume(org.ovirt.engine.api.model.GlusterVolume) GlusterBricks(org.ovirt.engine.api.model.GlusterBricks) GlusterBrick(org.ovirt.engine.api.model.GlusterBrick) GlusterVolumeRemoveBricksParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters) Test(org.junit.Test) AbstractBackendCollectionResourceTest(org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResourceTest)

Example 12 with GlusterBrick

use of org.ovirt.engine.api.model.GlusterBrick 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);
}
Also used : Action(org.ovirt.engine.api.model.Action) GlusterVolume(org.ovirt.engine.api.model.GlusterVolume) GlusterBricks(org.ovirt.engine.api.model.GlusterBricks) GlusterBrick(org.ovirt.engine.api.model.GlusterBrick) GlusterVolumeRemoveBricksParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters) Test(org.junit.Test) AbstractBackendCollectionResourceTest(org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResourceTest)

Example 13 with GlusterBrick

use of org.ovirt.engine.api.model.GlusterBrick 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;
}
Also used : GlusterBricks(org.ovirt.engine.api.model.GlusterBricks) GlusterBrick(org.ovirt.engine.api.model.GlusterBrick)

Example 14 with GlusterBrick

use of org.ovirt.engine.api.model.GlusterBrick 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;
}
Also used : GlusterBricks(org.ovirt.engine.api.model.GlusterBricks) GlusterVolume(org.ovirt.engine.api.model.GlusterVolume) GlusterBrick(org.ovirt.engine.api.model.GlusterBrick)

Example 15 with GlusterBrick

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

the class BackendGlusterVolumesResourceTest method createBrick.

private GlusterBrick createBrick(String brickDir) {
    GlusterBrick brick = new GlusterBrick();
    brick.setServerId(serverId.toString());
    brick.setBrickDir(brickDir);
    return brick;
}
Also used : GlusterBrick(org.ovirt.engine.api.model.GlusterBrick)

Aggregations

GlusterBrick (org.ovirt.engine.api.model.GlusterBrick)21 GlusterBricks (org.ovirt.engine.api.model.GlusterBricks)7 GlusterVolume (org.ovirt.engine.api.model.GlusterVolume)7 GlusterBrickEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)6 GlusterVolumeRemoveBricksParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters)5 Action (org.ovirt.engine.api.model.Action)4 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 AbstractBackendCollectionResourceTest (org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResourceTest)3 Cluster (org.ovirt.engine.api.model.Cluster)2 GlusterClients (org.ovirt.engine.api.model.GlusterClients)2 GlusterMemoryPools (org.ovirt.engine.api.model.GlusterMemoryPools)2 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)2 WebApplicationException (javax.ws.rs.WebApplicationException)1 BrickProfileDetail (org.ovirt.engine.api.model.BrickProfileDetail)1 BrickProfileDetails (org.ovirt.engine.api.model.BrickProfileDetails)1 Fault (org.ovirt.engine.api.model.Fault)1 GlusterVolumeProfileDetails (org.ovirt.engine.api.model.GlusterVolumeProfileDetails)1 NfsProfileDetail (org.ovirt.engine.api.model.NfsProfileDetail)1 NfsProfileDetails (org.ovirt.engine.api.model.NfsProfileDetails)1