Search in sources :

Example 31 with ServiceCodeException

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

the class ServiceCodeExceptionTest method unableToCreateMashaller.

@Test
public void unableToCreateMashaller() {
    final String type = "type";
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "Unable to create a mashaller for mediatype: {0}", new Object[] { type });
    assertApiBadParameters("Unable to create a mashaller for mediatype: " + type, exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 32 with ServiceCodeException

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

the class ServiceCodeExceptionTest method invalidInput.

@Test
public void invalidInput() {
    final int lineNumber = 10;
    final int columnNumber = 5;
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "Invalid input at line {0}, column {1}", new Object[] { lineNumber, columnNumber });
    assertApiBadParameters("Invalid input at line " + lineNumber + ", column " + columnNumber, exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 33 with ServiceCodeException

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

the class ServiceCodeExceptionTest method noPoolFoundException.

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

Example 34 with ServiceCodeException

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

the class ServiceCodeExceptionTest method invalidRole.

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

Example 35 with ServiceCodeException

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

the class ServiceCodeExceptionTest method keypoolNotFound.

@Test
public void keypoolNotFound() {
    final String keyPath = "keyPool/RelativePath";
    final String key = "key";
    final ServiceCodeException exception = new ServiceCodeException(IO_ERROR, "Not found, key pool: {0}, key {1}", new Object[] { keyPath, key });
    assertIoError("Not found, key pool: " + keyPath + ", key " + key, exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) 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