From 4c9667e1a94d56be526d03e151cc7dc19f8486fe Mon Sep 17 00:00:00 2001 From: Rich Tabedzki Date: Fri, 9 Mar 2018 04:28:34 +0000 Subject: Convert sql-resource provider to blueprint Changes made: * Updated SqlResource class to include data members referenced in blueprint.xml * Added SqlResourceProvider class to resolve properties file * Added sql-resource-blueprint.xml * Removed SqlResource Activator * Added unit test for SqlResourceProvider Change-Id: Ia2bcc241c3c063176ac2b986f603a1915ba105b2 Issue-ID: CCSDK-206 Signed-off-by: Rich Tabedzki --- .../adaptors/resource/sql/ITCaseSqlResource.java | 2 +- .../resource/sql/SqlResourceProviderTest.java | 25 ++++++++++++++++++++++ .../src/test/resources/sql-resource.properties | 23 ++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) mode change 100644 => 100755 sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java create mode 100755 sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java create mode 100755 sql-resource/provider/src/test/resources/sql-resource.properties (limited to 'sql-resource/provider/src/test') 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 old mode 100644 new mode 100755 index e66034ba..2863c6c9 --- 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 @@ -80,7 +80,7 @@ public class ITCaseSqlResource extends TestCase { System.setProperty(propName, props.getProperty(propName)); } - SqlResource sqlResource = new SqlResource(); + SqlResource sqlResource = new SqlResource(new SqlResourcePropertiesProviderImpl()); diff --git a/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java new file mode 100755 index 00000000..404783d0 --- /dev/null +++ b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java @@ -0,0 +1,25 @@ +package org.onap.ccsdk.sli.adaptors.resource.sql; + +import static org.junit.Assert.assertNotNull; + +import java.util.Properties; + +import org.junit.Test; + +public class SqlResourceProviderTest { + + private static SqlResourcePropertiesProvider provider; + + @Test + public void testSqlResourceProvider() { + provider = new SqlResourcePropertiesProviderImpl(); + assertNotNull(provider); + } + + @Test + public void testGetProperties() { + Properties properties = provider.getProperties(); + assertNotNull(properties); + } + +} diff --git a/sql-resource/provider/src/test/resources/sql-resource.properties b/sql-resource/provider/src/test/resources/sql-resource.properties new file mode 100755 index 00000000..ac32f773 --- /dev/null +++ b/sql-resource/provider/src/test/resources/sql-resource.properties @@ -0,0 +1,23 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# 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. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +org.openecomp.sdnc.resource.sql.cryptkey=QtfJMKggVk + -- cgit 1.2.3-korg