From b581010e2f27d56a0b37e11899a6755993035d51 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Tue, 9 Feb 2016 17:59:47 +0000 Subject: [PATCH] Removed useless fields in IndexFields class. Tests class added and pom dependencies fixed git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@124023 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 32 ++++++++++++---- .../utils/IndexFields.java | 19 ++-------- .../social_data_indexing_common/Tests.java | 37 +++++++++++++++++++ 3 files changed, 64 insertions(+), 24 deletions(-) create mode 100644 src/test/java/org/gcube/socialnetworking/social_data_indexing_common/Tests.java diff --git a/pom.xml b/pom.xml index 3d4f79e..ab70632 100644 --- a/pom.xml +++ b/pom.xml @@ -49,11 +49,21 @@ + + org.gcube.socialnetworking + social-data-indexing-common + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + junit junit 4.8 + + org.elasticsearch + elasticsearch + ${elasticSearchVersion} + org.gcube.common.portal portal-manager @@ -73,6 +83,11 @@ aslsocial provided + + org.gcube.portal + social-networking-library + provided + org.gcube.portal notifications-common-library @@ -87,23 +102,24 @@ org.gcube.dvos usermanagement-core + + com.sun.mail + javax.mail + provided + org.gcube.resources.discovery ic-client + + com.netflix.astyanax + astyanax + org.gcube.core common-encryption provided - - org.slf4j - slf4j-log4j12 - - - org.slf4j - slf4j-api - diff --git a/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/IndexFields.java b/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/IndexFields.java index 5f7799a..f7f2f18 100644 --- a/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/IndexFields.java +++ b/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/IndexFields.java @@ -11,28 +11,15 @@ public class IndexFields { // name of the index public static final String INDEX_NAME = "social"; - // table for comments - public static final String COMMENT_TABLE = "comments"; - - // table for feeds - public static final String FEED_TABLE = "feeds"; - // table for enhanced feeds public static final String EF_FEEDS_TABLE = "enhanced_feeds"; - // comment table's fields - public static final String COMMENT_TEXT = "description"; - public static final String COMMENT_PARENT_ID = "parent_id"; - - // feed table's fields - public static final String FEED_TEXT = "description"; - public static final String FEED_TYPE = "type"; - public static final String FEED_VRE_ID = "vre_id"; - - // enhanced feeds' fields + // enhanced feeds' fields of interest public static final String EF_ATTACHMENT_NAME = "attachments.name"; public static final String EF_FEED_TEXT = "feed.description"; public static final String EF_COMMENT_TEXT = "comments.text"; public static final String EF_PREVIEW_DESCRIPTION = "feed.linkTitle"; + public static final String EF_FEED_AUTHOR = "feed.fullName"; + public static final String EF_FEED_VRE_ID = "feed.vreid"; } diff --git a/src/test/java/org/gcube/socialnetworking/social_data_indexing_common/Tests.java b/src/test/java/org/gcube/socialnetworking/social_data_indexing_common/Tests.java new file mode 100644 index 0000000..7570fa6 --- /dev/null +++ b/src/test/java/org/gcube/socialnetworking/social_data_indexing_common/Tests.java @@ -0,0 +1,37 @@ +package org.gcube.socialnetworking.social_data_indexing_common; + +import org.gcube.common.authorization.library.provider.SecurityTokenProvider; +import org.gcube.socialnetworking.social_data_indexing_common.utils.ElasticSearchRunningCluster; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Tests { + + /** + * Logger + */ + private static Logger _log = LoggerFactory.getLogger(Tests.class); + + @Before + public void beforeTest(){ + // set security token + SecurityTokenProvider.instance.set("422d795b-d978-41d5-abac-b1c8be90a632"); + } + + @Test + public void retrieveElasticSearchInformation() throws Exception{ + + ElasticSearchRunningCluster es = new ElasticSearchRunningCluster("gcube"); + _log.debug("Result is " + es.getClusterName() + " " + es.getHosts() + " " + es.getPorts()); + + } + + @After + public void after(){ + + } + +}