Author: ilgrosso
Date: Wed Jan 9 11:29:37 2013
New Revision: 1430794
URL: http://svn.apache.org/viewvc?rev=1430794view=rev
Log:
[SYNCOPE-259] Fixing minor issues on WorkflowTestITCase
Modified:
syncope/trunk/core/src/main/java/org/apache/syncope/core/init/SpringContextInitializer.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/WorkflowController.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java
Modified:
syncope/trunk/core/src/main/java/org/apache/syncope/core/init/SpringContextInitializer.java
URL:
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/SpringContextInitializer.java?rev=1430794r1=1430793r2=1430794view=diff
==
---
syncope/trunk/core/src/main/java/org/apache/syncope/core/init/SpringContextInitializer.java
(original)
+++
syncope/trunk/core/src/main/java/org/apache/syncope/core/init/SpringContextInitializer.java
Wed Jan 9 11:29:37 2013
@@ -52,9 +52,11 @@ public class SpringContextInitializer im
private static String uwfAdapterClassName;
+private static String rwfAdapterClassName;
+
static {
try {
-initUWFAdapterClassName();
+initWFAdapterClassNames();
} catch (IOException e) {
LOG.error(Could not init uwfAdapterClassName, e);
}
@@ -65,13 +67,14 @@ public class SpringContextInitializer im
*
* @throws IOException if anything goes wrong
*/
-private static void initUWFAdapterClassName() throws IOException {
+private static void initWFAdapterClassNames() throws IOException {
Properties props = new java.util.Properties();
InputStream propStream = null;
try {
propStream =
ContentLoader.class.getResourceAsStream(/workflow.properties);
props.load(propStream);
uwfAdapterClassName = props.getProperty(uwfAdapter);
+rwfAdapterClassName = props.getProperty(rwfAdapter);
} catch (Exception e) {
LOG.error(Could not load workflow.properties, e);
} finally {
@@ -84,12 +87,23 @@ public class SpringContextInitializer im
/**
* Check if the configured user workflow adapter is Activiti's.
*
- * @return whether Activiti is configured for workflow or not
+ * @return whether Activiti is configured for user workflow or not
*/
public static boolean isActivitiEnabledForUsers() {
return uwfAdapterClassName != null
uwfAdapterClassName.equals(ActivitiUserWorkflowAdapter.class.getName());
}
+/**
+ * Check if the configured role workflow adapter is Activiti's.
+ *
+ * @return whether Activiti is configured for role workflow or not
+ */
+public static boolean isActivitiEnabledForRoles() {
+// ActivitiRoleWorkflowAdapter hasn't been developed (yet) as part of
SYNCOPE-173
+//return rwfAdapterClassName != null
rwfAdapterClassName.equals(ActivitiRoleWorkflowAdapter.class.getName());
+return false;
+}
+
@Autowired
private ConnectorFactory connInstanceLoader;
Modified:
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/WorkflowController.java
URL:
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/WorkflowController.java?rev=1430794r1=1430793r2=1430794view=diff
==
---
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/WorkflowController.java
(original)
+++
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/WorkflowController.java
Wed Jan 9 11:29:37 2013
@@ -50,6 +50,7 @@ public class WorkflowController extends
@Autowired
private RoleWorkflowAdapter rwfAdapter;
+
private WorkflowDefinitionTO getDefinition(final WorkflowAdapter adapter)
throws WorkflowException {
WorkflowDefinitionTO result = adapter.getDefinition();
@@ -86,6 +87,7 @@ public class WorkflowController extends
@RequestMapping(method = RequestMethod.PUT, value = /definition/user)
public void updateUserDefinition(@RequestBody final WorkflowDefinitionTO
definition)
throws NotFoundException, WorkflowException {
+
updateDefinition(uwfAdapter, definition);
}
Modified:
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
URL:
http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java?rev=1430794r1=1430793r2=1430794view=diff
==
---
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
(original)
+++