Package org.apache.cloudstack.storage.datastore.util.NexentaStorAppliance

Examples of org.apache.cloudstack.storage.datastore.util.NexentaStorAppliance.IntegerNmsResponse


    public void testIsLuExists() {
        final String volumeName = appliance.getVolumeName("volume1");
        when(client.execute(IntegerNmsResponse.class, "scsidisk", "lu_exists", volumeName)).thenReturn(null);
        assertFalse(appliance.isLuExists(volumeName));

        when(client.execute(IntegerNmsResponse.class, "scsidisk", "lu_exists", volumeName)).thenReturn(new IntegerNmsResponse(0));
        assertFalse(appliance.isLuExists(volumeName));

        when(client.execute(IntegerNmsResponse.class, "scsidisk", "lu_exists", volumeName)).thenReturn(new IntegerNmsResponse(1));
        assertTrue(appliance.isLuExists(volumeName));

        when(client.execute(IntegerNmsResponse.class, "scsidisk", "lu_exists", volumeName)).thenThrow(new CloudRuntimeException("does not exist"));
        assertFalse(appliance.isLuExists(volumeName));
    }
View Full Code Here


    public void testIsLuShared() {
        final String luName = appliance.getVolumeName("volume1");
        when(client.execute(IntegerNmsResponse.class, "scsidisk", "lu_shared", luName)).thenReturn(null);
        assertFalse(appliance.isLuShared(luName));

        when(client.execute(IntegerNmsResponse.class, "scsidisk", "lu_shared", luName)).thenReturn(new IntegerNmsResponse(0));
        assertFalse(appliance.isLuShared(luName));

        when(client.execute(IntegerNmsResponse.class, "scsidisk", "lu_shared", luName)).thenReturn(new IntegerNmsResponse(1));
        assertTrue(appliance.isLuShared(luName));

        final String error = String.format(ZVOL_DOES_NOT_EXISTS_ERROR, luName);
        when(client.execute(IntegerNmsResponse.class, "scsidisk", "lu_shared", luName)).thenThrow(new CloudRuntimeException(error));
        assertFalse(appliance.isLuShared(luName));
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.storage.datastore.util.NexentaStorAppliance.IntegerNmsResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.