syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1300882 [20/22] - in /incubator/syncope/trunk: build-tools/src/main/java/org/syncope/buildtools/ client/src/main/java/org/syncope/annotation/ client/src/main/java/org/syncope/client/ client/src/main/java/org/syncope/client/http/ client/src...
Date Thu, 15 Mar 2012 10:17:24 GMT
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/ConnInstanceTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/ConnInstanceTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/ConnInstanceTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/ConnInstanceTest.java Thu Mar 15 10:17:12 2012
@@ -52,20 +52,16 @@ public class ConnInstanceTest extends Ab
 
         assertNotNull("findById did not work", connectorInstance);
 
-        assertEquals("invalid connector name",
-                WebServiceConnector.class.getName(),
-                connectorInstance.getConnectorName());
+        assertEquals("invalid connector name", WebServiceConnector.class.getName(), connectorInstance
+                .getConnectorName());
 
-        assertEquals("invalid bundle name", "org.connid.bundles.soap",
-                connectorInstance.getBundleName());
+        assertEquals("invalid bundle name", "org.connid.bundles.soap", connectorInstance.getBundleName());
 
-        assertEquals("invalid bundle version",
-                connidSoapVersion, connectorInstance.getVersion());
+        assertEquals("invalid bundle version", connidSoapVersion, connectorInstance.getVersion());
     }
 
     @Test
-    public void save()
-            throws ClassNotFoundException {
+    public void save() throws ClassNotFoundException {
 
         ConnInstance connectorInstance = new ConnInstance();
 
@@ -76,8 +72,7 @@ public class ConnInstanceTest extends Ab
         connectorInstance.setConnectorName("WebService");
 
         // set bundle name
-        connectorInstance.setBundleName(
-                "org.syncope.core.persistence.test.util");
+        connectorInstance.setBundleName("org.syncope.core.persistence.test.util");
 
         connectorInstance.setDisplayName("New");
 
@@ -114,16 +109,12 @@ public class ConnInstanceTest extends Ab
 
         assertTrue("save did not work", actual.getId() > 100L);
 
-        assertEquals("save did not work for \"name\" attribute",
-                "WebService",
-                actual.getConnectorName());
+        assertEquals("save did not work for \"name\" attribute", "WebService", actual.getConnectorName());
 
-        assertEquals("save did not work for \"bundle name\" attribute",
-                "org.syncope.core.persistence.test.util",
+        assertEquals("save did not work for \"bundle name\" attribute", "org.syncope.core.persistence.test.util",
                 actual.getBundleName());
 
-        assertEquals("save did not work for \"majorVersion\" attribute",
-                "1.0", connectorInstance.getVersion());
+        assertEquals("save did not work for \"majorVersion\" attribute", "1.0", connectorInstance.getVersion());
 
         assertEquals("New", actual.getDisplayName());
 

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/DerAttrTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/DerAttrTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/DerAttrTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/DerAttrTest.java Thu Mar 15 10:17:12 2012
@@ -58,25 +58,19 @@ public class DerAttrTest extends Abstrac
 
     @Test
     public void findAll() {
-        List<UDerAttr> list = derAttrDAO.findAll(
-                UDerAttr.class);
-        assertEquals("did not get expected number of derived attributes ",
-                1, list.size());
+        List<UDerAttr> list = derAttrDAO.findAll(UDerAttr.class);
+        assertEquals("did not get expected number of derived attributes ", 1, list.size());
     }
 
     @Test
     public void findById() {
-        UDerAttr attribute = derAttrDAO.find(100L,
-                UDerAttr.class);
-        assertNotNull("did not find expected attribute schema",
-                attribute);
+        UDerAttr attribute = derAttrDAO.find(100L, UDerAttr.class);
+        assertNotNull("did not find expected attribute schema", attribute);
     }
 
     @Test
-    public void saveUDerAttribute()
-            throws ClassNotFoundException {
-        UDerSchema cnSchema =
-                derSchemaDAO.find("cn", UDerSchema.class);
+    public void saveUDerAttribute() throws ClassNotFoundException {
+        UDerSchema cnSchema = derSchemaDAO.find("cn", UDerSchema.class);
         assertNotNull(cnSchema);
 
         SyncopeUser owner = userDAO.find(3L);
@@ -88,28 +82,20 @@ public class DerAttrTest extends Abstrac
 
         derivedAttribute = derAttrDAO.save(derivedAttribute);
 
-        UDerAttr actual = derAttrDAO.find(
-                derivedAttribute.getId(), UDerAttr.class);
+        UDerAttr actual = derAttrDAO.find(derivedAttribute.getId(), UDerAttr.class);
         assertNotNull("expected save to work", actual);
         assertEquals(derivedAttribute, actual);
 
-        UAttrValue firstnameAttribute =
-                (UAttrValue) owner.getAttribute(
-                "firstname").getValues().iterator().next();
-        UAttrValue surnameAttribute =
-                (UAttrValue) owner.getAttribute(
-                "surname").getValues().iterator().next();
-
-        assertEquals(surnameAttribute.getValue() + ", "
-                + firstnameAttribute.getValue(),
-                derivedAttribute.getValue(owner.getAttributes()));
+        UAttrValue firstnameAttribute = (UAttrValue) owner.getAttribute("firstname").getValues().iterator().next();
+        UAttrValue surnameAttribute = (UAttrValue) owner.getAttribute("surname").getValues().iterator().next();
+
+        assertEquals(surnameAttribute.getValue() + ", " + firstnameAttribute.getValue(), derivedAttribute
+                .getValue(owner.getAttributes()));
     }
 
     @Test
-    public void saveMDerAttribute()
-            throws ClassNotFoundException {
-        MDerSchema deriveddata =
-                derSchemaDAO.find("mderiveddata", MDerSchema.class);
+    public void saveMDerAttribute() throws ClassNotFoundException {
+        MDerSchema deriveddata = derSchemaDAO.find("mderiveddata", MDerSchema.class);
         assertNotNull(deriveddata);
 
         Membership owner = membershipDAO.find(1L);
@@ -121,27 +107,19 @@ public class DerAttrTest extends Abstrac
 
         derivedAttribute = derAttrDAO.save(derivedAttribute);
 
-        MDerAttr actual = derAttrDAO.find(
-                derivedAttribute.getId(), MDerAttr.class);
+        MDerAttr actual = derAttrDAO.find(derivedAttribute.getId(), MDerAttr.class);
         assertNotNull("expected save to work", actual);
         assertEquals(derivedAttribute, actual);
 
-        MAttrValue sx =
-                (MAttrValue) owner.getAttribute(
-                "mderived_sx").getValues().iterator().next();
-        MAttrValue dx =
-                (MAttrValue) owner.getAttribute(
-                "mderived_dx").getValues().iterator().next();
-
-        assertEquals(sx.getValue() + "-" + dx.getValue(),
-                derivedAttribute.getValue(owner.getAttributes()));
+        MAttrValue sx = (MAttrValue) owner.getAttribute("mderived_sx").getValues().iterator().next();
+        MAttrValue dx = (MAttrValue) owner.getAttribute("mderived_dx").getValues().iterator().next();
+
+        assertEquals(sx.getValue() + "-" + dx.getValue(), derivedAttribute.getValue(owner.getAttributes()));
     }
 
     @Test
-    public void saveRDerAttribute()
-            throws ClassNotFoundException {
-        RDerSchema deriveddata =
-                derSchemaDAO.find("rderiveddata", RDerSchema.class);
+    public void saveRDerAttribute() throws ClassNotFoundException {
+        RDerSchema deriveddata = derSchemaDAO.find("rderiveddata", RDerSchema.class);
         assertNotNull(deriveddata);
 
         SyncopeRole owner = roleDAO.find(1L);
@@ -153,41 +131,27 @@ public class DerAttrTest extends Abstrac
 
         derivedAttribute = derAttrDAO.save(derivedAttribute);
 
-        RDerAttr actual = derAttrDAO.find(
-                derivedAttribute.getId(), RDerAttr.class);
+        RDerAttr actual = derAttrDAO.find(derivedAttribute.getId(), RDerAttr.class);
         assertNotNull("expected save to work", actual);
         assertEquals(derivedAttribute, actual);
 
-        RAttrValue sx =
-                (RAttrValue) owner.getAttribute(
-                "rderived_sx").getValues().iterator().next();
-        RAttrValue dx =
-                (RAttrValue) owner.getAttribute(
-                "rderived_dx").getValues().iterator().next();
+        RAttrValue sx = (RAttrValue) owner.getAttribute("rderived_sx").getValues().iterator().next();
+        RAttrValue dx = (RAttrValue) owner.getAttribute("rderived_dx").getValues().iterator().next();
 
-        assertEquals(sx.getValue() + "-" + dx.getValue(),
-                derivedAttribute.getValue(owner.getAttributes()));
+        assertEquals(sx.getValue() + "-" + dx.getValue(), derivedAttribute.getValue(owner.getAttributes()));
     }
 
     @Test
     public void delete() {
-        UDerAttr attribute = derAttrDAO.find(100L,
-                UDerAttr.class);
-        String attributeSchemaName =
-                attribute.getDerivedSchema().getName();
+        UDerAttr attribute = derAttrDAO.find(100L, UDerAttr.class);
+        String attributeSchemaName = attribute.getDerivedSchema().getName();
 
-        derAttrDAO.delete(attribute.getId(),
-                UDerAttr.class);
+        derAttrDAO.delete(attribute.getId(), UDerAttr.class);
 
-        UDerAttr actual = derAttrDAO.find(100L,
-                UDerAttr.class);
+        UDerAttr actual = derAttrDAO.find(100L, UDerAttr.class);
         assertNull("delete did not work", actual);
 
-        UDerSchema attributeSchema =
-                derSchemaDAO.find(attributeSchemaName,
-                UDerSchema.class);
-        assertNotNull("user derived attribute schema deleted "
-                + "when deleting values",
-                attributeSchema);
+        UDerSchema attributeSchema = derSchemaDAO.find(attributeSchemaName, UDerSchema.class);
+        assertNotNull("user derived attribute schema deleted " + "when deleting values", attributeSchema);
     }
 }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/DerSchemaTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/DerSchemaTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/DerSchemaTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/DerSchemaTest.java Thu Mar 15 10:17:12 2012
@@ -40,43 +40,36 @@ public class DerSchemaTest extends Abstr
 
     @Test
     public void findAll() {
-        List<UDerSchema> list =
-                derSchemaDAO.findAll(UDerSchema.class);
+        List<UDerSchema> list = derSchemaDAO.findAll(UDerSchema.class);
         assertEquals(3, list.size());
     }
 
     @Test
     public void findByName() {
-        UDerSchema attributeSchema =
-                derSchemaDAO.find("cn", UDerSchema.class);
-        assertNotNull("did not find expected derived attribute schema",
-                attributeSchema);
+        UDerSchema attributeSchema = derSchemaDAO.find("cn", UDerSchema.class);
+        assertNotNull("did not find expected derived attribute schema", attributeSchema);
     }
 
     @Test
     public void save() {
-        UDerSchema derivedAttributeSchema =
-                new UDerSchema();
+        UDerSchema derivedAttributeSchema = new UDerSchema();
         derivedAttributeSchema.setName("cn2");
         derivedAttributeSchema.setExpression("firstname surname");
 
         derSchemaDAO.save(derivedAttributeSchema);
 
-        UDerSchema actual =
-                derSchemaDAO.find("cn2", UDerSchema.class);
+        UDerSchema actual = derSchemaDAO.find("cn2", UDerSchema.class);
         assertNotNull("expected save to work", actual);
         assertEquals(derivedAttributeSchema, actual);
     }
 
     @Test
     public void delete() {
-        UDerSchema attributeSchema =
-                derSchemaDAO.find("cn", UDerSchema.class);
+        UDerSchema attributeSchema = derSchemaDAO.find("cn", UDerSchema.class);
 
         derSchemaDAO.delete(attributeSchema.getName(), AttributableUtil.getInstance(AttributableType.USER));
 
-        UDerSchema actual =
-                derSchemaDAO.find("cn", UDerSchema.class);
+        UDerSchema actual = derSchemaDAO.find("cn", UDerSchema.class);
         assertNull("delete did not work", actual);
     }
 }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/NotificationTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/NotificationTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/NotificationTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/NotificationTest.java Thu Mar 15 10:17:12 2012
@@ -64,17 +64,14 @@ public class NotificationTest extends Ab
         Notification notification = new Notification();
         notification.addEvent("save");
 
-        AttributeCond fullnameLeafCond1 =
-                new AttributeCond(AttributeCond.Type.LIKE);
+        AttributeCond fullnameLeafCond1 = new AttributeCond(AttributeCond.Type.LIKE);
         fullnameLeafCond1.setSchema("fullname");
         fullnameLeafCond1.setExpression("%o%");
-        AttributeCond fullnameLeafCond2 =
-                new AttributeCond(AttributeCond.Type.LIKE);
+        AttributeCond fullnameLeafCond2 = new AttributeCond(AttributeCond.Type.LIKE);
         fullnameLeafCond2.setSchema("fullname");
         fullnameLeafCond2.setExpression("%i%");
-        NodeCond about = NodeCond.getAndCond(
-                NodeCond.getLeafCond(fullnameLeafCond1),
-                NodeCond.getLeafCond(fullnameLeafCond2));
+        NodeCond about = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1), NodeCond
+                .getLeafCond(fullnameLeafCond2));
 
         notification.setAbout(about);
 
@@ -111,7 +108,6 @@ public class NotificationTest extends Ab
         notification.setSubject("Test notification");
         notification.setTemplate("test");
 
-
         Map<Class, Set<EntityViolationType>> violations;
         try {
             notificationDAO.save(notification);

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/PolicyTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/PolicyTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/PolicyTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/PolicyTest.java Thu Mar 15 10:17:12 2012
@@ -66,9 +66,7 @@ public class PolicyTest extends Abstract
 
         assertEquals(PolicyType.GLOBAL_PASSWORD, policy.getType());
 
-        assertEquals("invalid policy values",
-                8,
-                ((PasswordPolicySpec) policy.getSpecification()).getMinLength());
+        assertEquals("invalid policy values", 8, ((PasswordPolicySpec) policy.getSpecification()).getMinLength());
     }
 
     @Test(expected = InvalidEntityException.class)
@@ -123,12 +121,8 @@ public class PolicyTest extends Abstract
 
         assertNotNull(policy);
         assertEquals(PolicyType.GLOBAL_PASSWORD, policy.getType());
-        assertEquals(
-                ((PasswordPolicySpec) policy.getSpecification()).getMaxLength(),
-                8);
-        assertEquals(
-                ((PasswordPolicySpec) policy.getSpecification()).getMinLength(),
-                6);
+        assertEquals(((PasswordPolicySpec) policy.getSpecification()).getMaxLength(), 8);
+        assertEquals(((PasswordPolicySpec) policy.getSpecification()).getMinLength(), 6);
     }
 
     @Test

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/ResourceTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/ResourceTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/ResourceTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/ResourceTest.java Thu Mar 15 10:17:12 2012
@@ -43,8 +43,7 @@ public class ResourceTest extends Abstra
 
     @Test
     public void findById() {
-        ExternalResource resource =
-                resourceDAO.find("ws-target-resource-1");
+        ExternalResource resource = resourceDAO.find("ws-target-resource-1");
 
         assertNotNull("findById did not work", resource);
 
@@ -52,15 +51,11 @@ public class ResourceTest extends Abstra
 
         assertNotNull("connector not found", connector);
 
-        assertEquals("invalid connector name",
-                WebServiceConnector.class.getName(),
-                connector.getConnectorName());
+        assertEquals("invalid connector name", WebServiceConnector.class.getName(), connector.getConnectorName());
 
-        assertEquals("invalid bundle name", "org.connid.bundles.soap",
-                connector.getBundleName());
+        assertEquals("invalid bundle name", "org.connid.bundles.soap", connector.getBundleName());
 
-        assertEquals("invalid bundle version",
-                connidSoapVersion, connector.getVersion());
+        assertEquals("invalid bundle version", connidSoapVersion, connector.getVersion());
 
         Set<SchemaMapping> mappings = resource.getMappings();
         assertNotNull("mappings not found", mappings);
@@ -167,8 +162,7 @@ public class ResourceTest extends Abstra
         ExternalResource resource = new ExternalResource();
         resource.setName("ws-target-resource-basic-save-invalid");
 
-        ConnInstance connector =
-                resourceDAO.find("ws-target-resource-1").getConnector();
+        ConnInstance connector = resourceDAO.find("ws-target-resource-1").getConnector();
 
         resource.setConnector(connector);
 
@@ -196,8 +190,7 @@ public class ResourceTest extends Abstra
         ExternalResource resource = new ExternalResource();
         resource.setName("ws-target-resource-basic-save-invalid");
 
-        ConnInstance connector =
-                resourceDAO.find("ws-target-resource-1").getConnector();
+        ConnInstance connector = resourceDAO.find("ws-target-resource-1").getConnector();
 
         resource.setConnector(connector);
 
@@ -235,13 +228,12 @@ public class ResourceTest extends Abstra
         for (SchemaMapping schemaMapping : actual.getMappings()) {
 
             if ("icon".equals(SchemaMappingUtil.getIntAttrName(schemaMapping))) {
-                assertTrue(IntMappingType.contains(
-                        AttributableType.ROLE, schemaMapping.getIntMappingType().toString()));
+                assertTrue(IntMappingType.contains(AttributableType.ROLE, schemaMapping.getIntMappingType().toString()));
             }
 
             if ("mderiveddata".equals(SchemaMappingUtil.getIntAttrName(schemaMapping))) {
-                assertTrue(IntMappingType.contains(
-                        AttributableType.MEMBERSHIP, schemaMapping.getIntMappingType().toString()));
+                assertTrue(IntMappingType.contains(AttributableType.MEMBERSHIP, schemaMapping.getIntMappingType()
+                        .toString()));
             }
         }
     }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/SchemaTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/SchemaTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/SchemaTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/SchemaTest.java Thu Mar 15 10:17:12 2012
@@ -51,10 +51,8 @@ public class SchemaTest extends Abstract
 
     @Test
     public void findByName() {
-        USchema attributeSchema =
-                schemaDAO.find("fullname", USchema.class);
-        assertNotNull("did not find expected attribute schema",
-                attributeSchema);
+        USchema attributeSchema = schemaDAO.find("fullname", USchema.class);
+        assertNotNull("did not find expected attribute schema", attributeSchema);
     }
 
     @Test
@@ -76,8 +74,7 @@ public class SchemaTest extends Abstract
         USchema attributeSchema = new USchema();
         attributeSchema.setName("secondaryEmail");
         attributeSchema.setType(SchemaType.String);
-        attributeSchema.setValidatorClass(
-                "org.syncope.core.validation.EmailAddressValidator");
+        attributeSchema.setValidatorClass("org.syncope.core.validation.EmailAddressValidator");
         attributeSchema.setMandatoryCondition("false");
         attributeSchema.setMultivalue(true);
 
@@ -93,8 +90,7 @@ public class SchemaTest extends Abstract
         USchema attributeSchema = new USchema();
         attributeSchema.setName("secondaryEmail");
         attributeSchema.setType(SchemaType.String);
-        attributeSchema.setValidatorClass(
-                "org.syncope.core.validation.EmailAddressValidator");
+        attributeSchema.setValidatorClass("org.syncope.core.validation.EmailAddressValidator");
         attributeSchema.setMandatoryCondition("false");
         attributeSchema.setMultivalue(true);
         attributeSchema.setUniqueConstraint(true);
@@ -116,8 +112,7 @@ public class SchemaTest extends Abstract
         }
         assertNotNull(ex);
 
-        schema.setEnumerationValues(
-                "red" + AbstractSchema.enumValuesSeparator + "yellow");
+        schema.setEnumerationValues("red" + AbstractSchema.enumValuesSeparator + "yellow");
 
         schemaDAO.save(schema);
 

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/TaskTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/TaskTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/TaskTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/TaskTest.java Thu Mar 15 10:17:12 2012
@@ -54,8 +54,7 @@ public class TaskTest extends AbstractTe
 
     @Test
     public void findWithoutExecs() {
-        List<PropagationTask> tasks =
-                taskDAO.findWithoutExecs(PropagationTask.class);
+        List<PropagationTask> tasks = taskDAO.findWithoutExecs(PropagationTask.class);
         assertNotNull(tasks);
         assertEquals(3, tasks.size());
     }
@@ -97,10 +96,8 @@ public class TaskTest extends AbstractTe
         task.setAccountId("one@two.com");
 
         Set<Attribute> attributes = new HashSet<Attribute>();
-        attributes.add(AttributeBuilder.build("testAttribute", "testValue1",
-                "testValue2"));
-        attributes.add(
-                AttributeBuilder.buildPassword("password".toCharArray()));
+        attributes.add(AttributeBuilder.build("testAttribute", "testValue1", "testValue2"));
+        attributes.add(AttributeBuilder.buildPassword("password".toCharArray()));
         task.setAttributes(attributes);
 
         task = taskDAO.save(task);
@@ -174,7 +171,6 @@ public class TaskTest extends AbstractTe
 
         resource = resourceDAO.find(resource.getName());
         assertNotNull(resource);
-        assertFalse(taskDAO.findAll(resource, PropagationTask.class).
-                contains(task));
+        assertFalse(taskDAO.findAll(resource, PropagationTask.class).contains(task));
     }
 }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/UserSearchTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/UserSearchTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/UserSearchTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/UserSearchTest.java Thu Mar 15 10:17:12 2012
@@ -38,12 +38,8 @@ import org.syncope.core.persistence.bean
 import org.syncope.core.util.EntitlementUtil;
 
 @RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = {
-    "classpath:syncopeContext.xml",
-    "classpath:persistenceContext.xml",
-    "classpath:schedulingContext.xml",
-    "classpath:workflowContext.xml"
-})
+@ContextConfiguration(locations = { "classpath:syncopeContext.xml", "classpath:persistenceContext.xml",
+        "classpath:schedulingContext.xml", "classpath:workflowContext.xml" })
 @Transactional
 public class UserSearchTest {
 
@@ -64,19 +60,16 @@ public class UserSearchTest {
         MembershipCond membershipCond = new MembershipCond();
         membershipCond.setRoleId(5L);
 
-        assertFalse(searchDAO.matches(user,
-                NodeCond.getLeafCond(membershipCond)));
+        assertFalse(searchDAO.matches(user, NodeCond.getLeafCond(membershipCond)));
 
         membershipCond.setRoleId(1L);
 
-        assertTrue(searchDAO.matches(user,
-                NodeCond.getLeafCond(membershipCond)));
+        assertTrue(searchDAO.matches(user, NodeCond.getLeafCond(membershipCond)));
     }
 
     @Test
     public void searchWithLikeCondition() {
-        AttributeCond fullnameLeafCond =
-                new AttributeCond(AttributeCond.Type.LIKE);
+        AttributeCond fullnameLeafCond = new AttributeCond(AttributeCond.Type.LIKE);
         fullnameLeafCond.setSchema("fullname");
         fullnameLeafCond.setExpression("%o%");
 
@@ -87,35 +80,30 @@ public class UserSearchTest {
         loginDateCond.setSchema("loginDate");
         loginDateCond.setExpression("2009-05-26");
 
-        NodeCond subCond = NodeCond.getAndCond(
-                NodeCond.getLeafCond(fullnameLeafCond),
-                NodeCond.getLeafCond(membershipCond));
+        NodeCond subCond = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond), NodeCond
+                .getLeafCond(membershipCond));
 
         assertTrue(subCond.checkValidity());
 
-        NodeCond cond = NodeCond.getAndCond(subCond,
-                NodeCond.getLeafCond(loginDateCond));
+        NodeCond cond = NodeCond.getAndCond(subCond, NodeCond.getLeafCond(loginDateCond));
 
         assertTrue(cond.checkValidity());
 
-        List<SyncopeUser> users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond);
+        List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond);
         assertNotNull(users);
         assertEquals(1, users.size());
     }
 
     @Test
     public void searchWithNotCondition() {
-        final AttributeCond fullnameLeafCond =
-                new AttributeCond(AttributeCond.Type.EQ);
+        final AttributeCond fullnameLeafCond = new AttributeCond(AttributeCond.Type.EQ);
         fullnameLeafCond.setSchema("fullname");
         fullnameLeafCond.setExpression("fabio.martelli");
 
         final NodeCond cond = NodeCond.getNotLeafCond(fullnameLeafCond);
         assertTrue(cond.checkValidity());
 
-        final List<SyncopeUser> users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond);
+        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond);
         assertNotNull(users);
         assertEquals(2, users.size());
 
@@ -128,16 +116,14 @@ public class UserSearchTest {
 
     @Test
     public void searchByBoolean() {
-        final AttributeCond coolLeafCond =
-                new AttributeCond(AttributeCond.Type.EQ);
+        final AttributeCond coolLeafCond = new AttributeCond(AttributeCond.Type.EQ);
         coolLeafCond.setSchema("cool");
         coolLeafCond.setExpression("true");
 
         final NodeCond cond = NodeCond.getLeafCond(coolLeafCond);
         assertTrue(cond.checkValidity());
 
-        final List<SyncopeUser> users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond);
+        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond);
         assertNotNull(users);
         assertEquals(1, users.size());
 
@@ -146,8 +132,7 @@ public class UserSearchTest {
 
     @Test
     public void searchByPageAndSize() {
-        AttributeCond fullnameLeafCond =
-                new AttributeCond(AttributeCond.Type.LIKE);
+        AttributeCond fullnameLeafCond = new AttributeCond(AttributeCond.Type.LIKE);
         fullnameLeafCond.setSchema("fullname");
         fullnameLeafCond.setExpression("%o%");
 
@@ -158,26 +143,20 @@ public class UserSearchTest {
         loginDateCond.setSchema("loginDate");
         loginDateCond.setExpression("2009-05-26");
 
-        NodeCond subCond = NodeCond.getAndCond(
-                NodeCond.getLeafCond(fullnameLeafCond),
-                NodeCond.getLeafCond(membershipCond));
+        NodeCond subCond = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond), NodeCond
+                .getLeafCond(membershipCond));
 
         assertTrue(subCond.checkValidity());
 
-        NodeCond cond = NodeCond.getAndCond(subCond,
-                NodeCond.getLeafCond(loginDateCond));
+        NodeCond cond = NodeCond.getAndCond(subCond, NodeCond.getLeafCond(loginDateCond));
 
         assertTrue(cond.checkValidity());
 
-        List<SyncopeUser> users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
-                cond, 1, 2);
+        List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond, 1, 2);
         assertNotNull(users);
         assertEquals(1, users.size());
 
-        users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
-                cond, 2, 2);
+        users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond, 2, 2);
         assertNotNull(users);
         assertTrue(users.isEmpty());
     }
@@ -187,42 +166,35 @@ public class UserSearchTest {
         MembershipCond membershipCond = new MembershipCond();
         membershipCond.setRoleId(1L);
 
-        List<SyncopeUser> users =
-                searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
-                NodeCond.getLeafCond(membershipCond));
+        List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), NodeCond
+                .getLeafCond(membershipCond));
         assertNotNull(users);
         assertEquals(2, users.size());
 
         membershipCond = new MembershipCond();
         membershipCond.setRoleId(5L);
 
-        users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
-                NodeCond.getNotLeafCond(membershipCond));
+        users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), NodeCond
+                .getNotLeafCond(membershipCond));
         assertNotNull(users);
         assertEquals(4, users.size());
     }
 
     @Test
     public void searchByIsNull() {
-        AttributeCond coolLeafCond =
-                new AttributeCond(AttributeCond.Type.ISNULL);
+        AttributeCond coolLeafCond = new AttributeCond(AttributeCond.Type.ISNULL);
         coolLeafCond.setSchema("cool");
 
-        List<SyncopeUser> users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
-                NodeCond.getLeafCond(coolLeafCond));
+        List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), NodeCond
+                .getLeafCond(coolLeafCond));
         assertNotNull(users);
         assertEquals(3, users.size());
 
-        coolLeafCond =
-                new AttributeCond(AttributeCond.Type.ISNOTNULL);
+        coolLeafCond = new AttributeCond(AttributeCond.Type.ISNOTNULL);
         coolLeafCond.setSchema("cool");
 
-        users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
-                NodeCond.getLeafCond(coolLeafCond));
+        users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), NodeCond
+                .getLeafCond(coolLeafCond));
         assertNotNull(users);
         assertEquals(1, users.size());
     }
@@ -235,14 +207,11 @@ public class UserSearchTest {
         ResourceCond ws1 = new ResourceCond();
         ws1.setResourceName("ws-target-resource-list-mappings-2");
 
-        NodeCond searchCondition = NodeCond.getAndCond(
-                NodeCond.getNotLeafCond(ws2),
-                NodeCond.getLeafCond(ws1));
+        NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getNotLeafCond(ws2), NodeCond.getLeafCond(ws1));
 
         assertTrue(searchCondition.checkValidity());
 
-        List<SyncopeUser> users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
+        List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                 searchCondition);
 
         assertNotNull(users);
@@ -251,22 +220,18 @@ public class UserSearchTest {
 
     @Test
     public void searchByUsernameAndId() {
-        final SyncopeUserCond usernameLeafCond =
-                new SyncopeUserCond(SyncopeUserCond.Type.EQ);
+        final SyncopeUserCond usernameLeafCond = new SyncopeUserCond(SyncopeUserCond.Type.EQ);
         usernameLeafCond.setSchema("username");
         usernameLeafCond.setExpression("user1");
 
-        final SyncopeUserCond idRightCond =
-                new SyncopeUserCond(SyncopeUserCond.Type.LT);
+        final SyncopeUserCond idRightCond = new SyncopeUserCond(SyncopeUserCond.Type.LT);
         idRightCond.setSchema("id");
         idRightCond.setExpression("2");
 
-        final NodeCond searchCondition = NodeCond.getOrCond(
-                NodeCond.getLeafCond(usernameLeafCond),
-                NodeCond.getLeafCond(idRightCond));
+        final NodeCond searchCondition = NodeCond.getOrCond(NodeCond.getLeafCond(usernameLeafCond), NodeCond
+                .getLeafCond(idRightCond));
 
-        final List<SyncopeUser> matchingUsers = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
+        final List<SyncopeUser> matchingUsers = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                 searchCondition);
 
         assertNotNull(matchingUsers);
@@ -277,22 +242,18 @@ public class UserSearchTest {
 
     @Test
     public void searchByUsernameAndFullname() {
-        final SyncopeUserCond usernameLeafCond =
-                new SyncopeUserCond(SyncopeUserCond.Type.EQ);
+        final SyncopeUserCond usernameLeafCond = new SyncopeUserCond(SyncopeUserCond.Type.EQ);
         usernameLeafCond.setSchema("username");
         usernameLeafCond.setExpression("user1");
 
-        final AttributeCond idRightCond =
-                new AttributeCond(AttributeCond.Type.LIKE);
+        final AttributeCond idRightCond = new AttributeCond(AttributeCond.Type.LIKE);
         idRightCond.setSchema("fullname");
         idRightCond.setExpression("fabio.mart%");
 
-        final NodeCond searchCondition = NodeCond.getOrCond(
-                NodeCond.getLeafCond(usernameLeafCond),
-                NodeCond.getLeafCond(idRightCond));
+        final NodeCond searchCondition = NodeCond.getOrCond(NodeCond.getLeafCond(usernameLeafCond), NodeCond
+                .getLeafCond(idRightCond));
 
-        final List<SyncopeUser> matchingUsers = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
+        final List<SyncopeUser> matchingUsers = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                 searchCondition);
 
         assertNotNull(matchingUsers);
@@ -301,16 +262,14 @@ public class UserSearchTest {
 
     @Test
     public void searchById() {
-        SyncopeUserCond idLeafCond =
-                new SyncopeUserCond(SyncopeUserCond.Type.LT);
+        SyncopeUserCond idLeafCond = new SyncopeUserCond(SyncopeUserCond.Type.LT);
         idLeafCond.setSchema("id");
         idLeafCond.setExpression("2");
 
         NodeCond searchCondition = NodeCond.getLeafCond(idLeafCond);
         assertTrue(searchCondition.checkValidity());
 
-        List<SyncopeUser> matchingUsers = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
+        List<SyncopeUser> matchingUsers = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                 searchCondition);
 
         assertNotNull(matchingUsers);
@@ -324,9 +283,7 @@ public class UserSearchTest {
         searchCondition = NodeCond.getNotLeafCond(idLeafCond);
         assertTrue(searchCondition.checkValidity());
 
-        matchingUsers = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
-                searchCondition);
+        matchingUsers = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), searchCondition);
 
         assertNotNull(matchingUsers);
         assertEquals(1, matchingUsers.size());
@@ -341,13 +298,11 @@ public class UserSearchTest {
         final ResourceCond ws1 = new ResourceCond();
         ws1.setResourceName("ws-target-resource-list-mappings-1");
 
-        final NodeCond searchCondition = NodeCond.getAndCond(
-                NodeCond.getNotLeafCond(ws2),
-                NodeCond.getNotLeafCond(ws1));
+        final NodeCond searchCondition = NodeCond
+                .getAndCond(NodeCond.getNotLeafCond(ws2), NodeCond.getNotLeafCond(ws1));
         assertTrue(searchCondition.checkValidity());
 
-        final List<SyncopeUser> users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
+        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                 searchCondition);
         assertNotNull(users);
         assertEquals(1, users.size());
@@ -356,16 +311,14 @@ public class UserSearchTest {
 
     @Test
     public void issue242() {
-        final SyncopeUserCond cond =
-                new SyncopeUserCond(AttributeCond.Type.LIKE);
+        final SyncopeUserCond cond = new SyncopeUserCond(AttributeCond.Type.LIKE);
         cond.setSchema("id");
         cond.setExpression("test%");
 
         final NodeCond searchCondition = NodeCond.getLeafCond(cond);
         assertTrue(searchCondition.checkValidity());
 
-        final List<SyncopeUser> users = searchDAO.search(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
+        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                 searchCondition);
         assertNotNull(users);
         assertTrue(users.isEmpty());

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/UserTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/UserTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/UserTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/UserTest.java Thu Mar 15 10:17:12 2012
@@ -45,23 +45,20 @@ public class UserTest extends AbstractTe
 
     @Test
     public void findAll() {
-        List<SyncopeUser> list = userDAO.findAll(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()));
+        List<SyncopeUser> list = userDAO.findAll(EntitlementUtil.getRoleIds(entitlementDAO.findAll()));
         assertEquals("did not get expected number of users ", 4, list.size());
     }
 
     @Test
     public void count() {
-        Integer count = userDAO.count(
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll()));
+        Integer count = userDAO.count(EntitlementUtil.getRoleIds(entitlementDAO.findAll()));
         assertNotNull(count);
         assertEquals(4, count.intValue());
     }
 
     @Test
     public void findAllByPageAndSize() {
-        Set<Long> allRoleIds =
-                EntitlementUtil.getRoleIds(entitlementDAO.findAll());
+        Set<Long> allRoleIds = EntitlementUtil.getRoleIds(entitlementDAO.findAll());
 
         // get first page
         List<SyncopeUser> list = userDAO.findAll(allRoleIds, 1, 2);
@@ -81,22 +78,18 @@ public class UserTest extends AbstractTe
     }
 
     @Test
-    public void findByDerAttributeValue()
-            throws InvalidSearchConditionException {
-        final List<SyncopeUser> list = userDAO.findByDerAttrValue(
-                "cn", "Doe, John");
+    public void findByDerAttributeValue() throws InvalidSearchConditionException {
+        final List<SyncopeUser> list = userDAO.findByDerAttrValue("cn", "Doe, John");
         assertEquals("did not get expected number of users ", 1, list.size());
     }
 
     @Test(expected = InvalidSearchConditionException.class)
-    public void findByInvalidDerAttrValue()
-            throws InvalidSearchConditionException {
+    public void findByInvalidDerAttrValue() throws InvalidSearchConditionException {
         userDAO.findByDerAttrValue("cn", "Antonio, Maria, Rossi");
     }
 
     @Test(expected = InvalidSearchConditionException.class)
-    public void findByInvalidDerAttrExpression()
-            throws InvalidSearchConditionException {
+    public void findByInvalidDerAttrExpression() throws InvalidSearchConditionException {
         userDAO.findByDerAttrValue("noschema", "Antonio, Maria");
     }
 
@@ -105,8 +98,7 @@ public class UserTest extends AbstractTe
         final UAttrValue fullnameValue = new UAttrValue();
         fullnameValue.setStringValue("chicchiricco");
 
-        final List<SyncopeUser> list = userDAO.findByAttrValue(
-                "fullname", fullnameValue);
+        final List<SyncopeUser> list = userDAO.findByAttrValue("fullname", fullnameValue);
         assertEquals("did not get expected number of users ", 1, list.size());
     }
 
@@ -115,8 +107,7 @@ public class UserTest extends AbstractTe
         final UAttrValue coolValue = new UAttrValue();
         coolValue.setBooleanValue(true);
 
-        final List<SyncopeUser> list = userDAO.findByAttrValue(
-                "cool", coolValue);
+        final List<SyncopeUser> list = userDAO.findByAttrValue("cool", coolValue);
         assertEquals("did not get expected number of users ", 1, list.size());
     }
 

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/VirAttrTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/VirAttrTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/VirAttrTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/VirAttrTest.java Thu Mar 15 10:17:12 2012
@@ -56,24 +56,18 @@ public class VirAttrTest extends Abstrac
     @Test
     public void findAll() {
         List<UVirAttr> list = virAttrDAO.findAll(UVirAttr.class);
-        assertEquals(
-                "did not get expected number of derived attributes ",
-                1, list.size());
+        assertEquals("did not get expected number of derived attributes ", 1, list.size());
     }
 
     @Test
     public void findById() {
         UVirAttr attribute = virAttrDAO.find(100L, UVirAttr.class);
-        assertNotNull(
-                "did not find expected attribute schema",
-                attribute);
+        assertNotNull("did not find expected attribute schema", attribute);
     }
 
     @Test
-    public void saveUVirAttribute()
-            throws ClassNotFoundException {
-        UVirSchema virtualSchema =
-                virSchemaDAO.find("virtualdata", UVirSchema.class);
+    public void saveUVirAttribute() throws ClassNotFoundException {
+        UVirSchema virtualSchema = virSchemaDAO.find("virtualdata", UVirSchema.class);
         assertNotNull(virtualSchema);
 
         SyncopeUser owner = userDAO.find(3L);
@@ -85,15 +79,13 @@ public class VirAttrTest extends Abstrac
 
         virtualAttribute = virAttrDAO.save(virtualAttribute);
 
-        UVirAttr actual = virAttrDAO.find(
-                virtualAttribute.getId(), UVirAttr.class);
+        UVirAttr actual = virAttrDAO.find(virtualAttribute.getId(), UVirAttr.class);
         assertNotNull("expected save to work", actual);
         assertEquals(virtualAttribute, actual);
     }
 
     @Test
-    public void saveMVirAttribute()
-            throws ClassNotFoundException {
+    public void saveMVirAttribute() throws ClassNotFoundException {
 
         MVirSchema virtualSchema = new MVirSchema();
         virtualSchema.setName("mvirtualdata");
@@ -107,15 +99,13 @@ public class VirAttrTest extends Abstrac
 
         virtualAttribute = virAttrDAO.save(virtualAttribute);
 
-        MVirAttr actual = virAttrDAO.find(
-                virtualAttribute.getId(), MVirAttr.class);
+        MVirAttr actual = virAttrDAO.find(virtualAttribute.getId(), MVirAttr.class);
         assertNotNull("expected save to work", actual);
         assertEquals(virtualAttribute, actual);
     }
 
     @Test
-    public void saveRVirAttribute()
-            throws ClassNotFoundException {
+    public void saveRVirAttribute() throws ClassNotFoundException {
 
         RVirSchema virtualSchema = new RVirSchema();
         virtualSchema.setName("rvirtualdata");
@@ -129,8 +119,7 @@ public class VirAttrTest extends Abstrac
 
         virtualAttribute = virAttrDAO.save(virtualAttribute);
 
-        RVirAttr actual = virAttrDAO.find(
-                virtualAttribute.getId(), RVirAttr.class);
+        RVirAttr actual = virAttrDAO.find(virtualAttribute.getId(), RVirAttr.class);
         assertNotNull("expected save to work", actual);
         assertEquals(virtualAttribute, actual);
     }
@@ -145,12 +134,8 @@ public class VirAttrTest extends Abstrac
         UVirAttr actual = virAttrDAO.find(100L, UVirAttr.class);
         assertNull("delete did not work", actual);
 
-        UVirSchema attributeSchema =
-                virSchemaDAO.find(attributeSchemaName,
-                UVirSchema.class);
-
-        assertNotNull("user virtual attribute schema deleted "
-                + "when deleting values",
-                attributeSchema);
+        UVirSchema attributeSchema = virSchemaDAO.find(attributeSchemaName, UVirSchema.class);
+
+        assertNotNull("user virtual attribute schema deleted " + "when deleting values", attributeSchema);
     }
 }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/VirSchemaTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/VirSchemaTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/VirSchemaTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/VirSchemaTest.java Thu Mar 15 10:17:12 2012
@@ -40,42 +40,35 @@ public class VirSchemaTest extends Abstr
 
     @Test
     public void findAll() {
-        List<UVirSchema> list =
-                virSchemaDAO.findAll(UVirSchema.class);
+        List<UVirSchema> list = virSchemaDAO.findAll(UVirSchema.class);
         assertEquals(1, list.size());
     }
 
     @Test
     public void findByName() {
-        UVirSchema attributeSchema =
-                virSchemaDAO.find("virtualdata", UVirSchema.class);
-        assertNotNull("did not find expected virtual attribute schema",
-                attributeSchema);
+        UVirSchema attributeSchema = virSchemaDAO.find("virtualdata", UVirSchema.class);
+        assertNotNull("did not find expected virtual attribute schema", attributeSchema);
     }
 
     @Test
     public void save() {
-        UVirSchema virtualAttributeSchema =
-                new UVirSchema();
+        UVirSchema virtualAttributeSchema = new UVirSchema();
         virtualAttributeSchema.setName("virtual");
 
         virSchemaDAO.save(virtualAttributeSchema);
 
-        UVirSchema actual =
-                virSchemaDAO.find("virtual", UVirSchema.class);
+        UVirSchema actual = virSchemaDAO.find("virtual", UVirSchema.class);
         assertNotNull("expected save to work", actual);
         assertEquals(virtualAttributeSchema, actual);
     }
 
     @Test
     public void delete() {
-        UVirSchema attributeSchema =
-                virSchemaDAO.find("virtualdata", UVirSchema.class);
+        UVirSchema attributeSchema = virSchemaDAO.find("virtualdata", UVirSchema.class);
 
         virSchemaDAO.delete(attributeSchema.getName(), AttributableUtil.getInstance(AttributableType.USER));
 
-        UVirSchema actual =
-                virSchemaDAO.find("virtualdata", UVirSchema.class);
+        UVirSchema actual = virSchemaDAO.find("virtualdata", UVirSchema.class);
         assertNull("delete did not work", actual);
     }
 }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/AttrTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/AttrTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/AttrTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/AttrTest.java Thu Mar 15 10:17:12 2012
@@ -80,10 +80,8 @@ public class AttrTest extends AbstractTe
 
     @Test
     public void deleteAttributeValue() {
-        UAttrValue value =
-                attrValueDAO.find(20L, UAttrValue.class);
-        int attributeValueNumber =
-                value.getAttribute().getValues().size();
+        UAttrValue value = attrValueDAO.find(20L, UAttrValue.class);
+        int attributeValueNumber = value.getAttribute().getValues().size();
 
         attrValueDAO.delete(20L, UAttrValue.class);
 
@@ -92,8 +90,7 @@ public class AttrTest extends AbstractTe
         assertNull(attrValueDAO.find(20L, UAttrValue.class));
 
         UAttr attribute = attrDAO.find(200L, UAttr.class);
-        assertEquals(attribute.getValues().size(),
-                attributeValueNumber - 1);
+        assertEquals(attribute.getValues().size(), attributeValueNumber - 1);
     }
 
     @Test
@@ -101,8 +98,7 @@ public class AttrTest extends AbstractTe
         MSchema schema = new MSchema();
         schema.setType(SchemaType.Enum);
         schema.setName("color");
-        schema.setEnumerationValues(
-                "red" + AbstractSchema.enumValuesSeparator + "yellow");
+        schema.setEnumerationValues("red" + AbstractSchema.enumValuesSeparator + "yellow");
 
         MSchema actualSchema = schemaDAO.save(schema);
         assertNotNull(actualSchema);
@@ -124,9 +120,7 @@ public class AttrTest extends AbstractTe
         assertNotNull(membership.getAttribute(schema.getName()));
         assertNotNull(membership.getAttribute(schema.getName()).getValues());
 
-        assertEquals(
-                membership.getAttribute(schema.getName()).getValues().size(),
-                1);
+        assertEquals(membership.getAttribute(schema.getName()).getValues().size(), 1);
     }
 
     public void derAttrFromSpecialAttrs() {

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/ConnInstanceTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/ConnInstanceTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/ConnInstanceTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/ConnInstanceTest.java Thu Mar 15 10:17:12 2012
@@ -75,8 +75,7 @@ public class ConnInstanceTest extends Ab
         List<ExternalResource> resources = connInstance.getResources();
         assertNotNull(resources);
         assertEquals(1, resources.size());
-        assertEquals(
-                "ws-target-resource-nopropagation", resources.get(0).getName());
+        assertEquals("ws-target-resource-nopropagation", resources.get(0).getName());
 
         connInstance.addCapability(ConnectorCapability.SEARCH);
 
@@ -87,7 +86,6 @@ public class ConnInstanceTest extends Ab
         resources = connInstance.getResources();
         assertNotNull(resources);
         assertEquals(1, resources.size());
-        assertEquals(
-                "ws-target-resource-nopropagation", resources.get(0).getName());
+        assertEquals("ws-target-resource-nopropagation", resources.get(0).getName());
     }
 }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/ResourceTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/ResourceTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/ResourceTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/ResourceTest.java Thu Mar 15 10:17:12 2012
@@ -115,8 +115,7 @@ public class ResourceTest extends Abstra
         schemaMappingTO.setPassword(false);
         schemaMappingTO.setMandatoryCondition("false");
 
-        List<SchemaMappingTO> schemaMappingTOs =
-                new ArrayList<SchemaMappingTO>();
+        List<SchemaMappingTO> schemaMappingTOs = new ArrayList<SchemaMappingTO>();
         schemaMappingTOs.add(schemaMappingTO);
 
         ResourceTO resourceTO = new ResourceTO();
@@ -258,8 +257,7 @@ public class ResourceTest extends Abstra
         // -------------------------------------
 
         // Get tasks
-        List<PropagationTask> propagationTasks = taskDAO.findAll(resource,
-                PropagationTask.class);
+        List<PropagationTask> propagationTasks = taskDAO.findAll(resource, PropagationTask.class);
         assertFalse(propagationTasks.isEmpty());
 
         // delete resource

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/RoleTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/RoleTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/RoleTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/RoleTest.java Thu Mar 15 10:17:12 2012
@@ -89,8 +89,7 @@ public class RoleTest extends AbstractTe
         roleDAO.flush();
 
         assertNull(roleDAO.find(2L));
-        assertEquals(1, roleDAO.findByEntitlement(
-                entitlementDAO.find("base")).size());
+        assertEquals(1, roleDAO.findByEntitlement(entitlementDAO.find("base")).size());
         assertEquals(userDAO.find(2L).getRoles().size(), 2);
         assertNull(attrDAO.find(700L, RAttr.class));
         assertNull(attrValueDAO.find(41L, RAttrValue.class));

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/TaskTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/TaskTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/TaskTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/TaskTest.java Thu Mar 15 10:17:12 2012
@@ -83,10 +83,8 @@ public class TaskTest extends AbstractTe
         task.setAccountId("one@two.com");
 
         Set<Attribute> attributes = new HashSet<Attribute>();
-        attributes.add(AttributeBuilder.build("testAttribute", "testValue1",
-                "testValue2"));
-        attributes.add(
-                AttributeBuilder.buildPassword("password".toCharArray()));
+        attributes.add(AttributeBuilder.build("testAttribute", "testValue1", "testValue2"));
+        attributes.add(AttributeBuilder.buildPassword("password".toCharArray()));
         task.setAttributes(attributes);
 
         task = taskDAO.save(task);
@@ -98,8 +96,7 @@ public class TaskTest extends AbstractTe
         taskDAO.flush();
 
         resource = resourceDAO.find("ws-target-resource-1");
-        assertTrue(taskDAO.findAll(resource, PropagationTask.class).
-                contains(task));
+        assertTrue(taskDAO.findAll(resource, PropagationTask.class).contains(task));
     }
 
     @Test
@@ -170,7 +167,6 @@ public class TaskTest extends AbstractTe
         assertNull(taskExecDAO.find(1L));
 
         PropagationTask task = taskDAO.find(1L);
-        assertEquals(task.getExecs().size(),
-                executionNumber - 1);
+        assertEquals(task.getExecs().size(), executionNumber - 1);
     }
 }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/UserTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/UserTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/UserTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/relationships/UserTest.java Thu Mar 15 10:17:12 2012
@@ -64,8 +64,7 @@ public class UserTest extends AbstractTe
         assertNull(attrValueDAO.find(22L, UAttrValue.class));
         assertNotNull(schemaDAO.find("loginDate", USchema.class));
 
-        List<Membership> memberships =
-                roleDAO.findMemberships(roleDAO.find(7L));
+        List<Membership> memberships = roleDAO.findMemberships(roleDAO.find(7L));
         assertTrue(memberships.isEmpty());
     }
 }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/AbstractTest.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/AbstractTest.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/AbstractTest.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/AbstractTest.java Thu Mar 15 10:17:12 2012
@@ -32,20 +32,15 @@ import org.springframework.web.client.Re
 import org.syncope.client.http.PreemptiveAuthHttpRequestFactory;
 
 @RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = {
-    "classpath:restClientContext.xml",
-    "classpath:testJDBCContext.xml"
-})
+@ContextConfiguration(locations = { "classpath:restClientContext.xml", "classpath:testJDBCContext.xml" })
 public abstract class AbstractTest {
 
     /**
      * Logger.
      */
-    protected static final Logger LOG = LoggerFactory.getLogger(
-            AbstractTest.class);
+    protected static final Logger LOG = LoggerFactory.getLogger(AbstractTest.class);
 
-    protected static final String BASE_URL =
-            "http://localhost:9080/syncope/rest/";
+    protected static final String BASE_URL = "http://localhost:9080/syncope/rest/";
 
     @Autowired
     protected RestTemplate restTemplate;
@@ -59,12 +54,9 @@ public abstract class AbstractTest {
 
     @Before
     public void setupRestTemplate() {
-        PreemptiveAuthHttpRequestFactory requestFactory =
-                ((PreemptiveAuthHttpRequestFactory) restTemplate.
-                getRequestFactory());
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials("admin", "password"));
+        PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate
+                .getRequestFactory());
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials("admin", "password"));
     }
 }

Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/AuthenticationTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/AuthenticationTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/AuthenticationTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/AuthenticationTestITCase.java Thu Mar 15 10:17:12 2012
@@ -47,17 +47,15 @@ public class AuthenticationTestITCase ex
     @Test
     public void testAdminEntitlements() {
         // 1. as anonymous, read all available entitlements
-        Set<String> allEntitlements = new HashSet<String>(
-                Arrays.asList(anonymousRestTemplate().getForObject(
+        Set<String> allEntitlements = new HashSet<String>(Arrays.asList(anonymousRestTemplate().getForObject(
                 BASE_URL + "auth/allentitlements.json", String[].class)));
         assertNotNull(allEntitlements);
         assertFalse(allEntitlements.isEmpty());
 
         // 2. as admin, read own entitlements
         super.setupRestTemplate();
-        Set<String> adminEntitlements = new HashSet<String>(
-                Arrays.asList(restTemplate.getForObject(
-                BASE_URL + "auth/entitlements.json", String[].class)));
+        Set<String> adminEntitlements = new HashSet<String>(Arrays.asList(restTemplate.getForObject(BASE_URL
+                + "auth/entitlements.json", String[].class)));
 
         assertEquals(allEntitlements, adminEntitlements);
     }
@@ -70,8 +68,7 @@ public class AuthenticationTestITCase ex
         authRoleTO.setParent(8L);
         authRoleTO.addEntitlement("SCHEMA_READ");
 
-        authRoleTO = restTemplate.postForObject(BASE_URL + "role/create",
-                authRoleTO, RoleTO.class);
+        authRoleTO = restTemplate.postForObject(BASE_URL + "role/create", authRoleTO, RoleTO.class);
         assertNotNull(authRoleTO);
 
         // 1. create a schema (as admin)
@@ -80,8 +77,7 @@ public class AuthenticationTestITCase ex
         schemaTO.setMandatoryCondition("false");
         schemaTO.setType(SchemaType.String);
 
-        SchemaTO newSchemaTO = restTemplate.postForObject(BASE_URL
-                + "schema/user/create", schemaTO, SchemaTO.class);
+        SchemaTO newSchemaTO = restTemplate.postForObject(BASE_URL + "schema/user/create", schemaTO, SchemaTO.class);
         assertEquals(schemaTO, newSchemaTO);
 
         // 2. create an user with the role created above (as admin)
@@ -95,34 +91,26 @@ public class AuthenticationTestITCase ex
         membershipTO.addAttribute(testAttributeTO);
         userTO.addMembership(membershipTO);
 
-        userTO = restTemplate.postForObject(
-                BASE_URL + "user/create", userTO, UserTO.class);
+        userTO = restTemplate.postForObject(BASE_URL + "user/create", userTO, UserTO.class);
         assertNotNull(userTO);
 
         // 3. read the schema created above (as admin) - success
-        schemaTO = restTemplate.getForObject(BASE_URL
-                + "schema/user/read/authTestSchema.json", SchemaTO.class);
+        schemaTO = restTemplate.getForObject(BASE_URL + "schema/user/read/authTestSchema.json", SchemaTO.class);
         assertNotNull(schemaTO);
 
         // 4. read the schema created above (as user) - success
-        PreemptiveAuthHttpRequestFactory requestFactory =
-                ((PreemptiveAuthHttpRequestFactory) restTemplate.
-                getRequestFactory());
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "password123"));
+        PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate
+                .getRequestFactory());
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "password123"));
 
-        schemaTO = restTemplate.getForObject(BASE_URL
-                + "schema/user/read/authTestSchema.json", SchemaTO.class);
+        schemaTO = restTemplate.getForObject(BASE_URL + "schema/user/read/authTestSchema.json", SchemaTO.class);
         assertNotNull(schemaTO);
 
         // 5. update the schema create above (as user) - failure
         HttpClientErrorException exception = null;
         try {
-            restTemplate.postForObject(BASE_URL
-                    + "schema/role/update", schemaTO, SchemaTO.class);
+            restTemplate.postForObject(BASE_URL + "schema/role/update", schemaTO, SchemaTO.class);
         } catch (HttpClientErrorException e) {
             exception = e;
         }
@@ -132,8 +120,7 @@ public class AuthenticationTestITCase ex
         // reset admin credentials for restTemplate
         super.setupRestTemplate();
 
-        userTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json",
-                UserTO.class, userTO.getId());
+        userTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
 
         assertNotNull(userTO);
         assertNotNull(userTO.getLastLoginDate());
@@ -152,36 +139,26 @@ public class AuthenticationTestITCase ex
         membershipTO.addAttribute(testAttributeTO);
         userTO.addMembership(membershipTO);
 
-        userTO = restTemplate.postForObject(
-                BASE_URL + "user/create", userTO, UserTO.class);
+        userTO = restTemplate.postForObject(BASE_URL + "user/create", userTO, UserTO.class);
         assertNotNull(userTO);
 
-        PreemptiveAuthHttpRequestFactory requestFactory =
-                ((PreemptiveAuthHttpRequestFactory) restTemplate.
-                getRequestFactory());
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "password123"));
+        PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate
+                .getRequestFactory());
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "password123"));
 
-        UserTO readUserTO = restTemplate.getForObject(
-                BASE_URL + "user/read/{userId}.json", UserTO.class, 1);
+        UserTO readUserTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, 1);
         assertNotNull(readUserTO);
 
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials("user2", "password"));
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials("user2", "password"));
 
         SyncopeClientException exception = null;
         try {
-            restTemplate.getForObject(
-                    BASE_URL + "user/read/{userId}.json", UserTO.class, 1);
+            restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, 1);
             fail();
         } catch (SyncopeClientCompositeErrorException e) {
-            exception = e.getException(
-                    SyncopeClientExceptionType.UnauthorizedRole);
+            exception = e.getException(SyncopeClientExceptionType.UnauthorizedRole);
         }
         assertNotNull(exception);
 
@@ -201,27 +178,20 @@ public class AuthenticationTestITCase ex
         membershipTO.addAttribute(testAttributeTO);
         userTO.addMembership(membershipTO);
 
-        userTO = restTemplate.postForObject(BASE_URL + "user/create",
-                userTO, UserTO.class);
+        userTO = restTemplate.postForObject(BASE_URL + "user/create", userTO, UserTO.class);
         assertNotNull(userTO);
 
-        PreemptiveAuthHttpRequestFactory requestFactory =
-                ((PreemptiveAuthHttpRequestFactory) restTemplate.
-                getRequestFactory());
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "password123"));
+        PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate
+                .getRequestFactory());
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "password123"));
 
-        AttributeCond isNullCond = new AttributeCond(
-                AttributeCond.Type.ISNOTNULL);
+        AttributeCond isNullCond = new AttributeCond(AttributeCond.Type.ISNOTNULL);
         isNullCond.setSchema("loginDate");
         NodeCond searchCondition = NodeCond.getLeafCond(isNullCond);
 
-        List<UserTO> matchedUsers = Arrays.asList(
-                restTemplate.postForObject(BASE_URL + "user/search",
-                searchCondition, UserTO[].class));
+        List<UserTO> matchedUsers = Arrays.asList(restTemplate.postForObject(BASE_URL + "user/search", searchCondition,
+                UserTO[].class));
         assertNotNull(matchedUsers);
         assertFalse(matchedUsers.isEmpty());
         Set<Long> userIds = new HashSet<Long>(matchedUsers.size());
@@ -230,14 +200,11 @@ public class AuthenticationTestITCase ex
         }
         assertTrue(userIds.contains(1L));
 
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials("user2", "password"));
-
-        matchedUsers = Arrays.asList(
-                restTemplate.postForObject(BASE_URL + "user/search",
-                searchCondition, UserTO[].class));
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials("user2", "password"));
+
+        matchedUsers = Arrays.asList(restTemplate.postForObject(BASE_URL + "user/search", searchCondition,
+                UserTO[].class));
         assertNotNull(matchedUsers);
         userIds = new HashSet<Long>(matchedUsers.size());
         for (UserTO user : matchedUsers) {
@@ -251,8 +218,7 @@ public class AuthenticationTestITCase ex
 
     @Test
     public void checkFailedLogins() {
-        UserTO userTO =
-                UserTestITCase.getSampleTO("checkFailedLogin@syncope-idm.org");
+        UserTO userTO = UserTestITCase.getSampleTO("checkFailedLogin@syncope-idm.org");
 
         MembershipTO membershipTO = new MembershipTO();
         membershipTO.setRoleId(7L);
@@ -262,22 +228,16 @@ public class AuthenticationTestITCase ex
         membershipTO.addAttribute(testAttributeTO);
         userTO.addMembership(membershipTO);
 
-        userTO = restTemplate.postForObject(
-                BASE_URL + "user/create", userTO, UserTO.class);
+        userTO = restTemplate.postForObject(BASE_URL + "user/create", userTO, UserTO.class);
         assertNotNull(userTO);
 
-        PreemptiveAuthHttpRequestFactory requestFactory =
-                ((PreemptiveAuthHttpRequestFactory) restTemplate.
-                getRequestFactory());
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "password123"));
-
-        UserTO readUserTO = restTemplate.getForObject(
-                BASE_URL + "user/read/{userId}.json",
-                UserTO.class, userTO.getId());
+        PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate
+                .getRequestFactory());
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "password123"));
+
+        UserTO readUserTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO
+                .getId());
 
         assertNotNull(readUserTO);
         assertNotNull(readUserTO.getFailedLogins());
@@ -285,18 +245,13 @@ public class AuthenticationTestITCase ex
 
         // authentications failed ...
 
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "wrongpwd1"));
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "wrongpwd1"));
 
         Throwable t = null;
 
         try {
-            restTemplate.getForObject(
-                    BASE_URL + "user/read/{userId}.json",
-                    UserTO.class, userTO.getId());
+            restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
             assertNotNull(readUserTO);
         } catch (Exception e) {
             t = e;
@@ -306,9 +261,7 @@ public class AuthenticationTestITCase ex
         t = null;
 
         try {
-            restTemplate.getForObject(
-                    BASE_URL + "user/read/{userId}.json",
-                    UserTO.class, userTO.getId());
+            restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
             assertNotNull(readUserTO);
         } catch (Exception e) {
             t = e;
@@ -317,22 +270,15 @@ public class AuthenticationTestITCase ex
         // reset admin credentials for restTemplate
         super.setupRestTemplate();
 
-        readUserTO = restTemplate.getForObject(
-                BASE_URL + "user/read/{userId}.json",
-                UserTO.class, userTO.getId());
+        readUserTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
         assertNotNull(readUserTO);
         assertNotNull(readUserTO.getFailedLogins());
         assertEquals(Integer.valueOf(2), readUserTO.getFailedLogins());
 
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "password123"));
-
-        readUserTO = restTemplate.getForObject(
-                BASE_URL + "user/read/{userId}.json",
-                UserTO.class, userTO.getId());
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "password123"));
+
+        readUserTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
         assertNotNull(readUserTO);
         assertNotNull(readUserTO.getFailedLogins());
         assertEquals(Integer.valueOf(0), readUserTO.getFailedLogins());
@@ -340,8 +286,7 @@ public class AuthenticationTestITCase ex
 
     @Test
     public void checkUserSuspension() {
-        UserTO userTO =
-                UserTestITCase.getSampleTO("checkSuspension@syncope-idm.org");
+        UserTO userTO = UserTestITCase.getSampleTO("checkSuspension@syncope-idm.org");
 
         MembershipTO membershipTO = new MembershipTO();
         membershipTO.setRoleId(7L);
@@ -351,22 +296,15 @@ public class AuthenticationTestITCase ex
         membershipTO.addAttribute(testAttributeTO);
         userTO.addMembership(membershipTO);
 
-        userTO = restTemplate.postForObject(
-                BASE_URL + "user/create", userTO, UserTO.class);
+        userTO = restTemplate.postForObject(BASE_URL + "user/create", userTO, UserTO.class);
         assertNotNull(userTO);
 
-        PreemptiveAuthHttpRequestFactory requestFactory =
-                ((PreemptiveAuthHttpRequestFactory) restTemplate.
-                getRequestFactory());
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "password123"));
-
-        userTO = restTemplate.getForObject(
-                BASE_URL + "user/read/{userId}.json",
-                UserTO.class, userTO.getId());
+        PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate
+                .getRequestFactory());
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "password123"));
+
+        userTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
 
         assertNotNull(userTO);
         assertNotNull(userTO.getFailedLogins());
@@ -374,18 +312,13 @@ public class AuthenticationTestITCase ex
 
         // authentications failed ...
 
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "wrongpwd1"));
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "wrongpwd1"));
 
         Throwable t = null;
 
         try {
-            restTemplate.getForObject(
-                    BASE_URL + "user/read/{userId}.json",
-                    UserTO.class, userTO.getId());
+            restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
         } catch (Exception e) {
             t = e;
         }
@@ -394,9 +327,7 @@ public class AuthenticationTestITCase ex
         t = null;
 
         try {
-            restTemplate.getForObject(
-                    BASE_URL + "user/read/{userId}.json",
-                    UserTO.class, userTO.getId());
+            restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
         } catch (Exception e) {
             t = e;
         }
@@ -405,9 +336,7 @@ public class AuthenticationTestITCase ex
         t = null;
 
         try {
-            restTemplate.getForObject(
-                    BASE_URL + "user/read/{userId}.json",
-                    UserTO.class, userTO.getId());
+            restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
         } catch (Exception e) {
             t = e;
         }
@@ -418,25 +347,18 @@ public class AuthenticationTestITCase ex
         // reset admin credentials for restTemplate
         super.setupRestTemplate();
 
-        userTO = restTemplate.getForObject(
-                BASE_URL + "user/read/{userId}.json",
-                UserTO.class, userTO.getId());
+        userTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
 
         assertNotNull(userTO);
         assertNotNull(userTO.getFailedLogins());
         assertEquals(Integer.valueOf(3), userTO.getFailedLogins());
 
         // last authentication before suspension
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "wrongpwd1"));
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "wrongpwd1"));
 
         try {
-            restTemplate.getForObject(
-                    BASE_URL + "user/read/{userId}.json",
-                    UserTO.class, userTO.getId());
+            restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
         } catch (Exception e) {
             t = e;
         }
@@ -447,9 +369,7 @@ public class AuthenticationTestITCase ex
         // reset admin credentials for restTemplate
         super.setupRestTemplate();
 
-        userTO = restTemplate.getForObject(
-                BASE_URL + "user/read/{userId}.json",
-                UserTO.class, userTO.getId());
+        userTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
 
         assertNotNull(userTO);
         assertNotNull(userTO.getFailedLogins());
@@ -458,16 +378,11 @@ public class AuthenticationTestITCase ex
 
         // check for authentication
 
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "password123"));
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "password123"));
 
         try {
-            restTemplate.getForObject(
-                    BASE_URL + "user/read/{userId}.json",
-                    UserTO.class, userTO.getId());
+            restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
             assertNotNull(userTO);
         } catch (Exception e) {
             t = e;
@@ -479,21 +394,15 @@ public class AuthenticationTestITCase ex
         // reset admin credentials for restTemplate
         super.setupRestTemplate();
 
-        userTO = restTemplate.getForObject(
-                BASE_URL + "user/reactivate/" + userTO.getId(), UserTO.class);
+        userTO = restTemplate.getForObject(BASE_URL + "user/reactivate/" + userTO.getId(), UserTO.class);
 
         assertNotNull(userTO);
         assertEquals("active", userTO.getStatus());
 
-        ((DefaultHttpClient) requestFactory.getHttpClient()).
-                getCredentialsProvider().setCredentials(
-                requestFactory.getAuthScope(),
-                new UsernamePasswordCredentials(
-                userTO.getUsername(), "password123"));
-
-        userTO = restTemplate.getForObject(
-                BASE_URL + "user/read/{userId}.json",
-                UserTO.class, userTO.getId());
+        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+                requestFactory.getAuthScope(), new UsernamePasswordCredentials(userTO.getUsername(), "password123"));
+
+        userTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, userTO.getId());
 
         assertNotNull(userTO);
         assertEquals(Integer.valueOf(0), userTO.getFailedLogins());



Mime
View raw message