Search in sources :

Example 11 with ServiceCodeException

use of com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method noProtectionPoolFound.

@Test
public void noProtectionPoolFound() {
    final String label = "protectionNeighborhoodLabel";
    final ServiceCodeException exception = new ServiceCodeException(API_NO_PLACEMENT_FOUND, "Could not find a Storage pool for Protection VirtualArray: {0}", new Object[] { label });
    assertApiNoPlacementFound("Could not find a Storage pool for Protection VirtualArray: " + label, exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 12 with ServiceCodeException

use of com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method invalidTag.

@Test
public void invalidTag() {
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "Tag is empty or contains less than 2 characters", null);
    assertApiBadParameters("Tag is empty or contains less than 2 characters", exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 13 with ServiceCodeException

use of com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method noDelete.

@Test
public void noDelete() {
    final URI id = createTestId("Volume");
    final ServiceCodeException exception = new ServiceCodeException(API_ERROR, "Attempt to delete a protected volume that is not the source volume: {0}", new Object[] { id });
    assertApiError("Attempt to delete a protected volume that is not the source volume: " + id, exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) URI(java.net.URI) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 14 with ServiceCodeException

use of com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method IllegalId.

@Test
public void IllegalId() {
    final String uri = "uri";
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "Illegal URI: {0}", new Object[] { uri });
    assertApiBadParameters("Illegal URI: " + uri, exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 15 with ServiceCodeException

use of com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method noPoolFound.

@Test
public void noPoolFound() {
    final URI cosId = createTestId("CoS");
    final URI neighborhoodId = createTestId("Neighbohood");
    final ServiceCodeException exception = new ServiceCodeException(API_NO_PLACEMENT_FOUND, "No matching storage pool found using vpool {0} and VirtualArray {1}", new Object[] { cosId, neighborhoodId });
    assertApiNoPlacementFound("No matching storage pool found using vpool " + cosId + " and VirtualArray " + neighborhoodId, exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) URI(java.net.URI) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Aggregations

ServiceCodeException (com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException)37 BaseServiceCodeExceptionTest (com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)27 Test (org.junit.Test)27 URI (java.net.URI)10 Operation (com.emc.storageos.db.client.model.Operation)5 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)5 ArrayList (java.util.ArrayList)5 DataObject (com.emc.storageos.db.client.model.DataObject)4 Volume (com.emc.storageos.db.client.model.Volume)4 BlockObject (com.emc.storageos.db.client.model.BlockObject)3 DiscoveredDataObject (com.emc.storageos.db.client.model.DiscoveredDataObject)3 NamedURI (com.emc.storageos.db.client.model.NamedURI)3 MapVolume (com.emc.storageos.api.mapper.functions.MapVolume)2 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)2 StringMap (com.emc.storageos.db.client.model.StringMap)2 VirtualPool (com.emc.storageos.db.client.model.VirtualPool)2 NullColumnValueGetter.isNullURI (com.emc.storageos.db.client.util.NullColumnValueGetter.isNullURI)2 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)2 HashMap (java.util.HashMap)2 List (java.util.List)2