Merge "Update junits"
authorThomas Nelson <nelson24@att.com>
Fri, 27 Dec 2019 04:55:27 +0000 (04:55 +0000)
committerGerrit Code Review <gerrit@onap.org>
Fri, 27 Dec 2019 04:55:27 +0000 (04:55 +0000)
1  2 
music-core/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java

@@@ -129,7 -129,7 +129,7 @@@ public class CassaLockStore 
          table = table_prepend_name+table;
          String tabQuery = "CREATE TABLE IF NOT EXISTS "+keyspace+"."+table
                  + " ( key text, lockReference bigint, createTime text, acquireTime text, guard bigint static, "
-                 + "lockType text, owner text, PRIMARY KEY ((key), lockReference) ) "
+                 + "lockType text, leasePeriodTime bigint, owner text, PRIMARY KEY ((key), lockReference) ) "
                  + "WITH CLUSTERING ORDER BY (lockReference ASC);";
          PreparedQueryObject queryObject = new PreparedQueryObject();
          
          queryObject.appendQueryString(" WHERE lockType = ? ALLOW FILTERING");
          queryObject.addValue(LockType.WRITE);
  
 -        DeadlockDetectionUtil ddu = new DeadlockDetectionUtil();
 +        DeadlockDetectionUtil ddu = getDeadlockDetectionUtil();
  
          ResultSet rs = dsHandle.executeLocalQuorumConsistencyGet(queryObject);
          logger.debug("rs has " + rs.getAvailableWithoutFetching() + (rs.isFullyFetched()?"":" (or more!)") );
          return deadlock;
      }
  
 +    /**
 +     * This is used for testing purpose
 +     * @return new DeadlockDetectionUtil object
 +     */
 +    DeadlockDetectionUtil getDeadlockDetectionUtil() {
 +      return new DeadlockDetectionUtil();
 +    }
 +    
      public List<String> getAllLocksForOwner(String ownerId, String keyspace, String table) throws MusicServiceException, MusicQueryException {
          List<String> toRet = new ArrayList<String>();
          String lockTable = table_prepend_name + table;