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: All verified with Oracle - harder as always...
Date Mon, 21 Mar 2016 12:55:48 GMT
Repository: syncope
Updated Branches:
  refs/heads/master b8bbd7eb2 -> 4ede1ed11


All verified with Oracle - harder as always...


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

Branch: refs/heads/master
Commit: f9af4eb39c111a154b8b2a644dd0f119bb9059f7
Parents: b8bbd7e
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Mon Mar 21 13:36:11 2016 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Mon Mar 21 13:36:11 2016 +0100

----------------------------------------------------------------------
 .../common/lib/report/AuditReportletConf.java   | 10 -----
 .../logic/notification/NotificationJob.java     |  4 +-
 .../core/logic/report/AuditReportlet.java       |  5 ++-
 .../syncope/core/logic/report/ReportJob.java    |  8 +++-
 .../core/logic/report/ReportJobDelegate.java    | 12 ++---
 .../entity/resource/JPAExternalResource.java    |  2 +-
 .../src/main/resources/audit/audit_oracle.sql   | 16 +------
 .../java/job/AbstractSchedTaskJobDelegate.java  |  2 +-
 .../core/provisioning/java/job/TaskJob.java     |  8 +++-
 fit/core-reference/pom.xml                      | 46 ++++++++++----------
 .../syncope/fit/core/PlainSchemaITCase.java     |  5 +--
 11 files changed, 54 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/common/lib/src/main/java/org/apache/syncope/common/lib/report/AuditReportletConf.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/report/AuditReportletConf.java
b/common/lib/src/main/java/org/apache/syncope/common/lib/report/AuditReportletConf.java
index fe5605b..96e49d0 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/report/AuditReportletConf.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/report/AuditReportletConf.java
@@ -27,8 +27,6 @@ public class AuditReportletConf extends AbstractReportletConf {
 
     private static final long serialVersionUID = -4814950086361753689L;
 
-    private int page = 0;
-
     private int size = 10;
 
     public AuditReportletConf() {
@@ -39,14 +37,6 @@ public class AuditReportletConf extends AbstractReportletConf {
         super(name);
     }
 
-    public int getPage() {
-        return page;
-    }
-
-    public void setPage(final int page) {
-        this.page = page;
-    }
-
     public int getSize() {
         return size;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/core/logic/src/main/java/org/apache/syncope/core/logic/notification/NotificationJob.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/notification/NotificationJob.java
b/core/logic/src/main/java/org/apache/syncope/core/logic/notification/NotificationJob.java
index bd28aeb..7a0270f 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/notification/NotificationJob.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/notification/NotificationJob.java
@@ -68,6 +68,7 @@ public class NotificationJob extends AbstractInterruptableJob {
                         try {
                             delegate.execute();
                         } catch (Exception e) {
+                            LOG.error("While sending out notifications", e);
                             throw new RuntimeException(e);
                         }
 
@@ -75,7 +76,8 @@ public class NotificationJob extends AbstractInterruptableJob {
                     }
                 });
             } catch (RuntimeException e) {
-                throw new JobExecutionException(e.getCause());
+                LOG.error("While sending out notifications", e);
+                throw new JobExecutionException("While sending out notifications", e);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/core/logic/src/main/java/org/apache/syncope/core/logic/report/AuditReportlet.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/report/AuditReportlet.java
b/core/logic/src/main/java/org/apache/syncope/core/logic/report/AuditReportlet.java
index 69caef9..ffd94a4 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/report/AuditReportlet.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/report/AuditReportlet.java
@@ -49,8 +49,9 @@ public class AuditReportlet extends AbstractReportlet {
 
     private void doExtractConf(final ContentHandler handler) throws SAXException {
         JdbcTemplate jdbcTemplate = new JdbcTemplate(datasource);
-        List<Map<String, Object>> rows = jdbcTemplate.queryForList(
-                String.format("SELECT * FROM SYNCOPEAUDIT LIMIT %d OFFSET %d", conf.getSize(),
conf.getPage()));
+        jdbcTemplate.setMaxRows(conf.getSize());
+        List<Map<String, Object>> rows = jdbcTemplate.
+                queryForList("SELECT * FROM SYNCOPEAUDIT ORDER BY EVENT_DATE DESC");
 
         handler.startElement("", "", "events", null);
         AttributesImpl atts = new AttributesImpl();

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJob.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJob.java
b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJob.java
index 19c2b86..cd4bf0a 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJob.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJob.java
@@ -24,12 +24,16 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.apache.syncope.core.provisioning.api.job.JobManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Quartz job for executing a given report.
  */
 public class ReportJob extends AbstractInterruptableJob {
 
+    private static final Logger LOG = LoggerFactory.getLogger(ReportJob.class);
+
     /**
      * Key, set by the caller, for identifying the report to be executed.
      */
@@ -60,6 +64,7 @@ public class ReportJob extends AbstractInterruptableJob {
                     try {
                         delegate.execute(reportKey);
                     } catch (Exception e) {
+                        LOG.error("While executing report {}", reportKey, e);
                         throw new RuntimeException(e);
                     }
 
@@ -67,7 +72,8 @@ public class ReportJob extends AbstractInterruptableJob {
                 }
             });
         } catch (RuntimeException e) {
-            throw new JobExecutionException(e.getCause());
+            LOG.error("While executing report {}", reportKey, e);
+            throw new JobExecutionException("While executing report " + reportKey, e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJobDelegate.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJobDelegate.java
b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJobDelegate.java
index e455778..5d5430d 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJobDelegate.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReportJobDelegate.java
@@ -152,14 +152,16 @@ public class ReportJobDelegate {
                     // invoke reportlet
                     try {
                         reportlet.extract(reportletConf, handler);
-                    } catch (Exception e) {
+                    } catch (Throwable t) {
+                        LOG.error("While executing reportlet {} for report {}", reportlet,
reportKey, t);
+
                         execution.setStatus(ReportExecStatus.FAILURE);
 
-                        Throwable t = e instanceof ReportException
-                                ? e.getCause()
-                                : e;
+                        Throwable effective = t instanceof ReportException
+                                ? t.getCause()
+                                : t;
                         reportExecutionMessage.
-                                append(ExceptionUtils2.getFullStackTrace(t)).
+                                append(ExceptionUtils2.getFullStackTrace(effective)).
                                 append("\n==================\n");
                     }
                 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
index e4158ea..bc36174 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
@@ -154,7 +154,7 @@ public class JPAExternalResource extends AbstractAnnotatedEntity<String>
impleme
     @ElementCollection(fetch = FetchType.EAGER)
     @Enumerated(EnumType.STRING)
     @Column(name = "capabilityOverride")
-    @CollectionTable(name = "ExternalResource_capabilitiesOverride",
+    @CollectionTable(name = "ExternalResource_capOverride",
             joinColumns =
             @JoinColumn(name = "resource_name", referencedColumnName = "name"))
     private Set<ConnectorCapability> capabilitiesOverride = new HashSet<>();

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/core/persistence-jpa/src/main/resources/audit/audit_oracle.sql
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/resources/audit/audit_oracle.sql b/core/persistence-jpa/src/main/resources/audit/audit_oracle.sql
index e1b7d81..9115bee 100644
--- a/core/persistence-jpa/src/main/resources/audit/audit_oracle.sql
+++ b/core/persistence-jpa/src/main/resources/audit/audit_oracle.sql
@@ -15,24 +15,10 @@
 -- specific language governing permissions and limitations
 -- under the License.
 
-BEGIN
-    BEGIN
-         EXECUTE IMMEDIATE 'DROP TABLE SYNCOPEAUDIT';
-    EXCEPTION
-         WHEN OTHERS THEN
-                IF SQLCODE != -942 THEN
-                     RAISE;
-                END IF;
-    END;
-
-    EXECUTE IMMEDIATE '
 CREATE TABLE SYNCOPEAUDIT (
   EVENT_DATE TIMESTAMP,
   LOGGER_LEVEL VARCHAR(255) NOT NULL,
   LOGGER VARCHAR(255) NOT NULL,
   MESSAGE CLOB NOT NULL,
   THROWABLE CLOB
-)
-';
-
-END;
+);

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/AbstractSchedTaskJobDelegate.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/AbstractSchedTaskJobDelegate.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/AbstractSchedTaskJobDelegate.java
index aec8853..1aa0e3f 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/AbstractSchedTaskJobDelegate.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/AbstractSchedTaskJobDelegate.java
@@ -94,7 +94,7 @@ public abstract class AbstractSchedTaskJobDelegate implements SchedTaskJobDelega
             execution.setStatus(TaskJob.Status.SUCCESS.name());
             result = AuditElements.Result.SUCCESS;
         } catch (JobExecutionException e) {
-            LOG.error("While executing task " + taskKey, e);
+            LOG.error("While executing task {}" , taskKey, e);
             result = AuditElements.Result.FAILURE;
 
             execution.setMessage(ExceptionUtils2.getFullStackTrace(e));

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/TaskJob.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/TaskJob.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/TaskJob.java
index 50067dc..0fcc461 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/TaskJob.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/TaskJob.java
@@ -26,9 +26,13 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.apache.syncope.core.provisioning.api.job.JobManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class TaskJob extends AbstractInterruptableJob {
 
+    private static final Logger LOG = LoggerFactory.getLogger(TaskJob.class);
+
     public static final String DRY_RUN_JOBDETAIL_KEY = "dryRun";
 
     public static final String DELEGATE_CLASS_KEY = "delegateClass";
@@ -75,6 +79,7 @@ public class TaskJob extends AbstractInterruptableJob {
                                 createBean(delegateClass, AbstractBeanDefinition.AUTOWIRE_BY_NAME,
false)).
                                 execute(taskKey, context.getMergedJobDataMap().getBoolean(DRY_RUN_JOBDETAIL_KEY));
                     } catch (Exception e) {
+                        LOG.error("While executing task {}", taskKey, e);
                         throw new RuntimeException(e);
                     }
 
@@ -83,7 +88,8 @@ public class TaskJob extends AbstractInterruptableJob {
             }
             );
         } catch (RuntimeException e) {
-            throw new JobExecutionException(e.getCause());
+            LOG.error("While executing task {}", taskKey, e);
+            throw new JobExecutionException("While executing task " + taskKey, e);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/fit/core-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/pom.xml b/fit/core-reference/pom.xml
index c720230..124ad87 100644
--- a/fit/core-reference/pom.xml
+++ b/fit/core-reference/pom.xml
@@ -594,31 +594,31 @@ under the License.
       <id>jboss-it</id>
 
       <dependencies>
-	<dependency>
+        <dependency>
           <groupId>javax.xml.ws</groupId>
           <artifactId>jaxws-api</artifactId>
           <version>2.2.11</version>
-	</dependency>
-	<dependency>
-	  <groupId>org.apache.cxf</groupId>
-	  <artifactId>cxf-core</artifactId>
-	  <version>${cxf.version}</version>
-	</dependency>
-	<dependency>
-	  <groupId>org.apache.cxf</groupId>
-	  <artifactId>cxf-rt-transports-http</artifactId>
-	  <version>${cxf.version}</version>
-	</dependency>
-	<dependency>
-	  <groupId>org.apache.cxf</groupId>
-	  <artifactId>cxf-rt-ws-policy</artifactId>
-	  <version>${cxf.version}</version>
-	</dependency>
-	<dependency>
-	  <groupId>org.apache.cxf</groupId>
-	  <artifactId>cxf-rt-wsdl</artifactId>
-	  <version>${cxf.version}</version>
-	</dependency>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.cxf</groupId>
+          <artifactId>cxf-core</artifactId>
+          <version>${cxf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.cxf</groupId>
+          <artifactId>cxf-rt-transports-http</artifactId>
+          <version>${cxf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.cxf</groupId>
+          <artifactId>cxf-rt-ws-policy</artifactId>
+          <version>${cxf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.cxf</groupId>
+          <artifactId>cxf-rt-wsdl</artifactId>
+          <version>${cxf.version}</version>
+        </dependency>
 
         <dependency>
           <groupId>org.apache.syncope.core</groupId>
@@ -719,7 +719,7 @@ under the License.
               <container>
                 <containerId>wildfly10x</containerId>
                 <zipUrlInstaller>
-		  <url>http://download.jboss.org/wildfly/10.0.0.Final/wildfly-10.0.0.Final.zip</url>
+                  <url>http://download.jboss.org/wildfly/10.0.0.Final/wildfly-10.0.0.Final.zip</url>
                   <downloadDir>${settings.localRepository}/org/codehaus/cargo/cargo-container-archives</downloadDir>
                   <extractDir>${project.build.directory}/cargo/extract</extractDir>
                 </zipUrlInstaller>

http://git-wip-us.apache.org/repos/asf/syncope/blob/f9af4eb3/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
index 6b4fb58..1109d62 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
@@ -37,7 +37,6 @@ import org.apache.syncope.common.lib.to.MembershipTO;
 import org.apache.syncope.common.lib.to.PlainSchemaTO;
 import org.apache.syncope.common.lib.to.ProvisioningResult;
 import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
@@ -174,10 +173,8 @@ public class PlainSchemaITCase extends AbstractITCase {
 
     @Test
     public void listByAnyTypeClass() {
-        final String clazz = anyTypeService.read(AnyTypeKind.USER.name()).getClasses().get(0);
-
         List<PlainSchemaTO> userSchemas = schemaService.list(
-                new SchemaQuery.Builder().type(SchemaType.PLAIN).anyTypeClass(clazz).build());
+                new SchemaQuery.Builder().type(SchemaType.PLAIN).anyTypeClass("minimal user").build());
 
         assertTrue(IterableUtils.matchesAny(userSchemas, new Predicate<PlainSchemaTO>()
{
 


Mime
View raw message