syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1532392 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/ client/src/main/java/org/apache/syncope/client/rest/ common/src/main/java/org/apache/syncope/common/to/ console/src/main/java/org/apache/syncope/console/pages/ co...
Date Tue, 15 Oct 2013 15:35:49 GMT
Author: ilgrosso
Date: Tue Oct 15 15:35:49 2013
New Revision: 1532392

URL: http://svn.apache.org/r1532392
Log:
Some minor cleanup, including further removal of JAXB collection setters

Modified:
    syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java
    syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClientFactoryBean.java
    syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAction.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkActionRes.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAssociationAction.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BulkActionModalPage.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ProvisioningModalPage.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ResourceTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java

Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java (original)
+++ syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java Tue Oct
15 15:35:49 2013
@@ -21,6 +21,7 @@ package org.apache.syncope.client;
 import java.net.URI;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import javax.ws.rs.core.MediaType;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.syncope.client.rest.RestClientFactoryBean;
 
@@ -32,6 +33,8 @@ import org.apache.syncope.client.rest.Re
  */
 public class SyncopeClient {
 
+    private final MediaType mediaType;
+
     private final RestClientFactoryBean restClientFactory;
 
     private final String username;
@@ -40,7 +43,10 @@ public class SyncopeClient {
 
     private final Map<Class<?>, Object> services = new ConcurrentHashMap<Class<?>,
Object>();
 
-    public SyncopeClient(final RestClientFactoryBean restClientFactory, final String username,
final String password) {
+    public SyncopeClient(final MediaType mediaType, final RestClientFactoryBean restClientFactory,
+            final String username, final String password) {
+
+        this.mediaType = mediaType;
         this.restClientFactory = restClientFactory;
         this.username = username;
         this.password = password;
@@ -49,14 +55,15 @@ public class SyncopeClient {
     @SuppressWarnings("unchecked")
     public <T> T getService(final Class<T> serviceClass) {
         if (!services.containsKey(serviceClass)) {
-            services.put(serviceClass, restClientFactory.createServiceInstance(serviceClass,
username, password));
+            services.put(serviceClass,
+                    restClientFactory.createServiceInstance(serviceClass, mediaType, username,
password));
         }
         return (T) services.get(serviceClass);
     }
 
     public <T> T getObject(final URI location, final Class<?> serviceClass, final
Class<T> resultClass) {
         WebClient webClient = WebClient.fromClient(WebClient.client(getService(serviceClass)));
-        webClient.accept(restClientFactory.getContentType()).to(location.toASCIIString(),
false);
+        webClient.accept(mediaType).to(location.toASCIIString(), false);
 
         return webClient.get(resultClass);
     }

Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClientFactoryBean.java
URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClientFactoryBean.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClientFactoryBean.java
(original)
+++ syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClientFactoryBean.java
Tue Oct 15 15:35:49 2013
@@ -42,21 +42,21 @@ public class SyncopeClientFactoryBean {
 
     public enum ContentType {
 
-        JSON(MediaType.APPLICATION_JSON),
-        XML(MediaType.APPLICATION_XML);
+        JSON(MediaType.APPLICATION_JSON_TYPE),
+        XML(MediaType.APPLICATION_XML_TYPE);
 
-        private final String mediaType;
+        private final MediaType mediaType;
 
-        private ContentType(final String mediaType) {
+        private ContentType(final MediaType mediaType) {
             this.mediaType = mediaType;
         }
 
-        public String getMediaType() {
+        public MediaType getMediaType() {
             return mediaType;
         }
 
         public static ContentType fromString(final String value) {
-            return StringUtils.isNotBlank(value) && value.equalsIgnoreCase(XML.name())
+            return StringUtils.isNotBlank(value) && value.equalsIgnoreCase(XML.getMediaType().toString())
                     ? XML
                     : JSON;
         }
@@ -113,8 +113,6 @@ public class SyncopeClientFactoryBean {
         defaultRestClientFactoryBean.setThreadSafe(true);
         defaultRestClientFactoryBean.setInheritHeaders(true);
 
-        defaultRestClientFactoryBean.setContentType(getContentType().getMediaType());
-
         List<Feature> features = new ArrayList<Feature>();
         features.add(new LoggingFeature());
         defaultRestClientFactoryBean.setFeatures(features);
@@ -197,6 +195,6 @@ public class SyncopeClientFactoryBean {
     }
 
     public SyncopeClient create(final String username, final String password) {
-        return new SyncopeClient(getRestClientFactoryBean(), username, password);
+        return new SyncopeClient(getContentType().getMediaType(), getRestClientFactoryBean(),
username, password);
     }
 }

Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java
URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java
(original)
+++ syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java
Tue Oct 15 15:35:49 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.rest;
 
+import javax.ws.rs.core.MediaType;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
 import org.apache.cxf.jaxrs.client.WebClient;
@@ -30,19 +31,13 @@ public class RestClientFactoryBean exten
         super();
     }
 
-    public void setContentType(final String contentType) {
-        this.contentType = contentType;
+    public <T> T createServiceInstance(final Class<T> serviceClass, final MediaType
mediaType) {
+        return createServiceInstance(serviceClass, mediaType, null, null);
     }
 
-    public String getContentType() {
-        return contentType;
-    }
-
-    public <T> T createServiceInstance(final Class<T> serviceClass) {
-        return createServiceInstance(serviceClass, null, null);
-    }
+    public <T> T createServiceInstance(
+            final Class<T> serviceClass, final MediaType mediaType, final String username,
final String password) {
 
-    public <T> T createServiceInstance(final Class<T> serviceClass, final String
username, final String password) {
         if (StringUtils.isNotBlank(username)) {
             setUsername(username);
         }
@@ -51,7 +46,7 @@ public class RestClientFactoryBean exten
         }
         setServiceClass(serviceClass);
         final T serviceInstance = create(serviceClass);
-        WebClient.client(serviceInstance).type(getContentType()).accept(getContentType());
+        WebClient.client(serviceInstance).type(mediaType).accept(mediaType);
         return serviceInstance;
     }
 }

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAction.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAction.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAction.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAction.java Tue Oct
15 15:35:49 2013
@@ -18,8 +18,11 @@
  */
 package org.apache.syncope.common.to;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.ArrayList;
-import java.util.Collection;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlEnum;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
@@ -48,7 +51,7 @@ public class BulkAction extends Abstract
     /**
      * Serialized identifiers.
      */
-    private Collection<String> targets;
+    private final List<String> targets = new ArrayList<String>();
 
     public Type getOperation() {
         return operation;
@@ -58,23 +61,10 @@ public class BulkAction extends Abstract
         this.operation = operation;
     }
 
-    public void setTargets(final Collection<String> targets) {
-        this.targets = targets;
-    }
-
-    public Collection<String> getTargets() {
+    @XmlElementWrapper(name = "targets")
+    @XmlElement(name = "target")
+    @JsonProperty("targets")
+    public List<String> getTargets() {
         return targets;
     }
-
-    public void addTarget(final String target) {
-        if (this.targets == null) {
-            this.targets = new ArrayList<String>();
-        }
-
-        this.targets.add(target);
-    }
-
-    public int size() {
-        return targets == null ? 0 : targets.size();
-    }
 }

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkActionRes.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkActionRes.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkActionRes.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkActionRes.java Tue
Oct 15 15:35:49 2013
@@ -19,16 +19,19 @@
 package org.apache.syncope.common.to;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlEnum;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 import org.apache.syncope.common.AbstractBaseBean;
 
-@XmlRootElement(name = "BulkActionRes")
+@XmlRootElement(name = "bulkActionRes")
 @XmlType
 public class BulkActionRes extends AbstractBaseBean {
 
@@ -43,22 +46,17 @@ public class BulkActionRes extends Abstr
 
     }
 
-    private List<Result> results;
-
-    public void setResults(final List<Result> results) {
-        this.results = results;
-    }
+    private final List<Result> results = new ArrayList<Result>();
 
+    @XmlElementWrapper(name = "results")
+    @XmlElement(name = "result")
+    @JsonProperty("results")
     public List<Result> getResults() {
         return results;
     }
 
     @JsonIgnore
     public void add(final Object id, final Status status) {
-        if (results == null) {
-            results = new ArrayList<Result>();
-        }
-
         if (id != null) {
             results.add(new Result(id.toString(), status));
         }
@@ -67,24 +65,24 @@ public class BulkActionRes extends Abstr
     @JsonIgnore
     public Map<String, Status> getResultMap() {
         final Map<String, Status> res = new HashMap<String, Status>();
-        if (results != null) {
-            for (Result result : results) {
-                res.put(result.getKey(), result.getValue());
-            }
+
+        for (Result result : results) {
+            res.put(result.getKey(), result.getValue());
         }
+
         return res;
     }
 
     @JsonIgnore
     public List<String> getResultByStatus(final Status status) {
         final List<String> res = new ArrayList<String>();
-        if (results != null) {
-            for (Result result : results) {
-                if (result.getValue() == status) {
-                    res.add(result.getKey());
-                }
+
+        for (Result result : results) {
+            if (result.getValue() == status) {
+                res.add(result.getKey());
             }
         }
+
         return res;
     }
 
@@ -97,9 +95,10 @@ public class BulkActionRes extends Abstr
         private Status value;
 
         public Result() {
+            super();
         }
 
-        public Result(String key, Status value) {
+        public Result(final String key, final Status value) {
             this.key = key;
             this.value = value;
         }
@@ -112,11 +111,11 @@ public class BulkActionRes extends Abstr
             return value;
         }
 
-        public void setKey(String key) {
+        public void setKey(final String key) {
             this.key = key;
         }
 
-        public void setValue(Status value) {
+        public void setValue(final Status value) {
             this.value = value;
         }
     }

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAssociationAction.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAssociationAction.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAssociationAction.java
(original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAssociationAction.java
Tue Oct 15 15:35:49 2013
@@ -18,21 +18,25 @@
  */
 package org.apache.syncope.common.to;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlEnum;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 import org.apache.syncope.common.AbstractBaseBean;
 
-@XmlRootElement(name = "bulkAction")
+@XmlRootElement(name = "bulkAssociationAction")
 @XmlType
 public class BulkAssociationAction extends AbstractBaseBean {
 
     private static final long serialVersionUID = 1395353278878758961L;
 
     @XmlEnum
-    @XmlType(name = "bulkActionType")
+    @XmlType(name = "bulkAssociationActionType")
     public enum Type {
 
         UNLINK,
@@ -46,7 +50,7 @@ public class BulkAssociationAction exten
     /**
      * Serialized identifiers.
      */
-    private Collection<Long> targets;
+    private final List<Long> targets = new ArrayList<Long>();
 
     public Type getOperation() {
         return operation;
@@ -56,23 +60,10 @@ public class BulkAssociationAction exten
         this.operation = operation;
     }
 
-    public void setTargets(final Collection<Long> targets) {
-        this.targets = targets;
-    }
-
+    @XmlElementWrapper(name = "targets")
+    @XmlElement(name = "target")
+    @JsonProperty("targets")
     public Collection<Long> getTargets() {
         return targets;
     }
-
-    public void addTarget(final Long target) {
-        if (this.targets == null) {
-            this.targets = new ArrayList<Long>();
-        }
-
-        this.targets.add(target);
-    }
-
-    public int size() {
-        return targets == null ? 0 : targets.size();
-    }
 }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BulkActionModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BulkActionModalPage.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BulkActionModalPage.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BulkActionModalPage.java
Tue Oct 15 15:35:49 2013
@@ -91,7 +91,7 @@ public class BulkActionModalPage<T, S> e
             final BulkAction bulkAction = new BulkAction();
             for (Object item : items) {
                 try {
-                    bulkAction.addTarget(getTargetId(item, idFieldName).toString());
+                    bulkAction.getTargets().add(getTargetId(item, idFieldName).toString());
                 } catch (Exception e) {
                     LOG.error("Error retrieving item id {}", idFieldName, e);
                 }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ProvisioningModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ProvisioningModalPage.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ProvisioningModalPage.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ProvisioningModalPage.java
Tue Oct 15 15:35:49 2013
@@ -223,13 +223,14 @@ public class ProvisioningModalPage<T ext
             final BulkAssociationAction.Type type,
             final ActionDataTablePanel<StatusBean, String> table,
             final List<IColumn<StatusBean, String>> columns) {
+
         final BulkAssociationAction bulkAction = new BulkAssociationAction();
         bulkAction.setOperation(type);
 
         final List<StatusBean> beans = new ArrayList<StatusBean>(table.getModelObject());
         for (StatusBean bean : beans) {
             LOG.debug("Selected bean {}", bean);
-            bulkAction.addTarget(bean.getAttributableId());
+            bulkAction.getTargets().add(bean.getAttributableId());
         }
 
         if (!beans.isEmpty()) {

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java Tue Oct
15 15:35:49 2013
@@ -19,14 +19,12 @@
 package org.apache.syncope.core.rest;
 
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
 
 import java.io.InputStream;
 import java.util.Properties;
 import java.util.UUID;
 
 import javax.sql.DataSource;
-import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -149,7 +147,7 @@ public abstract class AbstractTest {
     public static void restSetup() {
         final String envContentType = System.getProperty(ENV_KEY_CONTENT_TYPE);
         if (StringUtils.isNotBlank(envContentType)) {
-            clientFactory.getRestClientFactoryBean().setContentType(envContentType);
+            clientFactory.setContentType(envContentType);
         }
         LOG.info("Performing IT with content type {}", clientFactory.getContentType().getMediaType());
 
@@ -190,20 +188,6 @@ public abstract class AbstractTest {
         return attr;
     }
 
-    protected void assertCreated(final Response response) {
-        if (response.getStatus() != HttpStatus.SC_CREATED) {
-            StringBuilder builder = new StringBuilder();
-            MultivaluedMap<String, Object> headers = response.getHeaders();
-            builder.append("Headers (");
-            for (String key : headers.keySet()) {
-                builder.append(key).append(':').append(headers.getFirst(key)).append(',');
-            }
-            builder.append(")");
-            fail("Error on create. Status is : " + response.getStatus() + " with headers
"
-                    + builder.toString());
-        }
-    }
-
     protected UserTO createUser(final UserTO userTO) {
         Response response = userService.create(userTO);
         if (response.getStatus() != HttpStatus.SC_CREATED) {

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java
(original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java
Tue Oct 15 15:35:49 2013
@@ -677,12 +677,12 @@ public class ConnInstanceTestITCase exte
         conn.setId(0);
         conn.setDisplayName("forBulk1");
 
-        bulkAction.addTarget(String.valueOf(adminClient.getObject(
+        bulkAction.getTargets().add(String.valueOf(adminClient.getObject(
                 connectorService.create(conn).getLocation(), ConnectorService.class, ConnInstanceTO.class).getId()));
 
         conn.setDisplayName("forBulk2");
 
-        bulkAction.addTarget(String.valueOf(adminClient.getObject(
+        bulkAction.getTargets().add(String.valueOf(adminClient.getObject(
                 connectorService.create(conn).getLocation(), ConnectorService.class, ConnInstanceTO.class).getId()));
 
         Iterator<String> iter = bulkAction.getTargets().iterator();

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java Tue
Oct 15 15:35:49 2013
@@ -48,7 +48,7 @@ public class ReportTestITCase extends Ab
 
     public ReportTO createReport(final ReportTO report) {
         Response response = reportService.create(report);
-        assertCreated(response);
+        assertEquals(HttpStatus.SC_CREATED, response.getStatus());
         return adminClient.getObject(response.getLocation(), ReportService.class, ReportTO.class);
     }
 

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ResourceTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ResourceTestITCase.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ResourceTestITCase.java
(original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ResourceTestITCase.java
Tue Oct 15 15:35:49 2013
@@ -458,8 +458,8 @@ public class ResourceTestITCase extends 
         final BulkAction bulkAction = new BulkAction();
         bulkAction.setOperation(BulkAction.Type.DELETE);
 
-        bulkAction.addTarget(String.valueOf("forBulk1"));
-        bulkAction.addTarget(String.valueOf("forBulk2"));
+        bulkAction.getTargets().add(String.valueOf("forBulk1"));
+        bulkAction.getTargets().add(String.valueOf("forBulk2"));
 
         resourceService.bulkAction(bulkAction);
 

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java?rev=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java Tue
Oct 15 15:35:49 2013
@@ -903,7 +903,7 @@ public class TaskTestITCase extends Abst
         bulkAction.setOperation(BulkAction.Type.DELETE);
 
         for (AbstractTaskTO taskTO : after) {
-            bulkAction.addTarget(String.valueOf(taskTO.getId()));
+            bulkAction.getTargets().add(String.valueOf(taskTO.getId()));
         }
 
         taskService.bulkAction(bulkAction);

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=1532392&r1=1532391&r2=1532392&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java Tue
Oct 15 15:35:49 2013
@@ -2081,13 +2081,13 @@ public class UserTestITCase extends Abst
 
         for (int i = 0; i < 10; i++) {
             UserTO userTO = getUniqueSampleTO("bulk_" + i + "@apache.org");
-            bulkAction.addTarget(String.valueOf(createUser(userTO).getId()));
+            bulkAction.getTargets().add(String.valueOf(createUser(userTO).getId()));
         }
 
         // check for a fail
-        bulkAction.addTarget(String.valueOf(Long.MAX_VALUE));
+        bulkAction.getTargets().add(String.valueOf(Long.MAX_VALUE));
 
-        assertEquals(11, bulkAction.size());
+        assertEquals(11, bulkAction.getTargets().size());
 
         bulkAction.setOperation(BulkAction.Type.SUSPEND);
         BulkActionRes res = userService.bulkAction(bulkAction);



Mime
View raw message