Author: mdisabatino
Date: Thu Jul 18 10:27:05 2013
New Revision: 1504416
URL: http://svn.apache.org/r1504416
Log:
Syncope-402 Removed PropagationException from rest service mapper
Modified:
syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java
syncope/branches/1_1_X/core/src/main/webapp/syncopeClientError.jsp
syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
Modified:
syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java
URL:
http://svn.apache.org/viewvc/syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java?rev=1504416&r1=1504415&r2=1504416&view=diff
==============================================================================
---
syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java
(original)
+++
syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java
Thu Jul 18 10:27:05 2013
@@ -60,7 +60,6 @@ public enum SyncopeClientExceptionType {
InvalidSyncTask("Syncope.InvalidSyncTask",
"Syncope.InvalidSyncTask.element"),
InvalidValues("Syncope.InvalidValues",
"Syncope.InvalidValues.attributeName"),
NotFound("Syncope.NotFound", "Syncope.NotFound.entity"),
- Propagation("Syncope.Propagation", "Syncope.Propagation.resourceName"),
RejectedUserCreate("Syncope.RejectUserCreate",
"Syncope.RejectUserCreate.userId"),
RequiredValuesMissing("Syncope.RequiredValuesMissing",
"Syncope.RequiredValuesMissing.attributeName"),
Scheduling("Syncope.Scheduling", "Syncope.Scheduling.message"),
Modified:
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java
URL:
http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java?rev=1504416&r1=1504415&r2=1504416&view=diff
==============================================================================
---
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java
(original)
+++
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java
Thu Jul 18 10:27:05 2013
@@ -38,7 +38,6 @@ import org.apache.syncope.common.validat
import org.apache.syncope.core.persistence.dao.MissingConfKeyException;
import org.apache.syncope.core.persistence.dao.NotFoundException;
import
org.apache.syncope.core.persistence.validation.entity.InvalidEntityException;
-import org.apache.syncope.core.propagation.PropagationException;
import org.apache.syncope.core.rest.controller.UnauthorizedRoleException;
import org.apache.syncope.core.workflow.WorkflowException;
import
org.identityconnectors.framework.common.exceptions.ConfigurationException;
@@ -186,9 +185,6 @@ public class RestServiceExceptionMapper
return responseBuilder.build();
} else if (ex instanceof WorkflowException) {
return buildResponse(responseBuilder,
SyncopeClientExceptionType.Workflow, getExMessage(ex));
- } else if (ex instanceof PropagationException) {
- return buildResponse(responseBuilder,
SyncopeClientExceptionType.Propagation, getMessage(ex,
- ((PropagationException) ex).getResourceName()));
} else if (ex instanceof InvalidSearchConditionException) {
return buildResponse(responseBuilder,
SyncopeClientExceptionType.InvalidSearchCondition, getExMessage(ex));
} else if (ex instanceof PersistenceException) {
Modified: syncope/branches/1_1_X/core/src/main/webapp/syncopeClientError.jsp
URL:
http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/main/webapp/syncopeClientError.jsp?rev=1504416&r1=1504415&r2=1504416&view=diff
==============================================================================
--- syncope/branches/1_1_X/core/src/main/webapp/syncopeClientError.jsp
(original)
+++ syncope/branches/1_1_X/core/src/main/webapp/syncopeClientError.jsp Thu Jul
18 10:27:05 2013
@@ -28,7 +28,6 @@ under the License.
<%@page
import="org.apache.syncope.core.persistence.dao.MissingConfKeyException"%>
<%@page import="org.apache.syncope.common.validation.SyncopeClientException"%>
<%@page
import="org.apache.syncope.common.validation.SyncopeClientCompositeErrorException"%>
-<%@page import="org.apache.syncope.core.propagation.PropagationException"%>
<%@page import="org.apache.syncope.core.workflow.WorkflowException"%>
<%@page import="org.apache.syncope.common.types.SyncopeClientExceptionType"%>
<%@page import="org.apache.syncope.core.persistence.dao.NotFoundException"%>
@@ -90,13 +89,6 @@ under the License.
SyncopeClientExceptionType.Workflow.getElementHeaderName(),
"Currently unavailable. Please try later.");
statusCode = HttpServletResponse.SC_BAD_REQUEST;
- } else if (ex instanceof PropagationException) {
- response.setHeader(SyncopeClientErrorHandler.EXCEPTION_TYPE_HEADER,
- SyncopeClientExceptionType.Propagation.getHeaderValue());
-
response.setHeader(SyncopeClientExceptionType.Propagation.getElementHeaderName(),
- ((PropagationException) ex).getResourceName());
-
- statusCode = HttpServletResponse.SC_BAD_REQUEST;
} else if (ex instanceof SyncopeClientCompositeErrorException) {
for (SyncopeClientException sce :
((SyncopeClientCompositeErrorException) ex).getExceptions()) {
response.addHeader(
Modified:
syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
URL:
http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java?rev=1504416&r1=1504415&r2=1504416&view=diff
==============================================================================
---
syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
(original)
+++
syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
Thu Jul 18 10:27:05 2013
@@ -255,9 +255,9 @@ public class UserTestITCase extends Abst
try {
userTO = userService.update(userMod.getId(), userMod);
} catch (SyncopeClientCompositeErrorException scce) {
- sce = scce.getException(SyncopeClientExceptionType.Propagation);
+ sce =
scce.getException(SyncopeClientExceptionType.InvalidSyncopeUser);
}
- assertNull(sce);
+ assertNotNull(sce);
}
@Test
@@ -593,7 +593,7 @@ public class UserTestITCase extends Abst
Exception exception = null;
try {
jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
- new String[] {userTO.getUsername()}, Integer.class);
+ new String[]{userTO.getUsername()}, Integer.class);
} catch (EmptyResultDataAccessException e) {
exception = e;
}
@@ -1927,12 +1927,12 @@ public class UserTestITCase extends Abst
assertNotNull(prop);
assertEquals("ws-target-resource-1", prop.getResource());
assertEquals(PropagationTaskExecStatus.SUBMITTED, prop.getStatus());
-
+
// 6. restore initial cipher algorithm
pwdCipherAlgo.setValue(origpwdCipherAlgo);
configurationService.update(pwdCipherAlgo.getKey(), pwdCipherAlgo);
}
-
+
@Test
public void isseSYNCOPE136Random() {
// 1. create user with no resources