summaryrefslogtreecommitdiffstats
path: root/blueprints-processor/adaptors/data-adaptor-provider/src/test
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2018-09-14 16:03:35 -0400
committerSingal, Kapil (ks220y) <ks220y@att.com>2018-09-14 17:47:16 -0400
commitb1248f701a8428d9e0df45af18e306a7e4545669 (patch)
tree8ff27543470d43892fa19317b0d4f91ccd9867fd /blueprints-processor/adaptors/data-adaptor-provider/src/test
parent43b4f3fc292fa69361065ca3343e5e37eb41c209 (diff)
SDN Controller Blueprint Processor
Removing Config Property Map Table and Dao Implementation Reformatting Codebase as per Onap Code Style Change-Id: I0841d5173aa40268e3451fd793826835c74fec77 Issue-ID: CCSDK-572 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Diffstat (limited to 'blueprints-processor/adaptors/data-adaptor-provider/src/test')
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoTest.java53
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java6
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java6
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql88
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml29
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml5
6 files changed, 52 insertions, 135 deletions
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoTest.java b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoTest.java
deleted file mode 100644
index 1915017a6..000000000
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.data.adaptor.dao;
-
-import org.junit.Assert;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.MethodSorters;
-import org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDao;
-import org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDao;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = {"classpath:test-context-h2db.xml"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class ConfigPropertyMapDaoTest {
-
- @Autowired
- private ConfigPropertyMapDao configPropertyMapDao;
-
- @Autowired
- private QueryExecutorDao queryExecutorDao;
-
- @Test
- public void testConfigResourcesData() throws Exception {
- String sql = "INSERT INTO CONFIG_PROPERTY_MAP (reference_key, reference_value) VALUES ( ?, ?)";
- Object[] data = new Object[] {"dummy123", "username123"};
- int result = queryExecutorDao.update(sql, data);
- Assert.assertNotNull("Failed to get Query Result", result);
-
- String propKeyValye = configPropertyMapDao.getConfigPropertyByKey("org.onap.ccsdk.features.rest.adaptors.test");
- Assert.assertNull("propKeyValue is null", propKeyValye);
- }
-
-}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java
index 53724c5c9..61a2e3196 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java
@@ -24,7 +24,6 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.ccsdk.features.data.adaptor.DataAdaptorConstants;
-import org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDao;
import org.onap.ccsdk.features.data.adaptor.dao.ConfigResourceDao;
import org.onap.ccsdk.features.data.adaptor.dao.NamedQueryExecutorDao;
import org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDao;
@@ -58,13 +57,10 @@ public class ConfigResourceNodeTest {
@Autowired
NamedQueryExecutorDao namedQueryExecutorDao;
- @Autowired
- ConfigPropertyMapDao configPropertyMapDao;
-
@Before
public void before() {
configResourceService = new ConfigResourceServiceImpl(transactionLogDao, configResourceDao, queryExecutorDao,
- namedQueryExecutorDao, configPropertyMapDao);
+ namedQueryExecutorDao);
configResourceNode = new ConfigResourceNode(configResourceService);
}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java
index 2d599e2f1..cecede810 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java
@@ -29,7 +29,6 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDao;
import org.onap.ccsdk.features.data.adaptor.dao.ConfigResourceDao;
import org.onap.ccsdk.features.data.adaptor.dao.ConfigResourceDaoTest;
import org.onap.ccsdk.features.data.adaptor.dao.NamedQueryExecutorDao;
@@ -62,13 +61,10 @@ public class ConfigResourceServiceTest {
@Autowired
NamedQueryExecutorDao namedQueryExecutorDao;
- @Autowired
- ConfigPropertyMapDao configPropertyMapDao;
-
@Before
public void before() {
configResourceService = new ConfigResourceServiceImpl(transactionLogDao, configResourceDao, queryExecutorDao,
- namedQueryExecutorDao, configPropertyMapDao);
+ namedQueryExecutorDao);
}
@Test
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql
index 15d22e242..af7f02c51 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql
@@ -1,46 +1,42 @@
-
-CREATE TABLE IF NOT EXISTS CONFIG_RESOURCE (
- config_resource_id VARCHAR(50) PRIMARY KEY,
- resource_id VARCHAR(50) NOT NULL,
- resource_type VARCHAR(50) NOT NULL,
- service_template_name VARCHAR(50) NULL DEFAULT NULL,
- service_template_version VARCHAR(50) NULL DEFAULT NULL,
- template_name VARCHAR(50) NOT NULL,
- recipe_name VARCHAR(50) NOT NULL,
- request_id VARCHAR(50) NOT NULL,
- resource_data LONGTEXT NULL DEFAULT NULL,
- mask_data LONGTEXT NULL DEFAULT NULL,
- created_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- status VARCHAR(20) NOT NULL,
- updated_by VARCHAR(50) NOT NULL
-);
-
-CREATE TABLE IF NOT EXISTS CONFIG_RESOURCE_ASSIGNMENT_DATA (
- config_resource_assignment_data_id VARCHAR(50) PRIMARY KEY,
- config_resource_id VARCHAR(50) NOT NULL,
- version INT(11) NOT NULL,
- updated_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- updated_by VARCHAR(50) NOT NULL,
- template_key_name VARCHAR(50) NOT NULL,
- resource_name VARCHAR(50) NOT NULL,
- data_type VARCHAR(100) NOT NULL,
- entry_schema VARCHAR(100) NULL DEFAULT NULL,
- resource_value LONGTEXT NOT NULL,
- source VARCHAR(50) NOT NULL,
- status VARCHAR(50) NOT NULL,
- message LONGTEXT NOT NULL
-);
-
-CREATE TABLE IF NOT EXISTS CONFIG_TRANSACTION_LOG (
- config_transaction_log_id VARCHAR(50) PRIMARY KEY,
- request_id VARCHAR(50) NULL DEFAULT NULL,
- message_type VARCHAR(100) NULL DEFAULT NULL,
- creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- message LONGTEXT NULL DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS CONFIG_PROPERTY_MAP (
- reference_key VARCHAR(100) NOT NULL,
- reference_value VARCHAR(250) NOT NULL
-);
-
+
+CREATE TABLE IF NOT EXISTS CONFIG_RESOURCE (
+ config_resource_id VARCHAR(50) PRIMARY KEY,
+ resource_id VARCHAR(50) NOT NULL,
+ resource_type VARCHAR(50) NOT NULL,
+ service_template_name VARCHAR(50) NULL DEFAULT NULL,
+ service_template_version VARCHAR(50) NULL DEFAULT NULL,
+ template_name VARCHAR(50) NOT NULL,
+ recipe_name VARCHAR(50) NOT NULL,
+ request_id VARCHAR(50) NOT NULL,
+ resource_data LONGTEXT NULL DEFAULT NULL,
+ mask_data LONGTEXT NULL DEFAULT NULL,
+ created_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ status VARCHAR(20) NOT NULL,
+ updated_by VARCHAR(50) NOT NULL
+);
+
+CREATE TABLE IF NOT EXISTS CONFIG_RESOURCE_ASSIGNMENT_DATA (
+ config_resource_assignment_data_id VARCHAR(50) PRIMARY KEY,
+ config_resource_id VARCHAR(50) NOT NULL,
+ version INT(11) NOT NULL,
+ updated_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ updated_by VARCHAR(50) NOT NULL,
+ template_key_name VARCHAR(50) NOT NULL,
+ resource_name VARCHAR(50) NOT NULL,
+ data_type VARCHAR(100) NOT NULL,
+ entry_schema VARCHAR(100) NULL DEFAULT NULL,
+ resource_value LONGTEXT NOT NULL,
+ source VARCHAR(50) NOT NULL,
+ status VARCHAR(50) NOT NULL,
+ message LONGTEXT NOT NULL
+);
+
+CREATE TABLE IF NOT EXISTS CONFIG_TRANSACTION_LOG (
+ config_transaction_log_id VARCHAR(50) PRIMARY KEY,
+ request_id VARCHAR(50) NULL DEFAULT NULL,
+ message_type VARCHAR(100) NULL DEFAULT NULL,
+ creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ message LONGTEXT NULL DEFAULT NULL
+);
+
+
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml
index baffb54e6..9e413b099 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml
@@ -1,20 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright © 2017-2018 AT&T Intellectual Property.
- Modifications Copyright © 2018 IBM.
-
- 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.
--->
+<!-- Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright
+ © 2018 IBM. 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. -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -57,11 +49,6 @@
<constructor-arg ref="jdbcTemplate" />
</bean>
- <bean id="configPropertyMapDao"
- class="org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDaoImpl">
- <constructor-arg ref="jdbcTemplate" />
- </bean>
-
<bean id="queryExecutorDao"
class="org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDaoImpl">
<constructor-arg ref="jdbcTemplate" />
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml
index ee3d33120..59af664b1 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml
@@ -75,11 +75,6 @@
<constructor-arg ref="jdbcTemplate" />
</bean>
- <bean id="ConfigPropertyMapDao"
- class="org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDaoImpl">
- <constructor-arg ref="jdbcTemplate" />
- </bean>
-
<bean id="queryExecutorDao"
class="org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDaoImpl">
<constructor-arg ref="jdbcTemplate" />