Search in sources :

Example 6 with ServiceCodeException

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

the class ServiceCodeExceptionTest method missingOrInvalid.

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

Example 7 with ServiceCodeException

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

the class ServiceCodeExceptionTest method notSupportedVPlex.

@Test
public void notSupportedVPlex() {
    final ServiceCodeException exception = new ServiceCodeException(API_METHOD_NOT_SUPPORTED, "Not Supported for VPlex volumes", null);
    assertApiMethodNotAllowed("Not Supported for VPlex volumes", exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 8 with ServiceCodeException

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

the class ServiceCodeExceptionTest method endpointNotAdded.

@Test
public void endpointNotAdded() {
    final String discoveredEndpoints = "discoveredEndpoints";
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "Endpoints {0} cannot be added because " + "they were discovered automatically in different transport zones", new Object[] { discoveredEndpoints });
    assertApiBadParameters("Endpoints " + discoveredEndpoints + " cannot be added because they were discovered automatically in different transport zones", exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 9 with ServiceCodeException

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

the class ServiceCodeExceptionTest method alreadyContainsZone.

@Test
public void alreadyContainsZone() {
    final URI id = createTestId("TransportZone");
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "VirtualArray already contains an IP transport zone: {0}", new Object[] { id });
    assertApiBadParameters("VirtualArray already contains an IP transport zone: " + 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 10 with ServiceCodeException

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

the class ServiceCodeExceptionTest method duplicateNetworkSystem.

@Test
public void duplicateNetworkSystem() {
    final String ipAddress = "ip_address";
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "Duplicate NetworkSystem already exists at IP address: {0}", new Object[] { ipAddress });
    assertApiBadParameters("Duplicate NetworkSystem already exists at IP address: " + ipAddress, 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