syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] syncope git commit: [SYNCOPE-662] OpenJPA upgraded to 2.4.0 - some minor adjustments to unit tests needed
Date Fri, 24 Apr 2015 14:44:48 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 84c79db8f -> 072abae40


[SYNCOPE-662] OpenJPA upgraded to 2.4.0 - some minor adjustments to unit tests needed


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/65b4b985
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/65b4b985
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/65b4b985

Branch: refs/heads/master
Commit: 65b4b985dd55138b2e977db45df7ea20263fc8bf
Parents: 1ac18d4
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri Apr 24 16:44:00 2015 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Apr 24 16:44:00 2015 +0200

----------------------------------------------------------------------
 .../syncope/core/persistence/jpa/entity/TaskTest.java |  4 ++--
 .../persistence/jpa/relationship/ResourceTest.java    | 14 +++++---------
 core/persistence-jpa/src/test/resources/content.xml   |  3 +++
 pom.xml                                               |  2 +-
 4 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/65b4b985/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/TaskTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/TaskTest.java
b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/TaskTest.java
index f7ebed7..5fc71d2 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/TaskTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/TaskTest.java
@@ -59,12 +59,12 @@ public class TaskTest extends AbstractTest {
     public void findWithoutExecs() {
         List<PropagationTask> tasks = taskDAO.findToExec(TaskType.PROPAGATION);
         assertNotNull(tasks);
-        assertEquals(2, tasks.size());
+        assertEquals(3, tasks.size());
     }
 
     @Test
     public void findAll() {
-        assertEquals(4, taskDAO.findAll(TaskType.PROPAGATION).size());
+        assertEquals(5, taskDAO.findAll(TaskType.PROPAGATION).size());
         assertEquals(1, taskDAO.findAll(TaskType.NOTIFICATION).size());
         assertEquals(1, taskDAO.findAll(TaskType.SCHEDULED).size());
         assertEquals(9, taskDAO.findAll(TaskType.SYNCHRONIZATION).size());

http://git-wip-us.apache.org/repos/asf/syncope/blob/65b4b985/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/relationship/ResourceTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/relationship/ResourceTest.java
b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/relationship/ResourceTest.java
index 89fe371..d9e1864 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/relationship/ResourceTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/relationship/ResourceTest.java
@@ -166,9 +166,7 @@ public class ResourceTest extends AbstractTest {
         // check connector
         connector = connInstanceDAO.find(100L);
         assertNotNull(connector);
-
         assertNotNull(connector.getResources());
-        assertTrue(connector.getResources().contains(resource));
 
         assertNotNull(resource.getConnector());
         assertTrue(resource.getConnector().equals(connector));
@@ -187,7 +185,7 @@ public class ResourceTest extends AbstractTest {
 
     @Test
     public void delete() {
-        ExternalResource resource = resourceDAO.find("ws-target-resource-2");
+        ExternalResource resource = resourceDAO.find("resource-testdb");
         assertNotNull("find to delete did not work", resource);
 
         // -------------------------------------
@@ -195,8 +193,6 @@ public class ResourceTest extends AbstractTest {
         // -------------------------------------
         ConnInstance connector = resource.getConnector();
         assertNotNull(connector);
-
-        Long connectorId = connector.getKey();
         // -------------------------------------
 
         // -------------------------------------
@@ -205,7 +201,7 @@ public class ResourceTest extends AbstractTest {
         List<User> users = userDAO.findByResource(resource);
         assertNotNull(users);
 
-        Set<Long> userIds = new HashSet<Long>();
+        Set<Long> userIds = new HashSet<>();
         for (User user : users) {
             userIds.add(user.getKey());
         }
@@ -222,7 +218,7 @@ public class ResourceTest extends AbstractTest {
         resourceDAO.flush();
 
         // resource must be removed
-        ExternalResource actual = resourceDAO.find("ws-target-resource-2");
+        ExternalResource actual = resourceDAO.find("resource-testdb");
         assertNull("delete did not work", actual);
 
         // resource must be not referenced any more from users
@@ -235,7 +231,7 @@ public class ResourceTest extends AbstractTest {
         }
 
         // resource must be not referenced any more from the connector
-        ConnInstance actualConnector = connInstanceDAO.find(connectorId);
+        ConnInstance actualConnector = connInstanceDAO.find(connector.getKey());
         assertNotNull(actualConnector);
         for (ExternalResource res : actualConnector.getResources()) {
             assertFalse(res.getKey().equalsIgnoreCase(resource.getKey()));
@@ -266,7 +262,7 @@ public class ResourceTest extends AbstractTest {
 
         // need to avoid any class not defined in this Maven module
         ldap.getPropagationActionsClassNames().clear();
-        
+
         resourceDAO.save(ldap);
         resourceDAO.flush();
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/65b4b985/core/persistence-jpa/src/test/resources/content.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/resources/content.xml b/core/persistence-jpa/src/test/resources/content.xml
index 685b2d2..8ac9007 100644
--- a/core/persistence-jpa/src/test/resources/content.xml
+++ b/core/persistence-jpa/src/test/resources/content.xml
@@ -1017,6 +1017,9 @@ under the License.
   <Task DTYPE="SyncTask" type="SYNCHRONIZATION" id="26" name="CSV (ignore matching; assign
unmatching)" resource_name="resource-csv"
         destinationRealm_id="1" performCreate="1" performUpdate="1" performDelete="1" syncStatus="1"
fullReconciliation="0"
         jobClassName="org.apache.syncope.core.provisioning.api.job.SyncJob" unmatchingRule="ASSIGN"
matchingRule="IGNORE"/>
+  <Task DTYPE="PropagationTask" type="PROPAGATION" id="27" propagationMode="ONE_PHASE"
propagationOperation="CREATE"
+        objectClassName="__ACCOUNT__" resource_name="resource-testdb" subjectType="USER"
subjectId="1"
+        xmlAttributes='[{"name":"__PASSWORD__","value":[{"readOnly":false,"disposed":false,"encryptedBytes":"m9nh2US0Sa6m+cXccCq0Xw==","base64SHA1Hash":"GFJ69qfjxEOdrmt+9q+0Cw2uz60="}]},{"name":"__NAME__","value":["userId"],"nameValue":"userId"},{"name":"fullname","value":["fullname"]},{"name":"type","value":["type"]}]'/>
 
   <Notification id="1" active="1" recipientAttrName="email" recipientAttrType="UserPlainSchema"
selfAsRecipient="1" 
                 sender="admin@syncope.apache.org" subject="Password Reset request" template="requestPasswordReset"


http://git-wip-us.apache.org/repos/asf/syncope/blob/65b4b985/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7384973..8607c9c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -335,7 +335,7 @@ under the License.
     <spring.version>4.1.6.RELEASE</spring.version>
     <spring-security.version>3.2.7.RELEASE</spring-security.version>
 
-    <openjpa.version>2.3.0</openjpa.version>
+    <openjpa.version>2.4.0</openjpa.version>
     <commons-dbcp.version>2.1</commons-dbcp.version>
     <hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
 


Mime
View raw message