summaryrefslogtreecommitdiffstats
path: root/asdctool/src
diff options
context:
space:
mode:
authorPiotr Darosz <piotr.darosz@nokia.com>2018-06-15 08:28:00 +0200
committerTal Gitelman <tg851x@intl.att.com>2018-08-29 13:27:45 +0000
commit20da3d02c6c5507761c257b6ec6f58dcfc27d05a (patch)
tree6fef3ccd72cb8c092adac410b77a5da25284055a /asdctool/src
parent8eff5a1ff79ca212a42d0e69326af7dc00b7c503 (diff)
Add tests for SdcSchema classes
Introduce Cassandra Unit tool and tests for schema-related classes Change-Id: I14da602c42056730e7992dd92b4da8b87dd9fb0d Issue-ID: SDC-1358 Signed-off-by: Piotr Darosz <piotr.darosz@nokia.com>
Diffstat (limited to 'asdctool/src')
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/main/DataSchemaMenu.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/DataSchemaMenu.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/DataSchemaMenu.java
index 496eb1864e..fe117d1a1a 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/DataSchemaMenu.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/DataSchemaMenu.java
@@ -16,6 +16,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
+ * Modifications copyright (c) 2018 Nokia
+ * ================================================================================
*/
package org.openecomp.sdc.asdctool.main;
@@ -23,6 +25,7 @@ package org.openecomp.sdc.asdctool.main;
import org.openecomp.sdc.asdctool.impl.TitanGraphInitializer;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.dao.cassandra.schema.SdcSchemaBuilder;
+import org.openecomp.sdc.be.dao.cassandra.schema.SdcSchemaUtils;
import org.openecomp.sdc.common.api.ConfigurationSource;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
@@ -34,7 +37,7 @@ public class DataSchemaMenu {
public static void main(String[] args) {
- String operation = args[0];
+ String operation = args[0];
String appConfigDir = args[1];
@@ -45,10 +48,13 @@ public class DataSchemaMenu {
ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir);
ConfigurationManager configurationManager = new ConfigurationManager(configurationSource);
+ SdcSchemaBuilder sdcSchemaBuilder = new SdcSchemaBuilder(new SdcSchemaUtils(),
+ ConfigurationManager.getConfigurationManager().getConfiguration()::getCassandraConfig);
+
switch (operation.toLowerCase()) {
case "create-cassandra-structures":
log.debug("Start create cassandra keyspace, tables and indexes");
- if (SdcSchemaBuilder.createSchema()) {
+ if (sdcSchemaBuilder.createSchema()) {
log.debug("create cassandra keyspace, tables and indexes successfull");
System.exit(0);
} else {
@@ -69,7 +75,7 @@ public class DataSchemaMenu {
break;
case "clean-cassndra":
log.debug("Start clean keyspace, tables");
- if (SdcSchemaBuilder.deleteSchema()) {
+ if (sdcSchemaBuilder.deleteSchema()) {
log.debug(" successfull");
System.exit(0);
} else {