aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-dao
diff options
context:
space:
mode:
authorPiotr Krysiak <piotr.krysiak@nokia.com>2018-07-23 13:25:18 +0200
committerTal Gitelman <tg851x@intl.att.com>2018-08-01 16:47:58 +0300
commitcaf13efd0cb09e0d9c4ad09174ab34a2e57fb439 (patch)
tree33e47c09f4e284e335a536ac495211bf6a933e0f /catalog-dao
parent8b7fbe7f36fdff210ae956e206478d55a71eabd7 (diff)
Catalog-dao dead code removal
Issue-ID: SDC-1551 Change-Id: I4947b3f8219f20c543abf06798caf69035ed7aa0 Signed-off-by: Piotr Krysiak <piotr.krysiak@nokia.com>
Diffstat (limited to 'catalog-dao')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java31
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java15
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/resources/impl/ResourceUploader.java27
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaBuilderTest.java31
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/dao/graph/GraphElementFactoryTest.java2
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/resources/ArtifactDaoTest.java392
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/resources/AuditingDaoTest.java16
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/resources/CassandraTest.java2
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/resources/TitanGenericDaoTest.java67
9 files changed, 15 insertions, 568 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java
index e13b0ee9c5..e50c5e6278 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java
@@ -37,7 +37,8 @@ import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.dao.DAOTitanStrategy;
import org.openecomp.sdc.be.dao.TitanClientStrategy;
import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
-import org.openecomp.sdc.common.log.wrappers.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@@ -48,9 +49,8 @@ import java.util.concurrent.*;
@Component("titan-client")
public class TitanGraphClient {
-
- private static Logger logger = Logger.getLogger(TitanGraphClient.class.getName());
- private static Logger healthLogger = Logger.getLogger("titan.healthcheck");
+ private static Logger logger = LoggerFactory.getLogger(TitanGraphClient.class.getName());
+ private static Logger healthLogger = LoggerFactory.getLogger("titan.healthcheck");
private static final String HEALTH_CHECK = GraphPropertiesDictionary.HEALTH_CHECK.getProperty();
private static final String OK = "GOOD";
@@ -67,12 +67,6 @@ public class TitanGraphClient {
healthLogger.trace("Health Check Node Found...{}", v.property(HEALTH_CHECK));
graph.tx().commit();
- // Vertex v = graph.getVertices(HEALTH_CHECK, OK).iterator().next();
- // v.setProperty("healthcheck", OK + "_" +
- // System.currentTimeMillis());
- // graph.commit();
- // healthLogger.trace("Health Check Node
- // Found..."+v.getProperty(HEALTH_CHECK) );
return v;
}
}
@@ -397,19 +391,10 @@ public class TitanGraphClient {
if (!graphMgt.containsGraphIndex(prop.getProperty())) {
if (prop.isUnique()) {
index = graphMgt.buildIndex(prop.getProperty(), Vertex.class).addKey(propKey).unique().buildCompositeIndex();
-
- graphMgt.setConsistency(propKey, ConsistencyModifier.LOCK); // Ensures
- // only
- // one
- // name
- // per
- // vertex
- graphMgt.setConsistency(index, ConsistencyModifier.LOCK); // Ensures
- // name
- // uniqueness
- // in
- // the
- // graph
+ // Ensures only one name per vertex
+ graphMgt.setConsistency(propKey, ConsistencyModifier.LOCK);
+ // Ensures name uniqueness in the graph
+ graphMgt.setConsistency(index, ConsistencyModifier.LOCK);
} else {
graphMgt.buildIndex(prop.getProperty(), Vertex.class).addKey(propKey).buildCompositeIndex();
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java
index 5576f0db9f..f5ec18ac61 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java
@@ -86,21 +86,6 @@ public abstract class CategoryData extends GraphNode {
return "CategoryData [name=" + name + ", normalizedName=" + normalizedName + "uniqueId=" + uniqueId + "]";
}
- /*
- * @Override public int hashCode() { final int prime = 31; int result = 1;
- * result = prime * result + ((name == null) ? 0 : name.hashCode()); result
- * = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode()); return
- * result; }
- *
- * @Override public boolean equals(Object obj) { if (this == obj) return
- * true; if (obj == null) return false; if (getClass() != obj.getClass())
- * return false; CategoryData other = (CategoryData) obj; if (name == null)
- * { if (other.name != null) return false; } else if
- * (!name.equals(other.name)) return false; if (uniqueId == null) { if
- * (other.uniqueId != null) return false; } else if
- * (!uniqueId.equals(other.uniqueId)) return false; return true; }
- */
-
@Override
public String getUniqueIdKey() {
return GraphPropertiesDictionary.UNIQUE_ID.getProperty();
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/impl/ResourceUploader.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/impl/ResourceUploader.java
index 8b5dee4e8b..5b9f548b46 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/impl/ResourceUploader.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/impl/ResourceUploader.java
@@ -124,26 +124,6 @@ public class ResourceUploader implements IResourceUploader {
return status;
}
- /*
- * @Override public ResourceUploadStatus
- * updateServiceArtifact(ServiceArtifactData artifactUpdateData) {
- * ResourceUploadStatus status = ResourceUploadStatus.OK; if(resourceDAO ==
- * null) return ResourceUploadStatus.ERROR; Either<ServiceArtifactData,
- * ResourceUploadStatus> getServiceArtifactStatus =
- * getServiceArtifact(artifactUpdateData.getId());
- *
- * if(getServiceArtifactStatus.isRight()){
- * log.debug("ResourceUploadStatus:updateArtifactt artifact with id " +
- * artifactUpdateData.getId() + " not exist."); status =
- * getServiceArtifactStatus.right().value(); }
- * if(getServiceArtifactStatus.isLeft()){ status =
- * updateServiceArtifact(artifactUpdateData,
- * getServiceArtifactStatus.left().value()); }
- *
- * return status; }
- *
- */
-
@Override
public Either<ESArtifactData, ResourceUploadStatus> getArtifact(String id) {
if (resourceDAO == null)
@@ -152,13 +132,6 @@ public class ResourceUploader implements IResourceUploader {
return resourceDAO.getArtifact(id);
}
- /*
- * @Override public Either<ServiceArtifactData, ResourceUploadStatus>
- * getServiceArtifact(String id) { if(resourceDAO == null) return
- * Either.right(ResourceUploadStatus.ERROR);
- *
- * return resourceDAO.getServiceArtifact(id); }
- */
@Override
public void deleteArtifact(String id) {
if (resourceDAO != null) {
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaBuilderTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaBuilderTest.java
index 14eda51a03..f902f8f603 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaBuilderTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaBuilderTest.java
@@ -44,24 +44,6 @@ public class SdcSchemaBuilderTest extends DAOConfDependentTest{
result = SdcSchemaBuilder.deleteSchema();
}
- /*@Test
- public void testParseKeyspaceMetadata() throws Exception {
- List<KeyspaceMetadata> keyspacesMetadata = new LinkedList<>();
- Map<String, Map<String, List<String>>> result;
-
- // default test
- result = Deencapsulation.invoke(SdcSchemaBuilder.class, "parseKeyspaceMetadata", keyspacesMetadata);
- }*/
-
- /*@Test
- public void testGetMetadataTablesStructure() throws Exception {
- List<KeyspaceMetadata> keyspacesMetadata = new LinkedList<>();
- Map<String, Map<String, List<String>>> result;
-
- // default test
- result = Deencapsulation.invoke(SdcSchemaBuilder.class, "getMetadataTablesStructure", keyspacesMetadata);
- }*/
-
@Test
public void testCreateIndexName() throws Exception {
String table = "";
@@ -72,19 +54,6 @@ public class SdcSchemaBuilderTest extends DAOConfDependentTest{
result = Deencapsulation.invoke(SdcSchemaBuilder.class, "createIndexName", table, column);
}
- /*@Test
- public void testAlterTable() throws Exception {
- Session session = null;
- Map<String, List<String>> existingTablesMetadata = null;
- ITableDescription tableDescription = null;
- String tableName = "";
- Map<String, ImmutablePair<DataType, Boolean>> columnDescription = null;
-
- // default test
- Deencapsulation.invoke(SdcSchemaBuilder.class, "alterTable",
- new Object[] { Session.class, Map.class, ITableDescription.class, tableName, Map.class });
- }*/
-
@Test
public void testCreateKeyspace() throws Exception {
String keyspace = "mock";
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/graph/GraphElementFactoryTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/graph/GraphElementFactoryTest.java
index 47dccd3bea..7a66f85d3f 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/graph/GraphElementFactoryTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/graph/GraphElementFactoryTest.java
@@ -62,8 +62,6 @@ public class GraphElementFactoryTest {
properties);
result = Deencapsulation.invoke(GraphElementFactory.class, "createNode", NodeTypeEnum.Service.getName(),
properties);
- // result = Deencapsulation.invoke(GraphElementFactory.class, "createNode",
- // NodeTypeEnum.Resource.getName(), properties);
result = Deencapsulation.invoke(GraphElementFactory.class, "createNode", NodeTypeEnum.Property.getName(),
properties);
result = Deencapsulation.invoke(GraphElementFactory.class, "createNode", NodeTypeEnum.HeatParameter.getName(),
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/ArtifactDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/ArtifactDaoTest.java
index fe31e39199..dc65d5d236 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/ArtifactDaoTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/ArtifactDaoTest.java
@@ -21,9 +21,6 @@
package org.openecomp.sdc.be.resources;
import fj.data.Either;
-import static org.junit.Assert.fail;
-import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
-import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.config.ConfigurationManager;
@@ -70,7 +67,7 @@ public class ArtifactDaoTest extends DAOConfDependentTest {
public void testSaveNewArtifact() {
// daoUploader = new ArtifactUploader(artifactDAO);
if (daoUploader == null) {
- fail();
+ assertTrue(false);
}
String strData = "qweqwqweqw34e4wrwer";
@@ -86,111 +83,6 @@ public class ArtifactDaoTest extends DAOConfDependentTest {
}
- /*
- * @Test public void testSaveNewImage(){
- *
- * Path iconPath = Paths.get(TEST_IMAGES_DIRECTORY, "apache.png");
- *
- * ImageData imageData = new ImageData(); try {
- * imageData.setData(Files.readAllBytes(iconPath));
- * imageData.setComponentName("ComponentMarina");
- * imageData.setComponentVersion("v.1.0");
- * imageData.setArtifactName("apache.png");
- * imageData.setResourceCreator("Marina");
- * imageData.setResourceLastUpdater("Marina"); ResourceUploadStatus status =
- * daoUploader.saveImage(imageData, true); assertEquals(status,
- * ResourceUploadStatus.OK); } catch (IOException e) { e.printStackTrace(); }
- *
- *
- * }
- */
-
- // @Test
- // public void testGetArtifactsList() {
- // //daoUploader = new ArtifactUploader(artifactDAO);
- // if(daoUploader==null){
- // assertTrue(false);
- // }
- // String myNodeType = "MyListNodeType";
- //
- //
- //
- // //resourceDAO.save(indexedNodeType);
- //
- // String strData = "qweqwqweqw34e4wrwer";
- // ESArtifactData arData1 = new ESArtifactData("artifactNewMarina_1",
- // strData.getBytes());
- //
- //
- // ResourceUploadStatus status = daoUploader.saveArtifact(arData1, true);
- // assertEquals(status, ResourceUploadStatus.OK);
- //
- // ESArtifactData arData2 = new ESArtifactData("artifactNewMarina_2",
- // strData.getBytes());
- //
- //
- // status = daoUploader.saveArtifact(arData2, true);
- // assertEquals(status, ResourceUploadStatus.OK);
- //
- // ESArtifactData arData3 = new ESArtifactData("artifactNewMarina_3",
- // strData.getBytes());
- //
- //
- // status = daoUploader.saveArtifact(arData3, true);
- // assertEquals(status, ResourceUploadStatus.OK);
- //
- //
- //
- // Either<List<ESArtifactData>, ResourceUploadStatus> arrArray =
- // daoUploader.getArtifacts(myNodeType, nodeTypeVersion);
- // assertTrue(arrArray.isLeft());
- //
- // assertEquals(3, arrArray.left().value().size());
- //
- // daoUploader.deleteArtifact(arData1.getId());
- // daoUploader.deleteArtifact(arData2.getId());
- // daoUploader.deleteArtifact(arData3.getId());
- //
- // //resourceDAO.delete(IndexedNodeType.class, indexedNodeType.getId());
- //
- // }
- //
-
- /*
- * @Test public void testGetSeviceArtifactsList() {
- *
- * if(daoUploader==null){ assertTrue(false); } String strData =
- * "qweqwqweqw34e4wrwer";
- *
- * ServiceArtifactData serviceArData = new
- * ServiceArtifactData("serviceArData", topologyTemplateName,
- * topologyTemplateVersion, nodeTypeTemplate1, nodeType, nodeTypeVersion,
- * "YANG", strData.getBytes(), strData.getBytes(), "Marina", null);
- * //serviceArData.setRefArtifactId(arData.getId()); ResourceUploadStatus
- * status = daoUploader.saveServiceArtifact(serviceArData, true);
- *
- * ServiceArtifactData serviceArData1 = new
- * ServiceArtifactData("serviceArData1", topologyTemplateName,
- * topologyTemplateVersion, nodeTypeTemplate2, nodeType2, nodeTypeVersion2,
- * "YANG", strData.getBytes(), strData.getBytes(), "Marina", null);
- * //serviceArData1.setRefArtifactId(arData4.getId()); status =
- * daoUploader.saveServiceArtifact(serviceArData1, true);
- * ServiceArtifactData getServiceData =
- * daoUploader.getServiceArtifact(serviceArData.getId()).left().value();
- *
- * List<ServiceArtifactData> arrArray =
- * daoUploader.getServiceArtifacts(topologyTemplateName,
- * topologyTemplateVersion).left().value();
- *
- * assertEquals(2, arrArray.size());
- *
- * daoUploader.deleteArtifact(serviceArData.getId());
- * daoUploader.deleteArtifact(serviceArData1.getId());
- *
- *
- * }
- */
-
@Test
public void testGetArtifact() {
@@ -210,67 +102,16 @@ public class ArtifactDaoTest extends DAOConfDependentTest {
}
- /*
- * @Test public void testGetSeviceArtifact() {
- *
- * ServiceArtifactData servArData = getServiceArtifactData();
- *
- * Either<ServiceArtifactData, ResourceUploadStatus>
- * getServiceArtifactStatus =
- * daoUploader.getServiceArtifact("MyService:v.1.1:updatedServiceArtifact");
- * if (!getServiceArtifactStatus.isLeft()){
- * daoUploader.saveServiceArtifact(servArData, true);
- * getServiceArtifactStatus =
- * daoUploader.getServiceArtifact(servArData.getId()); }
- *
- * assertNotNull(getServiceArtifactStatus.left().value());
- *
- * daoUploader.deleteArtifact(getServiceArtifactStatus.left().value().getId(
- * ));
- *
- *
- * }
- */
-
- /*
- * @Test public void testGetSeviceArtifactsCollection() {
- *
- * prepareTopolgyService(); prepareTestTopolgyService();
- * Either<ServiceArtifactsDataCollection, ResourceUploadStatus>
- * getServiceArtifactsCollectionStatus =
- * daoUploader.getServiceArtifactsCollection(topologyTemplateName,
- * topologyTemplateVersion); ServiceArtifactsDataCollection serviceAtrifacts
- * = getServiceArtifactsCollectionStatus.left().value();
- *
- * Map<String, List<ArtifactData>> map =
- * serviceAtrifacts.getServiceArtifactDataMap();
- *
- * List<ArtifactData> list = map.get(nodeType); assertNotNull(list);
- * assertEquals(2, list.size());
- *
- *
- * list = map.get(nodeTypeTemplate1 ); assertNotNull(list); assertEquals(1,
- * list.size());
- *
- * list = map.get(nodeTypeTemplate2 ); assertNotNull(list); assertEquals(1,
- * list.size());
- *
- *
- * }
- */
@Test
public void testUpdateArtifact() {
- // daoUploader = new ArtifactUploader(artifactDAO);
if (daoUploader == null) {
- fail();
+ fail();
}
ResourceUploadStatus status = ResourceUploadStatus.OK;
String myNodeType = "MyUpdatedNodeType";
- // resourceDAO.save(indexedNodeType);
-
ESArtifactData arData = getArtifactData(myNodeType, nodeTypeVersion);
Either<ESArtifactData, ResourceUploadStatus> getArtifactStatus = daoUploader.getArtifact(arData.getId());
@@ -283,8 +124,6 @@ public class ArtifactDaoTest extends DAOConfDependentTest {
status = daoUploader.updateArtifact(arData);
assertEquals(status, ResourceUploadStatus.OK);
- // resourceDAO.delete(IndexedNodeType.class, indexedNodeType.getId());
-
}
private ESArtifactData getArtifactData(String componentName, String componentVersion) {
@@ -292,231 +131,4 @@ public class ArtifactDaoTest extends DAOConfDependentTest {
return new ESArtifactData("updatedArtifact", strData.getBytes());
}
-
- /*
- * private ServiceArtifactData getServiceArtifactData(){ String strData =
- * "qweqwqweqw34e4wrwer"; ServiceArtifactData arData = new
- * ServiceArtifactData("updatedServiceArtifact", "MyService", "v.1.1",
- * "MyComponentTemplate", "MyComponent", "v.1.1", "YANG",
- * strData.getBytes(), strData.getBytes(), "Marina", null);
- *
- * return arData; }
- */
-
- /*
- * private void prepareTopolgyService(){
- *
- * List<String> listCap = new ArrayList<String>(); listCap.add("very_evil");
- * List<String> listCap1 = new ArrayList<String>(); listCap.add("evil");
- * try{ // Initialize test data IndexedNodeType indexedNodeType = new
- * IndexedNodeType(); CSARDependency dep = new CSARDependency();
- * dep.setName(nodeType); dep.setVersion(nodeTypeVersion);
- * indexedNodeType.setElementId(nodeType);
- * indexedNodeType.setArchiveName(nodeType);
- * indexedNodeType.setArchiveVersion(nodeTypeVersion);
- * indexedNodeType.setCreationDate(new Date());
- * indexedNodeType.setLastUpdateDate(new Date());
- * indexedNodeType.setDefaultCapabilities(listCap);
- * resourceDAO.save(indexedNodeType);
- *
- *
- * IndexedNodeType indexedNodeType1 = new IndexedNodeType();
- * indexedNodeType1.setElementId(nodeType2);
- * indexedNodeType1.setArchiveName(nodeType2);
- * indexedNodeType1.setArchiveVersion(nodeTypeVersion2); CSARDependency dep1
- * = new CSARDependency(); dep1.setName(nodeType2);
- * dep1.setVersion(nodeTypeVersion2); indexedNodeType1.setCreationDate(new
- * Date()); indexedNodeType1.setLastUpdateDate(new Date());
- * indexedNodeType1.setDefaultCapabilities(listCap1);
- * resourceDAO.save(indexedNodeType1);
- *
- *
- * indexedNodeType.setElementId(nodeType3);
- * indexedNodeType.setArchiveName(nodeType3);
- * indexedNodeType.setArchiveVersion(nodeNypeVersion3); CSARDependency dep2
- * = new CSARDependency(); dep2.setName(nodeType3);
- * dep2.setVersion(nodeNypeVersion3); indexedNodeType.setCreationDate(new
- * Date()); indexedNodeType.setLastUpdateDate(new Date());
- * indexedNodeType.setDefaultCapabilities(null);
- * resourceDAO.save(indexedNodeType); String osgiliath100Id =
- * indexedNodeType.getId();
- *
- * Topology topology = new Topology(); topology.setId(topologyId);
- * Set<CSARDependency> dependencies = new HashSet<CSARDependency>();
- * dependencies.add(dep); dependencies.add(dep2); dependencies.add(dep1);
- * topology.setDependencies(dependencies); Map<String, NodeTemplate>
- * nodeTemplates = new HashMap <String, NodeTemplate>();
- *
- * NodeTemplate template1 = new NodeTemplate(nodeType, null, null, null,
- * null, null, null); template1.setName(nodeTypeTemplate1);
- * nodeTemplates.put(nodeTypeTemplate1, template1 );
- *
- * NodeTemplate template2 = new NodeTemplate(nodeType2, null, null, null,
- * null, null, null); template2.setName(nodeTypeTemplate2 );
- * nodeTemplates.put(nodeTypeTemplate2, template2 );
- *
- * NodeTemplate template3 = new NodeTemplate(nodeType, null, null, null,
- * null, null, null); template3.setName(nodeTypeTemplate3 );
- * nodeTemplates.put(nodeTypeTemplate3, template3);
- *
- * topology.setNodeTemplates(nodeTemplates); resourceDAO.save(topology);
- *
- * TopologyTemplate topologyTemplate = new TopologyTemplate();
- * topologyTemplate.setId(topologyTemplateName);
- * topologyTemplate.setName(topologyTemplateName);
- * topologyTemplate.setTopologyId(topology.getId());
- * topologyTemplate.setDescription("my topology template");
- * resourceDAO.save(topologyTemplate);
- *
- * String strData = "qweqwqweqw34e4wrwer"; ArtifactData arData = new
- * ArtifactData("artifact1", nodeType, nodeTypeVersion, "YANG",
- * strData.getBytes(), strData.getBytes(), "Marina"); ArtifactData arData1 =
- * new ArtifactData("artifact2", nodeType, nodeTypeVersion, "YANG",
- * strData.getBytes(), strData.getBytes(), "Marina"); ResourceUploadStatus
- * status = daoUploader.saveArtifact(arData, true); status =
- * daoUploader.saveArtifact(arData1, true);
- *
- * ArtifactData arData3 = new ArtifactData("artifact1", nodeType2,
- * nodeTypeVersion2, "YANG", strData.getBytes(), strData.getBytes(),
- * "Marina"); status = daoUploader.saveArtifact(arData3, true);
- *
- * ArtifactData arData4 = new ArtifactData("artifact2", nodeType2,
- * nodeTypeVersion2, "YANG", strData.getBytes(), strData.getBytes(),
- * "Marina"); status = daoUploader.saveArtifact(arData4, true);
- *
- * ServiceArtifactData serviceArData = new
- * ServiceArtifactData("serviceArData", topologyTemplateName,
- * topologyTemplateVersion, nodeTypeTemplate1, nodeType, nodeTypeVersion,
- * "YANG", strData.getBytes(), strData.getBytes(), "Marina",
- * arData.getId());
- *
- * status = daoUploader.saveServiceArtifact(serviceArData, true);
- *
- * ServiceArtifactData serviceArData1 = new
- * ServiceArtifactData("serviceArData1", topologyTemplateName,
- * topologyTemplateVersion, nodeTypeTemplate2, nodeType2, nodeTypeVersion2,
- * "YANG", strData.getBytes(), strData.getBytes(), "Marina",
- * arData4.getId());
- *
- * status = daoUploader.saveServiceArtifact(serviceArData1, true);
- *
- *
- * } catch (Exception e) {
- * e.printStackTrace(); }
- *
- * }
- *
- * private void prepareTestTopolgyService(){
- *
- * List<String> listCap = new ArrayList<String>();
- * listCap.add("very_evil test"); List<String> listCap1 = new
- * ArrayList<String>(); listCap.add("evil test"); try{ // Initialize test
- * data IndexedNodeType indexedNodeType = new IndexedNodeType();
- * CSARDependency dep = new CSARDependency(); dep.setName(nodeType +
- * " test"); dep.setVersion(nodeTypeVersion);
- * indexedNodeType.setElementId(nodeType + " test");
- * indexedNodeType.setArchiveName(nodeType + " test");
- * indexedNodeType.setArchiveVersion(nodeTypeVersion);
- * indexedNodeType.setCreationDate(new Date());
- * indexedNodeType.setLastUpdateDate(new Date());
- * indexedNodeType.setDefaultCapabilities(listCap);
- * resourceDAO.save(indexedNodeType);
- *
- *
- * IndexedNodeType indexedNodeType1 = new IndexedNodeType();
- * indexedNodeType1.setElementId(nodeType2 + " test");
- * indexedNodeType1.setArchiveName(nodeType2 + " test");
- * indexedNodeType1.setArchiveVersion(nodeTypeVersion2); CSARDependency dep1
- * = new CSARDependency(); dep1.setName(nodeType2 + " test");
- * dep1.setVersion(nodeTypeVersion2); indexedNodeType1.setCreationDate(new
- * Date()); indexedNodeType1.setLastUpdateDate(new Date());
- * indexedNodeType1.setDefaultCapabilities(listCap1);
- * resourceDAO.save(indexedNodeType1);
- *
- *
- * indexedNodeType.setElementId(nodeType3 + " test");
- * indexedNodeType.setArchiveName(nodeType3 + " test");
- * indexedNodeType.setArchiveVersion(nodeNypeVersion3); CSARDependency dep2
- * = new CSARDependency(); dep2.setName(nodeType3 + " test");
- * dep2.setVersion(nodeNypeVersion3); indexedNodeType.setCreationDate(new
- * Date()); indexedNodeType.setLastUpdateDate(new Date());
- * indexedNodeType.setDefaultCapabilities(null);
- * resourceDAO.save(indexedNodeType); String osgiliath100Id =
- * indexedNodeType.getId();
- *
- * Topology topology = new Topology(); topology.setId(topologyId + " test");
- * Set<CSARDependency> dependencies = new HashSet<CSARDependency>();
- * dependencies.add(dep); dependencies.add(dep2); dependencies.add(dep1);
- * topology.setDependencies(dependencies); Map<String, NodeTemplate>
- * nodeTemplates = new HashMap <String, NodeTemplate>();
- *
- * NodeTemplate template1 = new NodeTemplate(nodeType + " test", null, null,
- * null, null, null, null); template1.setName(nodeTypeTemplate1 + " test");
- * nodeTemplates.put(nodeTypeTemplate1 + " test", template1 );
- *
- * NodeTemplate template2 = new NodeTemplate(nodeType2 + " test", null,
- * null, null, null, null, null); template2.setName(nodeTypeTemplate2 +
- * " test" ); nodeTemplates.put(nodeTypeTemplate2 + " test", template2 );
- *
- * NodeTemplate template3 = new NodeTemplate(nodeType, null, null, null,
- * null, null, null); template3.setName(nodeTypeTemplate3 + " test" );
- * nodeTemplates.put(nodeTypeTemplate3 + " test", template3);
- *
- * topology.setNodeTemplates(nodeTemplates); resourceDAO.save(topology);
- *
- * TopologyTemplate topologyTemplate = new TopologyTemplate();
- * topologyTemplate.setId(topologyTemplateName + " test");
- * topologyTemplate.setName(topologyTemplateName + " test");
- * topologyTemplate.setTopologyId(topology.getId());
- * topologyTemplate.setDescription("my topology template");
- * resourceDAO.save(topologyTemplate);
- *
- * String strData = "qweqwqweqw34e4wrwer"; ArtifactData arData = new
- * ArtifactData("artifact1 test", nodeType + " test", nodeTypeVersion,
- * "YANG", strData.getBytes(), strData.getBytes(), "Marina"); ArtifactData
- * arData1 = new ArtifactData("artifact2 test", nodeType + " test",
- * nodeTypeVersion, "YANG", strData.getBytes(), strData.getBytes(),
- * "Marina"); ResourceUploadStatus status = daoUploader.saveArtifact(arData,
- * true); status = daoUploader.saveArtifact(arData1, true);
- *
- * ArtifactData arData3 = new ArtifactData("artifact1 test", nodeType2 +
- * " test", nodeTypeVersion2, "YANG", strData.getBytes(),
- * strData.getBytes(), "Marina"); status = daoUploader.saveArtifact(arData3,
- * true);
- *
- * ArtifactData arData4 = new ArtifactData("artifact2 test", nodeType2 +
- * " test", nodeTypeVersion2, "YANG", strData.getBytes(),
- * strData.getBytes(), "Marina"); status = daoUploader.saveArtifact(arData4,
- * true);
- *
- * ServiceArtifactData serviceArData = new
- * ServiceArtifactData("serviceArData test" , topologyTemplateName +
- * " test", topologyTemplateVersion, nodeTypeTemplate1 + " test", nodeType +
- * " test", nodeTypeVersion, "YANG", strData.getBytes(), strData.getBytes(),
- * "Marina", arData.getId());
- *
- * status = daoUploader.saveServiceArtifact(serviceArData, true);
- *
- * ServiceArtifactData serviceArData1 = new
- * ServiceArtifactData("serviceArData1 test", topologyTemplateName +
- * " test", topologyTemplateVersion, nodeTypeTemplate2 + " test", nodeType2
- * + " test", nodeTypeVersion2, "YANG", strData.getBytes(),
- * strData.getBytes(), "Marina", arData4.getId());
- *
- * status = daoUploader.saveServiceArtifact(serviceArData1, true);
- *
- *
- * } catch (Exception e) {
- * e.printStackTrace(); }
- *
- * }
- */
-
- private void clearIndex(String indexName, Class<?> clazz) throws InterruptedException {
-
- DeleteIndexResponse actionGet = esclient.getClient().admin().indices().delete(new DeleteIndexRequest(indexName))
- .actionGet();
- assertTrue(actionGet.isAcknowledged());
- }
-
}
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/AuditingDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/AuditingDaoTest.java
index 5639228233..919c69fce4 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/AuditingDaoTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/AuditingDaoTest.java
@@ -386,22 +386,6 @@ public class AuditingDaoTest extends DAOConfDependentTest{
assertTrue(!esclient.getClient().admin().indices().prepareExists(expectedIndexName).execute().actionGet()
.isExists());
- // Client client = esclient.getClient();
- // final CreateIndexRequestBuilder createIndexRequestBuilder =
- // client.admin().indices().prepareCreate(expectedIndexName);
- // final XContentBuilder mappingBuilder =
- // jsonBuilder().startObject().startObject("resourceadminevent")
- // .startObject("_ttl").field("enabled", "true").field("default",
- // "1s").endObject().endObject()
- // .endObject();
- // System.out.println(mappingBuilder.string());
- // createIndexRequestBuilder.addMapping(documentType, mappingBuilder);
- //
- // // MAPPING DONE
- // createIndexRequestBuilder.execute().actionGet();
- //
- //
-
Map<AuditingFieldsKey, Object> params = getResourceAdminEventParams(timestamp, "DRequest");
params.put(AuditingFieldsKey.AUDIT_DISTRIBUTION_ID, distributionId);
testCreationPeriodScenario(params, creationPeriod, expectedIndexName, ResourceAdminEvent.class);
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/CassandraTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/CassandraTest.java
index 195232aaf5..e18a4528b1 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/CassandraTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/CassandraTest.java
@@ -52,8 +52,6 @@ public class CassandraTest {
Mapper<Account> mapper = new MappingManager(session).mapper(Account.class);
Account account = new Account("John Doe", "jd@example.com");
- // Class<? extends Account> class1 = account.getClass();
- // Class class2 = Account.class;
mapper.save(account);
Account whose = mapper.get("jd@example.com");
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/TitanGenericDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/TitanGenericDaoTest.java
index d420f630e4..e8c6b3cdd1 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/TitanGenericDaoTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/TitanGenericDaoTest.java
@@ -21,7 +21,11 @@
package org.openecomp.sdc.be.resources;
import com.google.gson.Gson;
-import com.thinkaurelius.titan.core.*;
+import com.thinkaurelius.titan.core.PropertyKey;
+import com.thinkaurelius.titan.core.TitanEdge;
+import com.thinkaurelius.titan.core.TitanFactory;
+import com.thinkaurelius.titan.core.TitanGraph;
+import com.thinkaurelius.titan.core.TitanVertex;
import com.thinkaurelius.titan.core.attribute.Text;
import com.thinkaurelius.titan.core.schema.TitanManagement;
import fj.data.Either;
@@ -414,70 +418,9 @@ public class TitanGenericDaoTest {
propKey = graphMgt.makePropertyKey("string2").dataType(String.class).make();
- // graphMgt.buildIndex("string2", Vertex.class).addKey(propKey,
- // Mapping.TEXT.getParameter()).buildMixedIndex("search");
graphMgt.buildIndex("string2", Vertex.class).addKey(propKey).unique().buildCompositeIndex();
graphMgt.commit();
- // TitanVertex v = graph.addVertex();
- // v.addProperty("string1", "My new String 1");
- // v.addProperty("string2", "String11");
- // graph.commit();
- //
- // v = graph.addVertex();
- // v.addProperty("string1", "my new string 1");
- // v.addProperty("string2", "string11");
- // graph.commit();
- //
- // System.out.println("First index search - case");
- //
- // Iterable<Vertex> vertices = graph.getVertices("string1", "My new
- // String 1");
- // Iterator<Vertex> iter = vertices.iterator();
- // while ( iter.hasNext() ){
- // Vertex ver = iter.next();
- // System.out.println(com.tinkerpop.blueprints.util.ElementHelper.getProperties(ver));
- // }
- // System.out.println("First index search non case");
- //
- // vertices = graph.getVertices("string1", "my new string 1");
- // iter = vertices.iterator();
- // while ( iter.hasNext() ){
- // Vertex ver = iter.next();
- // System.out.println(com.tinkerpop.blueprints.util.ElementHelper.getProperties(ver));
- // }
- // System.out.println("Second index search case");
- //
- // vertices = graph.getVertices("string2", "String11");
- // iter = vertices.iterator();
- // while ( iter.hasNext() ){
- // Vertex ver = iter.next();
- // System.out.println(com.tinkerpop.blueprints.util.ElementHelper.getProperties(ver));
- // }
- // System.out.println("second index search non case");
- //
- // vertices = graph.getVertices("string2", "string11");
- // iter = vertices.iterator();
- // while ( iter.hasNext() ){
- // Vertex ver = iter.next();
- // System.out.println(com.tinkerpop.blueprints.util.ElementHelper.getProperties(ver));
- // }
- // System.out.println("Query index search case");
- // vertices = graph.query().has("string1", "My new String
- // 1").vertices();
- // iter = vertices.iterator();
- // while ( iter.hasNext() ){
- // Vertex ver = iter.next();
- // System.out.println(com.tinkerpop.blueprints.util.ElementHelper.getProperties(ver));
- // }
- // System.out.println("Query index search non case");
- // vertices = graph.query().has("string1", "my new string
- // 1").vertices();
- // iter = vertices.iterator();
- // while ( iter.hasNext() ){
- // Vertex ver = iter.next();
- // System.out.println(com.tinkerpop.blueprints.util.ElementHelper.getProperties(ver));
- // }
log.debug("**** predicat index search non case");
Iterable<TitanVertex> vertices = graph.query().has("string1", Text.REGEX, "my new string 1").vertices();