diff options
-rwxr-xr-x | pom.xml | 2 | ||||
-rw-r--r-- | resource-assignment/features/src/main/resources/features.xml | 2 | ||||
-rwxr-xr-x | resource-assignment/provider/pom.xml | 6 | ||||
-rwxr-xr-x | sql-resource/provider/pom.xml | 6 | ||||
-rw-r--r-- | sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java | 19 | ||||
-rw-r--r-- | sql-resource/provider/src/test/resources/svclogic.properties | 31 |
6 files changed, 43 insertions, 23 deletions
@@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-carbon-sr1</artifactId> - <version>0.0.1-SNAPSHOT</version> + <version>0.0.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/resource-assignment/features/src/main/resources/features.xml b/resource-assignment/features/src/main/resources/features.xml index f4191293d..ca1126d37 100644 --- a/resource-assignment/features/src/main/resources/features.xml +++ b/resource-assignment/features/src/main/resources/features.xml @@ -34,7 +34,7 @@ <feature version="[3.1,4)">spring-jdbc</feature> <feature>spring-dm</feature> <bundle start-level="88">mvn:org.onap.ccsdk.sli.adaptors/resource-assignment-provider/${project.version}</bundle> - <bundle>mvn:mysql/mysql-connector-java/${mysql.connector.version}</bundle> + <bundle>mvn:org.mariadb.jdbc/mariadb-java-client/${mariadb.connector.version}</bundle> <bundle>mvn:commons-lang/commons-lang/2.6</bundle> </feature> diff --git a/resource-assignment/provider/pom.xml b/resource-assignment/provider/pom.xml index 89134284c..741f9fbe2 100755 --- a/resource-assignment/provider/pom.xml +++ b/resource-assignment/provider/pom.xml @@ -61,9 +61,9 @@ <version>${slf4j.version}</version> </dependency> <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - <version>${mysql.connector.version}</version> + <groupId>org.mariadb.jdbc</groupId> + <artifactId>mariadb-java-client</artifactId> + <version>${mariadb.connector.version}</version> <type>jar</type> <scope>runtime</scope> </dependency> diff --git a/sql-resource/provider/pom.xml b/sql-resource/provider/pom.xml index 841561b6d..9a7d2457b 100755 --- a/sql-resource/provider/pom.xml +++ b/sql-resource/provider/pom.xml @@ -20,6 +20,12 @@ <version>${junit.version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>ch.vorburger.mariaDB4j</groupId> + <artifactId>mariaDB4j</artifactId> + <version>2.2.3</version> + <scope>test</scope> + </dependency> <dependency> <groupId>org.onap.ccsdk.sli.core</groupId> <artifactId>sli-common</artifactId> diff --git a/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java index f0ab60379..e66034ba8 100644 --- a/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java +++ b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java @@ -8,9 +8,9 @@ * Licensed 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. @@ -32,6 +32,8 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import ch.vorburger.mariadb4j.DB; +import ch.vorburger.mariadb4j.DBConfigurationBuilder; import junit.framework.TestCase; public class ITCaseSqlResource extends TestCase { @@ -40,7 +42,7 @@ public class ITCaseSqlResource extends TestCase { .getLogger(ITCaseSqlResource.class); - public void testExists() { + public void testExists() throws Exception { Properties props = new Properties(); @@ -57,6 +59,17 @@ public class ITCaseSqlResource extends TestCase { fail("Could not initialize properties"); } + + // Start MariaDB4j database + DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder(); + config.setPort(0); // 0 => autom. detect free port + DB db = DB.newEmbeddedDB(config.build()); + db.start(); + + // Override jdbc URL and database name + props.setProperty("org.onap.ccsdk.sli.jdbc.database", "test"); + props.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test")); + // Add properties to global properties Enumeration propNames = props.keys(); diff --git a/sql-resource/provider/src/test/resources/svclogic.properties b/sql-resource/provider/src/test/resources/svclogic.properties index 69c8e2487..6504e1aec 100644 --- a/sql-resource/provider/src/test/resources/svclogic.properties +++ b/sql-resource/provider/src/test/resources/svclogic.properties @@ -8,9 +8,9 @@ # Licensed 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. @@ -18,17 +18,18 @@ # limitations under the License. # ============LICENSE_END========================================================= ### +org.onap.ccsdk.sli.dbtype=jdbc -org.onap.ccsdk.sli.adaptors.dbtype=jdbc -org.onap.ccsdk.sli.adaptors.jdbc.hosts=localhost -org.onap.ccsdk.sli.adaptors.jdbc.url=jdbc:mysql://DBHOST:3306/sdnctl -org.onap.ccsdk.sli.adaptors.jdbc.database=sdnctl -org.onap.ccsdk.sli.adaptors.jdbc.user=sdnctl -org.onap.ccsdk.sli.adaptors.jdbc.password=gamma -org.onap.ccsdk.sli.adaptors.jdbc.connection.name=sdnctldb01 - -org.onap.ccsdk.sli.adaptors.jdbc.connection.timeout=50 -org.onap.ccsdk.sli.adaptors.jdbc.request.timeout=100 -org.onap.ccsdk.sli.adaptors.jdbc.limit.init=10 -org.onap.ccsdk.sli.adaptors.jdbc.limit.min=10 -org.onap.ccsdk.sli.adaptors.jdbc.limit.max=20 +org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01 +org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/sdnctl +org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver +org.onap.ccsdk.sli.jdbc.database=sdnctl +org.onap.ccsdk.sli.jdbc.user=sdnctl +org.onap.ccsdk.sli.jdbc.password=gamma +org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01 +org.onap.ccsdk.sli.jdbc.connection.timeout=50 +org.onap.ccsdk.sli.jdbc.request.timeout=100 +org.onap.ccsdk.sli.jdbc.limit.init=10 +org.onap.ccsdk.sli.jdbc.limit.min=10 +org.onap.ccsdk.sli.jdbc.limit.max=20 +org.onap.dblib.connection.recovery=false |