aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap/music/unittests/jsonobjects
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/onap/music/unittests/jsonobjects')
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JSONObjectTest.java44
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java86
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java111
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java73
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java47
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java56
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java100
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java111
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java48
9 files changed, 0 insertions, 676 deletions
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JSONObjectTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JSONObjectTest.java
deleted file mode 100644
index 7f6af4c5..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JSONObjectTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * org.onap.music
- * ===================================================================
- * Copyright (c) 2017 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.
- *
- * ============LICENSE_END=============================================
- * ====================================================================
- */
-
-package org.onap.music.unittests.jsonobjects;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.onap.music.datastore.jsonobjects.JSONObject;
-
-public class JSONObjectTest {
- private JSONObject jsonObject;
-
- @Before
- public void setUp() {
- jsonObject = new JSONObject();
- }
-
- @Test
- public void testGetSetData() {
- jsonObject.setData("data");
- Assert.assertEquals("data", jsonObject.getData());
- }
-}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java
deleted file mode 100644
index a069b81d..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * org.onap.music
- * ===================================================================
- * Copyright (c) 2017 AT&T Intellectual Property
- * ===================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ===================================================================
- * 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=============================================
- * ====================================================================
- */
-
-package org.onap.music.unittests.jsonobjects;
-
-import static org.junit.Assert.*;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.music.datastore.jsonobjects.JsonDelete;
-
-public class JsonDeleteTest {
-
- JsonDelete jd = null;
-
- @Before
- public void init() {
- jd = new JsonDelete();
- }
-
- @Test
- public void testGetConditions() {
- Map<String,Object> mapSo = new HashMap<>();
- mapSo.put("key1","one");
- mapSo.put("key2","two");
- jd.setConditions(mapSo);
- assertEquals("one",jd.getConditions().get("key1"));
- }
-
- @Test
- public void testGetConsistencyInfo() {
- Map<String,String> mapSs = new HashMap<>();
- mapSs.put("key3","three");
- mapSs.put("key4","four");
- jd.setConsistencyInfo(mapSs);
- assertEquals("three",jd.getConsistencyInfo().get("key3"));
- }
-
- @Test
- public void testGetColumns() {
- List<String> ary = new ArrayList<>();
- ary.add("e1");
- ary.add("e2");
- ary.add("e3");
- jd.setColumns(ary);
- assertEquals("e1",jd.getColumns().get(0));
- }
-
- @Test
- public void testGetTtl() {
- jd.setTtl("2000");
- assertEquals("2000",jd.getTtl());
- }
-
- @Test
- public void testGetTimestamp() {
- jd.setTimestamp("20:00");
- assertEquals("20:00",jd.getTimestamp());
-
- }
-
-}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java
deleted file mode 100644
index 4992af7b..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * org.onap.music
- * ===================================================================
- * Copyright (c) 2017 AT&T Intellectual Property
- * ===================================================================
- * Modifications Copyright (c) 2019 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.
- *
- * ============LICENSE_END=============================================
- * ====================================================================
- */
-
-package org.onap.music.unittests.jsonobjects;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.Test;
-import org.onap.music.datastore.jsonobjects.JsonInsert;
-
-public class JsonInsertTest {
-
- JsonInsert ji = new JsonInsert();
-
- @Test
- public void testGetKeyspaceName() {
- ji.setKeyspaceName("keyspace");
- assertEquals("keyspace",ji.getKeyspaceName());
- }
-
- @Test
- public void testGetTableName() {
- ji.setTableName("table");
- assertEquals("table",ji.getTableName());
- }
-
- @Test
- public void testGetConsistencyInfo() {
- Map<String,String> cons = new HashMap<>();
- cons.put("test","true");
- ji.setConsistencyInfo(cons);
- assertEquals("true",ji.getConsistencyInfo().get("test"));
- }
-
- @Test
- public void testGetTtl() {
- ji.setTtl("ttl");
- assertEquals("ttl",ji.getTtl());
- }
-
- @Test
- public void testGetTimestamp() {
- ji.setTimestamp("10:30");
- assertEquals("10:30",ji.getTimestamp());
- }
-
- @Test
- public void testGetValues() {
- Map<String,Object> cons = new HashMap<>();
- cons.put("val1","one");
- cons.put("val2","two");
- ji.setValues(cons);
- assertEquals("one",ji.getValues().get("val1"));
- }
-
- @Test
- public void testGetRowSpecification() {
- Map<String,Object> cons = new HashMap<>();
- cons.put("val1","one");
- cons.put("val2","two");
- ji.setRowSpecification(cons);
- assertEquals("two",ji.getRowSpecification().get("val2"));
- }
-
- @Test
- public void testSerialize() {
- Map<String,Object> cons = new HashMap<>();
- cons.put("val1","one");
- cons.put("val2","two");
- ji.setTimestamp("10:30");
- ji.setRowSpecification(cons);
- byte[] test1 = ji.serialize();
- byte[] ji1 = SerializationUtils.serialize(ji);
- assertArrayEquals(ji1,test1);
- }
-
- @Test
- public void testObjectMap()
- {
- Map<String, byte[]> map = new HashMap<>();
- ji.setObjectMap(map);
- assertEquals(map, ji.getObjectMap());
- }
-
-}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java
deleted file mode 100644
index 0f4abd7c..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * org.onap.music
- * ===================================================================
- * Copyright (c) 2017 AT&T Intellectual Property
- * ===================================================================
- * 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=============================================
- * ====================================================================
- */
-
-package org.onap.music.unittests.jsonobjects;
-
-import static org.junit.Assert.*;
-import java.util.HashMap;
-import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.music.datastore.jsonobjects.JsonKeySpace;
-
-public class JsonKeySpaceTest {
-
- JsonKeySpace jk = null;
-
-
- @Before
- public void init() {
- jk = new JsonKeySpace();
- }
-
-
-
- @Test
- public void testGetConsistencyInfo() {
- Map<String, String> mapSs = new HashMap<>();
- mapSs.put("k1", "one");
- jk.setConsistencyInfo(mapSs);
- assertEquals("one",jk.getConsistencyInfo().get("k1"));
- }
-
- @Test
- public void testGetReplicationInfo() {
- Map<String,Object> mapSo = new HashMap<>();
- mapSo.put("k1", "one");
- jk.setReplicationInfo(mapSo);
- assertEquals("one",jk.getReplicationInfo().get("k1"));
-
- }
-
- @Test
- public void testGetDurabilityOfWrites() {
- jk.setDurabilityOfWrites("1");
- assertEquals("1",jk.getDurabilityOfWrites());
- }
-
- @Test
- public void testGetKeyspaceName() {
- jk.setKeyspaceName("Keyspace");
- assertEquals("Keyspace",jk.getKeyspaceName());
- }
-
-}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java
deleted file mode 100644
index b7dfa075..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * org.onap.music
- * ===================================================================
- * Copyright (c) 2017 AT&T Intellectual Property
- * ===================================================================
- * 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=============================================
- * ====================================================================
- */
-
-package org.onap.music.unittests.jsonobjects;
-
-import static org.junit.Assert.*;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.music.datastore.jsonobjects.JsonLeasedLock;
-
-public class JsonLeasedLockTest {
-
- JsonLeasedLock jl = null;
-
- @Before
- public void init() {
- jl = new JsonLeasedLock();
- }
-
-
- @Test
- public void testGetLeasePeriod() {
- long lease = 20000;
- jl.setLeasePeriod(lease);
- assertEquals(lease,jl.getLeasePeriod());
- }
-
-}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java
deleted file mode 100644
index 37d1787a..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * org.onap.music
- * ===================================================================
- * Copyright (c) 2017 AT&T Intellectual Property
- * ===================================================================
- * Modifications Copyright (c) 2018-2019 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.
- *
- * ============LICENSE_END=============================================
- * ====================================================================
- */
-
-package org.onap.music.unittests.jsonobjects;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-import org.onap.music.datastore.jsonobjects.JsonSelect;
-
-public class JsonSelectTest {
-
- @Test
- public void testGetConsistencyInfo() {
- JsonSelect js = new JsonSelect();
- Map<String, String> mapSs = new HashMap<>();
- mapSs.put("k1", "one");
- js.setConsistencyInfo(mapSs);
- assertEquals("one", js.getConsistencyInfo().get("k1"));
- }
-
- @Test
- public void testSerialize() throws IOException {
- JsonSelect js = new JsonSelect();
- Map<String, String> mapSs = new HashMap<>();
- mapSs.put("Key", "Value");
- js.setConsistencyInfo(mapSs);
- js.serialize();
- }
-
-}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java
deleted file mode 100644
index 4e3b4629..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * org.onap.music
- * ===================================================================
- * Copyright (c) 2017 AT&T Intellectual Property
- * ===================================================================
- * Modifications Copyright (c) 2019 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.
- *
- * ============LICENSE_END=============================================
- * ====================================================================
- */
-
-package org.onap.music.unittests.jsonobjects;
-
-import static org.junit.Assert.*;
-import java.util.HashMap;
-import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.music.datastore.jsonobjects.JsonTable;
-
-public class JsonTableTest {
-
- JsonTable jt = null;
-
- @Before
- public void init() {
- jt = new JsonTable();
- }
-
- @Test
- public void testGetConsistencyInfo() {
- Map<String, String> mapSs = new HashMap<>();
- mapSs.put("k1", "one");
- jt.setConsistencyInfo(mapSs);
- assertEquals("one",jt.getConsistencyInfo().get("k1"));
- }
-
- @Test
- public void testGetProperties() {
- Map<String, Object> properties = new HashMap<>();
- properties.put("k1", "one");
- jt.setProperties(properties);
- }
-
- @Test
- public void testGetFields() {
- Map<String, String> fields = new HashMap<>();
- fields.put("k1", "one");
- jt.setFields(fields);
- assertEquals("one",jt.getFields().get("k1"));
- }
-
- @Test
- public void testGetKeyspaceName() {
- String keyspace = "keyspace";
- jt.setKeyspaceName(keyspace);
- assertEquals(keyspace,jt.getKeyspaceName());
- }
-
- @Test
- public void testGetTableName() {
- String table = "table";
- jt.setTableName(table);
- assertEquals(table,jt.getTableName());
- }
-
- @Test
- public void testGetClusteringOrder() {
- String clusteringOrder = "clusteringOrder";
- jt.setClusteringOrder(clusteringOrder);
- assertEquals(clusteringOrder,jt.getClusteringOrder());
- }
-
- @Test
- public void testGetPrimaryKey() {
- String primaryKey = "primaryKey";
- jt.setPrimaryKey(primaryKey);
- assertEquals(primaryKey,jt.getPrimaryKey());
- }
-
- @Test
- public void testFilteringKey() {
- jt.setFilteringKey("FilteringKey");
- assertEquals("FilteringKey",jt.getFilteringKey());
- }
-
-}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java
deleted file mode 100644
index e00cb463..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START==========================================
- * org.onap.music
- * ===================================================================
- * Copyright (c) 2018 AT&T Intellectual Property
- * ===================================================================
- * Modifications Copyright (c) 2019 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.
- *
- * ============LICENSE_END=============================================
- * ====================================================================
- *******************************************************************************/
-
-package org.onap.music.unittests.jsonobjects;
-
-import static org.junit.Assert.*;
-import java.util.HashMap;
-import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.music.datastore.jsonobjects.JsonUpdate;
-
-public class JsonUpdateTest {
-
- JsonUpdate ju = null;
-
- @Before
- public void init() {
- ju = new JsonUpdate();
- }
-
-
- @Test
- public void testGetConditions() {
- Map<String,Object> mapSo = new HashMap<>();
- mapSo.put("key1","one");
- mapSo.put("key2","two");
- ju.setConditions(mapSo);
- assertEquals("one",ju.getConditions().get("key1"));
- }
-
- @Test
- public void testGetRow_specification() {
- Map<String,Object> mapSo = new HashMap<>();
- mapSo.put("key1","one");
- mapSo.put("key2","two");
- ju.setRow_specification(mapSo);
- assertEquals("one",ju.getRow_specification().get("key1"));
- }
-
- @Test
- public void testGetKeyspaceName() {
- String keyspace = "keyspace";
- ju.setKeyspaceName(keyspace);
- assertEquals(keyspace,ju.getKeyspaceName());
- }
-
- @Test
- public void testGetTableName() {
- String table = "table";
- ju.setTableName(table);
- assertEquals(table,ju.getTableName());
- }
-
- @Test
- public void testGetConsistencyInfo() {
- Map<String, String> mapSs = new HashMap<>();
- mapSs.put("k1", "one");
- ju.setConsistencyInfo(mapSs);
- assertEquals("one",ju.getConsistencyInfo().get("k1"));
- }
-
- @Test
- public void testGetTtl() {
- ju.setTtl("2000");
- assertEquals("2000",ju.getTtl());
- }
-
- @Test
- public void testGetTimestamp() {
- ju.setTimestamp("20:00");
- assertEquals("20:00",ju.getTimestamp());
-
- }
-
- @Test
- public void testGetValues() {
- Map<String,Object> cons = new HashMap<>();
- cons.put("val1","one");
- cons.put("val2","two");
- ju.setValues(cons);
- assertEquals("one",ju.getValues().get("val1"));
- }
-
- @Test
- public void testSerialize() {
- assertTrue(ju.serialize() instanceof byte[]);
- }
-
-}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java
deleted file mode 100644
index ceda3f3a..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * org.onap.music
- * ===================================================================
- * Copyright (c) 2019 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.
- *
- * ============LICENSE_END=============================================
- * ====================================================================
- */
-
-package org.onap.music.unittests.jsonobjects;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.music.eelf.healthcheck.MusicHealthCheck;
-
-public class MusicHealthCheckTest {
-
- private MusicHealthCheck musicHealthCheck;
-
- @Before
- public void setUp()
- {
- musicHealthCheck= new MusicHealthCheck();
- }
-
- @Test
- public void testCassandraHost()
- {
- musicHealthCheck.setCassandrHost("9042");
- assertEquals("9042", musicHealthCheck.getCassandrHost());
- }
-
-}