aboutsummaryrefslogtreecommitdiffstats
path: root/mdbc-server/src/test/java/org/onap
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-11-30 10:24:27 -0500
committerTschaen, Brendan <ctschaen@att.com>2018-11-30 13:15:18 -0500
commitc4db500cdd53a2ed1e19a2abdb04612bb3785cd7 (patch)
treef4f10c167dce08fe41b8a0db3759c6b85ab916bb /mdbc-server/src/test/java/org/onap
parent9cc93ae782739f4fd637fa8d30a986ce2e14ae3e (diff)
Upgrade to MUSIC 3.2.1
Add license headers to new files Change-Id: I1a557dbafbd29ce457b545dbd1ca2bc0db62a085 Issue-ID: MUSIC-219 Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'mdbc-server/src/test/java/org/onap')
-rw-r--r--mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java22
-rwxr-xr-xmdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java11
-rw-r--r--mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java36
3 files changed, 52 insertions, 17 deletions
diff --git a/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java b/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java
index 776a06e..2250b90 100644
--- a/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java
+++ b/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java
@@ -1,3 +1,23 @@
+/*
+ * ============LICENSE_START====================================================
+ * org.onap.music.mdbc
+ * =============================================================================
+ * Copyright (C) 2018 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======================================================
+ */
+
package org.onap.music.mdbc;
import static org.junit.Assert.*;
@@ -13,4 +33,4 @@ public class MdbcConnectionTest {
@Test
public void relinquishIfRequired() {
}
-} \ No newline at end of file
+}
diff --git a/mdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java b/mdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java
index 4d32b83..85220d4 100755
--- a/mdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java
+++ b/mdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java
@@ -22,7 +22,7 @@ package org.onap.music.mdbc;
import com.datastax.driver.core.*;
import com.datastax.driver.core.exceptions.QueryExecutionException;
import com.datastax.driver.core.exceptions.SyntaxError;
-import org.onap.music.datastore.CassaDataStore;
+import org.onap.music.lockingservice.cassandra.CassaLockStore;
import org.onap.music.logging.EELFLoggerDelegate;
import org.onap.music.main.MusicUtil;
@@ -99,15 +99,6 @@ public class TestUtils {
return expectedTypes;
}
-
- public static void checkRowsInTable(String keyspace, String tableName, CassaDataStore ds,
- HashSet<String> expectedColumns, HashMap<String,DataType> expectedTypes){
- TableMetadata table = ds.returnColumnMetadata(keyspace,tableName);
- assertNotNull("Error obtaining metadata of table, there may be an error with its creation", table);
- List<ColumnMetadata> columnsMeta = table.getColumns();
- checkDataTypeForTable(columnsMeta,expectedColumns,expectedTypes);
- }
-
public static void checkDataTypeForTable(List<ColumnMetadata> columnsMeta, HashSet<String> expectedColumns,
HashMap<String,DataType> expectedTypes){
for(ColumnMetadata cMeta : columnsMeta){
diff --git a/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java b/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java
index 7e0e4c8..b6ab2dd 100644
--- a/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java
+++ b/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java
@@ -1,3 +1,23 @@
+/*
+ * ============LICENSE_START====================================================
+ * org.onap.music.mdbc
+ * =============================================================================
+ * Copyright (C) 2018 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======================================================
+ */
+
package org.onap.music.mdbc.mixins;
import static org.junit.Assert.*;
@@ -14,17 +34,20 @@ import org.cassandraunit.utils.EmbeddedCassandraServerHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.music.datastore.CassaDataStore;
-import org.onap.music.datastore.MusicLockState;
+import org.onap.music.datastore.MusicDataStore;
+import org.onap.music.datastore.MusicDataStoreHandle;
import org.onap.music.exceptions.MDBCServiceException;
import org.onap.music.exceptions.MusicLockingException;
import org.onap.music.exceptions.MusicQueryException;
import org.onap.music.exceptions.MusicServiceException;
+import org.onap.music.lockingservice.cassandra.CassaLockStore;
+import org.onap.music.lockingservice.cassandra.MusicLockState;
import org.onap.music.main.MusicCore;
import org.onap.music.mdbc.DatabasePartition;
import org.onap.music.mdbc.Range;
import org.onap.music.mdbc.tables.MusicRangeInformationRow;
import org.onap.music.mdbc.tables.MusicTxDigestId;
+import org.onap.music.service.impl.MusicCassaCore;
public class MusicMixinTest {
@@ -52,9 +75,10 @@ public class MusicMixinTest {
assertNotNull("Invalid configuration for cassandra", cluster);
session = cluster.connect();
assertNotNull("Invalid configuration for cassandra", session);
- CassaDataStore store = new CassaDataStore(cluster, session);
+
+ MusicDataStoreHandle.mDstoreHandle = new MusicDataStore(cluster, session);
+ CassaLockStore store = new CassaLockStore(MusicDataStoreHandle.mDstoreHandle);
assertNotNull("Invalid configuration for music", store);
- MusicCore.mDstoreHandle = store;
try {
Properties properties = new Properties();
properties.setProperty(MusicMixin.KEY_MUSIC_NAMESPACE,keyspace);
@@ -145,7 +169,7 @@ public class MusicMixinTest {
ownershipReturn.getOldIRangeds().get(1).equals(partition2.getMusicRangeInformationIndex()));
String finalfullyQualifiedMriKey = keyspace+"."+ mriTableName+"."+newPartition.getMusicRangeInformationIndex().toString();
try {
- List<String> lockQueue = MusicCore.getLockingServiceHandle().getLockQueue(keyspace, mriTableName,
+ List<String> lockQueue = MusicCassaCore.getLockingServiceHandle().getLockQueue(keyspace, mriTableName,
newPartition.getMusicRangeInformationIndex().toString());
assertEquals(1,lockQueue.size());
assertEquals(lockQueue.get(0),newPartition.getLockId());
@@ -190,4 +214,4 @@ public class MusicMixinTest {
@Test
public void relinquishIfRequired() {
}
-} \ No newline at end of file
+}