syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [69/70] syncope git commit: [SYNCOPE-666] All done now
Date Thu, 11 Jun 2015 14:17:59 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/AnyTypeClassTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/AnyTypeClassTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/AnyTypeClassTest.java
deleted file mode 100644
index c77ea93..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/AnyTypeClassTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-import org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO;
-import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
-import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class AnyTypeClassTest extends AbstractTest {
-
-    @Autowired
-    private PlainSchemaDAO plainSchemaDAO;
-
-    @Autowired
-    private AnyTypeClassDAO anyTypeClassDAO;
-
-    @Test
-    public void find() {
-        AnyTypeClass minimalGroup = anyTypeClassDAO.find("minimal group");
-        assertNotNull(minimalGroup);
-
-        assertFalse(minimalGroup.getPlainSchemas().isEmpty());
-        assertFalse(minimalGroup.getDerSchemas().isEmpty());
-        assertFalse(minimalGroup.getVirSchemas().isEmpty());
-    }
-
-    @Test
-    public void findAll() {
-        List<AnyTypeClass> list = anyTypeClassDAO.findAll();
-        assertFalse(list.isEmpty());
-    }
-
-    @Test
-    public void save() {
-        AnyTypeClass newClass = entityFactory.newEntity(AnyTypeClass.class);
-        newClass.setKey("new class");
-        newClass.add(plainSchemaDAO.find("firstname"));
-
-        newClass = anyTypeClassDAO.save(newClass);
-        assertNotNull(newClass);
-        assertFalse(newClass.getPlainSchemas().isEmpty());
-        assertTrue(newClass.getDerSchemas().isEmpty());
-        assertTrue(newClass.getVirSchemas().isEmpty());
-    }
-
-    @Test
-    public void delete() {
-        AnyTypeClass minimalUser = anyTypeClassDAO.find("minimal user");
-        assertNotNull(minimalUser);
-
-        anyTypeClassDAO.delete(minimalUser.getKey());
-        assertNull(anyTypeClassDAO.find("minimal user"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/AnyTypeTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/AnyTypeTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/AnyTypeTest.java
deleted file mode 100644
index 13937cc..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/AnyTypeTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.util.List;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
-import org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO;
-import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
-import org.apache.syncope.core.persistence.api.entity.AnyType;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class AnyTypeTest extends AbstractTest {
-
-    @Autowired
-    private AnyTypeDAO anyTypeDAO;
-
-    @Autowired
-    private AnyTypeClassDAO anyTypeClassDAO;
-
-    @Test
-    public void find() {
-        AnyType userType = anyTypeDAO.findUser();
-        assertNotNull(userType);
-        assertEquals(AnyTypeKind.USER, userType.getKind());
-        assertEquals(AnyTypeKind.USER.name(), userType.getKey());
-        assertFalse(userType.getClasses().isEmpty());
-
-        AnyType groupType = anyTypeDAO.findGroup();
-        assertNotNull(groupType);
-        assertEquals(AnyTypeKind.GROUP, groupType.getKind());
-        assertEquals(AnyTypeKind.GROUP.name(), groupType.getKey());
-        assertFalse(groupType.getClasses().isEmpty());
-
-        AnyType otherType = anyTypeDAO.find("PRINTER");
-        assertNotNull(otherType);
-        assertEquals(AnyTypeKind.ANY_OBJECT, otherType.getKind());
-        assertEquals("PRINTER", otherType.getKey());
-    }
-
-    @Test
-    public void findAll() {
-        List<AnyType> list = anyTypeDAO.findAll();
-        assertFalse(list.isEmpty());
-    }
-
-    @Test
-    public void save() {
-        AnyType newType = entityFactory.newEntity(AnyType.class);
-        newType.setKey("new type");
-        newType.setKind(AnyTypeKind.ANY_OBJECT);
-        newType.add(anyTypeClassDAO.find("generic membership"));
-        newType.add(anyTypeClassDAO.find("csv"));
-
-        newType = anyTypeDAO.save(newType);
-        assertNotNull(newType);
-        assertFalse(newType.getClasses().isEmpty());
-    }
-
-    @Test(expected = InvalidEntityException.class)
-    public void saveInvalidKind() {
-        AnyType newType = entityFactory.newEntity(AnyType.class);
-        newType.setKey("new type");
-        newType.setKind(AnyTypeKind.USER);
-        anyTypeDAO.save(newType);
-    }
-
-    @Test(expected = InvalidEntityException.class)
-    public void saveInvalidName() {
-        AnyType newType = entityFactory.newEntity(AnyType.class);
-        newType.setKey("group");
-        newType.setKind(AnyTypeKind.ANY_OBJECT);
-        anyTypeDAO.save(newType);
-    }
-
-    @Test
-    public void delete() {
-        AnyType otherType = anyTypeDAO.find("PRINTER");
-        assertNotNull(otherType);
-
-        anyTypeDAO.delete(otherType.getKey());
-        assertNull(anyTypeDAO.find("PRINTER"));
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void deleteInvalid() {
-        anyTypeDAO.delete(anyTypeDAO.findUser().getKey());
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ConfTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ConfTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ConfTest.java
deleted file mode 100644
index 606c417..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ConfTest.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.syncope.common.lib.types.AttrSchemaType;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
-import org.apache.syncope.core.persistence.api.dao.ConfDAO;
-import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
-import org.apache.syncope.core.persistence.api.entity.PlainAttrUniqueValue;
-import org.apache.syncope.core.persistence.api.entity.PlainSchema;
-import org.apache.syncope.core.persistence.api.entity.conf.CPlainAttr;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.apache.syncope.core.persistence.jpa.entity.conf.JPACPlainAttrValue;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class ConfTest extends AbstractTest {
-
-    @Autowired
-    private ConfDAO confDAO;
-
-    @Autowired
-    private PlainSchemaDAO plainSchemaDAO;
-
-    @Test
-    public void read() {
-        CPlainAttr conf = confDAO.find("selfRegistration.allowed");
-        assertNotNull(conf);
-        assertTrue(conf.getValues().get(0).getBooleanValue());
-
-        conf = confDAO.find("authentication.statuses");
-        assertNotNull(conf);
-        assertEquals(2, conf.getValues().size());
-
-        conf = confDAO.find("non.existing");
-        assertNull(conf);
-    }
-
-    private void add(final CPlainAttr newAttr, final String value) {
-        JPACPlainAttrValue attrValue;
-        if (newAttr.getSchema().isUniqueConstraint()) {
-            attrValue = new JPACPlainAttrValue();
-            ((PlainAttrUniqueValue) attrValue).setSchema(newAttr.getSchema());
-        } else {
-            attrValue = new JPACPlainAttrValue();
-        }
-        newAttr.add(value, attrValue);
-    }
-
-    @Test
-    public void setAndDelete() {
-        // 1. create CSChema
-        PlainSchema useless = entityFactory.newEntity(PlainSchema.class);
-        useless.setKey("useless");
-        useless.setType(AttrSchemaType.Date);
-        useless.setConversionPattern("yyyy-MM-dd");
-        useless = plainSchemaDAO.save(useless);
-
-        // 2. create conf
-        CPlainAttr newConf = entityFactory.newEntity(CPlainAttr.class);
-        newConf.setSchema(useless);
-        add(newConf, "2014-06-20");
-        confDAO.save(newConf);
-
-        CPlainAttr actual = confDAO.find("useless");
-        assertEquals(actual.getValuesAsStrings(), newConf.getValuesAsStrings());
-
-        // 3. update conf
-        newConf.getValues().clear();
-        add(newConf, "2014-06-20");
-        confDAO.save(newConf);
-
-        actual = confDAO.find("useless");
-        assertEquals(actual.getValuesAsStrings(), newConf.getValuesAsStrings());
-
-        // 4. delete conf
-        confDAO.delete("useless");
-        assertNull(confDAO.find("useless"));
-    }
-
-    @Test
-    public void issueSYNCOPE418() {
-        try {
-            PlainSchema failing = entityFactory.newEntity(PlainSchema.class);
-            failing.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
-            failing.setType(AttrSchemaType.String);
-            plainSchemaDAO.save(failing);
-
-            fail();
-        } catch (InvalidEntityException e) {
-            assertTrue(e.hasViolation(EntityViolationType.InvalidName));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ConnInstanceTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ConnInstanceTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ConnInstanceTest.java
deleted file mode 100644
index 03b7c5d..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ConnInstanceTest.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.apache.syncope.common.lib.types.ConnConfPropSchema;
-import org.apache.syncope.common.lib.types.ConnConfProperty;
-import org.apache.syncope.core.persistence.api.dao.ConnInstanceDAO;
-import org.apache.syncope.core.persistence.api.entity.ConnInstance;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class ConnInstanceTest extends AbstractTest {
-
-    @Autowired
-    private ConnInstanceDAO connInstanceDAO;
-
-    @Test
-    public void findAll() {
-        List<ConnInstance> connectors = connInstanceDAO.findAll();
-        assertNotNull(connectors);
-        assertFalse(connectors.isEmpty());
-    }
-
-    @Test
-    public void findById() {
-        ConnInstance connectorInstance = connInstanceDAO.find(100L);
-
-        assertNotNull("findById did not work", connectorInstance);
-
-        assertEquals("invalid connector name",
-                "net.tirasa.connid.bundles.soap.WebServiceConnector", connectorInstance.getConnectorName());
-
-        assertEquals("invalid bundle name", "net.tirasa.connid.bundles.soap", connectorInstance.getBundleName());
-    }
-
-    @Test
-    public void save() throws ClassNotFoundException {
-        ConnInstance connInstance = entityFactory.newEntity(ConnInstance.class);
-
-        connInstance.setLocation(new File(System.getProperty("java.io.tmpdir")).toURI().toString());
-
-        // set connector version
-        connInstance.setVersion("1.0");
-
-        // set connector name
-        connInstance.setConnectorName("WebService");
-
-        // set bundle name
-        connInstance.setBundleName("org.apache.syncope.core.persistence.test.util");
-
-        connInstance.setDisplayName("New");
-
-        connInstance.setConnRequestTimeout(60);
-
-        // set the connector configuration using PropertyTO
-        Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
-
-        ConnConfPropSchema endpointSchema = new ConnConfPropSchema();
-        endpointSchema.setName("endpoint");
-        endpointSchema.setType(String.class.getName());
-        endpointSchema.setRequired(true);
-        ConnConfProperty endpoint = new ConnConfProperty();
-        endpoint.setSchema(endpointSchema);
-        endpoint.getValues().add("http://host.domain");
-
-        ConnConfPropSchema servicenameSchema = new ConnConfPropSchema();
-        servicenameSchema.setName("servicename");
-        servicenameSchema.setType(String.class.getName());
-        servicenameSchema.setRequired(true);
-        ConnConfProperty servicename = new ConnConfProperty();
-        servicename.setSchema(servicenameSchema);
-        endpoint.getValues().add("Provisioning");
-
-        conf.add(endpoint);
-        conf.add(servicename);
-
-        // set connector configuration
-        connInstance.setConfiguration(conf);
-        assertFalse(connInstance.getConfiguration().isEmpty());
-
-        // perform save operation
-        ConnInstance actual = connInstanceDAO.save(connInstance);
-
-        assertNotNull("save did not work", actual.getKey());
-
-        assertTrue("save did not work", actual.getKey() > 100L);
-
-        assertEquals("save did not work for \"name\" attribute", "WebService", actual.getConnectorName());
-
-        assertEquals("save did not work for \"bundle name\" attribute", "org.apache.syncope.core.persistence.test.util",
-                actual.getBundleName());
-
-        assertEquals("save did not work for \"majorVersion\" attribute", "1.0", connInstance.getVersion());
-
-        assertEquals("New", actual.getDisplayName());
-
-        assertEquals(new Integer(60), actual.getConnRequestTimeout());
-
-        conf = connInstance.getConfiguration();
-        assertFalse(conf.isEmpty());
-
-        assertNotNull("configuration retrieving failed", conf);
-        assertTrue(conf.size() == 2);
-    }
-
-    @Test
-    public void delete() {
-        ConnInstance connectorInstance = connInstanceDAO.find(100L);
-        assertNotNull("find to delete did not work", connectorInstance);
-
-        connInstanceDAO.delete(connectorInstance.getKey());
-
-        ConnInstance actual = connInstanceDAO.find(100L);
-        assertNull("delete did not work", actual);
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/DerAttrTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/DerAttrTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/DerAttrTest.java
deleted file mode 100644
index f64e314..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/DerAttrTest.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-import org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO;
-import org.apache.syncope.core.persistence.api.dao.DerAttrDAO;
-import org.apache.syncope.core.persistence.api.dao.DerSchemaDAO;
-import org.apache.syncope.core.persistence.api.dao.GroupDAO;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
-import org.apache.syncope.core.persistence.api.entity.DerSchema;
-import org.apache.syncope.core.persistence.api.entity.group.GDerAttr;
-import org.apache.syncope.core.persistence.api.entity.group.GPlainAttrValue;
-import org.apache.syncope.core.persistence.api.entity.group.Group;
-import org.apache.syncope.core.persistence.api.entity.user.UDerAttr;
-import org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class DerAttrTest extends AbstractTest {
-
-    @Autowired
-    private DerAttrDAO derAttrDAO;
-
-    @Autowired
-    private UserDAO userDAO;
-
-    @Autowired
-    private GroupDAO groupDAO;
-
-    @Autowired
-    private DerSchemaDAO derSchemaDAO;
-
-    @Autowired
-    private AnyTypeClassDAO anyTypeClassDAO;
-
-    @Test
-    public void findAll() {
-        List<UDerAttr> list = derAttrDAO.findAll(UDerAttr.class);
-        assertEquals("did not get expected number of derived attributes ", 2, list.size());
-    }
-
-    @Test
-    public void findById() {
-        UDerAttr attribute = derAttrDAO.find(100L, UDerAttr.class);
-        assertNotNull("did not find expected attribute schema", attribute);
-    }
-
-    @Test
-    public void saveUDerAttribute() {
-        DerSchema cnSchema = derSchemaDAO.find("cn");
-        assertNotNull(cnSchema);
-
-        User owner = userDAO.find(3L);
-        assertNotNull("did not get expected user", owner);
-
-        UDerAttr derAttr = entityFactory.newEntity(UDerAttr.class);
-        derAttr.setOwner(owner);
-        derAttr.setSchema(cnSchema);
-
-        derAttr = derAttrDAO.save(derAttr);
-
-        UDerAttr actual = derAttrDAO.find(derAttr.getKey(), UDerAttr.class);
-        assertNotNull("expected save to work", actual);
-        assertEquals(derAttr, actual);
-
-        UPlainAttrValue firstname = owner.getPlainAttr("firstname").getValues().iterator().next();
-        UPlainAttrValue surname = owner.getPlainAttr("surname").getValues().iterator().next();
-
-        assertEquals(surname.getValue() + ", " + firstname.getValue(), derAttr.getValue(owner.getPlainAttrs()));
-    }
-
-    @Test
-    public void saveGDerAttribute() {
-        DerSchema schema = derSchemaDAO.find("rderiveddata");
-        assertNotNull(schema);
-
-        Group owner = groupDAO.find(1L);
-        assertNotNull("did not get expected user", owner);
-
-        GDerAttr derAttr = entityFactory.newEntity(GDerAttr.class);
-        derAttr.setOwner(owner);
-        derAttr.setSchema(schema);
-
-        derAttr = derAttrDAO.save(derAttr);
-
-        GDerAttr actual = derAttrDAO.find(derAttr.getKey(), GDerAttr.class);
-        assertNotNull("expected save to work", actual);
-        assertEquals(derAttr, actual);
-
-        GPlainAttrValue sx = owner.getPlainAttr("rderived_sx").getValues().iterator().next();
-        GPlainAttrValue dx = owner.getPlainAttr("rderived_dx").getValues().iterator().next();
-
-        assertEquals(sx.getValue() + "-" + dx.getValue(), derAttr.getValue(owner.getPlainAttrs()));
-    }
-
-    @Test
-    public void delete() {
-        UDerAttr attribute = derAttrDAO.find(100L, UDerAttr.class);
-        String schemaName = attribute.getSchema().getKey();
-
-        derAttrDAO.delete(attribute.getKey(), UDerAttr.class);
-
-        UDerAttr actual = derAttrDAO.find(100L, UDerAttr.class);
-        assertNull("delete did not work", actual);
-
-        DerSchema attributeSchema = derSchemaDAO.find(schemaName);
-        assertNotNull("user derived attribute schema deleted when deleting values", attributeSchema);
-    }
-
-    @Test
-    public void issueSYNCOPE134User() {
-        AnyTypeClass other = anyTypeClassDAO.find("other");
-
-        DerSchema sderived = entityFactory.newEntity(DerSchema.class);
-        sderived.setKey("sderived");
-        sderived.setExpression("status + ' - ' + username + ' - ' + creationDate + '[' + failedLogins + ']'");
-
-        sderived = derSchemaDAO.save(sderived);
-
-        derSchemaDAO.flush();
-
-        other.add(sderived);
-        sderived.setAnyTypeClass(other);
-
-        derSchemaDAO.flush();
-
-        sderived = derSchemaDAO.find("sderived");
-        assertNotNull("expected save to work", sderived);
-        assertEquals(other, sderived.getAnyTypeClass());
-
-        User owner = userDAO.find(3L);
-        assertNotNull("did not get expected user", owner);
-        owner.add(other);
-
-        UDerAttr derAttr = entityFactory.newEntity(UDerAttr.class);
-        derAttr.setOwner(owner);
-        derAttr.setSchema(sderived);
-
-        derAttr = derAttrDAO.save(derAttr);
-        derAttrDAO.flush();
-
-        derAttr = derAttrDAO.find(derAttr.getKey(), UDerAttr.class);
-        assertNotNull("expected save to work", derAttr);
-
-        String value = derAttr.getValue(owner.getPlainAttrs());
-        assertNotNull(value);
-        assertFalse(value.isEmpty());
-        assertTrue(value.startsWith("active - vivaldi - 2010-10-20"));
-        assertTrue(value.endsWith("[0]"));
-    }
-
-    @Test
-    public void issueSYNCOPE134Group() {
-        AnyTypeClass genericMembership = anyTypeClassDAO.find("generic membership");
-
-        DerSchema sderived = entityFactory.newEntity(DerSchema.class);
-        sderived.setKey("sderived");
-        sderived.setExpression("name");
-
-        sderived = derSchemaDAO.save(sderived);
-
-        derSchemaDAO.flush();
-
-        genericMembership.add(sderived);
-        sderived.setAnyTypeClass(genericMembership);
-
-        derSchemaDAO.flush();
-
-        sderived = derSchemaDAO.find("sderived");
-        assertNotNull("expected save to work", sderived);
-        assertEquals(genericMembership, sderived.getAnyTypeClass());
-
-        Group owner = groupDAO.find(7L);
-        assertNotNull("did not get expected group", owner);
-        owner.add(genericMembership);
-
-        GDerAttr derAttr = entityFactory.newEntity(GDerAttr.class);
-        derAttr.setOwner(owner);
-        derAttr.setSchema(sderived);
-
-        derAttr = derAttrDAO.save(derAttr);
-        derAttrDAO.flush();
-
-        derAttr = derAttrDAO.find(derAttr.getKey(), GDerAttr.class);
-        assertNotNull("expected save to work", derAttr);
-
-        String value = derAttr.getValue(owner.getPlainAttrs());
-        assertNotNull(value);
-        assertFalse(value.isEmpty());
-        assertTrue(value.startsWith("managingDirector"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/DerSchemaTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/DerSchemaTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/DerSchemaTest.java
deleted file mode 100644
index b123513..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/DerSchemaTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
-import org.apache.syncope.core.persistence.api.dao.DerSchemaDAO;
-import org.apache.syncope.core.persistence.api.entity.DerSchema;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class DerSchemaTest extends AbstractTest {
-
-    @Autowired
-    private DerSchemaDAO derSchemaDAO;
-
-    @Test
-    public void findAll() {
-        List<DerSchema> list = derSchemaDAO.findAll();
-        assertEquals(9, list.size());
-    }
-
-    @Test
-    public void findByName() {
-        DerSchema attributeSchema = derSchemaDAO.find("cn");
-        assertNotNull("did not find expected derived attribute schema", attributeSchema);
-    }
-
-    @Test
-    public void save() {
-        DerSchema derivedAttributeSchema = entityFactory.newEntity(DerSchema.class);
-        derivedAttributeSchema.setKey("cn2");
-        derivedAttributeSchema.setExpression("firstname surname");
-
-        derSchemaDAO.save(derivedAttributeSchema);
-
-        DerSchema actual = derSchemaDAO.find("cn2");
-        assertNotNull("expected save to work", actual);
-        assertEquals(derivedAttributeSchema, actual);
-    }
-
-    @Test
-    public void delete() {
-        DerSchema cn = derSchemaDAO.find("cn");
-        assertNotNull(cn);
-
-        derSchemaDAO.delete(cn.getKey());
-
-        DerSchema actual = derSchemaDAO.find("cn");
-        assertNull("delete did not work", actual);
-
-        // ------------- //
-        DerSchema rderiveddata = derSchemaDAO.find("rderiveddata");
-        assertNotNull(rderiveddata);
-
-        derSchemaDAO.delete(rderiveddata.getKey());
-
-        actual = derSchemaDAO.find("rderiveddata");
-        assertNull("delete did not work", actual);
-    }
-
-    @Test
-    public void issueSYNCOPE418() {
-        DerSchema schema = entityFactory.newEntity(DerSchema.class);
-        schema.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
-
-        try {
-            derSchemaDAO.save(schema);
-            fail();
-        } catch (InvalidEntityException e) {
-            assertTrue(e.hasViolation(EntityViolationType.InvalidName));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/GroupTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/GroupTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/GroupTest.java
deleted file mode 100644
index 7593b06..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/GroupTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.util.List;
-import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.core.persistence.api.dao.GroupDAO;
-import org.apache.syncope.core.persistence.api.dao.RealmDAO;
-import org.apache.syncope.core.persistence.api.entity.group.Group;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class GroupTest extends AbstractTest {
-
-    @Autowired
-    private GroupDAO groupDAO;
-
-    @Autowired
-    private RealmDAO realmDAO;
-
-    @Test
-    public void findAll() {
-        List<Group> list = groupDAO.findAll(SyncopeConstants.FULL_ADMIN_REALMS, 1, 100);
-        assertEquals("did not get expected number of groups ", 14, list.size());
-    }
-
-    @Test
-    public void find() {
-        Group group = groupDAO.find("root");
-        assertNotNull("did not find expected group", group);
-    }
-
-    @Test
-    public void save() {
-        Group group = entityFactory.newEntity(Group.class);
-        group.setName("secondChild");
-        group.setRealm(realmDAO.find(SyncopeConstants.ROOT_REALM));
-
-        group = groupDAO.save(group);
-
-        Group actual = groupDAO.find(group.getKey());
-        assertNotNull("expected save to work", actual);
-    }
-
-    @Test
-    public void delete() {
-        Group group = groupDAO.find(4L);
-        groupDAO.delete(group.getKey());
-
-        Group actual = groupDAO.find(4L);
-        assertNull("delete did not work", actual);
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/NotificationTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/NotificationTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/NotificationTest.java
deleted file mode 100644
index df629ff..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/NotificationTest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.util.List;
-import org.apache.syncope.common.lib.types.IntMappingType;
-import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
-import org.apache.syncope.core.persistence.api.dao.NotificationDAO;
-import org.apache.syncope.core.persistence.api.entity.AnyAbout;
-import org.apache.syncope.core.persistence.api.entity.Notification;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class NotificationTest extends AbstractTest {
-
-    @Autowired
-    private AnyTypeDAO anyTypeDAO;
-
-    @Autowired
-    private NotificationDAO notificationDAO;
-
-    @Test
-    public void find() {
-        Notification notification = notificationDAO.find(10L);
-        assertNotNull(notification);
-        assertNotNull(notification.getEvents());
-        assertFalse(notification.getEvents().isEmpty());
-        assertNotNull(notification.getAbout(anyTypeDAO.findUser()));
-        assertNotNull(notification.getRecipients());
-
-    }
-
-    @Test
-    public void findAll() {
-        List<Notification> notifications = notificationDAO.findAll();
-        assertNotNull(notifications);
-        assertFalse(notifications.isEmpty());
-    }
-
-    @Test
-    public void save() {
-        Notification notification = entityFactory.newEntity(Notification.class);
-        notification.getEvents().add("save");
-
-        AnyAbout about = entityFactory.newEntity(AnyAbout.class);
-        about.setNotification(notification);
-        notification.add(about);
-        about.setAnyType(anyTypeDAO.findUser());
-        about.set("fake search condition");
-
-        notification.setRecipients("fake recipients");
-
-        notification.setRecipientAttrName("email");
-        notification.setRecipientAttrType(IntMappingType.UserPlainSchema);
-
-        notification.setSender("syncope@syncope.apache.org");
-        notification.setSubject("Test notification");
-        notification.setTemplate("test");
-
-        Notification actual = notificationDAO.save(notification);
-        assertNotNull(actual);
-        assertNotNull(actual.getKey());
-    }
-
-    @Test
-    public void delete() {
-        notificationDAO.delete(10L);
-        assertNull(notificationDAO.find(10L));
-    }
-
-    @Test
-    public void issueSYNCOPE445() {
-        Notification notification = entityFactory.newEntity(Notification.class);
-        notification.getEvents().add("save");
-
-        AnyAbout about = entityFactory.newEntity(AnyAbout.class);
-        about.setNotification(notification);
-        notification.add(about);
-        about.setAnyType(anyTypeDAO.findUser());
-        about.set("fake search condition");
-
-        notification.setRecipients("fake search condition");
-
-        notification.setRecipientAttrName("email");
-        notification.setRecipientAttrType(IntMappingType.UserPlainSchema);
-
-        notification.getStaticRecipients().add("syncope445@syncope.apache.org");
-
-        notification.setSender("syncope@syncope.apache.org");
-        notification.setSubject("Test notification");
-        notification.setTemplate("test");
-
-        Notification actual = notificationDAO.save(notification);
-        assertNotNull(actual);
-        assertNotNull(actual.getKey());
-        assertNotNull(actual.getStaticRecipients());
-        assertFalse(actual.getStaticRecipients().isEmpty());
-    }
-
-    @Test
-    public void issueSYNCOPE446() {
-        Notification notification = entityFactory.newEntity(Notification.class);
-        notification.getEvents().add("[REST]:[GroupLogic]:[]:[create]:[SUCCESS]");
-
-        AnyAbout about = entityFactory.newEntity(AnyAbout.class);
-        about.setNotification(notification);
-        notification.add(about);
-        about.setAnyType(anyTypeDAO.findUser());
-        about.set("fake search condition");
-
-        notification.setRecipientAttrName("email");
-        notification.setRecipientAttrType(IntMappingType.UserPlainSchema);
-
-        notification.getStaticRecipients().add("syncope446@syncope.apache.org");
-
-        notification.setSender("syncope@syncope.apache.org");
-        notification.setSubject("Test notification");
-        notification.setTemplate("test");
-
-        Notification actual = notificationDAO.save(notification);
-        assertNotNull(actual);
-        assertNotNull(actual.getKey());
-        assertNotNull(actual.getStaticRecipients());
-        assertFalse(actual.getStaticRecipients().isEmpty());
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PlainAttrTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PlainAttrTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PlainAttrTest.java
deleted file mode 100644
index 014ee64..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PlainAttrTest.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Arrays;
-import java.util.Random;
-import javax.validation.ValidationException;
-import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
-import org.apache.syncope.core.persistence.api.dao.PlainAttrDAO;
-import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.entity.user.UPlainAttr;
-import org.apache.syncope.core.persistence.api.entity.user.UPlainAttrUniqueValue;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.apache.syncope.core.misc.security.Encryptor;
-import org.apache.syncope.core.persistence.api.entity.PlainSchema;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.crypto.codec.Base64;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class PlainAttrTest extends AbstractTest {
-
-    @Autowired
-    private UserDAO userDAO;
-
-    @Autowired
-    private PlainAttrDAO plainAttrDAO;
-
-    @Autowired
-    private PlainSchemaDAO plainSchemaDAO;
-
-    @Test
-    public void findById() {
-        UPlainAttr attribute = plainAttrDAO.find(100L, UPlainAttr.class);
-        assertNotNull("did not find expected attribute schema", attribute);
-        attribute = plainAttrDAO.find(104L, UPlainAttr.class);
-        assertNotNull("did not find expected attribute schema", attribute);
-    }
-
-    @Test
-    public void read() {
-        UPlainAttr attribute = plainAttrDAO.find(100L, UPlainAttr.class);
-        assertNotNull(attribute);
-        assertTrue(attribute.getValues().isEmpty());
-        assertNotNull(attribute.getUniqueValue());
-    }
-
-    @Test
-    public void save() throws ClassNotFoundException {
-        User user = userDAO.find(1L);
-
-        PlainSchema emailSchema = plainSchemaDAO.find("email");
-        assertNotNull(emailSchema);
-
-        UPlainAttr attr = entityFactory.newEntity(UPlainAttr.class);
-        attr.setOwner(user);
-        attr.setSchema(emailSchema);
-
-        Exception thrown = null;
-        try {
-            attr.add("john.doe@gmail.com", anyUtilsFactory.getInstance(AnyTypeKind.USER));
-            attr.add("mario.rossi@gmail.com", anyUtilsFactory.getInstance(AnyTypeKind.USER));
-        } catch (ValidationException e) {
-            thrown = e;
-        }
-        assertNull("no validation exception expected here ", thrown);
-
-        try {
-            attr.add("http://www.apache.org", anyUtilsFactory.getInstance(AnyTypeKind.USER));
-        } catch (ValidationException e) {
-            thrown = e;
-        }
-        assertNotNull("validation exception expected here ", thrown);
-    }
-
-    @Test
-    public void saveWithEnum() throws ClassNotFoundException {
-        User user = userDAO.find(1L);
-        assertNotNull(user);
-
-        PlainSchema gender = plainSchemaDAO.find("gender");
-        assertNotNull(gender);
-        assertNotNull(gender.getType());
-        assertNotNull(gender.getEnumerationValues());
-
-        UPlainAttr attribute = entityFactory.newEntity(UPlainAttr.class);
-        attribute.setOwner(user);
-        attribute.setSchema(gender);
-        user.add(attribute);
-
-        Exception thrown = null;
-
-        try {
-            attribute.add("A", anyUtilsFactory.getInstance(AnyTypeKind.USER));
-        } catch (ValidationException e) {
-            thrown = e;
-        }
-        assertNotNull("validation exception expected here ", thrown);
-
-        attribute.add("M", anyUtilsFactory.getInstance(AnyTypeKind.USER));
-
-        InvalidEntityException iee = null;
-        try {
-            userDAO.save(user);
-        } catch (InvalidEntityException e) {
-            iee = e;
-        }
-        assertNull(iee);
-    }
-
-    @Test
-    public void validateAndSave() {
-        User user = userDAO.find(1L);
-
-        PlainSchema emailSchema = plainSchemaDAO.find("email");
-        assertNotNull(emailSchema);
-
-        PlainSchema fullnameSchema = plainSchemaDAO.find("fullname");
-        assertNotNull(fullnameSchema);
-
-        UPlainAttr attr = entityFactory.newEntity(UPlainAttr.class);
-        attr.setOwner(user);
-        attr.setSchema(emailSchema);
-
-        UPlainAttrUniqueValue uauv = entityFactory.newEntity(UPlainAttrUniqueValue.class);
-        uauv.setAttr(attr);
-        uauv.setSchema(fullnameSchema);
-        uauv.setStringValue("a value");
-
-        attr.setUniqueValue(uauv);
-
-        user.add(attr);
-
-        InvalidEntityException iee = null;
-        try {
-            userDAO.save(user);
-            fail();
-        } catch (InvalidEntityException e) {
-            iee = e;
-        }
-        assertNotNull(iee);
-        // for attribute
-        assertTrue(iee.hasViolation(EntityViolationType.InvalidValueList));
-        // for uauv
-        assertTrue(iee.hasViolation(EntityViolationType.InvalidPlainSchema));
-    }
-
-    @Test
-    public void saveWithEncrypted() throws Exception {
-        User user = userDAO.find(1L);
-
-        PlainSchema obscureSchema = plainSchemaDAO.find("obscure");
-        assertNotNull(obscureSchema);
-        assertNotNull(obscureSchema.getSecretKey());
-        assertNotNull(obscureSchema.getCipherAlgorithm());
-
-        UPlainAttr attr = entityFactory.newEntity(UPlainAttr.class);
-        attr.setOwner(user);
-        attr.setSchema(obscureSchema);
-        attr.add("testvalue", anyUtilsFactory.getInstance(AnyTypeKind.USER));
-        user.add(attr);
-
-        userDAO.save(user);
-
-        UPlainAttr obscure = user.getPlainAttr("obscure");
-        assertNotNull(obscure);
-        assertEquals(1, obscure.getValues().size());
-        assertEquals(Encryptor.getInstance(obscureSchema.getSecretKey()).
-                encode("testvalue", obscureSchema.getCipherAlgorithm()), obscure.getValues().get(0).getStringValue());
-    }
-
-    @Test
-    public void saveWithBinary() throws UnsupportedEncodingException {
-        User user = userDAO.find(1L);
-
-        PlainSchema photoSchema = plainSchemaDAO.find("photo");
-        assertNotNull(photoSchema);
-        assertNotNull(photoSchema.getMimeType());
-
-        final byte[] bytes = new byte[20];
-        new Random().nextBytes(bytes);
-        final String photoB64Value = new String(Base64.encode(bytes), SyncopeConstants.DEFAULT_ENCODING);
-
-        UPlainAttr attr = entityFactory.newEntity(UPlainAttr.class);
-        attr.setOwner(user);
-        attr.setSchema(photoSchema);
-        attr.add(photoB64Value, anyUtilsFactory.getInstance(AnyTypeKind.USER));
-        user.add(attr);
-
-        userDAO.save(user);
-
-        UPlainAttr obscure = user.getPlainAttr("photo");
-        assertNotNull(obscure);
-        assertEquals(1, obscure.getValues().size());
-        assertTrue(Arrays.equals(bytes, obscure.getValues().get(0).getBinaryValue()));
-    }
-
-    @Test
-    public void delete() {
-        UPlainAttr attribute = plainAttrDAO.find(104L, UPlainAttr.class);
-        String attrSchemaName = attribute.getSchema().getKey();
-
-        plainAttrDAO.delete(attribute.getKey(), UPlainAttr.class);
-
-        PlainSchema schema = plainSchemaDAO.find(attrSchemaName);
-        assertNotNull("user attribute schema deleted when deleting values", schema);
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PlainSchemaTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PlainSchemaTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PlainSchemaTest.java
deleted file mode 100644
index 7e86689..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PlainSchemaTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.lib.types.AttrSchemaType;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
-import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
-import org.apache.syncope.core.persistence.api.entity.PlainSchema;
-import org.apache.syncope.core.persistence.api.entity.group.GPlainAttr;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class PlainSchemaTest extends AbstractTest {
-
-    @Autowired
-    private PlainSchemaDAO plainSchemaDAO;
-
-    @Test
-    public void findAll() {
-        List<PlainSchema> schemas = plainSchemaDAO.findAll();
-        assertEquals(42, schemas.size());
-    }
-
-    @Test
-    public void findByName() {
-        PlainSchema schema = plainSchemaDAO.find("fullname");
-        assertNotNull("did not find expected attribute schema", schema);
-    }
-
-    @Test
-    public void findAttrs() {
-        PlainSchema schema = plainSchemaDAO.find("icon");
-        assertNotNull(schema);
-
-        List<GPlainAttr> attrs = plainSchemaDAO.findAttrs(schema, GPlainAttr.class);
-        assertNotNull(attrs);
-        assertFalse(attrs.isEmpty());
-    }
-
-    @Test
-    public void save() {
-        PlainSchema schema = entityFactory.newEntity(PlainSchema.class);
-        schema.setKey("secondaryEmail");
-        schema.setType(AttrSchemaType.String);
-        schema.setValidatorClass("org.apache.syncope.core.validation.EmailAddressValidator");
-        schema.setMandatoryCondition("false");
-        schema.setMultivalue(true);
-
-        plainSchemaDAO.save(schema);
-
-        PlainSchema actual = plainSchemaDAO.find("secondaryEmail");
-        assertNotNull("expected save to work", actual);
-        assertEquals(schema, actual);
-    }
-
-    @Test(expected = InvalidEntityException.class)
-    public void saveNonValid() {
-        PlainSchema schema = entityFactory.newEntity(PlainSchema.class);
-        schema.setKey("secondaryEmail");
-        schema.setType(AttrSchemaType.String);
-        schema.setValidatorClass("org.apache.syncope.core.validation.EmailAddressValidator");
-        schema.setMandatoryCondition("false");
-        schema.setMultivalue(true);
-        schema.setUniqueConstraint(true);
-
-        plainSchemaDAO.save(schema);
-    }
-
-    @Test
-    public void checkForEnumType() {
-        PlainSchema schema = entityFactory.newEntity(PlainSchema.class);
-        schema.setType(AttrSchemaType.Enum);
-        schema.setKey("color");
-
-        Exception ex = null;
-        try {
-            plainSchemaDAO.save(schema);
-        } catch (Exception e) {
-            ex = e;
-        }
-        assertNotNull(ex);
-
-        schema.setEnumerationValues("red" + SyncopeConstants.ENUM_VALUES_SEPARATOR + "yellow");
-        schema.setEnumerationKeys("1" + SyncopeConstants.ENUM_VALUES_SEPARATOR + "2");
-
-        plainSchemaDAO.save(schema);
-
-        PlainSchema actual = plainSchemaDAO.find(schema.getKey());
-        assertNotNull(actual);
-        assertNotNull(actual.getEnumerationKeys());
-        assertFalse(actual.getEnumerationKeys().isEmpty());
-    }
-
-    @Test(expected = InvalidEntityException.class)
-    public void saveInvalidSchema() {
-        PlainSchema schema = entityFactory.newEntity(PlainSchema.class);
-        schema.setKey("username");
-        plainSchemaDAO.save(schema);
-    }
-
-    @Test
-    public void delete() {
-        PlainSchema firstname = plainSchemaDAO.find("firstname");
-
-        plainSchemaDAO.delete(firstname.getKey());
-
-        PlainSchema actual = plainSchemaDAO.find("firstname");
-        assertNull("delete did not work", actual);
-    }
-
-    @Test
-    public void issueSYNCOPE418() {
-        PlainSchema schema = entityFactory.newEntity(PlainSchema.class);
-        schema.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
-
-        try {
-            plainSchemaDAO.save(schema);
-            fail();
-        } catch (InvalidEntityException e) {
-            assertTrue(e.hasViolation(EntityViolationType.InvalidName));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PolicyTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PolicyTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PolicyTest.java
deleted file mode 100644
index 764f0ac..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/PolicyTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.util.List;
-import org.apache.syncope.common.lib.types.PasswordPolicySpec;
-import org.apache.syncope.common.lib.types.PolicyType;
-import org.apache.syncope.common.lib.types.SyncPolicySpec;
-import org.apache.syncope.common.lib.types.SyncPolicySpecItem;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
-import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
-import org.apache.syncope.core.persistence.api.dao.PolicyDAO;
-import org.apache.syncope.core.persistence.api.entity.Policy;
-import org.apache.syncope.core.persistence.api.entity.SyncPolicy;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class PolicyTest extends AbstractTest {
-
-    @Autowired
-    private AnyTypeDAO anyTypeDAO;
-
-    @Autowired
-    private PolicyDAO policyDAO;
-
-    @Test
-    public void findAll() {
-        List<Policy> policies = policyDAO.findAll();
-        assertNotNull(policies);
-        assertFalse(policies.isEmpty());
-    }
-
-    @Test
-    public void findById() {
-        Policy policy = policyDAO.find(1L);
-        assertNotNull("findById did not work", policy);
-    }
-
-    @Test
-    public void findByType() {
-        List<? extends Policy> policies = policyDAO.find(PolicyType.SYNC);
-        assertNotNull("findById did not work", policies);
-        assertFalse(policies.isEmpty());
-    }
-
-    @Test(expected = InvalidEntityException.class)
-    public void saveInvalidPolicy() {
-        PasswordPolicySpec passwordPolicy = new PasswordPolicySpec();
-        passwordPolicy.setMaxLength(8);
-        passwordPolicy.setMinLength(6);
-
-        SyncPolicy policy = entityFactory.newEntity(SyncPolicy.class);
-        policy.setSpecification(passwordPolicy);
-        policy.setDescription("sync policy");
-
-        policyDAO.save(policy);
-    }
-
-    @Test
-    public void create() {
-        SyncPolicy policy = entityFactory.newEntity(SyncPolicy.class);
-
-        final String syncURuleName = "net.tirasa.sync.correlation.TirasaURule";
-        final String syncGRuleName = "net.tirasa.sync.correlation.TirasaGRule";
-
-        SyncPolicySpec syncPolicySpec = new SyncPolicySpec();
-
-        SyncPolicySpecItem item = new SyncPolicySpecItem();
-        item.setAnyTypeKey(anyTypeDAO.findUser().getKey());
-        item.setJavaRule(syncURuleName);
-        syncPolicySpec.getItems().add(item);
-
-        item = new SyncPolicySpecItem();
-        item.setAnyTypeKey(anyTypeDAO.findGroup().getKey());
-        item.setJavaRule(syncGRuleName);
-        syncPolicySpec.getItems().add(item);
-
-        policy.setSpecification(syncPolicySpec);
-        policy.setDescription("Sync policy");
-
-        policy = policyDAO.save(policy);
-
-        assertNotNull(policy);
-        assertEquals(PolicyType.SYNC, policy.getType());
-        assertEquals(syncURuleName,
-                (policy.getSpecification(SyncPolicySpec.class)).getItem(anyTypeDAO.findUser().getKey()).getJavaRule());
-        assertEquals(syncGRuleName,
-                (policy.getSpecification(SyncPolicySpec.class)).getItem(anyTypeDAO.findGroup().getKey()).getJavaRule());
-    }
-
-    @Test
-    public void update() {
-        PasswordPolicySpec specification = new PasswordPolicySpec();
-        specification.setMaxLength(8);
-        specification.setMinLength(6);
-
-        Policy policy = policyDAO.find(2L);
-        assertNotNull(policy);
-        policy.setSpecification(specification);
-
-        policy = policyDAO.save(policy);
-
-        assertNotNull(policy);
-        assertEquals(PolicyType.PASSWORD, policy.getType());
-        assertEquals((policy.getSpecification(PasswordPolicySpec.class)).getMaxLength(), 8);
-        assertEquals((policy.getSpecification(PasswordPolicySpec.class)).getMinLength(), 6);
-    }
-
-    @Test
-    public void delete() {
-        Policy policy = policyDAO.find(1L);
-        assertNotNull("find to delete did not work", policy);
-
-        policyDAO.delete(policy);
-
-        Policy actual = policyDAO.find(1L);
-        assertNull("delete did not work", actual);
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/RealmTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/RealmTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/RealmTest.java
deleted file mode 100644
index e5e55fe..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/RealmTest.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
-import org.apache.syncope.core.persistence.api.dao.MalformedPathException;
-import org.apache.syncope.core.persistence.api.dao.PolicyDAO;
-import org.apache.syncope.core.persistence.api.dao.RealmDAO;
-import org.apache.syncope.core.persistence.api.entity.AccountPolicy;
-import org.apache.syncope.core.persistence.api.entity.PasswordPolicy;
-import org.apache.syncope.core.persistence.api.entity.Realm;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class RealmTest extends AbstractTest {
-
-    @Autowired
-    private RealmDAO realmDAO;
-
-    @Autowired
-    private PolicyDAO policyDAO;
-
-    @Test
-    public void getRoot() {
-        assertNotNull(realmDAO.getRoot());
-    }
-
-    @Test
-    public void find() {
-        Realm realm = realmDAO.find(1L);
-        assertNotNull(realm);
-        assertEquals(SyncopeConstants.ROOT_REALM, realm.getName());
-        assertEquals(SyncopeConstants.ROOT_REALM, realm.getFullPath());
-
-        realm = realmDAO.find(3L);
-        assertNotNull(realm);
-        assertEquals("even", realm.getName());
-        assertEquals("/even", realm.getFullPath());
-        assertEquals(1, realm.getParent().getKey(), 0);
-        assertEquals(realmDAO.getRoot(), realm.getParent());
-
-        realm = realmDAO.find("/even/two");
-        assertNotNull(realm);
-        assertEquals(4, realm.getKey(), 0);
-        assertEquals("two", realm.getName());
-        assertEquals("/even/two", realm.getFullPath());
-    }
-
-    @Test(expected = MalformedPathException.class)
-    public void findInvalidPath() {
-        realmDAO.find("even/two");
-    }
-
-    @Test
-    public void findChildren() {
-        List<Realm> children = realmDAO.findChildren(realmDAO.find(SyncopeConstants.ROOT_REALM));
-        assertEquals(2, children.size());
-        assertTrue(children.contains(realmDAO.find("/odd")));
-        assertTrue(children.contains(realmDAO.find("/even")));
-
-        children = realmDAO.findChildren(realmDAO.find("/odd"));
-        assertTrue(children.isEmpty());
-    }
-
-    @Test
-    public void findDescendants() {
-        assertTrue(CollectionUtils.disjunction(realmDAO.findAll(), realmDAO.findDescendants(realmDAO.getRoot())).
-                isEmpty());
-    }
-
-    @Test
-    public void findAll() {
-        List<Realm> list = realmDAO.findAll();
-        assertNotNull(list);
-        assertFalse(list.isEmpty());
-        for (Realm realm : list) {
-            assertNotNull(realm);
-        }
-    }
-
-    @Test
-    public void save() {
-        Realm realm = entityFactory.newEntity(Realm.class);
-        realm.setName("last");
-        realm.setParent(realmDAO.find("/even/two"));
-        assertNull(realm.getKey());
-
-        Realm actual = realmDAO.save(realm);
-        assertNotNull(actual.getKey());
-        assertEquals("last", actual.getName());
-        assertEquals("/even/two/last", actual.getFullPath());
-        assertEquals(realmDAO.find("/even/two"), actual.getParent());
-        assertEquals(5L, realm.getAccountPolicy().getKey(), 0);
-        assertEquals(2L, realm.getPasswordPolicy().getKey(), 0);
-
-        realm = actual;
-        realm.setAccountPolicy((AccountPolicy) policyDAO.find(6L));
-        realm.setPasswordPolicy((PasswordPolicy) policyDAO.find(4L));
-
-        actual = realmDAO.save(realm);
-        assertEquals(6L, actual.getAccountPolicy().getKey(), 0);
-        assertEquals(4L, actual.getPasswordPolicy().getKey(), 0);
-    }
-
-    @Test
-    public void saveInvalidName() {
-        Realm realm = entityFactory.newEntity(Realm.class);
-        realm.setName(" a name");
-        realm.setParent(realmDAO.getRoot());
-
-        try {
-            realmDAO.save(realm);
-            fail();
-        } catch (InvalidEntityException e) {
-            assertTrue(e.hasViolation(EntityViolationType.InvalidRealm));
-        }
-    }
-
-    @Test
-    public void saveNullParent() {
-        Realm realm = entityFactory.newEntity(Realm.class);
-        realm.setName("name");
-        realm.setParent(null);
-
-        try {
-            realmDAO.save(realm);
-            fail();
-        } catch (InvalidEntityException e) {
-            assertTrue(e.hasViolation(EntityViolationType.InvalidRealm));
-        }
-    }
-
-    @Test
-    public void delete() {
-        Realm realm = entityFactory.newEntity(Realm.class);
-        realm.setName("name");
-        realm.setParent(realmDAO.getRoot());
-
-        Realm actual = realmDAO.save(realm);
-        assertNotNull(actual);
-
-        Long key = actual.getKey();
-        assertNotNull(realmDAO.find(key));
-
-        realmDAO.delete(key);
-        assertNull(realmDAO.find(key));
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8927ef4/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ReportTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ReportTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ReportTest.java
deleted file mode 100644
index 4521a48..0000000
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/ReportTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.util.List;
-import org.apache.syncope.common.lib.report.UserReportletConf;
-import org.apache.syncope.core.persistence.api.dao.ReportDAO;
-import org.apache.syncope.core.persistence.api.entity.Report;
-import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class ReportTest extends AbstractTest {
-
-    @Autowired
-    private ReportDAO reportDAO;
-
-    @Test
-    public void find() {
-        Report report = reportDAO.find(1L);
-        assertNotNull(report);
-
-        report = reportDAO.find(10L);
-        assertNull(report);
-    }
-
-    @Test
-    public void findAll() {
-        List<Report> reports = reportDAO.findAll();
-        assertNotNull(reports);
-        assertEquals(1, reports.size());
-    }
-
-    @Test
-    public void save() {
-        int beforeCount = reportDAO.count();
-
-        Report report = entityFactory.newEntity(Report.class);
-        report.setName("new report");
-        report.addReportletConf(new UserReportletConf("first"));
-        report.addReportletConf(new UserReportletConf("second"));
-
-        report = reportDAO.save(report);
-        assertNotNull(report);
-        assertNotNull(report.getKey());
-
-        int afterCount = reportDAO.count();
-        assertEquals(afterCount, beforeCount + 1);
-    }
-
-    @Test
-    public void delete() {
-        Report report = reportDAO.find(1L);
-        assertNotNull(report);
-
-        reportDAO.delete(1L);
-
-        report = reportDAO.find(1L);
-        assertNull(report);
-    }
-}


Mime
View raw message