Remove mysql references from sli/adaptors
Remove mysql references from sli/adaptors repository.
Change-Id: I19682626fdb954ce8190d61507eabe0152a6a635
Issue-ID: CCSDK-95
Signed-off-by: Dan Timoney <dtimoney@att.com>
diff --git a/pom.xml b/pom.xml
index a219c0d..341a801 100755
--- a/pom.xml
+++ b/pom.xml
@@ -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 f419129..ca1126d 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 8913428..741f9fb 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 841561b..9a7d245 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 f0ab603..e66034b 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.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 @@
.getLogger(ITCaseSqlResource.class);
- public void testExists() {
+ public void testExists() throws Exception {
Properties props = new Properties();
@@ -57,6 +59,17 @@
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 69c8e24..6504e1a 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