You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by Francesco Chicchiriccò <il...@apache.org> on 2013/01/31 12:50:15 UTC

Re: svn commit: r1440904 - in /syncope/trunk: build-tools/src/main/resources/org/apache/syncope/ client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ common/src/main/java/org/apache/syncope...

Hi Andrei,
as stated by latest failures on Jenkins, it seems that your commit broke 
the build, in particular your modification to 
core/src/main/resources/restContent.xml adds a reference to 
workflowServiceImpl that cannot be resolved by Spring.

Have you forgotten to commit something else or just to run the testsuite 
before committing? ;-)

I have just reverted this change to make the build succeed again (at 
least on JDK 1.6, but this is another story...): if you still need it, 
please take care that everything is still working before committing.

Regards.


On 31/01/2013 11:58, ashakirin@apache.org wrote:
> Author: ashakirin
> Date: Thu Jan 31 10:58:31 2013
> New Revision: 1440904
>
> URL: http://svn.apache.org/viewvc?rev=1440904&view=rev
> Log:
> [SYNCOPE-231] Added WorkflowServiceImpl and Test
>
> Modified:
>      syncope/trunk/build-tools/src/main/resources/org/apache/syncope/checkstyle.xml
>      syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/WorkflowServiceProxy.java
>      syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
>      syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java
>      syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/NotificationRestClient.java
>      syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java
>      syncope/trunk/core/src/main/resources/restContext.xml
>      syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java
>
> Modified: syncope/trunk/build-tools/src/main/resources/org/apache/syncope/checkstyle.xml
> URL: http://svn.apache.org/viewvc/syncope/trunk/build-tools/src/main/resources/org/apache/syncope/checkstyle.xml?rev=1440904&r1=1440903&r2=1440904&view=diff
> ==============================================================================
> --- syncope/trunk/build-tools/src/main/resources/org/apache/syncope/checkstyle.xml (original)
> +++ syncope/trunk/build-tools/src/main/resources/org/apache/syncope/checkstyle.xml Thu Jan 31 10:58:31 2013
> @@ -177,7 +177,7 @@ under the License.
>           <!-- Checks for common coding problems               -->
>           <!-- See http://checkstyle.sf.net/config_coding.html -->
>   <!--        <module name="AvoidInlineConditionals"/>-->
> -    <module name="DoubleCheckedLocking"/>    <!-- MY FAVOURITE -->
> +    <!--module name="DoubleCheckedLocking"/-->    <!-- MY FAVOURITE -->
>       <module name="EmptyStatement"/>
>       <module name="EqualsHashCode"/>
>       <module name="HiddenField">
>
> Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/WorkflowServiceProxy.java
> URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/WorkflowServiceProxy.java?rev=1440904&r1=1440903&r2=1440904&view=diff
> ==============================================================================
> --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/WorkflowServiceProxy.java (original)
> +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/WorkflowServiceProxy.java Thu Jan 31 10:58:31 2013
> @@ -22,6 +22,7 @@ import java.util.Arrays;
>   import java.util.List;
>   import org.apache.syncope.common.services.WorkflowService;
>   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> +import org.apache.syncope.common.types.AttributableType;
>   import org.springframework.web.client.RestTemplate;
>   
>   public class WorkflowServiceProxy extends SpringServiceProxy implements WorkflowService {
> @@ -31,17 +32,19 @@ public class WorkflowServiceProxy extend
>       }
>   
>       @Override
> -    public WorkflowDefinitionTO getDefinition(final String type) {
> -        return getRestTemplate().getForObject(baseUrl + "workflow/definition/" + type, WorkflowDefinitionTO.class);
> +    public WorkflowDefinitionTO getDefinition(final AttributableType type) {
> +        return getRestTemplate().getForObject(baseUrl + "workflow/definition/" + type.name().toLowerCase(),
> +                WorkflowDefinitionTO.class);
>       }
>   
>       @Override
> -    public void updateDefinition(final String type, final WorkflowDefinitionTO definition) {
> -        getRestTemplate().put(baseUrl + "workflow/definition/" + type, definition);
> +    public void updateDefinition(final AttributableType type, final WorkflowDefinitionTO definition) {
> +        getRestTemplate().put(baseUrl + "workflow/definition/" + type.name().toLowerCase(), definition);
>       }
>   
>       @Override
> -    public List<String> getDefinedTasks(final String type) {
> -        return Arrays.asList(getRestTemplate().getForObject(baseUrl + "workflow/tasks/{type}", String[].class, type));
> +    public List<String> getDefinedTasks(final AttributableType type) {
> +        return Arrays.asList(getRestTemplate().getForObject(baseUrl + "workflow/tasks/{type}", String[].class,
> +                type.name().toLowerCase()));
>       }
>   }
>
> Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
> URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java?rev=1440904&r1=1440903&r2=1440904&view=diff
> ==============================================================================
> --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java (original)
> +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java Thu Jan 31 10:58:31 2013
> @@ -25,19 +25,20 @@ import javax.ws.rs.Path;
>   import javax.ws.rs.PathParam;
>   
>   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> +import org.apache.syncope.common.types.AttributableType;
>   
>   @Path("workflows")
>   public interface WorkflowService {
>   
>       @GET
>       @Path("{kind}")
> -    WorkflowDefinitionTO getDefinition(@PathParam("kind") String kind);
> +    WorkflowDefinitionTO getDefinition(@PathParam("kind") AttributableType kind);
>   
>       @PUT
>       @Path("{kind}")
> -    void updateDefinition(@PathParam("kind") String kind, WorkflowDefinitionTO definition);
> +    void updateDefinition(@PathParam("kind") AttributableType kind, WorkflowDefinitionTO definition);
>   
>       @GET
>       @Path("{kind}/tasks")
> -    List<String> getDefinedTasks(@PathParam("kind") String kind);
> +    List<String> getDefinedTasks(@PathParam("kind") AttributableType kind);
>   }
>
> Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java
> URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java?rev=1440904&r1=1440903&r2=1440904&view=diff
> ==============================================================================
> --- syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java (original)
> +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java Thu Jan 31 10:58:31 2013
> @@ -185,4 +185,9 @@ public final class CollectionWrapper {
>           }
>           return respons;
>       }
> +
> +    @SuppressWarnings("unchecked")
> +    public static List<String> wrapStrings(final ModelAndView modelAndView) {
> +        return (List<String>) modelAndView.getModel().values().iterator().next();
> +    }
>   }
>
> Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/NotificationRestClient.java
> URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/NotificationRestClient.java?rev=1440904&r1=1440903&r2=1440904&view=diff
> ==============================================================================
> --- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/NotificationRestClient.java (original)
> +++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/NotificationRestClient.java Thu Jan 31 10:58:31 2013
> @@ -26,6 +26,7 @@ import org.apache.syncope.common.service
>   import org.apache.syncope.common.services.WorkflowService;
>   import org.apache.syncope.common.to.MailTemplateTO;
>   import org.apache.syncope.common.to.NotificationTO;
> +import org.apache.syncope.common.types.AttributableType;
>   import org.apache.syncope.common.util.CollectionWrapper;
>   import org.springframework.stereotype.Component;
>   
> @@ -60,6 +61,6 @@ public class NotificationRestClient exte
>       }
>   
>       public List<String> getEvents() {
> -        return getService(WorkflowService.class).getDefinedTasks("user");
> +        return getService(WorkflowService.class).getDefinedTasks(AttributableType.USER);
>       }
>   }
>
> Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java
> URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java?rev=1440904&r1=1440903&r2=1440904&view=diff
> ==============================================================================
> --- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java (original)
> +++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java Thu Jan 31 10:58:31 2013
> @@ -20,6 +20,7 @@ package org.apache.syncope.console.rest;
>   
>   import org.apache.syncope.common.services.WorkflowService;
>   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> +import org.apache.syncope.common.types.AttributableType;
>   import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
>   import org.springframework.stereotype.Component;
>   
> @@ -29,10 +30,10 @@ public class WorkflowRestClient extends
>       private static final long serialVersionUID = 5049285686167071017L;
>   
>       public WorkflowDefinitionTO getDefinition() throws SyncopeClientCompositeErrorException {
> -        return getService(WorkflowService.class).getDefinition("user");
> +        return getService(WorkflowService.class).getDefinition(AttributableType.USER);
>       }
>   
>       public void updateDefinition(final WorkflowDefinitionTO workflowDef) throws SyncopeClientCompositeErrorException {
> -        getService(WorkflowService.class).updateDefinition("user", workflowDef);
> +        getService(WorkflowService.class).updateDefinition(AttributableType.USER, workflowDef);
>       }
>   }
>
> Modified: syncope/trunk/core/src/main/resources/restContext.xml
> URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/restContext.xml?rev=1440904&r1=1440903&r2=1440904&view=diff
> ==============================================================================
> --- syncope/trunk/core/src/main/resources/restContext.xml (original)
> +++ syncope/trunk/core/src/main/resources/restContext.xml Thu Jan 31 10:58:31 2013
> @@ -78,6 +78,7 @@ under the License.
>         <ref bean="schemaServiceImpl"/>
>         <ref bean="userRequestServiceImpl"/>
>         <ref bean="userServiceImpl"/>
> +      <ref bean="workflowServiceImpl"/>
>       </jaxrs:serviceBeans>
>       <jaxrs:resourceComparator>
>         <bean id="myServiceComparator" class="org.apache.syncope.core.rest.utils.QueryResourceInfoComperator"/>
>
> Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java
> URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java?rev=1440904&r1=1440903&r2=1440904&view=diff
> ==============================================================================
> --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java (original)
> +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java Thu Jan 31 10:58:31 2013
> @@ -24,25 +24,22 @@ import static org.junit.Assert.assertNot
>   import java.util.List;
>   
>   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> +import org.apache.syncope.common.types.AttributableType;
>   import org.apache.syncope.core.workflow.ActivitiDetector;
>   import org.junit.Assume;
>   import org.junit.Test;
>   
>   public class WorkflowTestITCase extends AbstractTest {
>   
> -    public static final String ROLE_TYPE = "role";
> -
> -    public static final String USER_TYPE = "user";
> -
>       @Test //TODO TestCase needs to be extended
>       public void testGetUserDefinition() {
> -        WorkflowDefinitionTO definition = workflowService.getDefinition(USER_TYPE);
> +        WorkflowDefinitionTO definition = workflowService.getDefinition(AttributableType.USER);
>           assertNotNull(definition);
>       }
>   
>       @Test //TODO TestCase needs to be extended
>       public void testGetRoleDefinition() {
> -        WorkflowDefinitionTO definition = workflowService.getDefinition(ROLE_TYPE);
> +        WorkflowDefinitionTO definition = workflowService.getDefinition(AttributableType.ROLE);
>           assertNotNull(definition);
>       }
>   
> @@ -50,11 +47,11 @@ public class WorkflowTestITCase extends
>       public void testUpdateUserDefinition() {
>           Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
>   
> -        WorkflowDefinitionTO definition = workflowService.getDefinition(USER_TYPE);
> +        WorkflowDefinitionTO definition = workflowService.getDefinition(AttributableType.USER);
>           assertNotNull(definition);
>   
> -        workflowService.updateDefinition(USER_TYPE, definition);
> -        WorkflowDefinitionTO newDefinition = workflowService.getDefinition(USER_TYPE);
> +        workflowService.updateDefinition(AttributableType.USER, definition);
> +        WorkflowDefinitionTO newDefinition = workflowService.getDefinition(AttributableType.USER);
>           assertNotNull(newDefinition);
>       }
>   
> @@ -62,25 +59,25 @@ public class WorkflowTestITCase extends
>       public void testUpdateRoleDefinition() {
>           Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles());
>   
> -        WorkflowDefinitionTO definition = workflowService.getDefinition(ROLE_TYPE);
> +        WorkflowDefinitionTO definition = workflowService.getDefinition(AttributableType.ROLE);
>           assertNotNull(definition);
>   
> -        workflowService.updateDefinition(ROLE_TYPE, definition);
> -        WorkflowDefinitionTO newDefinition = workflowService.getDefinition(ROLE_TYPE);
> +        workflowService.updateDefinition(AttributableType.ROLE, definition);
> +        WorkflowDefinitionTO newDefinition = workflowService.getDefinition(AttributableType.ROLE);
>           assertNotNull(newDefinition);
>       }
>   
>       @Test
>       public void testGetUserTasks() {
> -        List<String> tasks = workflowService.getDefinedTasks(USER_TYPE);
> +        List<String> tasks = workflowService.getDefinedTasks(AttributableType.USER);
>           assertNotNull(tasks);
>           assertFalse(tasks.isEmpty());
>       }
>   
>       @Test
>       public void testGetRoleTasks() {
> -        List<String> tasks = workflowService.getDefinedTasks(ROLE_TYPE);
> +        List<String> tasks = workflowService.getDefinedTasks(AttributableType.ROLE);
>           assertNotNull(tasks);
>           assertFalse(tasks.isEmpty());
>       }
> -}
> \ No newline at end of file
> +}
>
>


-- 
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


RE: svn commit: r1440904 - in /syncope/trunk: build-tools/src/main/resources/org/apache/syncope/ client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ common/src/main/java/org/apache/syn...

Posted by Andrei Shakirin <as...@talend.com>.
Hi Francesco,

I care about it ...

Andrei.

> -----Original Message-----
> From: Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
> Sent: Donnerstag, 31. Januar 2013 12:50
> To: dev@syncope.apache.org
> Subject: Re: svn commit: r1440904 - in /syncope/trunk: build-
> tools/src/main/resources/org/apache/syncope/
> client/src/main/java/org/apache/syncope/client/services/proxy/
> common/src/main/java/org/apache/syncope/common/services/
> common/src/main/java/org/apache/syn...
> 
> Hi Andrei,
> as stated by latest failures on Jenkins, it seems that your commit broke the
> build, in particular your modification to
> core/src/main/resources/restContent.xml adds a reference to
> workflowServiceImpl that cannot be resolved by Spring.
> 
> Have you forgotten to commit something else or just to run the testsuite
> before committing? ;-)
> 
> I have just reverted this change to make the build succeed again (at least on
> JDK 1.6, but this is another story...): if you still need it, please take care that
> everything is still working before committing.
> 
> Regards.
> 
> 
> On 31/01/2013 11:58, ashakirin@apache.org wrote:
> > Author: ashakirin
> > Date: Thu Jan 31 10:58:31 2013
> > New Revision: 1440904
> >
> > URL: http://svn.apache.org/viewvc?rev=1440904&view=rev
> > Log:
> > [SYNCOPE-231] Added WorkflowServiceImpl and Test
> >
> > Modified:
> >      syncope/trunk/build-
> tools/src/main/resources/org/apache/syncope/checkstyle.xml
> >
> syncope/trunk/client/src/main/java/org/apache/syncope/client/services/pr
> oxy/WorkflowServiceProxy.java
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/servi
> ces/WorkflowService.java
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/util/
> CollectionWrapper.java
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/N
> otificationRestClient.java
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/W
> orkflowRestClient.java
> >      syncope/trunk/core/src/main/resources/restContext.xml
> >
> >
> syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/Workflow
> > TestITCase.java
> >
> > Modified:
> > syncope/trunk/build-
> tools/src/main/resources/org/apache/syncope/checks
> > tyle.xml
> > URL:
> > http://svn.apache.org/viewvc/syncope/trunk/build-tools/src/main/resour
> >
> ces/org/apache/syncope/checkstyle.xml?rev=1440904&r1=1440903&r2=1440
> 90
> > 4&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> > syncope/trunk/build-
> tools/src/main/resources/org/apache/syncope/checks
> > tyle.xml (original)
> > +++ syncope/trunk/build-
> tools/src/main/resources/org/apache/syncope/ch
> > +++ eckstyle.xml Thu Jan 31 10:58:31 2013
> > @@ -177,7 +177,7 @@ under the License.
> >           <!-- Checks for common coding problems               -->
> >           <!-- See http://checkstyle.sf.net/config_coding.html -->
> >   <!--        <module name="AvoidInlineConditionals"/>-->
> > -    <module name="DoubleCheckedLocking"/>    <!-- MY FAVOURITE -->
> > +    <!--module name="DoubleCheckedLocking"/-->    <!-- MY FAVOURITE --
> >
> >       <module name="EmptyStatement"/>
> >       <module name="EqualsHashCode"/>
> >       <module name="HiddenField">
> >
> > Modified:
> > syncope/trunk/client/src/main/java/org/apache/syncope/client/services/
> > proxy/WorkflowServiceProxy.java
> > URL:
> > http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/ap
> >
> ache/syncope/client/services/proxy/WorkflowServiceProxy.java?rev=14409
> > 04&r1=1440903&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> > syncope/trunk/client/src/main/java/org/apache/syncope/client/services/
> > proxy/WorkflowServiceProxy.java (original)
> > +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/servi
> > +++ ces/proxy/WorkflowServiceProxy.java Thu Jan 31 10:58:31 2013
> > @@ -22,6 +22,7 @@ import java.util.Arrays;
> >   import java.util.List;
> >   import org.apache.syncope.common.services.WorkflowService;
> >   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >   import org.springframework.web.client.RestTemplate;
> >
> >   public class WorkflowServiceProxy extends SpringServiceProxy
> > implements WorkflowService { @@ -31,17 +32,19 @@ public class
> WorkflowServiceProxy extend
> >       }
> >
> >       @Override
> > -    public WorkflowDefinitionTO getDefinition(final String type) {
> > -        return getRestTemplate().getForObject(baseUrl +
> "workflow/definition/" + type, WorkflowDefinitionTO.class);
> > +    public WorkflowDefinitionTO getDefinition(final AttributableType type)
> {
> > +        return getRestTemplate().getForObject(baseUrl +
> "workflow/definition/" + type.name().toLowerCase(),
> > +                WorkflowDefinitionTO.class);
> >       }
> >
> >       @Override
> > -    public void updateDefinition(final String type, final
> WorkflowDefinitionTO definition) {
> > -        getRestTemplate().put(baseUrl + "workflow/definition/" + type,
> definition);
> > +    public void updateDefinition(final AttributableType type, final
> WorkflowDefinitionTO definition) {
> > +        getRestTemplate().put(baseUrl + "workflow/definition/" +
> > + type.name().toLowerCase(), definition);
> >       }
> >
> >       @Override
> > -    public List<String> getDefinedTasks(final String type) {
> > -        return Arrays.asList(getRestTemplate().getForObject(baseUrl +
> "workflow/tasks/{type}", String[].class, type));
> > +    public List<String> getDefinedTasks(final AttributableType type) {
> > +        return Arrays.asList(getRestTemplate().getForObject(baseUrl +
> "workflow/tasks/{type}", String[].class,
> > +                type.name().toLowerCase()));
> >       }
> >   }
> >
> > Modified:
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/servi
> ces/
> > WorkflowService.java
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/a
> p
> >
> ache/syncope/common/services/WorkflowService.java?rev=1440904&r1=14
> 409
> > 03&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/servi
> ces/
> > WorkflowService.java (original)
> > +++
> syncope/trunk/common/src/main/java/org/apache/syncope/common/servi
> > +++ ces/WorkflowService.java Thu Jan 31 10:58:31 2013
> > @@ -25,19 +25,20 @@ import javax.ws.rs.Path;
> >   import javax.ws.rs.PathParam;
> >
> >   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >
> >   @Path("workflows")
> >   public interface WorkflowService {
> >
> >       @GET
> >       @Path("{kind}")
> > -    WorkflowDefinitionTO getDefinition(@PathParam("kind") String kind);
> > +    WorkflowDefinitionTO getDefinition(@PathParam("kind")
> > + AttributableType kind);
> >
> >       @PUT
> >       @Path("{kind}")
> > -    void updateDefinition(@PathParam("kind") String kind,
> WorkflowDefinitionTO definition);
> > +    void updateDefinition(@PathParam("kind") AttributableType kind,
> > + WorkflowDefinitionTO definition);
> >
> >       @GET
> >       @Path("{kind}/tasks")
> > -    List<String> getDefinedTasks(@PathParam("kind") String kind);
> > +    List<String> getDefinedTasks(@PathParam("kind") AttributableType
> > + kind);
> >   }
> >
> > Modified:
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/util/
> Coll
> > ectionWrapper.java
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/a
> p
> >
> ache/syncope/common/util/CollectionWrapper.java?rev=1440904&r1=14409
> 03
> > &r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/util/
> Coll
> > ectionWrapper.java (original)
> > +++
> syncope/trunk/common/src/main/java/org/apache/syncope/common/util/
> > +++ CollectionWrapper.java Thu Jan 31 10:58:31 2013
> > @@ -185,4 +185,9 @@ public final class CollectionWrapper {
> >           }
> >           return respons;
> >       }
> > +
> > +    @SuppressWarnings("unchecked")
> > +    public static List<String> wrapStrings(final ModelAndView
> modelAndView) {
> > +        return (List<String>)
> modelAndView.getModel().values().iterator().next();
> > +    }
> >   }
> >
> > Modified:
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/N
> o
> > tificationRestClient.java
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/a
> > pache/syncope/console/rest/NotificationRestClient.java?rev=1440904&r1=
> > 1440903&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/N
> o
> > tificationRestClient.java (original)
> > +++
> syncope/trunk/console/src/main/java/org/apache/syncope/console/res
> > +++ t/NotificationRestClient.java Thu Jan 31 10:58:31 2013
> > @@ -26,6 +26,7 @@ import org.apache.syncope.common.service
> >   import org.apache.syncope.common.services.WorkflowService;
> >   import org.apache.syncope.common.to.MailTemplateTO;
> >   import org.apache.syncope.common.to.NotificationTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >   import org.apache.syncope.common.util.CollectionWrapper;
> >   import org.springframework.stereotype.Component;
> >
> > @@ -60,6 +61,6 @@ public class NotificationRestClient exte
> >       }
> >
> >       public List<String> getEvents() {
> > -        return getService(WorkflowService.class).getDefinedTasks("user");
> > +        return
> > + getService(WorkflowService.class).getDefinedTasks(AttributableType.U
> > + SER);
> >       }
> >   }
> >
> > Modified:
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/W
> o
> > rkflowRestClient.java
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/a
> >
> pache/syncope/console/rest/WorkflowRestClient.java?rev=1440904&r1=144
> 0
> > 903&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/W
> o
> > rkflowRestClient.java (original)
> > +++
> syncope/trunk/console/src/main/java/org/apache/syncope/console/res
> > +++ t/WorkflowRestClient.java Thu Jan 31 10:58:31 2013
> > @@ -20,6 +20,7 @@ package org.apache.syncope.console.rest;
> >
> >   import org.apache.syncope.common.services.WorkflowService;
> >   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >   import
> org.apache.syncope.common.validation.SyncopeClientCompositeErrorExcep
> tion;
> >   import org.springframework.stereotype.Component;
> >
> > @@ -29,10 +30,10 @@ public class WorkflowRestClient extends
> >       private static final long serialVersionUID =
> > 5049285686167071017L;
> >
> >       public WorkflowDefinitionTO getDefinition() throws
> SyncopeClientCompositeErrorException {
> > -        return getService(WorkflowService.class).getDefinition("user");
> > +        return
> > + getService(WorkflowService.class).getDefinition(AttributableType.USE
> > + R);
> >       }
> >
> >       public void updateDefinition(final WorkflowDefinitionTO workflowDef)
> throws SyncopeClientCompositeErrorException {
> > -        getService(WorkflowService.class).updateDefinition("user",
> workflowDef);
> > +
> > + getService(WorkflowService.class).updateDefinition(AttributableType.
> > + USER, workflowDef);
> >       }
> >   }
> >
> > Modified: syncope/trunk/core/src/main/resources/restContext.xml
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/res
> > tContext.xml?rev=1440904&r1=1440903&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > --- syncope/trunk/core/src/main/resources/restContext.xml (original)
> > +++ syncope/trunk/core/src/main/resources/restContext.xml Thu Jan 31
> > +++ 10:58:31 2013
> > @@ -78,6 +78,7 @@ under the License.
> >         <ref bean="schemaServiceImpl"/>
> >         <ref bean="userRequestServiceImpl"/>
> >         <ref bean="userServiceImpl"/>
> > +      <ref bean="workflowServiceImpl"/>
> >       </jaxrs:serviceBeans>
> >       <jaxrs:resourceComparator>
> >         <bean id="myServiceComparator"
> > class="org.apache.syncope.core.rest.utils.QueryResourceInfoComperator"
> > />
> >
> > Modified:
> >
> syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/Workflow
> > TestITCase.java
> > URL:
> > http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apac
> >
> he/syncope/core/rest/WorkflowTestITCase.java?rev=1440904&r1=1440903&
> r2
> > =1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/Workflow
> > TestITCase.java (original)
> > +++
> syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/Work
> > +++ flowTestITCase.java Thu Jan 31 10:58:31 2013
> > @@ -24,25 +24,22 @@ import static org.junit.Assert.assertNot
> >   import java.util.List;
> >
> >   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >   import org.apache.syncope.core.workflow.ActivitiDetector;
> >   import org.junit.Assume;
> >   import org.junit.Test;
> >
> >   public class WorkflowTestITCase extends AbstractTest {
> >
> > -    public static final String ROLE_TYPE = "role";
> > -
> > -    public static final String USER_TYPE = "user";
> > -
> >       @Test //TODO TestCase needs to be extended
> >       public void testGetUserDefinition() {
> > -        WorkflowDefinitionTO definition =
> workflowService.getDefinition(USER_TYPE);
> > +        WorkflowDefinitionTO definition =
> > + workflowService.getDefinition(AttributableType.USER);
> >           assertNotNull(definition);
> >       }
> >
> >       @Test //TODO TestCase needs to be extended
> >       public void testGetRoleDefinition() {
> > -        WorkflowDefinitionTO definition =
> workflowService.getDefinition(ROLE_TYPE);
> > +        WorkflowDefinitionTO definition =
> > + workflowService.getDefinition(AttributableType.ROLE);
> >           assertNotNull(definition);
> >       }
> >
> > @@ -50,11 +47,11 @@ public class WorkflowTestITCase extends
> >       public void testUpdateUserDefinition() {
> >
> > Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
> >
> > -        WorkflowDefinitionTO definition =
> workflowService.getDefinition(USER_TYPE);
> > +        WorkflowDefinitionTO definition =
> > + workflowService.getDefinition(AttributableType.USER);
> >           assertNotNull(definition);
> >
> > -        workflowService.updateDefinition(USER_TYPE, definition);
> > -        WorkflowDefinitionTO newDefinition =
> workflowService.getDefinition(USER_TYPE);
> > +        workflowService.updateDefinition(AttributableType.USER,
> definition);
> > +        WorkflowDefinitionTO newDefinition =
> > + workflowService.getDefinition(AttributableType.USER);
> >           assertNotNull(newDefinition);
> >       }
> >
> > @@ -62,25 +59,25 @@ public class WorkflowTestITCase extends
> >       public void testUpdateRoleDefinition() {
> >
> > Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles());
> >
> > -        WorkflowDefinitionTO definition =
> workflowService.getDefinition(ROLE_TYPE);
> > +        WorkflowDefinitionTO definition =
> > + workflowService.getDefinition(AttributableType.ROLE);
> >           assertNotNull(definition);
> >
> > -        workflowService.updateDefinition(ROLE_TYPE, definition);
> > -        WorkflowDefinitionTO newDefinition =
> workflowService.getDefinition(ROLE_TYPE);
> > +        workflowService.updateDefinition(AttributableType.ROLE,
> definition);
> > +        WorkflowDefinitionTO newDefinition =
> > + workflowService.getDefinition(AttributableType.ROLE);
> >           assertNotNull(newDefinition);
> >       }
> >
> >       @Test
> >       public void testGetUserTasks() {
> > -        List<String> tasks = workflowService.getDefinedTasks(USER_TYPE);
> > +        List<String> tasks =
> > + workflowService.getDefinedTasks(AttributableType.USER);
> >           assertNotNull(tasks);
> >           assertFalse(tasks.isEmpty());
> >       }
> >
> >       @Test
> >       public void testGetRoleTasks() {
> > -        List<String> tasks = workflowService.getDefinedTasks(ROLE_TYPE);
> > +        List<String> tasks =
> > + workflowService.getDefinedTasks(AttributableType.ROLE);
> >           assertNotNull(tasks);
> >           assertFalse(tasks.isEmpty());
> >       }
> > -}
> > \ No newline at end of file
> > +}
> >
> >
> 
> 
> --
> Francesco Chicchiriccò
> 
> ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
> http://people.apache.org/~ilgrosso/


RE: svn commit: r1440904 - in /syncope/trunk: build-tools/src/main/resources/org/apache/syncope/ client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ common/src/main/java/org/apache/syn...

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

Found ... explore SVN client required to add new files explicitly.
All tests including console were successful, but two most important file was not committed, super :(
Will use command line client only in the future.

Regards,
Andrei.


> -----Original Message-----
> From: Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
> Sent: Donnerstag, 31. Januar 2013 12:50
> To: dev@syncope.apache.org
> Subject: Re: svn commit: r1440904 - in /syncope/trunk: build-
> tools/src/main/resources/org/apache/syncope/
> client/src/main/java/org/apache/syncope/client/services/proxy/
> common/src/main/java/org/apache/syncope/common/services/
> common/src/main/java/org/apache/syn...
> 
> Hi Andrei,
> as stated by latest failures on Jenkins, it seems that your commit broke the
> build, in particular your modification to
> core/src/main/resources/restContent.xml adds a reference to
> workflowServiceImpl that cannot be resolved by Spring.
> 
> Have you forgotten to commit something else or just to run the testsuite
> before committing? ;-)
> 
> I have just reverted this change to make the build succeed again (at least on
> JDK 1.6, but this is another story...): if you still need it, please take care that
> everything is still working before committing.
> 
> Regards.
> 
> 
> On 31/01/2013 11:58, ashakirin@apache.org wrote:
> > Author: ashakirin
> > Date: Thu Jan 31 10:58:31 2013
> > New Revision: 1440904
> >
> > URL: http://svn.apache.org/viewvc?rev=1440904&view=rev
> > Log:
> > [SYNCOPE-231] Added WorkflowServiceImpl and Test
> >
> > Modified:
> >      syncope/trunk/build-
> tools/src/main/resources/org/apache/syncope/checkstyle.xml
> >
> syncope/trunk/client/src/main/java/org/apache/syncope/client/services/pr
> oxy/WorkflowServiceProxy.java
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/servi
> ces/WorkflowService.java
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/util/
> CollectionWrapper.java
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/N
> otificationRestClient.java
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/W
> orkflowRestClient.java
> >      syncope/trunk/core/src/main/resources/restContext.xml
> >
> >
> syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/Workflow
> > TestITCase.java
> >
> > Modified:
> > syncope/trunk/build-
> tools/src/main/resources/org/apache/syncope/checks
> > tyle.xml
> > URL:
> > http://svn.apache.org/viewvc/syncope/trunk/build-tools/src/main/resour
> >
> ces/org/apache/syncope/checkstyle.xml?rev=1440904&r1=1440903&r2=1440
> 90
> > 4&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> > syncope/trunk/build-
> tools/src/main/resources/org/apache/syncope/checks
> > tyle.xml (original)
> > +++ syncope/trunk/build-
> tools/src/main/resources/org/apache/syncope/ch
> > +++ eckstyle.xml Thu Jan 31 10:58:31 2013
> > @@ -177,7 +177,7 @@ under the License.
> >           <!-- Checks for common coding problems               -->
> >           <!-- See http://checkstyle.sf.net/config_coding.html -->
> >   <!--        <module name="AvoidInlineConditionals"/>-->
> > -    <module name="DoubleCheckedLocking"/>    <!-- MY FAVOURITE -->
> > +    <!--module name="DoubleCheckedLocking"/-->    <!-- MY FAVOURITE --
> >
> >       <module name="EmptyStatement"/>
> >       <module name="EqualsHashCode"/>
> >       <module name="HiddenField">
> >
> > Modified:
> > syncope/trunk/client/src/main/java/org/apache/syncope/client/services/
> > proxy/WorkflowServiceProxy.java
> > URL:
> > http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/ap
> >
> ache/syncope/client/services/proxy/WorkflowServiceProxy.java?rev=14409
> > 04&r1=1440903&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> > syncope/trunk/client/src/main/java/org/apache/syncope/client/services/
> > proxy/WorkflowServiceProxy.java (original)
> > +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/servi
> > +++ ces/proxy/WorkflowServiceProxy.java Thu Jan 31 10:58:31 2013
> > @@ -22,6 +22,7 @@ import java.util.Arrays;
> >   import java.util.List;
> >   import org.apache.syncope.common.services.WorkflowService;
> >   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >   import org.springframework.web.client.RestTemplate;
> >
> >   public class WorkflowServiceProxy extends SpringServiceProxy
> > implements WorkflowService { @@ -31,17 +32,19 @@ public class
> WorkflowServiceProxy extend
> >       }
> >
> >       @Override
> > -    public WorkflowDefinitionTO getDefinition(final String type) {
> > -        return getRestTemplate().getForObject(baseUrl +
> "workflow/definition/" + type, WorkflowDefinitionTO.class);
> > +    public WorkflowDefinitionTO getDefinition(final AttributableType type)
> {
> > +        return getRestTemplate().getForObject(baseUrl +
> "workflow/definition/" + type.name().toLowerCase(),
> > +                WorkflowDefinitionTO.class);
> >       }
> >
> >       @Override
> > -    public void updateDefinition(final String type, final
> WorkflowDefinitionTO definition) {
> > -        getRestTemplate().put(baseUrl + "workflow/definition/" + type,
> definition);
> > +    public void updateDefinition(final AttributableType type, final
> WorkflowDefinitionTO definition) {
> > +        getRestTemplate().put(baseUrl + "workflow/definition/" +
> > + type.name().toLowerCase(), definition);
> >       }
> >
> >       @Override
> > -    public List<String> getDefinedTasks(final String type) {
> > -        return Arrays.asList(getRestTemplate().getForObject(baseUrl +
> "workflow/tasks/{type}", String[].class, type));
> > +    public List<String> getDefinedTasks(final AttributableType type) {
> > +        return Arrays.asList(getRestTemplate().getForObject(baseUrl +
> "workflow/tasks/{type}", String[].class,
> > +                type.name().toLowerCase()));
> >       }
> >   }
> >
> > Modified:
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/servi
> ces/
> > WorkflowService.java
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/a
> p
> >
> ache/syncope/common/services/WorkflowService.java?rev=1440904&r1=14
> 409
> > 03&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/servi
> ces/
> > WorkflowService.java (original)
> > +++
> syncope/trunk/common/src/main/java/org/apache/syncope/common/servi
> > +++ ces/WorkflowService.java Thu Jan 31 10:58:31 2013
> > @@ -25,19 +25,20 @@ import javax.ws.rs.Path;
> >   import javax.ws.rs.PathParam;
> >
> >   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >
> >   @Path("workflows")
> >   public interface WorkflowService {
> >
> >       @GET
> >       @Path("{kind}")
> > -    WorkflowDefinitionTO getDefinition(@PathParam("kind") String kind);
> > +    WorkflowDefinitionTO getDefinition(@PathParam("kind")
> > + AttributableType kind);
> >
> >       @PUT
> >       @Path("{kind}")
> > -    void updateDefinition(@PathParam("kind") String kind,
> WorkflowDefinitionTO definition);
> > +    void updateDefinition(@PathParam("kind") AttributableType kind,
> > + WorkflowDefinitionTO definition);
> >
> >       @GET
> >       @Path("{kind}/tasks")
> > -    List<String> getDefinedTasks(@PathParam("kind") String kind);
> > +    List<String> getDefinedTasks(@PathParam("kind") AttributableType
> > + kind);
> >   }
> >
> > Modified:
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/util/
> Coll
> > ectionWrapper.java
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/a
> p
> >
> ache/syncope/common/util/CollectionWrapper.java?rev=1440904&r1=14409
> 03
> > &r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/common/src/main/java/org/apache/syncope/common/util/
> Coll
> > ectionWrapper.java (original)
> > +++
> syncope/trunk/common/src/main/java/org/apache/syncope/common/util/
> > +++ CollectionWrapper.java Thu Jan 31 10:58:31 2013
> > @@ -185,4 +185,9 @@ public final class CollectionWrapper {
> >           }
> >           return respons;
> >       }
> > +
> > +    @SuppressWarnings("unchecked")
> > +    public static List<String> wrapStrings(final ModelAndView
> modelAndView) {
> > +        return (List<String>)
> modelAndView.getModel().values().iterator().next();
> > +    }
> >   }
> >
> > Modified:
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/N
> o
> > tificationRestClient.java
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/a
> > pache/syncope/console/rest/NotificationRestClient.java?rev=1440904&r1=
> > 1440903&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/N
> o
> > tificationRestClient.java (original)
> > +++
> syncope/trunk/console/src/main/java/org/apache/syncope/console/res
> > +++ t/NotificationRestClient.java Thu Jan 31 10:58:31 2013
> > @@ -26,6 +26,7 @@ import org.apache.syncope.common.service
> >   import org.apache.syncope.common.services.WorkflowService;
> >   import org.apache.syncope.common.to.MailTemplateTO;
> >   import org.apache.syncope.common.to.NotificationTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >   import org.apache.syncope.common.util.CollectionWrapper;
> >   import org.springframework.stereotype.Component;
> >
> > @@ -60,6 +61,6 @@ public class NotificationRestClient exte
> >       }
> >
> >       public List<String> getEvents() {
> > -        return getService(WorkflowService.class).getDefinedTasks("user");
> > +        return
> > + getService(WorkflowService.class).getDefinedTasks(AttributableType.U
> > + SER);
> >       }
> >   }
> >
> > Modified:
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/W
> o
> > rkflowRestClient.java
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/a
> >
> pache/syncope/console/rest/WorkflowRestClient.java?rev=1440904&r1=144
> 0
> > 903&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/W
> o
> > rkflowRestClient.java (original)
> > +++
> syncope/trunk/console/src/main/java/org/apache/syncope/console/res
> > +++ t/WorkflowRestClient.java Thu Jan 31 10:58:31 2013
> > @@ -20,6 +20,7 @@ package org.apache.syncope.console.rest;
> >
> >   import org.apache.syncope.common.services.WorkflowService;
> >   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >   import
> org.apache.syncope.common.validation.SyncopeClientCompositeErrorExcep
> tion;
> >   import org.springframework.stereotype.Component;
> >
> > @@ -29,10 +30,10 @@ public class WorkflowRestClient extends
> >       private static final long serialVersionUID =
> > 5049285686167071017L;
> >
> >       public WorkflowDefinitionTO getDefinition() throws
> SyncopeClientCompositeErrorException {
> > -        return getService(WorkflowService.class).getDefinition("user");
> > +        return
> > + getService(WorkflowService.class).getDefinition(AttributableType.USE
> > + R);
> >       }
> >
> >       public void updateDefinition(final WorkflowDefinitionTO workflowDef)
> throws SyncopeClientCompositeErrorException {
> > -        getService(WorkflowService.class).updateDefinition("user",
> workflowDef);
> > +
> > + getService(WorkflowService.class).updateDefinition(AttributableType.
> > + USER, workflowDef);
> >       }
> >   }
> >
> > Modified: syncope/trunk/core/src/main/resources/restContext.xml
> > URL:
> >
> http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/res
> > tContext.xml?rev=1440904&r1=1440903&r2=1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > --- syncope/trunk/core/src/main/resources/restContext.xml (original)
> > +++ syncope/trunk/core/src/main/resources/restContext.xml Thu Jan 31
> > +++ 10:58:31 2013
> > @@ -78,6 +78,7 @@ under the License.
> >         <ref bean="schemaServiceImpl"/>
> >         <ref bean="userRequestServiceImpl"/>
> >         <ref bean="userServiceImpl"/>
> > +      <ref bean="workflowServiceImpl"/>
> >       </jaxrs:serviceBeans>
> >       <jaxrs:resourceComparator>
> >         <bean id="myServiceComparator"
> > class="org.apache.syncope.core.rest.utils.QueryResourceInfoComperator"
> > />
> >
> > Modified:
> >
> syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/Workflow
> > TestITCase.java
> > URL:
> > http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apac
> >
> he/syncope/core/rest/WorkflowTestITCase.java?rev=1440904&r1=1440903&
> r2
> > =1440904&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/Workflow
> > TestITCase.java (original)
> > +++
> syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/Work
> > +++ flowTestITCase.java Thu Jan 31 10:58:31 2013
> > @@ -24,25 +24,22 @@ import static org.junit.Assert.assertNot
> >   import java.util.List;
> >
> >   import org.apache.syncope.common.to.WorkflowDefinitionTO;
> > +import org.apache.syncope.common.types.AttributableType;
> >   import org.apache.syncope.core.workflow.ActivitiDetector;
> >   import org.junit.Assume;
> >   import org.junit.Test;
> >
> >   public class WorkflowTestITCase extends AbstractTest {
> >
> > -    public static final String ROLE_TYPE = "role";
> > -
> > -    public static final String USER_TYPE = "user";
> > -
> >       @Test //TODO TestCase needs to be extended
> >       public void testGetUserDefinition() {
> > -        WorkflowDefinitionTO definition =
> workflowService.getDefinition(USER_TYPE);
> > +        WorkflowDefinitionTO definition =
> > + workflowService.getDefinition(AttributableType.USER);
> >           assertNotNull(definition);
> >       }
> >
> >       @Test //TODO TestCase needs to be extended
> >       public void testGetRoleDefinition() {
> > -        WorkflowDefinitionTO definition =
> workflowService.getDefinition(ROLE_TYPE);
> > +        WorkflowDefinitionTO definition =
> > + workflowService.getDefinition(AttributableType.ROLE);
> >           assertNotNull(definition);
> >       }
> >
> > @@ -50,11 +47,11 @@ public class WorkflowTestITCase extends
> >       public void testUpdateUserDefinition() {
> >
> > Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
> >
> > -        WorkflowDefinitionTO definition =
> workflowService.getDefinition(USER_TYPE);
> > +        WorkflowDefinitionTO definition =
> > + workflowService.getDefinition(AttributableType.USER);
> >           assertNotNull(definition);
> >
> > -        workflowService.updateDefinition(USER_TYPE, definition);
> > -        WorkflowDefinitionTO newDefinition =
> workflowService.getDefinition(USER_TYPE);
> > +        workflowService.updateDefinition(AttributableType.USER,
> definition);
> > +        WorkflowDefinitionTO newDefinition =
> > + workflowService.getDefinition(AttributableType.USER);
> >           assertNotNull(newDefinition);
> >       }
> >
> > @@ -62,25 +59,25 @@ public class WorkflowTestITCase extends
> >       public void testUpdateRoleDefinition() {
> >
> > Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles());
> >
> > -        WorkflowDefinitionTO definition =
> workflowService.getDefinition(ROLE_TYPE);
> > +        WorkflowDefinitionTO definition =
> > + workflowService.getDefinition(AttributableType.ROLE);
> >           assertNotNull(definition);
> >
> > -        workflowService.updateDefinition(ROLE_TYPE, definition);
> > -        WorkflowDefinitionTO newDefinition =
> workflowService.getDefinition(ROLE_TYPE);
> > +        workflowService.updateDefinition(AttributableType.ROLE,
> definition);
> > +        WorkflowDefinitionTO newDefinition =
> > + workflowService.getDefinition(AttributableType.ROLE);
> >           assertNotNull(newDefinition);
> >       }
> >
> >       @Test
> >       public void testGetUserTasks() {
> > -        List<String> tasks = workflowService.getDefinedTasks(USER_TYPE);
> > +        List<String> tasks =
> > + workflowService.getDefinedTasks(AttributableType.USER);
> >           assertNotNull(tasks);
> >           assertFalse(tasks.isEmpty());
> >       }
> >
> >       @Test
> >       public void testGetRoleTasks() {
> > -        List<String> tasks = workflowService.getDefinedTasks(ROLE_TYPE);
> > +        List<String> tasks =
> > + workflowService.getDefinedTasks(AttributableType.ROLE);
> >           assertNotNull(tasks);
> >           assertFalse(tasks.isEmpty());
> >       }
> > -}
> > \ No newline at end of file
> > +}
> >
> >
> 
> 
> --
> Francesco Chicchiriccò
> 
> ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
> http://people.apache.org/~ilgrosso/