aboutsummaryrefslogtreecommitdiffstats
path: root/music-core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'music-core/src/main')
-rw-r--r--music-core/src/main/java/org/onap/music/datastore/MusicDataStoreHandle.java3
-rw-r--r--music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java13
2 files changed, 11 insertions, 5 deletions
diff --git a/music-core/src/main/java/org/onap/music/datastore/MusicDataStoreHandle.java b/music-core/src/main/java/org/onap/music/datastore/MusicDataStoreHandle.java
index 92457d07..09fe0d35 100644
--- a/music-core/src/main/java/org/onap/music/datastore/MusicDataStoreHandle.java
+++ b/music-core/src/main/java/org/onap/music/datastore/MusicDataStoreHandle.java
@@ -88,6 +88,9 @@ public class MusicDataStoreHandle {
return mDstoreHandle;
}
+ public static void setMDstoreHandle(MusicDataStore dsHandle) {
+ mDstoreHandle = dsHandle;
+ }
/**
*
diff --git a/music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java b/music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java
index 63f2d14c..1f3f4a32 100644
--- a/music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java
+++ b/music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java
@@ -84,7 +84,8 @@ public class MusicCassaCore implements MusicCoreService {
return mLockHandle;
}
- public static void setmLockHandle(CassaLockStore mLockHandle) {
+ //for unit testing purposes
+ static void setmLockHandle(CassaLockStore mLockHandle) {
MusicCassaCore.mLockHandle = mLockHandle;
}
@@ -348,7 +349,6 @@ public class MusicCassaCore implements MusicCoreService {
* @return Boolean Indicates success or failure
* @throws MusicServiceException
*
- *
*/
public ResultType createTable(String keyspace, String table, PreparedQueryObject tableQueryObject,
String consistency) throws MusicServiceException {
@@ -357,9 +357,9 @@ public class MusicCassaCore implements MusicCoreService {
try {
// create shadow locking table
result = getLockingServiceHandle().createLockQueue(keyspace, table);
- if (result == false)
+ if (result == false) {
return ResultType.FAILURE;
-
+ }
result = false;
// create table to track unsynced_keys
@@ -370,8 +370,11 @@ public class MusicCassaCore implements MusicCoreService {
PreparedQueryObject queryObject = new PreparedQueryObject();
queryObject.appendQueryString(tabQuery);
- result = false;
result = MusicDataStoreHandle.getDSHandle().executePut(queryObject, "eventual");
+ if (result == false) {
+ return ResultType.FAILURE;
+ }
+ result = false;
// create actual table
result = MusicDataStoreHandle.getDSHandle().executePut(tableQueryObject, consistency);