2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package jtest.org.onap.ccsdk.sli.adaptors.ra;
24 import jtest.util.org.onap.ccsdk.sli.adaptors.ra.TestDb;
25 import jtest.util.org.onap.ccsdk.sli.adaptors.ra.TestTable;
27 public class DataSetup {
29 private TestDb testDb;
31 private TestTable resource = null;
32 private TestTable allocationItem = null;
34 private static final String[] RESOURCE_COLUMNS = {"asset_id", "resource_name", "resource_type", "lt_used"};
36 private static final String[] ALLOCATION_ITEM_COLUMNS = {"resource_id", "application_id", "resource_set_id",
37 "resource_union_id", "resource_share_group_list", "lt_used", "allocation_time"};
39 private void initTables() {
40 if (resource == null) {
41 resource = testDb.table("RESOURCE", "resource_id", RESOURCE_COLUMNS);
43 if (allocationItem == null) {
44 allocationItem = testDb.table("ALLOCATION_ITEM", "allocation_item_id", ALLOCATION_ITEM_COLUMNS);
48 public void cleanup() {
50 allocationItem.delete("true");
51 resource.delete("true");
54 public void setTestDb(TestDb testDb) {