Return-Path: X-Original-To: apmail-syncope-commits-archive@www.apache.org Delivered-To: apmail-syncope-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 779FA10B5E for ; Mon, 9 Feb 2015 16:20:35 +0000 (UTC) Received: (qmail 76235 invoked by uid 500); 9 Feb 2015 16:20:35 -0000 Delivered-To: apmail-syncope-commits-archive@syncope.apache.org Received: (qmail 76201 invoked by uid 500); 9 Feb 2015 16:20:35 -0000 Mailing-List: contact commits-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list commits@syncope.apache.org Received: (qmail 76189 invoked by uid 99); 9 Feb 2015 16:20:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2015 16:20:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 22DF9E03AB; Mon, 9 Feb 2015 16:20:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: ilgrosso@apache.org To: commits@syncope.apache.org Date: Mon, 09 Feb 2015 16:20:35 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] syncope git commit: [SYNCOPE-620] Added IT profiles for MySQL and PostgreSQL Repository: syncope Updated Branches: refs/heads/2_0_X 61f6395a6 -> cc74bb6c4 [SYNCOPE-620] Added IT profiles for MySQL and PostgreSQL Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/498eb7ec Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/498eb7ec Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/498eb7ec Branch: refs/heads/2_0_X Commit: 498eb7ecd43143100700326bc9af14bea7ff0436 Parents: 61f6395 Author: Francesco Chicchiriccò Authored: Fri Feb 6 18:45:23 2015 +0100 Committer: Francesco Chicchiriccò Committed: Fri Feb 6 18:45:23 2015 +0100 ---------------------------------------------------------------------- syncope620/fit/server-reference/pom.xml | 66 ++++++++++++++++++++ .../main/resources/mysql/persistence.properties | 29 +++++++++ .../resources/postgres/persistence.properties | 28 +++++++++ .../server/reference/ConfigurationITCase.java | 39 +++++++++++- 4 files changed, 160 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/498eb7ec/syncope620/fit/server-reference/pom.xml ---------------------------------------------------------------------- diff --git a/syncope620/fit/server-reference/pom.xml b/syncope620/fit/server-reference/pom.xml index 852b0b6..034fe69 100644 --- a/syncope620/fit/server-reference/pom.xml +++ b/syncope620/fit/server-reference/pom.xml @@ -350,6 +350,72 @@ under the License. + postgres-it + + + org.postgresql + postgresql + + + + + org.postgresql + postgresql + 9.4-1200-jdbc41 + test + + + + + clean verify + + + + src/main/resources + true + + + src/main/resources/postgres + true + + + + + + + mysql-it + + + mysql + mysql-connector-java + + + + + mysql + mysql-connector-java + 5.1.34 + test + + + + + clean verify + + + + src/main/resources + true + + + src/main/resources/mysql + true + + + + + + debug http://git-wip-us.apache.org/repos/asf/syncope/blob/498eb7ec/syncope620/fit/server-reference/src/main/resources/mysql/persistence.properties ---------------------------------------------------------------------- diff --git a/syncope620/fit/server-reference/src/main/resources/mysql/persistence.properties b/syncope620/fit/server-reference/src/main/resources/mysql/persistence.properties new file mode 100644 index 0000000..b5be6b7 --- /dev/null +++ b/syncope620/fit/server-reference/src/main/resources/mysql/persistence.properties @@ -0,0 +1,29 @@ +# 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. +content.directory=${conf.directory} +jpa.driverClassName=com.mysql.jdbc.Driver +jpa.url=jdbc:mysql://localhost:3306/syncope?characterEncoding=UTF-8 +jpa.username=syncope +jpa.password=syncope +jpa.dialect=org.apache.openjpa.jdbc.sql.MySQLDictionary +jpa.pool.validationQuery=SELECT 1 +#note: other connection pool settings can also be configured here, see persistenceContext.xml +quartz.jobstore=org.quartz.impl.jdbcjobstore.StdJDBCDelegate +quartz.scheduler.idleWaitTime=5000 +quartz.sql=tables_mysql.sql +audit.sql=audit.sql +database.schema= http://git-wip-us.apache.org/repos/asf/syncope/blob/498eb7ec/syncope620/fit/server-reference/src/main/resources/postgres/persistence.properties ---------------------------------------------------------------------- diff --git a/syncope620/fit/server-reference/src/main/resources/postgres/persistence.properties b/syncope620/fit/server-reference/src/main/resources/postgres/persistence.properties new file mode 100644 index 0000000..664afd0 --- /dev/null +++ b/syncope620/fit/server-reference/src/main/resources/postgres/persistence.properties @@ -0,0 +1,28 @@ +# 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. +content.directory=${conf.directory} +jpa.driverClassName=org.postgresql.Driver +jpa.url=jdbc:postgresql://localhost:5432/syncope +jpa.username=syncope +jpa.password=syncope +jpa.dialect=org.apache.openjpa.jdbc.sql.PostgresDictionary +jpa.pool.validationQuery=SELECT 1 +#note: other connection pool settings can also be configured here, see persistenceContext.xml +quartz.jobstore=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate +quartz.sql=tables_postgres.sql +audit.sql=audit.sql +database.schema= http://git-wip-us.apache.org/repos/asf/syncope/blob/498eb7ec/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java ---------------------------------------------------------------------- diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java index 0945c90..8d2d0fb 100644 --- a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java +++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java @@ -18,6 +18,7 @@ */ package org.apache.syncope.fit.server.reference; +import static org.apache.commons.lang3.StringUtils.isEmpty; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -27,10 +28,13 @@ import static org.junit.Assert.fail; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.List; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.SyncopeConstants; @@ -152,6 +156,37 @@ public class ConfigurationITCase extends AbstractITCase { } } + private static String[] substringsBetween(final String str, final String open, final String close) { + if (str == null || isEmpty(open) || isEmpty(close)) { + return null; + } + final int strLen = str.length(); + if (strLen == 0) { + return ArrayUtils.EMPTY_STRING_ARRAY; + } + final int closeLen = close.length(); + final int openLen = open.length(); + final List list = new ArrayList<>(); + int pos = 0; + while (pos < strLen - closeLen) { + int start = StringUtils.indexOfIgnoreCase(str, open, pos); + if (start < 0) { + break; + } + start += openLen; + final int end = StringUtils.indexOfIgnoreCase(str, close, start); + if (end < 0) { + break; + } + list.add(str.substring(start, end)); + pos = end + closeLen; + } + if (list.isEmpty()) { + return null; + } + return list.toArray(new String[list.size()]); + } + @Test public void issueSYNCOPE629() throws IOException { PlainSchemaTO membershipKey = new PlainSchemaTO(); @@ -184,7 +219,7 @@ public class ConfigurationITCase extends AbstractITCase { assertFalse(configExport.isEmpty()); assertTrue(configExport.length() > 1000); - String[] result = StringUtils.substringsBetween(configExport, ""); + String[] result = substringsBetween(configExport, ""); assertNotNull(result); boolean rattrExists = false; for (String entry : result) { @@ -194,7 +229,7 @@ public class ConfigurationITCase extends AbstractITCase { } assertTrue(rattrExists); - result = StringUtils.substringsBetween(configExport, ""); + result = substringsBetween(configExport, ""); assertNotNull(result); boolean mattrExists = false; for (String entry : result) {