summaryrefslogtreecommitdiffstats
path: root/sql-resource/provider/src/test/java
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2017-09-19 19:06:17 -0400
committerDan Timoney <dtimoney@att.com>2017-09-19 19:06:17 -0400
commit4d02e5b32dbce0815010a6bf61624420ab0ff1a3 (patch)
tree3182dcd06e34e3271d2167885edd99555d55fb38 /sql-resource/provider/src/test/java
parentf784437fa0b7946e5ab7663d6712fe2f1ca5b3e9 (diff)
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>
Diffstat (limited to 'sql-resource/provider/src/test/java')
-rw-r--r--sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java19
1 files changed, 16 insertions, 3 deletions
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();