From d92bdc4984e32ebf291fbc25ff1ae775d699a234 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Fri, 4 Nov 2016 15:00:38 +0200 Subject: [PATCH 01/35] Transferred old code base to ATTX with some minor refactoring. --- .../attx-api-plugin/build.gradle | 28 ++ .../apis/es/plugin/siren/ATTXApiPlugin.java | 31 ++ .../es/plugin/siren/AbstractRestHandler.java | 125 ++++++++ .../plugin/siren/CollectionRestHandler.java | 65 +++++ .../apis/es/plugin/siren/IDRestHandler.java | 90 ++++++ .../apis/es/plugin/siren/QueryParser.java | 268 ++++++++++++++++++ .../src/main/resources/es-plugin.properties | 1 + 7 files changed, 608 insertions(+) create mode 100644 elasticsearch-siren/attx-api-plugin/build.gradle create mode 100644 elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java create mode 100644 elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java create mode 100644 elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java create mode 100644 elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java create mode 100644 elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java create mode 100644 elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties diff --git a/elasticsearch-siren/attx-api-plugin/build.gradle b/elasticsearch-siren/attx-api-plugin/build.gradle new file mode 100644 index 0000000..e9901b1 --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin/build.gradle @@ -0,0 +1,28 @@ +// Note: "common.gradle" in the root project contains additional initialization +// for this project. This initialization is applied in the "build.gradle" +// of the root project. + +// NetBeans will automatically add "run" and "debug" tasks relying on the +// "mainClass" property. You may however define the property prior executing +// tasks by passing a "-PmainClass=" argument. +// +// Note however, that you may define your own "run" and "debug" task if you +// prefer. In this case NetBeans will not add these tasks but you may rely on +// your own implementation. +if (!hasProperty('mainClass')) { + ext.mainClass = '' +} + +dependencies { + // TODO: Add dependencies here + // but note that JUnit should have already been added in parent.gradle. + // By default, only the Maven Central Repository is specified in + // parent.gradle. + // + // You can read more about how to add dependency here: + // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies + + compile \ + 'org.elasticsearch:elasticsearch:1.3.4', + 'com.sindicetech.siren:siren-qparser:1.4' +} diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java new file mode 100644 index 0000000..fc2a357 --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java @@ -0,0 +1,31 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.hu.attx.apis.es.plugin.siren; + +import org.elasticsearch.plugins.AbstractPlugin; +import org.elasticsearch.rest.RestModule; + +/** + * + * @author jkesanie + */ +public class ATTXApiPlugin extends AbstractPlugin { + + @Override + public String name() { + return "ATTXApiPlugin"; + } + + @Override + public String description() { + return "Siren plugin based implementation of a simple query interface"; + } + + public void onModule(RestModule restModule) { + restModule.addRestAction(CollectionRestHandler.class); + restModule.addRestAction(IDRestHandler.class); + } +} diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java new file mode 100644 index 0000000..9b18309 --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java @@ -0,0 +1,125 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.hu.attx.apis.es.plugin.siren; + +import java.util.Iterator; +import java.util.Map; +import org.elasticsearch.action.search.SearchRequestBuilder; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.client.Client; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.BytesRestResponse; +import org.elasticsearch.rest.RestChannel; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.search.SearchHits; +import org.elasticsearch.search.SearchHit; +import org.elasticsearch.search.aggregations.Aggregations; +import org.elasticsearch.search.aggregations.Aggregation; +import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.search.sort.SortOrder; + + +/** + * + * @author jkesanie + */ +public abstract class AbstractRestHandler extends BaseRestHandler { + + protected final String API_VERSION = "v1"; + protected final String DEFAULT_SORT_TYPE = "asc"; + + protected final int DEFAULT_SIZE = 20; + protected final int DEFAULT_START = 0; + + protected AbstractRestHandler(Settings settings, Client client) { + super(settings, client); + } + + protected void sendSuccessResponse(RestRequest request, RestChannel channel, SearchResponse response) throws Exception { + XContentBuilder b = XContentFactory.jsonBuilder(); + b.startObject(); + b.field("time", response.getTookInMillis()); + + SearchHits hits = response.getHits(); + b.field("totalHits", hits.getTotalHits()); + + b.startArray("hits"); + for(SearchHit hit: hits.getHits()) { + Map map = hit.getSource(); + b.map(map); + } + b.endArray(); + + Aggregations aggs = response.getAggregations(); + if(aggs != null) { + b.startObject("aggregations"); + Iterator ai = aggs.iterator(); + while(ai.hasNext()) { + Aggregation a = ai.next(); + ((InternalAggregation)a).toXContent(b, null); + } + b.endObject(); + } + + b.endObject(); + b.flush(); + + channel.sendResponse(new BytesRestResponse(RestStatus.OK, "application/json", b.string().getBytes())); + } + + protected void sendEmptyResponse(RestChannel channel) throws Exception { + channel.sendResponse(new BytesRestResponse(RestStatus.OK, "application/json", "{\"hits\": []}".getBytes())); + } + + protected void sendErrorResponse(RestChannel channel, String error) { + channel.sendResponse(new BytesRestResponse(RestStatus.OK, "application/json", "{\"error\": \"" + error + "\"}".getBytes())); + } + + protected void doQuery(QueryBuilder qb, RestRequest rr, RestChannel rc, Client client) throws Exception { + int size = rr.paramAsInt("size", DEFAULT_SIZE); + int start = rr.paramAsInt("start", DEFAULT_START); + String sortBy = rr.param("sort_by", null); + String sortType = rr.param("sort_type", null); + String[] includeFields = rr.paramAsStringArray("includeFields", null); + String[] excludeFields = rr.paramAsStringArray("excludeFields", null); + String type = rr.param("type", null); + + SearchRequestBuilder sb = client.prepareSearch().setQuery(qb).setFrom(start).setSize(size); + sb.setIndices("current"); + sb.setFetchSource(includeFields, excludeFields); + + if(sortBy != null) { + if(sortType != null) { + if("desc".equals(sortType)) { + sb.addSort(sortBy, SortOrder.DESC); + } + } + else { + sb.addSort(sortBy, SortOrder.ASC); + } + } + + // handle possible aggregations from the request body + if(rr.hasContent()) { + XContentParser parser = XContentFactory.xContent(rr.content()).createParser(rr.content()); + sb.setAggregations(parser.mapAndClose()); + } + + if(type != null) { + sb.setTypes(type); + } + + SearchResponse response = sb.execute().actionGet(); + sendSuccessResponse(rr, rc, response); + } + +} diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java new file mode 100644 index 0000000..6a7b3be --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java @@ -0,0 +1,65 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.hu.attx.apis.es.plugin.siren; + +import java.net.URLDecoder; +import org.elasticsearch.action.search.SearchRequestBuilder; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.client.Client; +import org.elasticsearch.common.inject.Inject; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.rest.RestChannel; +import org.elasticsearch.rest.RestController; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.search.sort.SortOrder; + +/** + * + * @author jkesanie + */ +class CollectionRestHandler extends AbstractRestHandler { + + + + + @Inject + protected CollectionRestHandler(Settings settings, Client client, RestController controller) { + super(settings, client); + controller.registerHandler(RestRequest.Method.GET, "/attx/api/" + API_VERSION + "/", this); + controller.registerHandler(RestRequest.Method.POST, "/attx/api/" + API_VERSION + "/", this); + controller.registerHandler(RestRequest.Method.GET, "/attx/api/" + API_VERSION + "/{type}", this); + controller.registerHandler(RestRequest.Method.POST, "/attx/api/" + API_VERSION + "/{type}", this); + + } + + @Override + protected void handleRequest(RestRequest rr, RestChannel rc, Client client) throws Exception { + + try { + final String q = rr.param("q", null); + QueryBuilder qb = null; + + if(q == null) { + qb = QueryBuilders.matchAllQuery(); + } + else { + String decodedQuery = URLDecoder.decode(q); + qb = QueryParser.getSirenQuery(decodedQuery); + + } + + doQuery(qb, rr, rc, client); + + }catch(Exception ex) { + sendErrorResponse(rc, ex.getMessage()); + } + } + +} diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java new file mode 100644 index 0000000..2880a5b --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java @@ -0,0 +1,90 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.hu.attx.apis.es.plugin.siren; + +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.client.Client; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.rest.RestChannel; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.search.SearchHits; +import org.elasticsearch.search.SearchHit; + +/** + * + * @author jkesanie + */ +public class IDRestHandler extends AbstractRestHandler { + + public IDRestHandler(Settings settings, Client client) { + super(settings, client); + } + + @Override + protected void handleRequest(RestRequest rr, RestChannel rc, Client client) throws Exception { + final String decodedId = URLDecoder.decode(rr.param("id", null)); + final String relation = rr.param("relation", null); + + + QueryBuilder qb = null; + if(relation == null) { + qb = QueryBuilders.idsQuery(decodedId); + } + else { + // do two queries, first the parent id and then the relation + SearchResponse response = client.prepareSearch().setQuery(QueryBuilders.idsQuery(decodedId)).setFetchSource(relation, null).execute().actionGet(); + SearchHits hits = response.getHits(); + if(hits.getTotalHits() > 0) { + List uris = new ArrayList(); + SearchHit hit = hits.getAt(0); + Object sourceObject = hit.getSource().get(relation); + + // handle different types of source objects + if(sourceObject instanceof String) { + uris.add(sourceObject.toString()); + } + else if(sourceObject instanceof List) { + List list = (List)sourceObject; + for(Object listObject : list) { + if(listObject instanceof HashMap) { + Object idObject = ((HashMap)listObject).get("@id"); + if(idObject != null) { + uris.add(idObject.toString()); + } + } + else if(listObject instanceof String) { + uris.add(listObject.toString()); + } + + } + } + else if(sourceObject instanceof HashMap) { + HashMap objectData = (HashMap)sourceObject; + Object idObject = objectData.get("@id"); + if(idObject != null) { + uris.add(idObject.toString()); + } + } + + String[] values = new String[uris.size()]; + values = uris.toArray(values); + qb = QueryBuilders.idsQuery(values); + } + else { + sendEmptyResponse(rc); + } + } + + doQuery(qb, rr, rc, client); + } + +} diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java new file mode 100644 index 0000000..57bf778 --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java @@ -0,0 +1,268 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.hu.attx.apis.es.plugin.siren; + +import com.sindicetech.siren.qparser.tree.dsl.AbstractNodeQuery; +import com.sindicetech.siren.qparser.tree.dsl.BooleanQuery; +import com.sindicetech.siren.qparser.tree.dsl.ConciseNodeQuery; +import com.sindicetech.siren.qparser.tree.dsl.ConciseQueryBuilder; +import com.sindicetech.siren.qparser.tree.dsl.TwigQuery; +import java.util.regex.Pattern; +import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.PhraseQuery; +import org.apache.lucene.search.PrefixQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.util.Version; +import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.index.query.WrapperQueryBuilder; + +/** + * + * @author jkesanie + */ +public class QueryParser { + + private static ConciseQueryBuilder sb = new ConciseQueryBuilder(); + + public static QueryBuilder getSirenQuery(String queryString) throws Exception { + org.apache.lucene.queryparser.classic.QueryParser parser = new org.apache.lucene.queryparser.classic.QueryParser(Version.LUCENE_36, "", new StandardAnalyzer(Version.LUCENE_36)); + Query q = parser.parse(queryString); + + AbstractNodeQuery nq = null; + String field = ""; + String value = ""; + + if(q instanceof TermQuery) { + TermQuery tq = (TermQuery)q; + field = tq.getTerm().field(); + value = tq.getTerm().text(); + nq = getSingleQuery(field, value); + } + else if(q instanceof PrefixQuery) { + PrefixQuery pq = (PrefixQuery)q; + field = pq.getPrefix().field(); + value = pq.getPrefix().text() + "*"; + nq = getSingleQuery(field, value); + } + else if(q instanceof PhraseQuery) { + PhraseQuery pq = (PhraseQuery)q; + if(pq.toString().indexOf(":") > 0) { + field = pq.toString().substring(0, pq.toString().indexOf(":")); + } + value = pq.toString(field); + nq = getSingleQuery(field, value); + } + else if(q instanceof org.apache.lucene.search.BooleanQuery) { + org.apache.lucene.search.BooleanQuery bq = (org.apache.lucene.search.BooleanQuery)q; + BooleanQuery sbq = (BooleanQuery)sb.newBoolean(); + handleClauses(bq, sbq); + nq = sbq; + + } + else { + throw new Exception("Unknown query type: " + q.getClass().getName()); + } + + return new WrapperQueryBuilder(nq.toString()); + } + + private static AbstractNodeQuery getSingleQuery(String field, String value) throws Exception { + // check for number postfixed with 'l' + value = value.replaceAll("(\\d+)l", "xsd:long($1)"); + + if(!"".equals(field)) { + String[] fieldParts = field.split("\\."); + if(field.startsWith("parent_")) { + field = removeParentPrefix(field); + + ConciseNodeQuery nq = sb.newNode(value); + String twigField = null; + if(fieldParts.length == 1) { + // only root element is specified + twigField = field; + } + else { + // root element and attribute specified + twigField = fieldParts[0]; + String attribute = fieldParts[fieldParts.length - 1]; + nq.setAttribute(attribute); + } + + TwigQuery tq = sb.newTwig(twigField); + tq.with(nq); + return tq; + } + else { + if(fieldParts.length == 1) { + ConciseNodeQuery _q1 = sb.newNode(value); + _q1.setAttribute(field); + + ConciseNodeQuery nq = sb.newNode(value); + TwigQuery _tq = sb.newTwig(field); + _tq.with(nq); + + BooleanQuery booleanQuery = (BooleanQuery)sb.newBoolean(); + booleanQuery.optional(_q1); + booleanQuery.optional(_tq); + return booleanQuery; + } + else { + String twigField = fieldParts[0]; + String attribute = fieldParts[fieldParts.length - 1]; + int level = fieldParts.length - 1; + + ConciseNodeQuery nq = sb.newNode(value); + nq.setAttribute(attribute); + TwigQuery tq = sb.newTwig(twigField); + tq.with(nq, level); + + return tq; + + } + } + + } + else { + return sb.newNode(value); + } + + } + + private static String removeParentPrefix(String field) { + String[] parts = field.split(Pattern.quote("parent_")); + if(parts.length > 0) { + return parts[1]; + } + else { + return field; + } + + } + + private static void handleClauses(org.apache.lucene.search.BooleanQuery bq, BooleanQuery sbq) throws Exception { + TwigQuery parentQuery = null; + for(BooleanClause c : bq.getClauses()) { + Query q = c.getQuery(); + String occur = c.getOccur().name(); + String field = ""; + String value = ""; + boolean wasBoolean = false; + + if(q instanceof org.apache.lucene.search.BooleanQuery) { + org.apache.lucene.search.BooleanQuery _bq = (org.apache.lucene.search.BooleanQuery)q; + BooleanQuery _sbq = (BooleanQuery)sb.newBoolean(); + if("SHOULD".equals(occur)) + sbq.optional(_sbq); + else if("MUST NOT".equals(occur)) + sbq.without(_sbq); + else + sbq.with(_sbq); + + handleClauses(_bq, _sbq); + wasBoolean = true; + } + // TODO: remove this duplicate code + else if(q instanceof TermQuery) { + TermQuery tq = (TermQuery)q; + field = tq.getTerm().field(); + value = tq.getTerm().text(); + } + else if(q instanceof PrefixQuery) { + PrefixQuery pq = (PrefixQuery)q; + field = pq.getPrefix().field(); + value = pq.getPrefix().text() + "*"; + } + else if(q instanceof PhraseQuery) { + PhraseQuery pq = (PhraseQuery)q; + if(pq.toString().indexOf(":") > 0 ) + field = pq.toString().substring(0, pq.toString().indexOf(":")); + } + else { + throw new Exception("Unknown query type: " + q.getClass().getName()); + } + value = value.replaceAll("(\\d+)l", "xsd:long($1)"); + + if(!"".equals(field)) { + boolean isCommonParent = false; + if(field.startsWith("_parent")) { + String[] parts = field.split(Pattern.quote("parent_")); + isCommonParent = true; + if(parts.length > 1) { + field = parts[1]; + } + } + String[] fieldParts = field.split("\\."); + if(fieldParts.length == 1) { + ConciseNodeQuery _q1 = sb.newNode(value); + _q1.setAttribute(field); + + ConciseNodeQuery nq = sb.newNode(value); + TwigQuery _tq = sb.newTwig(field); + _tq.with(nq); + + BooleanQuery booleanQuery = (BooleanQuery)sb.newBoolean(); + booleanQuery.optional(_q1); + booleanQuery.optional(_tq); + + if(parentQuery != null) { + parentQuery.with(nq); + } + else { + if("SHOULD".equals(occur)) + sbq.optional(booleanQuery); + else if("MUST NOT".equals(occur)) + sbq.without(booleanQuery); + else + sbq.with(booleanQuery); + } + + if(parentQuery == null && isCommonParent) { + parentQuery = _tq; + } + } + else { + String root = fieldParts[0]; + String attribute = fieldParts[fieldParts.length - 1]; + int level = fieldParts.length - 1; + + ConciseNodeQuery nq = sb.newNode(value); + nq.setAttribute(attribute); + TwigQuery _tq = sb.newTwig(root); + _tq.with(nq, level); + + if(parentQuery != null) { + parentQuery.with(nq, level); + } + else { + if("SHOULD".equals(occur)) + sbq.optional(_tq); + else if("MUST NOT".equals(occur)) + sbq.without(_tq); + else + sbq.with(_tq); + } + + if(parentQuery == null && isCommonParent) { + parentQuery = _tq; + } + } + } + else { + if(!wasBoolean) { + ConciseNodeQuery nq = sb.newNode(value); + if("SHOULD".equals(occur)) + sbq.optional(nq); + else if("MUST NOT".equals(occur)) + sbq.without(nq); + else + sbq.with(nq); + } + } + } + } +} diff --git a/elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties b/elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties new file mode 100644 index 0000000..f30c42e --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties @@ -0,0 +1 @@ +plugin=org.hu.attx.apis.es.plugin.siren.ATTXApiPlugin From 48d6975eb5a3e9d019eaf3f7babe9142b38172f6 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Fri, 4 Nov 2016 16:21:59 +0200 Subject: [PATCH 02/35] ADded first tests --- .../attx-api-plugin/build.gradle | 3 +- .../nbproject/project.properties | 0 .../plugin/siren/CollectionRestHandler.java | 3 +- .../apis/es/plugin/siren/QueryParser.java | 4 +- .../apis/es/plugin/siren/QueryParserTest.java | 97 +++++++++++++++++++ 5 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 elasticsearch-siren/attx-api-plugin/nbproject/project.properties create mode 100644 elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java diff --git a/elasticsearch-siren/attx-api-plugin/build.gradle b/elasticsearch-siren/attx-api-plugin/build.gradle index e9901b1..392061e 100644 --- a/elasticsearch-siren/attx-api-plugin/build.gradle +++ b/elasticsearch-siren/attx-api-plugin/build.gradle @@ -24,5 +24,6 @@ dependencies { compile \ 'org.elasticsearch:elasticsearch:1.3.4', - 'com.sindicetech.siren:siren-qparser:1.4' + 'com.sindicetech.siren:siren-qparser:1.4', + 'org.skyscreamer:jsonassert:1.4.0' } diff --git a/elasticsearch-siren/attx-api-plugin/nbproject/project.properties b/elasticsearch-siren/attx-api-plugin/nbproject/project.properties new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java index 6a7b3be..f89683d 100644 --- a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java +++ b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java @@ -15,6 +15,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.index.query.WrapperQueryBuilder; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestRequest; @@ -51,7 +52,7 @@ protected void handleRequest(RestRequest rr, RestChannel rc, Client client) thro } else { String decodedQuery = URLDecoder.decode(q); - qb = QueryParser.getSirenQuery(decodedQuery); + qb = new WrapperQueryBuilder(QueryParser.getSirenQuery(decodedQuery).toString()); } diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java index 57bf778..09f9776 100644 --- a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java +++ b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java @@ -29,7 +29,7 @@ public class QueryParser { private static ConciseQueryBuilder sb = new ConciseQueryBuilder(); - public static QueryBuilder getSirenQuery(String queryString) throws Exception { + public static AbstractNodeQuery getSirenQuery(String queryString) throws Exception { org.apache.lucene.queryparser.classic.QueryParser parser = new org.apache.lucene.queryparser.classic.QueryParser(Version.LUCENE_36, "", new StandardAnalyzer(Version.LUCENE_36)); Query q = parser.parse(queryString); @@ -68,7 +68,7 @@ else if(q instanceof org.apache.lucene.search.BooleanQuery) { throw new Exception("Unknown query type: " + q.getClass().getName()); } - return new WrapperQueryBuilder(nq.toString()); + return nq; } private static AbstractNodeQuery getSingleQuery(String field, String value) throws Exception { diff --git a/elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java b/elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java new file mode 100644 index 0000000..2e4d240 --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java @@ -0,0 +1,97 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.hu.attx.apis.es.plugin.siren; + +import com.sindicetech.siren.qparser.tree.dsl.AbstractNodeQuery; +import com.sindicetech.siren.qparser.tree.dsl.BooleanQuery; +import com.sindicetech.siren.qparser.tree.dsl.ConciseNodeQuery; +import com.sindicetech.siren.qparser.tree.dsl.ConciseQueryBuilder; +import com.sindicetech.siren.qparser.tree.dsl.TwigQuery; +import org.elasticsearch.index.query.QueryBuilder; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author jkesanie + */ +public class QueryParserTest { + + private static ConciseQueryBuilder sb = new ConciseQueryBuilder(); + + public QueryParserTest() { + } + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + @Before + public void setUp() { + } + + @After + public void tearDown() { + } + + /** + * Test of getSirenQuery method, of class QueryParser. + */ + @Test + public void testGetSirenQuery() throws Exception { + + System.out.println("getSirenQuery"); + String queryString = "test"; + ConciseNodeQuery expResult = sb.newNode(queryString); + AbstractNodeQuery result = QueryParser.getSirenQuery(queryString); + + assertEquals(expResult.toString(), result.toString()); + + } + + /** + * Property based query should turn into boolean query where + * other part is simple node query and other part is a twiq query. + * + * + * + * @throws Exception + */ + @Test + public void testGetSirenQueryWithNumbers() throws Exception { + String queryString = "year:1l"; + + BooleanQuery bq = (BooleanQuery)sb.newBoolean(); + ConciseNodeQuery nq1 = sb.newNode("xsd:long(1)"); + nq1.setAttribute("year"); + + + ConciseNodeQuery nq2 = sb.newNode("xsd:long(1)"); + + + TwigQuery tq = sb.newTwig("year"); + tq.with(nq2); + + bq.optional(nq1); + bq.optional(tq); + + System.out.println(bq.toString()); + + + AbstractNodeQuery result = QueryParser.getSirenQuery(queryString); + + assertEquals(bq.toString(), result.toString()); + + } +} From d64612beb0e351058e9dea5ab6115046a53ca486 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Wed, 9 Nov 2016 11:31:33 +0200 Subject: [PATCH 03/35] First version of the BDD tests for es-siren api --- .../build.gradle | 38 +++++++ .../uh/attx/bdd/api/test/StepDefinitions.java | 98 +++++++++++++++++++ .../org/uh/attx/bdd/api/test/TestRunner.java | 20 ++++ .../src/test/resources/features/setup.feature | 27 +++++ 4 files changed, 183 insertions(+) create mode 100644 elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle create mode 100644 elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java create mode 100644 elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/TestRunner.java create mode 100644 elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle b/elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle new file mode 100644 index 0000000..eac31b3 --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle @@ -0,0 +1,38 @@ +// Note: "common.gradle" in the root project contains additional initialization +// for this project. This initialization is applied in the "build.gradle" +// of the root project. + +// NetBeans will automatically add "run" and "debug" tasks relying on the +// "mainClass" property. You may however define the property prior executing +// tasks by passing a "-PmainClass=" argument. +// +// Note however, that you may define your own "run" and "debug" task if you +// prefer. In this case NetBeans will not add these tasks but you may rely on +// your own implementation. +if (!hasProperty('mainClass')) { + ext.mainClass = '' +} + +dependencies { + // TODO: Add dependencies here + // but note that JUnit should have already been added in parent.gradle. + // By default, only the Maven Central Repository is specified in + // parent.gradle. + // + // You can read more about how to add dependency here: + // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies + testCompile 'com.codeborne:selenide:4.0', + 'info.cukes:cucumber-java8:1.2.5', + 'info.cukes:cucumber-junit:1.2.5', + 'org.skyscreamer:jsonassert:1.4.0', + 'net.javacrumbs.json-unit:json-unit:1.16.0', + 'net.javacrumbs.json-unit:json-unit-fluent:1.16.0' + + +} + +test { + testLogging.showStandardStreams = true + systemProperties System.getProperties() +} + diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java new file mode 100644 index 0000000..90404ed --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java @@ -0,0 +1,98 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.uh.attx.bdd.api.test; + +import com.codeborne.selenide.Selenide; +import com.codeborne.selenide.SelenideElement; +import com.codeborne.selenide.WebDriverRunner; +import cucumber.api.PendingException; +import cucumber.api.java.en.Given; +import cucumber.api.java8.En; +import java.util.Iterator; +import java.util.logging.Level; +import java.util.logging.Logger; +import net.javacrumbs.jsonunit.JsonAssert; +import net.javacrumbs.jsonunit.fluent.JsonFluentAssert; +import org.json.JSONException; +import org.json.JSONObject; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; + +/** + * + * @author jkesanie + */ +public class StepDefinitions implements En { + + public StepDefinitions() throws Exception { + System.setProperty("selenide.browser", "chrome"); + System.setProperty("webdriver.chrome.driver" , "/Users/jkesanie/Applications/chromedriver"); + + Given("^runtime environment is in place$", () -> { + // Write code here that turns the phrase above into concrete actions + //throw new PendingException(); + }); + + Given("^component image is available$", () -> { + // Write code here that turns the phrase above into concrete actions + //throw new PendingException(); + }); + + When("^component is finished with startup$", () -> { + // Write code here that turns the phrase above into concrete actions + //throw new PendingException(); + }); + + Then("^components API should be accessible via HTTP$", () -> { + try { + Selenide.open("http://localhost:9200"); + JSONObject result = new JSONObject(Selenide.$("pre").text()); + JSONAssert.assertEquals("{status:200}", result, JSONCompareMode.LENIENT); + + + } catch (JSONException ex) { + Logger.getLogger(StepDefinitions.class.getName()).log(Level.SEVERE, null, ex); + } + }); + + Given("^component is running$", () -> { + // Write code here that turns the phrase above into concrete actions + //throw new PendingException(); + }); + + When("^component is sent a stop signal$", () -> { + // Write code here that turns the phrase above into concrete actions + throw new PendingException(); + }); + + Then("^component's api should not available anymore$", () -> { + // Write code here that turns the phrase above into concrete actions + throw new PendingException(); + }); + + When("^listing available plugins$", () -> { + // Write code here that turns the phrase above into concrete actions + //throw new PendingException(); + }); + + Then("^all the required plugins should be installed succesfully$", () -> { + try { + Selenide.open("http://localhost:9200/_nodes/"); + + JSONObject nodes = new JSONObject(Selenide.$("pre").text()).getJSONObject("nodes"); + Iterator keys = nodes.keys(); + String key = keys.next(); // first node + JSONObject result = nodes.getJSONObject(key); + + JsonAssert.assertJsonPartEquals("siren-plugin", result, "plugins[0].name"); + + + } catch (JSONException ex) { + Logger.getLogger(StepDefinitions.class.getName()).log(Level.SEVERE, null, ex); + } + }); + } +} diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/TestRunner.java b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/TestRunner.java new file mode 100644 index 0000000..59aa035 --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/TestRunner.java @@ -0,0 +1,20 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.uh.attx.bdd.api.test; + +import cucumber.api.CucumberOptions; +import cucumber.api.junit.Cucumber; +import org.junit.runner.RunWith; + +/** + * + * @author jkesanie + */ +@RunWith(Cucumber.class) +@CucumberOptions(plugin = {"pretty"}, features="classpath:features", tags = {"~@ignore"}, glue={"classpath:org.uh.attx.bdd.api.test", "src/test/resources/python/steps"}) +public class TestRunner { + +} diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature new file mode 100644 index 0000000..d6b5cec --- /dev/null +++ b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature @@ -0,0 +1,27 @@ +# Setup of the service component that provides a public interface + + +Feature: Setting up public API component + As a platform admin + In order to provide public interface to the data + I want API component up and with all the bell and whistles running + + + Scenario: platform admin starts the component + Given runtime environment is in place + And component image is available + When component is finished with startup + Then components API should be accessible via HTTP +# And component should show up in the service registry as running + + Scenario: platform admin stops the component + Given component is running + When component is sent a stop signal + Then component's api should not available anymore +# And component should be removed from the service registry + + Scenario: check if all the required plugins are installed + Given component is running + When listing available plugins + Then all the required plugins should be installed succesfully + \ No newline at end of file From 686352488681537db067a6f168aaa7ef89d5f641 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Wed, 9 Nov 2016 11:44:37 +0200 Subject: [PATCH 04/35] Root project for elasticsearch-siren based public api. --- elasticsearch-siren/build.gradle | 20 +++++++++++ elasticsearch-siren/common.gradle | 56 +++++++++++++++++++++++++++++ elasticsearch-siren/settings.gradle | 20 +++++++++++ 3 files changed, 96 insertions(+) create mode 100644 elasticsearch-siren/build.gradle create mode 100644 elasticsearch-siren/common.gradle create mode 100644 elasticsearch-siren/settings.gradle diff --git a/elasticsearch-siren/build.gradle b/elasticsearch-siren/build.gradle new file mode 100644 index 0000000..50d7f45 --- /dev/null +++ b/elasticsearch-siren/build.gradle @@ -0,0 +1,20 @@ +import org.gradle.api.artifacts.* + +apply plugin: 'base' // To add "clean" task to the root project. + +subprojects { + apply from: rootProject.file('common.gradle') +} + +task mergedJavadoc(type: Javadoc, description: 'Creates Javadoc from all the projects.') { + title = 'All modules' + destinationDir = new File(project.buildDir, 'merged-javadoc') + + // Note: The closures below are executed lazily. + source { + subprojects*.sourceSets*.main*.allSource + } + classpath.from { + subprojects*.configurations*.compile*.copyRecursive({ !(it instanceof ProjectDependency); })*.resolve() + } +} diff --git a/elasticsearch-siren/common.gradle b/elasticsearch-siren/common.gradle new file mode 100644 index 0000000..adf79f3 --- /dev/null +++ b/elasticsearch-siren/common.gradle @@ -0,0 +1,56 @@ +// +// This file is to be applied to every subproject. +// + +apply plugin: 'java' +apply plugin: 'maven' + +String mavenGroupId = 'org.uh.attx.apis.es' +String mavenVersion = '1.0-SNAPSHOT' + +sourceCompatibility = '1.8' +[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' + +repositories { + mavenCentral(); + // You may define additional repositories, or even remove "mavenCentral()". + // Read more about repositories here: + // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories +} + +dependencies { + // Adding dependencies here will add the dependencies to each subproject. + testCompile group: 'junit', name: 'junit', version: '4.10' +} + +String mavenArtifactId = name + +group = mavenGroupId +version = mavenVersion + +task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') { + classifier = 'sources' + from sourceSets.main.allSource +} + +artifacts { + archives jar + archives sourcesJar +} + +configure(install.repositories.mavenInstaller) { + pom.project { + groupId = mavenGroupId + artifactId = mavenArtifactId + version = mavenVersion + } +} + +task createFolders(description: 'Creates the source folders if they do not exist.') doLast { + sourceSets*.allSource*.srcDirs*.each { File srcDir -> + if (!srcDir.isDirectory()) { + println "Creating source folder: ${srcDir}" + srcDir.mkdirs() + } + } +} diff --git a/elasticsearch-siren/settings.gradle b/elasticsearch-siren/settings.gradle new file mode 100644 index 0000000..079c3e4 --- /dev/null +++ b/elasticsearch-siren/settings.gradle @@ -0,0 +1,20 @@ +rootProject.name = 'elasticsearch-siren' + +// Find the directories containing a "build.gradle" file in the root directory +// of the project. That is, every directory containing a "build.gradle" will +// be automatically the subproject of this project. +def subDirs = rootDir.listFiles(new FileFilter() { + public boolean accept(File file) { + if (!file.isDirectory()) { + return false + } + if (file.name == 'buildSrc') { + return false + } + return new File(file, 'build.gradle').isFile() + } +}); + +subDirs.each { File dir -> + include dir.name +} From ef9b0b1fff52bcbdb6791509e6809591d24f3158 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Wed, 9 Nov 2016 15:08:12 +0200 Subject: [PATCH 05/35] Changed the test http client implementation to UniRest. --- .../build.gradle | 9 +++-- .../uh/attx/bdd/api/test/StepDefinitions.java | 36 ++++++++++++------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle b/elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle index eac31b3..48455d2 100644 --- a/elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle +++ b/elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle @@ -21,12 +21,15 @@ dependencies { // // You can read more about how to add dependency here: // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies - testCompile 'com.codeborne:selenide:4.0', - 'info.cukes:cucumber-java8:1.2.5', + testCompile \ + 'info.cukes:cucumber-java8:1.2.5', 'info.cukes:cucumber-junit:1.2.5', 'org.skyscreamer:jsonassert:1.4.0', 'net.javacrumbs.json-unit:json-unit:1.16.0', - 'net.javacrumbs.json-unit:json-unit-fluent:1.16.0' + 'net.javacrumbs.json-unit:json-unit-fluent:1.16.0', + 'com.mashape.unirest:unirest-java:1.4.9', + 'org.seleniumhq.selenium:selenium-java:3.0.0', + 'org.seleniumhq.selenium:selenium-support:2.47.1' } diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java index 90404ed..979eed1 100644 --- a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java +++ b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java @@ -5,15 +5,22 @@ */ package org.uh.attx.bdd.api.test; -import com.codeborne.selenide.Selenide; -import com.codeborne.selenide.SelenideElement; -import com.codeborne.selenide.WebDriverRunner; +import com.mashape.unirest.http.HttpResponse; +import com.mashape.unirest.http.JsonNode; +import com.mashape.unirest.http.Unirest; +import com.mashape.unirest.http.exceptions.UnirestException; +import com.mashape.unirest.request.GetRequest; import cucumber.api.PendingException; +import cucumber.api.java.Before; import cucumber.api.java.en.Given; import cucumber.api.java8.En; +import java.io.File; +import java.util.ArrayList; import java.util.Iterator; import java.util.logging.Level; import java.util.logging.Logger; +import junit.framework.Assert; +import junit.framework.TestCase; import net.javacrumbs.jsonunit.JsonAssert; import net.javacrumbs.jsonunit.fluent.JsonFluentAssert; import org.json.JSONException; @@ -28,8 +35,7 @@ public class StepDefinitions implements En { public StepDefinitions() throws Exception { - System.setProperty("selenide.browser", "chrome"); - System.setProperty("webdriver.chrome.driver" , "/Users/jkesanie/Applications/chromedriver"); + Given("^runtime environment is in place$", () -> { // Write code here that turns the phrase above into concrete actions @@ -48,14 +54,16 @@ public StepDefinitions() throws Exception { Then("^components API should be accessible via HTTP$", () -> { try { - Selenide.open("http://localhost:9200"); - JSONObject result = new JSONObject(Selenide.$("pre").text()); - JSONAssert.assertEquals("{status:200}", result, JSONCompareMode.LENIENT); + GetRequest get = Unirest.get("http://localhost:9200").header("accept", "application/json"); + HttpResponse response = get.asJson(); + JSONAssert.assertEquals("{status:200}", response.getBody().getObject(), JSONCompareMode.LENIENT); + - } catch (JSONException ex) { + } catch (Exception ex) { Logger.getLogger(StepDefinitions.class.getName()).log(Level.SEVERE, null, ex); - } + TestCase.fail(ex.getMessage()); + } }); Given("^component is running$", () -> { @@ -80,9 +88,10 @@ public StepDefinitions() throws Exception { Then("^all the required plugins should be installed succesfully$", () -> { try { - Selenide.open("http://localhost:9200/_nodes/"); + GetRequest get = Unirest.get("http://localhost:9200/_nodes/").header("accept", "application/json"); + HttpResponse response = get.asJson(); - JSONObject nodes = new JSONObject(Selenide.$("pre").text()).getJSONObject("nodes"); + JSONObject nodes = response.getBody().getObject().getJSONObject("nodes"); Iterator keys = nodes.keys(); String key = keys.next(); // first node JSONObject result = nodes.getJSONObject(key); @@ -90,8 +99,9 @@ public StepDefinitions() throws Exception { JsonAssert.assertJsonPartEquals("siren-plugin", result, "plugins[0].name"); - } catch (JSONException ex) { + } catch (Exception ex) { Logger.getLogger(StepDefinitions.class.getName()).log(Level.SEVERE, null, ex); + TestCase.fail(ex.getMessage()); } }); } From c6242429516b930653aa58d02f13efc1a90e9dd0 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Wed, 9 Nov 2016 15:56:52 +0200 Subject: [PATCH 06/35] Cleaning up. --- .../java/org/uh/attx/bdd/api/test/StepDefinitions.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java index 979eed1..6e11a7f 100644 --- a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java +++ b/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java @@ -56,9 +56,9 @@ public StepDefinitions() throws Exception { try { GetRequest get = Unirest.get("http://localhost:9200").header("accept", "application/json"); HttpResponse response = get.asJson(); - JSONAssert.assertEquals("{status:200}", response.getBody().getObject(), JSONCompareMode.LENIENT); - - + JSONObject result = response.getBody().getObject(); + JsonAssert.assertJsonPartEquals(200, result, "status"); + JsonAssert.assertJsonPartEquals("1.3.4", result, "version.number"); } catch (Exception ex) { Logger.getLogger(StepDefinitions.class.getName()).log(Level.SEVERE, null, ex); @@ -96,7 +96,8 @@ public StepDefinitions() throws Exception { String key = keys.next(); // first node JSONObject result = nodes.getJSONObject(key); - JsonAssert.assertJsonPartEquals("siren-plugin", result, "plugins[0].name"); + JsonAssert.assertJsonPartEquals("analysis-icu", result, "plugins[0].name"); + JsonAssert.assertJsonPartEquals("siren-plugin", result, "plugins[1].name"); } catch (Exception ex) { From 8ff8b24beee46f7fec7445edd09abba82e4b7741 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Thu, 10 Nov 2016 09:47:00 +0200 Subject: [PATCH 07/35] Added more tests. --- .../apis/es/plugin/siren/QueryParserTest.java | 106 +++++++++++++----- 1 file changed, 79 insertions(+), 27 deletions(-) diff --git a/elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java b/elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java index 2e4d240..6936585 100644 --- a/elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java +++ b/elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java @@ -10,6 +10,8 @@ import com.sindicetech.siren.qparser.tree.dsl.ConciseNodeQuery; import com.sindicetech.siren.qparser.tree.dsl.ConciseQueryBuilder; import com.sindicetech.siren.qparser.tree.dsl.TwigQuery; +import java.util.logging.Level; +import java.util.logging.Logger; import org.elasticsearch.index.query.QueryBuilder; import org.junit.After; import org.junit.AfterClass; @@ -23,24 +25,24 @@ * @author jkesanie */ public class QueryParserTest { - + private static ConciseQueryBuilder sb = new ConciseQueryBuilder(); - + public QueryParserTest() { } - + @BeforeClass public static void setUpClass() { } - + @AfterClass public static void tearDownClass() { } - + @Before public void setUp() { } - + @After public void tearDown() { } @@ -50,48 +52,98 @@ public void tearDown() { */ @Test public void testGetSirenQuery() throws Exception { - + System.out.println("getSirenQuery"); String queryString = "test"; ConciseNodeQuery expResult = sb.newNode(queryString); AbstractNodeQuery result = QueryParser.getSirenQuery(queryString); - + assertEquals(expResult.toString(), result.toString()); - + } - + /** - * Property based query should turn into boolean query where - * other part is simple node query and other part is a twiq query. - * - * - * - * @throws Exception + * Property based query should turn into boolean query where other part is + * simple node query and other part is a twiq query. + * + * + * + * @throws Exception */ @Test public void testGetSirenQueryWithNumbers() throws Exception { String queryString = "year:1l"; - - BooleanQuery bq = (BooleanQuery)sb.newBoolean(); + + BooleanQuery bq = (BooleanQuery) sb.newBoolean(); ConciseNodeQuery nq1 = sb.newNode("xsd:long(1)"); nq1.setAttribute("year"); - ConciseNodeQuery nq2 = sb.newNode("xsd:long(1)"); - - + TwigQuery tq = sb.newTwig("year"); tq.with(nq2); - + bq.optional(nq1); bq.optional(tq); - + System.out.println(bq.toString()); - - + AbstractNodeQuery result = QueryParser.getSirenQuery(queryString); - + assertEquals(bq.toString(), result.toString()); - + + } + + @Test + public void testGetSirenQueryBoolean() { + + String queryString = "prefLabel:sielun* OR altLabel:anglig*"; + try { + + BooleanQuery bq1 = (BooleanQuery) sb.newBoolean(); + ConciseNodeQuery nq1_1 = sb.newNode("sielun*"); + nq1_1.setAttribute("prefLabel"); + + ConciseNodeQuery nq1_2 = sb.newNode("sielun*"); + TwigQuery tq1 = sb.newTwig("prefLabel"); + tq1.with(nq1_2); + + bq1.optional(nq1_1); + bq1.optional(tq1); + + BooleanQuery bq2 = (BooleanQuery) sb.newBoolean(); + ConciseNodeQuery nq2_1 = sb.newNode("anglig*"); + nq2_1.setAttribute("altLabel"); + + ConciseNodeQuery nq2_2 = sb.newNode("anglig*"); + TwigQuery tq2 = sb.newTwig("altLabel"); + tq2.with(nq2_2); + + bq2.optional(nq2_1); + bq2.optional(tq2); + + BooleanQuery bq = (BooleanQuery) sb.newBoolean(); + bq.optional(bq1); + bq.optional(bq2); + + + AbstractNodeQuery result; + + result = QueryParser.getSirenQuery(queryString); + + System.out.println(result.toString()); + assertEquals(bq.toString(), result.toString()); + } catch (Exception ex) { + Logger.getLogger(QueryParserTest.class.getName()).log(Level.SEVERE, null, ex); + fail(ex.getMessage()); + } + + } + + /** + * Query using parent_ prefix + */ + public void testGetSirenQueryWithParent() { + } } From ae18696fbd3a6f11756f8dd765db9d9da4371a2a Mon Sep 17 00:00:00 2001 From: jkesanie Date: Mon, 21 Nov 2016 16:56:03 +0200 Subject: [PATCH 08/35] Added zip task to the build file. This is needed for file based ES installation. --- elasticsearch-siren/attx-api-plugin/build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/elasticsearch-siren/attx-api-plugin/build.gradle b/elasticsearch-siren/attx-api-plugin/build.gradle index 392061e..08bae57 100644 --- a/elasticsearch-siren/attx-api-plugin/build.gradle +++ b/elasticsearch-siren/attx-api-plugin/build.gradle @@ -27,3 +27,12 @@ dependencies { 'com.sindicetech.siren:siren-qparser:1.4', 'org.skyscreamer:jsonassert:1.4.0' } + +// If one wants to have tets reports in some other directory +//test.reports.html.destination = file("$buildDir/reports/tests") + +task zip(type: Zip) { + from configurations.runtime.allArtifacts.files + from configurations.runtime + into(project.name + '-' + project.version) +} \ No newline at end of file From edacac39aa8bc5211e3afd4fe04f6031ceb1b9a5 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Tue, 22 Nov 2016 10:14:48 +0200 Subject: [PATCH 09/35] Added missing annotation to the IDRestHandler. --- .../java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java index 2880a5b..7c2881f 100644 --- a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java +++ b/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java @@ -11,6 +11,7 @@ import java.util.List; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.Client; +import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; @@ -25,6 +26,7 @@ */ public class IDRestHandler extends AbstractRestHandler { + @Inject public IDRestHandler(Settings settings, Client client) { super(settings, client); } From 0c27f23e8f18d46ffe0e79022d4f49661a21d7c4 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Mon, 12 Dec 2016 12:51:20 +0200 Subject: [PATCH 10/35] adding gradle build options --- build.gradle | 21 +++++++++++++++++++ common.gradle | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ settings.gradle | 20 ++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 build.gradle create mode 100644 common.gradle create mode 100644 settings.gradle diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..3109163 --- /dev/null +++ b/build.gradle @@ -0,0 +1,21 @@ +import org.gradle.api.artifacts.* + +apply plugin: 'base' // To add "clean" task to the root project. + + +subprojects { + apply from: rootProject.file('common.gradle') +} + +task mergedJavadoc(type: Javadoc, description: 'Creates Javadoc from all the projects.') { + title = 'All modules' + destinationDir = new File(project.buildDir, 'merged-javadoc') + + // Note: The closures below are executed lazily. + source { + subprojects*.sourceSets*.main*.allSource + } + classpath.from { + subprojects*.configurations*.compile*.copyRecursive({ !(it instanceof ProjectDependency); })*.resolve() + } +} diff --git a/common.gradle b/common.gradle new file mode 100644 index 0000000..2e34e20 --- /dev/null +++ b/common.gradle @@ -0,0 +1,56 @@ +// +// This file is to be applied to every subproject. +// + +apply plugin: 'java' +apply plugin: 'maven' + +String mavenGroupId = 'org.uh.attx.dc' +String mavenVersion = '1.0-SNAPSHOT' + +sourceCompatibility = '1.8' +[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' + +repositories { + mavenCentral(); + // You may define additional repositories, or even remove "mavenCentral()". + // Read more about repositories here: + // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories +} + +dependencies { + // Adding dependencies here will add the dependencies to each subproject. + testCompile group: 'junit', name: 'junit', version: '4.10' +} + +String mavenArtifactId = name + +group = mavenGroupId +version = mavenVersion + +task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') { + classifier = 'sources' + from sourceSets.main.allSource +} + +artifacts { + archives jar + archives sourcesJar +} + +configure(install.repositories.mavenInstaller) { + pom.project { + groupId = mavenGroupId + artifactId = mavenArtifactId + version = mavenVersion + } +} + +task createFolders(description: 'Creates the source folders if they do not exist.') doLast { + sourceSets*.allSource*.srcDirs*.each { File srcDir -> + if (!srcDir.isDirectory()) { + println "Creating source folder: ${srcDir}" + srcDir.mkdirs() + } + } +} diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..242fbac --- /dev/null +++ b/settings.gradle @@ -0,0 +1,20 @@ +rootProject.name = 'distributionComponent' + +// Find the directories containing a "build.gradle" file in the root directory +// of the project. That is, every directory containing a "build.gradle" will +// be automatically the subproject of this project. +def subDirs = rootDir.listFiles(new FileFilter() { + public boolean accept(File file) { + if (!file.isDirectory()) { + return false + } + if (file.name == 'buildSrc') { + return false + } + return new File(file, 'build.gradle').isFile() + } +}); + +subDirs.each { File dir -> + include dir.name +} From ec225ac6bd9164b147d1c8af7d0b6cbb0712bbf4 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Mon, 12 Dec 2016 14:44:40 +0200 Subject: [PATCH 11/35] renaming --- .../attx-api-plugin-feature-tests/build.gradle | 0 .../src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java | 0 .../src/test/java/org/uh/attx/bdd/api/test/TestRunner.java | 0 .../src/test/resources/features/setup.feature | 0 .../attx-api-plugin/build.gradle | 0 .../attx-api-plugin/nbproject/project.properties | 0 .../main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java | 0 .../org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java | 0 .../org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java | 0 .../main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java | 0 .../main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java | 0 .../attx-api-plugin/src/main/resources/es-plugin.properties | 0 .../java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java | 0 {elasticsearch-siren => dc-elasticsearch-siren}/build.gradle | 0 {elasticsearch-siren => dc-elasticsearch-siren}/common.gradle | 0 {elasticsearch-siren => dc-elasticsearch-siren}/settings.gradle | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin-feature-tests/build.gradle (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/TestRunner.java (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin/build.gradle (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin/nbproject/project.properties (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin/src/main/resources/es-plugin.properties (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/build.gradle (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/common.gradle (100%) rename {elasticsearch-siren => dc-elasticsearch-siren}/settings.gradle (100%) diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle similarity index 100% rename from elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle rename to dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java similarity index 100% rename from elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java rename to dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/TestRunner.java b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/TestRunner.java similarity index 100% rename from elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/TestRunner.java rename to dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/TestRunner.java diff --git a/elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature similarity index 100% rename from elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature rename to dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature diff --git a/elasticsearch-siren/attx-api-plugin/build.gradle b/dc-elasticsearch-siren/attx-api-plugin/build.gradle similarity index 100% rename from elasticsearch-siren/attx-api-plugin/build.gradle rename to dc-elasticsearch-siren/attx-api-plugin/build.gradle diff --git a/elasticsearch-siren/attx-api-plugin/nbproject/project.properties b/dc-elasticsearch-siren/attx-api-plugin/nbproject/project.properties similarity index 100% rename from elasticsearch-siren/attx-api-plugin/nbproject/project.properties rename to dc-elasticsearch-siren/attx-api-plugin/nbproject/project.properties diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java similarity index 100% rename from elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java similarity index 100% rename from elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java similarity index 100% rename from elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java similarity index 100% rename from elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java diff --git a/elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java similarity index 100% rename from elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java diff --git a/elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties b/dc-elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties similarity index 100% rename from elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties rename to dc-elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties diff --git a/elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java b/dc-elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java similarity index 100% rename from elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java rename to dc-elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java diff --git a/elasticsearch-siren/build.gradle b/dc-elasticsearch-siren/build.gradle similarity index 100% rename from elasticsearch-siren/build.gradle rename to dc-elasticsearch-siren/build.gradle diff --git a/elasticsearch-siren/common.gradle b/dc-elasticsearch-siren/common.gradle similarity index 100% rename from elasticsearch-siren/common.gradle rename to dc-elasticsearch-siren/common.gradle diff --git a/elasticsearch-siren/settings.gradle b/dc-elasticsearch-siren/settings.gradle similarity index 100% rename from elasticsearch-siren/settings.gradle rename to dc-elasticsearch-siren/settings.gradle From a7e0b45ef3f8a50383c4d1c4bfff51aff2dc6b0c Mon Sep 17 00:00:00 2001 From: jkesanie Date: Tue, 13 Dec 2016 11:54:40 +0200 Subject: [PATCH 12/35] Cleaning up gradle files --- .gitignore | 1 + dc-elasticsearch-siren/build.gradle | 20 --------- dc-elasticsearch-siren/common.gradle | 56 -------------------------- dc-elasticsearch-siren/settings.gradle | 20 --------- settings.gradle | 21 +--------- 5 files changed, 2 insertions(+), 116 deletions(-) create mode 100644 .gitignore delete mode 100644 dc-elasticsearch-siren/build.gradle delete mode 100644 dc-elasticsearch-siren/common.gradle delete mode 100644 dc-elasticsearch-siren/settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11cfbe7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.nb-gradle/ \ No newline at end of file diff --git a/dc-elasticsearch-siren/build.gradle b/dc-elasticsearch-siren/build.gradle deleted file mode 100644 index 50d7f45..0000000 --- a/dc-elasticsearch-siren/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -import org.gradle.api.artifacts.* - -apply plugin: 'base' // To add "clean" task to the root project. - -subprojects { - apply from: rootProject.file('common.gradle') -} - -task mergedJavadoc(type: Javadoc, description: 'Creates Javadoc from all the projects.') { - title = 'All modules' - destinationDir = new File(project.buildDir, 'merged-javadoc') - - // Note: The closures below are executed lazily. - source { - subprojects*.sourceSets*.main*.allSource - } - classpath.from { - subprojects*.configurations*.compile*.copyRecursive({ !(it instanceof ProjectDependency); })*.resolve() - } -} diff --git a/dc-elasticsearch-siren/common.gradle b/dc-elasticsearch-siren/common.gradle deleted file mode 100644 index adf79f3..0000000 --- a/dc-elasticsearch-siren/common.gradle +++ /dev/null @@ -1,56 +0,0 @@ -// -// This file is to be applied to every subproject. -// - -apply plugin: 'java' -apply plugin: 'maven' - -String mavenGroupId = 'org.uh.attx.apis.es' -String mavenVersion = '1.0-SNAPSHOT' - -sourceCompatibility = '1.8' -[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' - -repositories { - mavenCentral(); - // You may define additional repositories, or even remove "mavenCentral()". - // Read more about repositories here: - // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories -} - -dependencies { - // Adding dependencies here will add the dependencies to each subproject. - testCompile group: 'junit', name: 'junit', version: '4.10' -} - -String mavenArtifactId = name - -group = mavenGroupId -version = mavenVersion - -task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') { - classifier = 'sources' - from sourceSets.main.allSource -} - -artifacts { - archives jar - archives sourcesJar -} - -configure(install.repositories.mavenInstaller) { - pom.project { - groupId = mavenGroupId - artifactId = mavenArtifactId - version = mavenVersion - } -} - -task createFolders(description: 'Creates the source folders if they do not exist.') doLast { - sourceSets*.allSource*.srcDirs*.each { File srcDir -> - if (!srcDir.isDirectory()) { - println "Creating source folder: ${srcDir}" - srcDir.mkdirs() - } - } -} diff --git a/dc-elasticsearch-siren/settings.gradle b/dc-elasticsearch-siren/settings.gradle deleted file mode 100644 index 079c3e4..0000000 --- a/dc-elasticsearch-siren/settings.gradle +++ /dev/null @@ -1,20 +0,0 @@ -rootProject.name = 'elasticsearch-siren' - -// Find the directories containing a "build.gradle" file in the root directory -// of the project. That is, every directory containing a "build.gradle" will -// be automatically the subproject of this project. -def subDirs = rootDir.listFiles(new FileFilter() { - public boolean accept(File file) { - if (!file.isDirectory()) { - return false - } - if (file.name == 'buildSrc') { - return false - } - return new File(file, 'build.gradle').isFile() - } -}); - -subDirs.each { File dir -> - include dir.name -} diff --git a/settings.gradle b/settings.gradle index 242fbac..677da67 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,20 +1 @@ -rootProject.name = 'distributionComponent' - -// Find the directories containing a "build.gradle" file in the root directory -// of the project. That is, every directory containing a "build.gradle" will -// be automatically the subproject of this project. -def subDirs = rootDir.listFiles(new FileFilter() { - public boolean accept(File file) { - if (!file.isDirectory()) { - return false - } - if (file.name == 'buildSrc') { - return false - } - return new File(file, 'build.gradle').isFile() - } -}); - -subDirs.each { File dir -> - include dir.name -} +include "dc-elasticsearch-siren:attx-api-plugin", "dc-elasticsearch-siren:attx-api-plugin-feature-tests" \ No newline at end of file From f0a6d4eade9d46a88ca792648fcbc98463de4816 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Wed, 14 Dec 2016 15:09:51 +0200 Subject: [PATCH 13/35] Added python/jython related configurations for BDD testing. --- .../build.gradle | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle index 48455d2..0180bf1 100644 --- a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle +++ b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle @@ -1,14 +1,16 @@ -// Note: "common.gradle" in the root project contains additional initialization -// for this project. This initialization is applied in the "build.gradle" -// of the root project. +buildscript { + repositories { + maven { + url "https://plugins.gradle.org/m2/" + } + } + dependencies { + classpath "gradle.plugin.com.hierynomus.gradle.plugins:jython-gradle-plugin:0.3.1" + } +} + +apply plugin: "com.github.hierynomus.jython" -// NetBeans will automatically add "run" and "debug" tasks relying on the -// "mainClass" property. You may however define the property prior executing -// tasks by passing a "-PmainClass=" argument. -// -// Note however, that you may define your own "run" and "debug" task if you -// prefer. In this case NetBeans will not add these tasks but you may rely on -// your own implementation. if (!hasProperty('mainClass')) { ext.mainClass = '' } @@ -29,7 +31,10 @@ dependencies { 'net.javacrumbs.json-unit:json-unit-fluent:1.16.0', 'com.mashape.unirest:unirest-java:1.4.9', 'org.seleniumhq.selenium:selenium-java:3.0.0', - 'org.seleniumhq.selenium:selenium-support:2.47.1' + 'org.seleniumhq.selenium:selenium-support:2.47.1', + 'info.cukes:cucumber-jython:1.2.5', + 'org.python:jython-standalone:2.7.1b3' + } From 3d311e159ea52ba11685c2690e3f4a0843caf8e5 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Wed, 14 Dec 2016 15:41:40 +0200 Subject: [PATCH 14/35] Added python/jython related configurations for BDD testing. --- .gitignore | 4 +++- .gradle/2.13/taskArtifacts/cache.properties | 1 + .../2.13/taskArtifacts/cache.properties.lock | Bin 0 -> 17 bytes .gradle/2.13/taskArtifacts/fileHashes.bin | Bin 0 -> 24170 bytes .gradle/2.13/taskArtifacts/fileSnapshots.bin | Bin 0 -> 63699 bytes .gradle/2.13/taskArtifacts/taskArtifacts.bin | Bin 0 -> 24896 bytes 6 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .gradle/2.13/taskArtifacts/cache.properties create mode 100644 .gradle/2.13/taskArtifacts/cache.properties.lock create mode 100644 .gradle/2.13/taskArtifacts/fileHashes.bin create mode 100644 .gradle/2.13/taskArtifacts/fileSnapshots.bin create mode 100644 .gradle/2.13/taskArtifacts/taskArtifacts.bin diff --git a/.gitignore b/.gitignore index 11cfbe7..69077cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/.nb-gradle/ \ No newline at end of file +/.nb-gradle/ +/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build/ +/dc-elasticsearch-siren/attx-api-plugin/build/ \ No newline at end of file diff --git a/.gradle/2.13/taskArtifacts/cache.properties b/.gradle/2.13/taskArtifacts/cache.properties new file mode 100644 index 0000000..565eff7 --- /dev/null +++ b/.gradle/2.13/taskArtifacts/cache.properties @@ -0,0 +1 @@ +#Wed Dec 14 15:08:23 EET 2016 diff --git a/.gradle/2.13/taskArtifacts/cache.properties.lock b/.gradle/2.13/taskArtifacts/cache.properties.lock new file mode 100644 index 0000000000000000000000000000000000000000..d4fb23f2d0b9be128ebabd9d2e778fe2c25bba7a GIT binary patch literal 17 UcmZRc_u~<-{;`WQ86aRj06vighX4Qo literal 0 HcmV?d00001 diff --git a/.gradle/2.13/taskArtifacts/fileHashes.bin b/.gradle/2.13/taskArtifacts/fileHashes.bin new file mode 100644 index 0000000000000000000000000000000000000000..40827dde6ab6a186d0cd2ca578f45dd0e96ccd89 GIT binary patch literal 24170 zcmeI3iC;|n|Ho(Aw4t;jNfPa$BrQ_WzOUMeN~@$Bax+@ADAg^};;N9+B8f({*t(W% zEn07jL@2T)6@Aal=X_@7Gv$@3AkMv;;RYe1ep+IuG}HC+U7ml()1eQf*1G~K%aw>blOmK9%6M1yb(;MP_&?q?u_}O@EvNAVeG0jx znEimezJUDi6_g`A9sle1s(?6bPJ999r`91P-_pkV;kg`(pTwiQ`cUCUS}BcvKJomYU-=e zy4V*%ez`*MO{8zvClGJ^9rCM|NkeT%*((7zYl58I-QnSx$#xNN8(Q8Qgi!Uc+{js9rf-;h7hZX9(YSGxml z;!Wdk{f{;tFU$gb`@fJsBu^x0`1F4S+`56rZ|F2WGGF}!aJLA^AB*T8t#(uz0^Hdd z@@7qUqEHckG2mA0kUvd$6P!p2koA>gTa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f3Z;p=cir+>8kxb(H@H%&x|C4Lg zCM2EHVBLvMY7+L|5i}iBH?Ifr8xMZ&wQrOD^V+IKx52$8)DacDQ5{n^A6<=oEpR3} z>5Jy&Fm>-_d+hKQ!cUZQi>K5r!M}6I%s+*Xp<~SH88?t z^>}UTnIEr#Olbgw3m#x0)8_Xu%~u}L|83-79Q?e?2rJ`7KDtrc+;y- zm9y6zs}qhzbxb9=x+ZT8w|N)ep#)#MdnUH3SRFUz&w`XTw*HSRR&bd%eA8-=Slg<`hKJCwc@@H!aFPE lKk&@am0)!AlCQj?xciufCvj??ffzA?ILA$H#3gD|`5%yDVEF(5 literal 0 HcmV?d00001 diff --git a/.gradle/2.13/taskArtifacts/fileSnapshots.bin b/.gradle/2.13/taskArtifacts/fileSnapshots.bin new file mode 100644 index 0000000000000000000000000000000000000000..d981a4650415b95de7736b216fbd19a3041d4563 GIT binary patch literal 63699 zcmeHQ31CxYwoY196m-&Y9Ty&=qN2&&H(3P1K|o~@!6zu(<-cu8o0Kdp%3ud^SVV~-Oz4JKWalqq%#{rK69tS)QcpUIJ;Bmm?fX4xk10DxF4tN~! zIN))>iYaX9nV~_d~(>io)}$oeMHS?c=Y>sAh9 z=lI?0yOyV}uj;czx=DKNOy}qC-krL>anKg7*R}d8=lZM#sq63V-qCvF+dZnC>n|o# z*EgLuw$r#p6Lvb+d!3lN{^Khr@k^HW+2dS~m87owi*EV&+a<%=IM+v)r>?h9T5UZ2 zFURe3uFtFa`J>nUhI{akc|+ZwpOE_bpdhEREMQ=wedBUH$HP1Wje?}hvw@$~FIoF@7sYDsAHw>Qk z{vj)z>mzF9DiMF_&CoUb<~!Ff>X*8I>brBjXtwj+`|5GP zabPuvf3Z3StY(3tw2lGmx`hg#XuXR4`~1}9 zaT1GD5GUDeA-oT`i($qEt=vXmLNzlRtq z95JIIJ&9+e^rW7w)JQB?u8vY=iV3kHfznxq(P=|eB_f%ODJv}DBt_CVh9SJj2(rYB zvcMU2RtN3Xp>j1=9JuJ%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-eb3aw4=Vb>*SmT9ZwCkU1MJR*U!CUK_nvw{O5r(n7>!5BXaz)7cXCG z^y=2uwGZrj?pbzQWl7_-OaA=tPx(CX!Q`au_$Pq(CdaH_Z(+?>4_LV73mw<|Pdy$in5NFNiy@J2q6=cVyX&t=jaDYv#TA<3rK@yocs7Ekey!*oo>* z@LnK76rY-$)t^(>;h?psfr$T3j!k7N29Kzor9>WP6Q1?$Pg14KH?K-o$@UxsJ#Xs? zo67>}h}n{In^?I$j_O0jElxKQaH9!Mn?OQq3}}u;vM21i)w7vgo3`?8R8Gi7O>@vg zU}Mb0wszPD!&pFo$;k#YeL;jddKJiA(b%5Ki)Xzt0=i1A7FBwM)aKNxZy0LtW~>3Z z&Q4vMaizBYvz5Kti!>wC8v>!W+IuGhZ|X>zhT>2l=lJ4K6Q^_ym9O8`(AhoQ@%>`Z zfn3)Ygo>mVZINk9YSTipnQetzdZ|?#wJgC^cGW0%)t?&}mmaZJfx^aYc<60Swt+&T zmuo@8n)Xm<&vEV;40$IJn+HyVhdW|@^fH@sbnJ1bYb3W zr9mbr+TeTG4%rZ3)-pXCnFX1zGuyPhBy9l27UsceVpUB<3&iS)_^sW$e*gF)KUVGP zmupIvE(^A4nO~f<3fL)3V#Cz*sRvr+1f{Z0CEbBUP27rn{SHERsfu(UO4c&FjV5y* z9kCAI*!}v#FTs!UWJ0mg&(1S?92xca_8h&uC|8e*@)-(C?#8_O0+SigkInm?!3 Date: Wed, 14 Dec 2016 15:42:44 +0200 Subject: [PATCH 15/35] Added .gradle to the root .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 69077cb..5faf2f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.nb-gradle/ +/.gradle/ /dc-elasticsearch-siren/attx-api-plugin-feature-tests/build/ /dc-elasticsearch-siren/attx-api-plugin/build/ \ No newline at end of file From e4fa78162fc8a2470aaa867f692890d391045e66 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Wed, 14 Dec 2016 16:17:21 +0200 Subject: [PATCH 16/35] removed .gradle dir --- .gradle/2.13/taskArtifacts/cache.properties | 1 - .../2.13/taskArtifacts/cache.properties.lock | Bin 17 -> 0 bytes .gradle/2.13/taskArtifacts/fileHashes.bin | Bin 24170 -> 0 bytes .gradle/2.13/taskArtifacts/fileSnapshots.bin | Bin 63699 -> 0 bytes .gradle/2.13/taskArtifacts/taskArtifacts.bin | Bin 24896 -> 0 bytes 5 files changed, 1 deletion(-) delete mode 100644 .gradle/2.13/taskArtifacts/cache.properties delete mode 100644 .gradle/2.13/taskArtifacts/cache.properties.lock delete mode 100644 .gradle/2.13/taskArtifacts/fileHashes.bin delete mode 100644 .gradle/2.13/taskArtifacts/fileSnapshots.bin delete mode 100644 .gradle/2.13/taskArtifacts/taskArtifacts.bin diff --git a/.gradle/2.13/taskArtifacts/cache.properties b/.gradle/2.13/taskArtifacts/cache.properties deleted file mode 100644 index 565eff7..0000000 --- a/.gradle/2.13/taskArtifacts/cache.properties +++ /dev/null @@ -1 +0,0 @@ -#Wed Dec 14 15:08:23 EET 2016 diff --git a/.gradle/2.13/taskArtifacts/cache.properties.lock b/.gradle/2.13/taskArtifacts/cache.properties.lock deleted file mode 100644 index d4fb23f2d0b9be128ebabd9d2e778fe2c25bba7a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 UcmZRc_u~<-{;`WQ86aRj06vighX4Qo diff --git a/.gradle/2.13/taskArtifacts/fileHashes.bin b/.gradle/2.13/taskArtifacts/fileHashes.bin deleted file mode 100644 index 40827dde6ab6a186d0cd2ca578f45dd0e96ccd89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24170 zcmeI3iC;|n|Ho(Aw4t;jNfPa$BrQ_WzOUMeN~@$Bax+@ADAg^};;N9+B8f({*t(W% zEn07jL@2T)6@Aal=X_@7Gv$@3AkMv;;RYe1ep+IuG}HC+U7ml()1eQf*1G~K%aw>blOmK9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z_19v}1%^rduF^iPpN0|F8IQ_E$cmyirWI73J~(7 zU8b6mSNO+dMv++;zkGkQ%^)`08ZWAdSw{G)URXFntySu*!DoX#e<4Q|a>7Q)A!iY# zEgu4}%r*a=80a>%xh2nLXhC3;(eebWj(q^t0aNI`)HN&Gb+W$KBsq;>u|L?9dQ#HU z@o!|6Zt(QZS?!1Nmw2oM3m@%1JExn1cUh!ctw9>^PP_A>w?Wk{;oMr}mXvXHl5lrm zn$gkSgr7?!g!*slT1i)PXmexDBp@Fzsg0@R|D~f3Z;p=cir+>8kxb(H@H%&x|C4Lg zCM2EHVBLvMY7+L|5i}iBH?Ifr8xMZ&wQrOD^V+IKx52$8)DacDQ5{n^A6<=oEpR3} z>5Jy&Fm>-_d+hKQ!cUZQi>K5r!M}6I%s+*Xp<~SH88?t z^>}UTnIEr#Olbgw3m#x0)8_Xu%~u}L|83-79Q?e?2rJ`7KDtrc+;y- zm9y6zs}qhzbxb9=x+ZT8w|N)ep#)#MdnUH3SRFUz&w`XTw*HSRR&bd%eA8-=Slg<`hKJCwc@@H!aFPE lKk&@am0)!AlCQj?xciufCvj??ffzA?ILA$H#3gD|`5%yDVEF(5 diff --git a/.gradle/2.13/taskArtifacts/fileSnapshots.bin b/.gradle/2.13/taskArtifacts/fileSnapshots.bin deleted file mode 100644 index d981a4650415b95de7736b216fbd19a3041d4563..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 63699 zcmeHQ31CxYwoY196m-&Y9Ty&=qN2&&H(3P1K|o~@!6zu(<-cu8o0Kdp%3ud^SVV~-Oz4JKWalqq%#{rK69tS)QcpUIJ;Bmm?fX4xk10DxF4tN~! zIN))>iYaX9nV~_d~(>io)}$oeMHS?c=Y>sAh9 z=lI?0yOyV}uj;czx=DKNOy}qC-krL>anKg7*R}d8=lZM#sq63V-qCvF+dZnC>n|o# z*EgLuw$r#p6Lvb+d!3lN{^Khr@k^HW+2dS~m87owi*EV&+a<%=IM+v)r>?h9T5UZ2 zF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 14 Dec 2016 16:19:59 +0200 Subject: [PATCH 17/35] added gradle to .gitignore --- .gitignore | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5faf2f8..b6f6ea0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,20 @@ /.nb-gradle/ /.gradle/ /dc-elasticsearch-siren/attx-api-plugin-feature-tests/build/ -/dc-elasticsearch-siren/attx-api-plugin/build/ \ No newline at end of file +/dc-elasticsearch-siren/attx-api-plugin/build/ + +### Gradle ### +.gradle +/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties From 31fd760dd71aa940175187982424dd40723015dd Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Mon, 16 Jan 2017 17:08:31 +0200 Subject: [PATCH 18/35] ATTX-project/project-management/issues#68 fixing BDD tests --- .gitignore | 88 +++++++++++++++ .../build.gradle | 56 +++++----- .../uh/attx/bdd/api/test/StepDefinitions.java | 105 ++++++++---------- .../src/test/resources/features/setup.feature | 17 +-- .../test/resources/features/platform.feature | 20 ++++ 5 files changed, 183 insertions(+), 103 deletions(-) create mode 100644 dc-feature-tests/src/test/resources/features/platform.feature diff --git a/.gitignore b/.gitignore index b6f6ea0..9c50074 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,91 @@ gradle-app.setting # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 # gradle/wrapper/gradle-wrapper.properties + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/workspace.xml +.idea/tasks.xml + +# Sensitive or high-churn files: +.idea/dataSources/ +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml +dc-elasticsearch-siren/attx-api-plugin-feature-tests/.idea/ + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + + +### Intellij+iml ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: + +# Sensitive or high-churn files: + +# Gradle: + +# Mongo Explorer plugin: + +## File-based project format: + +## Plugin-specific files: + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +### Intellij+iml Patch ### +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +# End of https://www.gitignore.io/api/intellij,intellij+iml \ No newline at end of file diff --git a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle index 0180bf1..dae8a92 100644 --- a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle +++ b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle @@ -1,46 +1,42 @@ -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath "gradle.plugin.com.hierynomus.gradle.plugins:jython-gradle-plugin:0.3.1" - } +plugins { + id "java" + id "com.github.hierynomus.jython" version "0.4.0" } apply plugin: "com.github.hierynomus.jython" + +repositories { + maven { + url "https://plugins.gradle.org/m2/" + } +} + if (!hasProperty('mainClass')) { ext.mainClass = '' } + dependencies { - // TODO: Add dependencies here - // but note that JUnit should have already been added in parent.gradle. - // By default, only the Maven Central Repository is specified in - // parent.gradle. - // - // You can read more about how to add dependency here: - // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies testCompile \ - 'info.cukes:cucumber-java8:1.2.5', - 'info.cukes:cucumber-junit:1.2.5', - 'org.skyscreamer:jsonassert:1.4.0', - 'net.javacrumbs.json-unit:json-unit:1.16.0', - 'net.javacrumbs.json-unit:json-unit-fluent:1.16.0', - 'com.mashape.unirest:unirest-java:1.4.9', - 'org.seleniumhq.selenium:selenium-java:3.0.0', - 'org.seleniumhq.selenium:selenium-support:2.47.1', - 'info.cukes:cucumber-jython:1.2.5', - 'org.python:jython-standalone:2.7.1b3' - - - + 'junit:junit:4.10', + 'info.cukes:cucumber-java8:1.2.5', + 'info.cukes:cucumber-junit:1.2.5', + 'info.cukes:cucumber-jython:1.2.5', + 'org.python:jython-standalone:2.7.1b3', + 'com.mashape.unirest:unirest-java:1.4.9', + 'org.skyscreamer:jsonassert:1.4.0', + 'net.javacrumbs.json-unit:json-unit:1.16.0', + 'net.javacrumbs.json-unit:json-unit-fluent:1.16.0', + 'org.apache.jena:apache-jena-libs:3.1.1' } test { testLogging.showStandardStreams = true - systemProperties System.getProperties() + systemProperties System.getProperties() } +task copyToLib(type: Copy) { + into "$buildDir/output/lib" + from configurations.testCompile +} \ No newline at end of file diff --git a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java index 6e11a7f..213c796 100644 --- a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java +++ b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java @@ -8,102 +8,93 @@ import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.JsonNode; import com.mashape.unirest.http.Unirest; -import com.mashape.unirest.http.exceptions.UnirestException; + import com.mashape.unirest.request.GetRequest; -import cucumber.api.PendingException; -import cucumber.api.java.Before; -import cucumber.api.java.en.Given; -import cucumber.api.java8.En; -import java.io.File; + import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; +import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; -import junit.framework.Assert; + +import cucumber.api.java8.En; import junit.framework.TestCase; import net.javacrumbs.jsonunit.JsonAssert; -import net.javacrumbs.jsonunit.fluent.JsonFluentAssert; -import org.json.JSONException; + +import org.json.JSONArray; import org.json.JSONObject; +import org.junit.Assert; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + /** - * * @author jkesanie */ public class StepDefinitions implements En { + private List where = new ArrayList(); public StepDefinitions() throws Exception { - - Given("^runtime environment is in place$", () -> { - // Write code here that turns the phrase above into concrete actions - //throw new PendingException(); - }); - - Given("^component image is available$", () -> { - // Write code here that turns the phrase above into concrete actions - //throw new PendingException(); - }); - - When("^component is finished with startup$", () -> { - // Write code here that turns the phrase above into concrete actions - //throw new PendingException(); - }); - Then("^components API should be accessible via HTTP$", () -> { + Given("^component is running$", () -> { try { GetRequest get = Unirest.get("http://localhost:9200").header("accept", "application/json"); - HttpResponse response = get.asJson(); + HttpResponse response = get.asJson(); JSONObject result = response.getBody().getObject(); JsonAssert.assertJsonPartEquals(200, result, "status"); JsonAssert.assertJsonPartEquals("1.3.4", result, "version.number"); - + } catch (Exception ex) { Logger.getLogger(StepDefinitions.class.getName()).log(Level.SEVERE, null, ex); TestCase.fail(ex.getMessage()); - } + } }); - Given("^component is running$", () -> { - // Write code here that turns the phrase above into concrete actions - //throw new PendingException(); - }); - - When("^component is sent a stop signal$", () -> { - // Write code here that turns the phrase above into concrete actions - throw new PendingException(); - }); - - Then("^component's api should not available anymore$", () -> { - // Write code here that turns the phrase above into concrete actions - throw new PendingException(); - }); When("^listing available plugins$", () -> { - // Write code here that turns the phrase above into concrete actions - //throw new PendingException(); - }); - - Then("^all the required plugins should be installed succesfully$", () -> { try { GetRequest get = Unirest.get("http://localhost:9200/_nodes/").header("accept", "application/json"); - HttpResponse response = get.asJson(); - + HttpResponse response = get.asJson(); + JSONObject nodes = response.getBody().getObject().getJSONObject("nodes"); Iterator keys = nodes.keys(); String key = keys.next(); // first node - JSONObject result = nodes.getJSONObject(key); - - JsonAssert.assertJsonPartEquals("analysis-icu", result, "plugins[0].name"); - JsonAssert.assertJsonPartEquals("siren-plugin", result, "plugins[1].name"); - - + JSONObject thekeys = nodes.getJSONObject(key); + JSONArray plugins = (JSONArray) thekeys.get("plugins"); + Iterator i = plugins.iterator(); + + while (i.hasNext()) { + JSONObject plugin = (JSONObject) i.next(); + String name = (String) plugin.get("name"); + where.add(name); + } + + assertEquals(response.getStatus(), 200); +// JsonAssert.assertJsonPartEquals("analysis-icu", result, "plugins[0].name"); +// JsonAssert.assertJsonPartEquals("siren-plugin", result, "plugins[1].name"); + + } catch (Exception ex) { Logger.getLogger(StepDefinitions.class.getName()).log(Level.SEVERE, null, ex); TestCase.fail(ex.getMessage()); - } + } + }); + + Then("^all the required plugins should be installed successfully\\.$", () -> { + try { + assertTrue(where.contains("ATTXApiPlugin")); + assertTrue(where.contains("siren-plugin")); + assertTrue(where.contains("analysis-icu")); + + } catch (Exception ex) { + Logger.getLogger(StepDefinitions.class.getName()).log(Level.SEVERE, null, ex); + TestCase.fail(ex.getMessage()); + } + }); } } diff --git a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature index d6b5cec..9df06a2 100644 --- a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature +++ b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/resources/features/setup.feature @@ -1,27 +1,12 @@ # Setup of the service component that provides a public interface - Feature: Setting up public API component As a platform admin In order to provide public interface to the data I want API component up and with all the bell and whistles running - - Scenario: platform admin starts the component - Given runtime environment is in place - And component image is available - When component is finished with startup - Then components API should be accessible via HTTP -# And component should show up in the service registry as running - - Scenario: platform admin stops the component - Given component is running - When component is sent a stop signal - Then component's api should not available anymore -# And component should be removed from the service registry - Scenario: check if all the required plugins are installed Given component is running When listing available plugins - Then all the required plugins should be installed succesfully + Then all the required plugins should be installed successfully. \ No newline at end of file diff --git a/dc-feature-tests/src/test/resources/features/platform.feature b/dc-feature-tests/src/test/resources/features/platform.feature new file mode 100644 index 0000000..7a0fb06 --- /dev/null +++ b/dc-feature-tests/src/test/resources/features/platform.feature @@ -0,0 +1,20 @@ +# Setup of the service component that provides a public interface + +Feature: Setting up public API component + As a platform admin + In order to provide public interface to the data + I want API component up and with all the bell and whistles running + + + Scenario: platform admin starts the component + Given runtime environment is in place + And component image is available + When component is finished with startup + Then components API should be accessible via HTTP +# And component should show up in the service registry as running + + Scenario: platform admin stops the component + Given component is running + When component is sent a stop signal + Then component's api should not available anymore +# And component should be removed from the service registry From 53b9b5d0b71c4d3042b792879fd2262e4dc3723a Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Tue, 17 Jan 2017 10:36:13 +0200 Subject: [PATCH 19/35] ATTX-project/project-management/issues#68 removed unecessary imports --- .../test/java/org/uh/attx/bdd/api/test/StepDefinitions.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java index 213c796..7c5b9ef 100644 --- a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java +++ b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/src/test/java/org/uh/attx/bdd/api/test/StepDefinitions.java @@ -12,7 +12,6 @@ import com.mashape.unirest.request.GetRequest; import java.util.ArrayList; -import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.logging.Level; @@ -24,9 +23,6 @@ import org.json.JSONArray; import org.json.JSONObject; -import org.junit.Assert; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; From d9ecc744f6edc84644a07b0f8e79d684b53c066b Mon Sep 17 00:00:00 2001 From: jkesanie Date: Wed, 15 Feb 2017 15:31:37 +0200 Subject: [PATCH 20/35] First version of containerized feature tests --- .gitignore | 3 +- build.gradle | 21 ++++----- dc-feature-tests/Dockerfile | 13 ++++++ dc-feature-tests/build.gradle | 46 +++++++++++++++++++ dc-feature-tests/build.test.gradle | 8 ++++ dc-feature-tests/nbproject/project.properties | 0 dc-feature-tests/runTests.sh | 16 +++++++ .../src/test/java/NewEmptyJUnitTest.java | 44 ++++++++++++++++++ .../test/resources/features/platform.feature | 20 -------- settings.gradle | 2 +- 10 files changed, 138 insertions(+), 35 deletions(-) create mode 100644 dc-feature-tests/Dockerfile create mode 100644 dc-feature-tests/build.gradle create mode 100644 dc-feature-tests/build.test.gradle create mode 100644 dc-feature-tests/nbproject/project.properties create mode 100644 dc-feature-tests/runTests.sh create mode 100644 dc-feature-tests/src/test/java/NewEmptyJUnitTest.java delete mode 100644 dc-feature-tests/src/test/resources/features/platform.feature diff --git a/.gitignore b/.gitignore index 9c50074..6b6f2c9 100644 --- a/.gitignore +++ b/.gitignore @@ -105,4 +105,5 @@ modules.xml .idea/misc.xml *.ipr -# End of https://www.gitignore.io/api/intellij,intellij+iml \ No newline at end of file +# End of https://www.gitignore.io/api/intellij,intellij+iml +/dc-feature-tests/build/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3109163..33251c0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,9 @@ -import org.gradle.api.artifacts.* - +plugins { + id "de.undercouch.download" version "3.1.2" + id "com.chrisgahlert.gradle-dcompose-plugin" version "0.8.2" + id "com.github.johnrengelman.shadow" version "1.2.4" +} +apply plugin: 'java' apply plugin: 'base' // To add "clean" task to the root project. @@ -7,15 +11,6 @@ subprojects { apply from: rootProject.file('common.gradle') } -task mergedJavadoc(type: Javadoc, description: 'Creates Javadoc from all the projects.') { - title = 'All modules' - destinationDir = new File(project.buildDir, 'merged-javadoc') - - // Note: The closures below are executed lazily. - source { - subprojects*.sourceSets*.main*.allSource - } - classpath.from { - subprojects*.configurations*.compile*.copyRecursive({ !(it instanceof ProjectDependency); })*.resolve() - } +repositories { + mavenCentral() } diff --git a/dc-feature-tests/Dockerfile b/dc-feature-tests/Dockerfile new file mode 100644 index 0000000..1194de1 --- /dev/null +++ b/dc-feature-tests/Dockerfile @@ -0,0 +1,13 @@ +FROM frekele/gradle:3.3-jdk8 + + +RUN apt-get update +RUN apt-get install -y netcat + +RUN mkdir -p /tmp/ +COPY build /tmp/build +COPY build.test.gradle /tmp/ +COPY runTests.sh /tmp/ +RUN chmod 755 /tmp/runTests.sh + +WORKDIR /tmp/ diff --git a/dc-feature-tests/build.gradle b/dc-feature-tests/build.gradle new file mode 100644 index 0000000..5419726 --- /dev/null +++ b/dc-feature-tests/build.gradle @@ -0,0 +1,46 @@ +apply plugin: 'com.chrisgahlert.gradle-dcompose-plugin' +apply plugin: 'com.github.johnrengelman.shadow' + +dcompose { + createComposeFile.useTags = true + registry ('http://attx-dev:5000') {} + registry ('http://attx-dev.hulib.helsinki.fi:5000') {} + + essiren { + image = 'attx-dev.hulib.helsinki.fi:5000/essiren:latest' + exposedPorts = ['9200', '9300'] + portBindings = ['9200:9200', '9300:9300'] + } + + test { + ignoreExitCode = true + baseDir = file('.') + dockerFilename = 'Dockerfile' + binds = ["/var/run/docker.sock:/run/docker.sock"] + command = ['sh', '-c', '/tmp/runTests.sh'] + dependsOn = [essiren] + waitForCommand = true + } + + +} + +task copyReportFiles(type: DcomposeCopyFileFromContainerTask) { + service = dcompose.test + containerPath = '/tmp/build/reports' + destinationDir = file("build/from-container/") + cleanDestinationDir = false +} + +startTestContainer.finalizedBy('copyReportFiles') + +// making sure the that fresh build of test classes is done before building the image +buildTestImage.dependsOn('shadowJar') +buildTestImage.dependsOn('testClasses') + + +shadowJar { + classifier = 'tests' + from sourceSets.test.output + configurations = [project.configurations.testRuntime] +} \ No newline at end of file diff --git a/dc-feature-tests/build.test.gradle b/dc-feature-tests/build.test.gradle new file mode 100644 index 0000000..6fff352 --- /dev/null +++ b/dc-feature-tests/build.test.gradle @@ -0,0 +1,8 @@ +plugins { + id "java" +} + +dependencies { + testRuntime \ + fileTree(dir: 'build/libs', include: ['*.jar']) +} diff --git a/dc-feature-tests/nbproject/project.properties b/dc-feature-tests/nbproject/project.properties new file mode 100644 index 0000000..e69de29 diff --git a/dc-feature-tests/runTests.sh b/dc-feature-tests/runTests.sh new file mode 100644 index 0000000..45582ab --- /dev/null +++ b/dc-feature-tests/runTests.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +: ${SLEEP_LENGTH:=2} + +wait_for() { + echo Waiting for $1 to listen on $2... >> /tmp/log + while ! nc -z $1 $2; do echo sleeping >> /tmp/log ; sleep $SLEEP_LENGTH; done +} + + + +wait_for "essiren" "9200" +wait_for "essiren" "9300" + +gradle -b /tmp/build.test.gradle --offline test + diff --git a/dc-feature-tests/src/test/java/NewEmptyJUnitTest.java b/dc-feature-tests/src/test/java/NewEmptyJUnitTest.java new file mode 100644 index 0000000..954f208 --- /dev/null +++ b/dc-feature-tests/src/test/java/NewEmptyJUnitTest.java @@ -0,0 +1,44 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author jkesanie + */ +public class NewEmptyJUnitTest { + + public NewEmptyJUnitTest() { + } + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + @Before + public void setUp() { + } + + @After + public void tearDown() { + } + + // TODO add test methods here. + // The methods must be annotated with annotation @Test. For example: + // + // @Test + // public void hello() {} +} diff --git a/dc-feature-tests/src/test/resources/features/platform.feature b/dc-feature-tests/src/test/resources/features/platform.feature deleted file mode 100644 index 7a0fb06..0000000 --- a/dc-feature-tests/src/test/resources/features/platform.feature +++ /dev/null @@ -1,20 +0,0 @@ -# Setup of the service component that provides a public interface - -Feature: Setting up public API component - As a platform admin - In order to provide public interface to the data - I want API component up and with all the bell and whistles running - - - Scenario: platform admin starts the component - Given runtime environment is in place - And component image is available - When component is finished with startup - Then components API should be accessible via HTTP -# And component should show up in the service registry as running - - Scenario: platform admin stops the component - Given component is running - When component is sent a stop signal - Then component's api should not available anymore -# And component should be removed from the service registry diff --git a/settings.gradle b/settings.gradle index 677da67..8052d76 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include "dc-elasticsearch-siren:attx-api-plugin", "dc-elasticsearch-siren:attx-api-plugin-feature-tests" \ No newline at end of file +include "dc-feature-tests", "dc-elasticsearch-siren:attx-api-plugin", "dc-elasticsearch-siren:attx-api-plugin-feature-tests" \ No newline at end of file From d4499d53f11a8c17d5714ff3f5c95fcd8ce7f9eb Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Thu, 23 Feb 2017 09:20:00 +0200 Subject: [PATCH 21/35] cleaning gradle files and adjusting to 4 spaces tab --- build.gradle | 15 ++++ common.gradle | 63 ++++--------- commonJava.gradle | 88 +++++++++++++++++++ .../build.gradle | 37 +++----- .../attx-api-plugin/build.gradle | 28 ++---- dc-feature-tests/build.gradle | 45 +++++----- dc-feature-tests/build.test.gradle | 4 +- 7 files changed, 160 insertions(+), 120 deletions(-) create mode 100644 commonJava.gradle diff --git a/build.gradle b/build.gradle index 33251c0..a134d9d 100644 --- a/build.gradle +++ b/build.gradle @@ -14,3 +14,18 @@ subprojects { repositories { mavenCentral() } + +ext { + javaProjectList = ['dc-elasticsearch-siren', + 'attx-api-plugin', + 'attx-api-plugin-feature-tests', + 'dc-feature-tests'] +} + +def javaProjects() { + subprojects.findAll { javaProjectList.contains(it.name)} +} + +configure(javaProjects()) { + apply from: rootProject.file('commonJava.gradle') +} diff --git a/common.gradle b/common.gradle index 2e34e20..4d6c75f 100644 --- a/common.gradle +++ b/common.gradle @@ -1,56 +1,29 @@ -// -// This file is to be applied to every subproject. -// - -apply plugin: 'java' -apply plugin: 'maven' - -String mavenGroupId = 'org.uh.attx.dc' -String mavenVersion = '1.0-SNAPSHOT' - -sourceCompatibility = '1.8' -[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' - -repositories { - mavenCentral(); - // You may define additional repositories, or even remove "mavenCentral()". - // Read more about repositories here: - // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories +apply plugin: 'base' + +ext { + imageRepo = "attx-dev" + imageRepoPort = "5000" + artifactRepoPort = "8081" + jenkinsPort = "49001" + pypiRepoPort = "5039" } -dependencies { - // Adding dependencies here will add the dependencies to each subproject. - testCompile group: 'junit', name: 'junit', version: '4.10' +if (!project.hasProperty("registryURL")) { + ext.registryURL = "http://${imageRepo}:${imageRepoPort}" } -String mavenArtifactId = name - -group = mavenGroupId -version = mavenVersion - -task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') { - classifier = 'sources' - from sourceSets.main.allSource +if (!project.hasProperty("artifactRepoURL")) { + ext.artifactRepoURL = "http://${imageRepo}:${artifactRepoPort}/repository/attx-releases" } -artifacts { - archives jar - archives sourcesJar +if (!project.hasProperty("snapshotRepoURL")) { + ext.snapshotRepoURL = "http://${imageRepo}:${artifactRepoPort}/repository/attx-snapshots" } -configure(install.repositories.mavenInstaller) { - pom.project { - groupId = mavenGroupId - artifactId = mavenArtifactId - version = mavenVersion - } +if (!project.hasProperty("artifactRepoUser")) { + ext.artifactRepoUser = "" } -task createFolders(description: 'Creates the source folders if they do not exist.') doLast { - sourceSets*.allSource*.srcDirs*.each { File srcDir -> - if (!srcDir.isDirectory()) { - println "Creating source folder: ${srcDir}" - srcDir.mkdirs() - } - } +if (!project.hasProperty("artifactRepoPassword")) { + ext.artifactRepoPassword = "" } diff --git a/commonJava.gradle b/commonJava.gradle new file mode 100644 index 0000000..ba410fc --- /dev/null +++ b/commonJava.gradle @@ -0,0 +1,88 @@ +apply plugin: 'java' +apply plugin: 'maven' +apply plugin: 'maven-publish' + +apply plugin: 'com.github.johnrengelman.shadow' + +String mavenGroupId = 'org.uh.attx.gc' +String mavenVersion = '1.0-SNAPSHOT' + +targetCompatibility = '1.8' +sourceCompatibility = '1.8' +[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' + +repositories { + // mavenCentral() + maven { url "https://plugins.gradle.org/m2/"} + maven { url "$snapshotRepoURL"} +} + +dependencies { + // Adding dependencies here will add the dependencies to each subproject. + testCompile 'junit:junit:4.12' +} + +String mavenArtifactId = name + +group = mavenGroupId +version = mavenVersion + +task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') { + classifier = 'sources' + from sourceSets.main.allSource +} + +artifacts { + archives jar + archives sourcesJar +} + +configure(install.repositories.mavenInstaller) { + pom.project { + groupId = mavenGroupId + artifactId = mavenArtifactId + version = mavenVersion + } +} + +task createFolders(description: 'Creates the source folders if they do not exist.') doLast { + sourceSets*.allSource*.srcDirs*.each { File srcDir -> + if (!srcDir.isDirectory()) { + println "Creating source folder: ${srcDir}" + srcDir.mkdirs() + } + } +} + +task mergedJavadoc(type: Javadoc, description: 'Creates Javadoc from all the projects.') { + title = 'All modules' + destinationDir = new File(project.buildDir, 'merged-javadoc') + + // Note: The closures below are executed lazily. + source { + subprojects*.sourceSets*.main*.allSource + } + classpath.from { + subprojects*.configurations*.compile*.copyRecursive({ !(it instanceof ProjectDependency); })*.resolve() + } +} + +// This might + +publishing { + repositories { + maven { + // change to point to your repo, e.g. http://my.org/repo + url "${artifactRepoURL}" + credentials { + username "${artifactRepoUser}" + password "${artifactRepoPassword}" + } + } + } + publications { + mavenJava(MavenPublication) { + from components.java + } + } +} diff --git a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle index dae8a92..dcd8bd8 100644 --- a/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle +++ b/dc-elasticsearch-siren/attx-api-plugin-feature-tests/build.gradle @@ -1,34 +1,19 @@ -plugins { - id "java" - id "com.github.hierynomus.jython" version "0.4.0" -} - -apply plugin: "com.github.hierynomus.jython" - - -repositories { - maven { - url "https://plugins.gradle.org/m2/" - } -} - if (!hasProperty('mainClass')) { ext.mainClass = '' } - dependencies { testCompile \ - 'junit:junit:4.10', - 'info.cukes:cucumber-java8:1.2.5', - 'info.cukes:cucumber-junit:1.2.5', - 'info.cukes:cucumber-jython:1.2.5', - 'org.python:jython-standalone:2.7.1b3', - 'com.mashape.unirest:unirest-java:1.4.9', - 'org.skyscreamer:jsonassert:1.4.0', - 'net.javacrumbs.json-unit:json-unit:1.16.0', - 'net.javacrumbs.json-unit:json-unit-fluent:1.16.0', - 'org.apache.jena:apache-jena-libs:3.1.1' + 'junit:junit:4.10', + 'info.cukes:cucumber-java8:1.2.5', + 'info.cukes:cucumber-junit:1.2.5', + 'info.cukes:cucumber-jython:1.2.5', + 'org.python:jython-standalone:2.7.1b3', + 'com.mashape.unirest:unirest-java:1.4.9', + 'org.skyscreamer:jsonassert:1.4.0', + 'net.javacrumbs.json-unit:json-unit:1.16.0', + 'net.javacrumbs.json-unit:json-unit-fluent:1.16.0', + 'org.apache.jena:apache-jena-libs:3.1.1' } test { @@ -39,4 +24,4 @@ test { task copyToLib(type: Copy) { into "$buildDir/output/lib" from configurations.testCompile -} \ No newline at end of file +} diff --git a/dc-elasticsearch-siren/attx-api-plugin/build.gradle b/dc-elasticsearch-siren/attx-api-plugin/build.gradle index 08bae57..40ff99f 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/build.gradle +++ b/dc-elasticsearch-siren/attx-api-plugin/build.gradle @@ -1,31 +1,13 @@ -// Note: "common.gradle" in the root project contains additional initialization -// for this project. This initialization is applied in the "build.gradle" -// of the root project. +apply plugin: 'java' -// NetBeans will automatically add "run" and "debug" tasks relying on the -// "mainClass" property. You may however define the property prior executing -// tasks by passing a "-PmainClass=" argument. -// -// Note however, that you may define your own "run" and "debug" task if you -// prefer. In this case NetBeans will not add these tasks but you may rely on -// your own implementation. if (!hasProperty('mainClass')) { ext.mainClass = '' } dependencies { - // TODO: Add dependencies here - // but note that JUnit should have already been added in parent.gradle. - // By default, only the Maven Central Repository is specified in - // parent.gradle. - // - // You can read more about how to add dependency here: - // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies - - compile \ - 'org.elasticsearch:elasticsearch:1.3.4', - 'com.sindicetech.siren:siren-qparser:1.4', - 'org.skyscreamer:jsonassert:1.4.0' + compile 'org.elasticsearch:elasticsearch:1.3.4' + compile 'com.sindicetech.siren:siren-qparser:1.4' + compile 'org.skyscreamer:jsonassert:1.4.0' } // If one wants to have tets reports in some other directory @@ -35,4 +17,4 @@ task zip(type: Zip) { from configurations.runtime.allArtifacts.files from configurations.runtime into(project.name + '-' + project.version) -} \ No newline at end of file +} diff --git a/dc-feature-tests/build.gradle b/dc-feature-tests/build.gradle index 5419726..1ba620a 100644 --- a/dc-feature-tests/build.gradle +++ b/dc-feature-tests/build.gradle @@ -2,45 +2,42 @@ apply plugin: 'com.chrisgahlert.gradle-dcompose-plugin' apply plugin: 'com.github.johnrengelman.shadow' dcompose { - createComposeFile.useTags = true - registry ('http://attx-dev:5000') {} - registry ('http://attx-dev.hulib.helsinki.fi:5000') {} - + createComposeFile.useTags = true + registry ("${registryURL}") {} + essiren { - image = 'attx-dev.hulib.helsinki.fi:5000/essiren:latest' + image = "${imageRepo}:${imageRepoPort}/essiren:latest" exposedPorts = ['9200', '9300'] - portBindings = ['9200:9200', '9300:9300'] - } + portBindings = ['9200:9200', '9300:9300'] + } test { - ignoreExitCode = true - baseDir = file('.') - dockerFilename = 'Dockerfile' - binds = ["/var/run/docker.sock:/run/docker.sock"] - command = ['sh', '-c', '/tmp/runTests.sh'] - dependsOn = [essiren] - waitForCommand = true + ignoreExitCode = true + baseDir = file('.') + dockerFilename = 'Dockerfile' + binds = ["/var/run/docker.sock:/run/docker.sock"] + command = ['sh', '-c', '/tmp/runTests.sh'] + dependsOn = [essiren] + waitForCommand = true } - - } task copyReportFiles(type: DcomposeCopyFileFromContainerTask) { - service = dcompose.test + service = dcompose.test containerPath = '/tmp/build/reports' destinationDir = file("build/from-container/") - cleanDestinationDir = false + cleanDestinationDir = false } startTestContainer.finalizedBy('copyReportFiles') // making sure the that fresh build of test classes is done before building the image -buildTestImage.dependsOn('shadowJar') -buildTestImage.dependsOn('testClasses') +buildTestImage.dependsOn shadowJar +buildTestImage.dependsOn testClasses shadowJar { - classifier = 'tests' - from sourceSets.test.output - configurations = [project.configurations.testRuntime] -} \ No newline at end of file + classifier = 'tests' + from sourceSets.test.output + configurations = [project.configurations.testRuntime] +} diff --git a/dc-feature-tests/build.test.gradle b/dc-feature-tests/build.test.gradle index 6fff352..37a4eeb 100644 --- a/dc-feature-tests/build.test.gradle +++ b/dc-feature-tests/build.test.gradle @@ -3,6 +3,6 @@ plugins { } dependencies { - testRuntime \ - fileTree(dir: 'build/libs', include: ['*.jar']) + testRuntime \ + fileTree(dir: 'build/libs', include: ['*.jar']) } From 7532b0093bae8ca2bfd0be724e27c918e692d8a0 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Mon, 27 Feb 2017 09:28:30 +0200 Subject: [PATCH 22/35] ATTX-project/project-management#75 start, do tests, remove images --- dc-feature-tests/Dockerfile | 15 ++++++++------- dc-feature-tests/build.gradle | 24 ++++++++++++++++-------- dc-feature-tests/runTests.sh | 7 ++----- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/dc-feature-tests/Dockerfile b/dc-feature-tests/Dockerfile index 1194de1..009e0e1 100644 --- a/dc-feature-tests/Dockerfile +++ b/dc-feature-tests/Dockerfile @@ -1,13 +1,14 @@ FROM frekele/gradle:3.3-jdk8 +RUN apt-get update \ + && apt-get install -y netcat \ + && apt-get clean -RUN apt-get update -RUN apt-get install -y netcat +RUN mkdir -p /tmp/ + +WORKDIR /tmp/ -RUN mkdir -p /tmp/ COPY build /tmp/build -COPY build.test.gradle /tmp/ +COPY build.test.gradle /tmp/build.gradle COPY runTests.sh /tmp/ -RUN chmod 755 /tmp/runTests.sh - -WORKDIR /tmp/ +RUN chmod 700 /tmp/runTests.sh diff --git a/dc-feature-tests/build.gradle b/dc-feature-tests/build.gradle index 1ba620a..6eb9814 100644 --- a/dc-feature-tests/build.gradle +++ b/dc-feature-tests/build.gradle @@ -6,19 +6,22 @@ dcompose { registry ("${registryURL}") {} essiren { + forcePull = true + forceRemoveImage = true image = "${imageRepo}:${imageRepoPort}/essiren:latest" exposedPorts = ['9200', '9300'] portBindings = ['9200:9200', '9300:9300'] } test { - ignoreExitCode = true - baseDir = file('.') - dockerFilename = 'Dockerfile' - binds = ["/var/run/docker.sock:/run/docker.sock"] - command = ['sh', '-c', '/tmp/runTests.sh'] - dependsOn = [essiren] - waitForCommand = true + ignoreExitCode = true + baseDir = file('.') + dockerFilename = 'Dockerfile' + binds = ["/var/run/docker.sock:/run/docker.sock"] + command = ['sh', '-c', '/tmp/runTests.sh'] + dependsOn = [essiren] + waitForCommand = true + forceRemoveImage = true } } @@ -29,7 +32,7 @@ task copyReportFiles(type: DcomposeCopyFileFromContainerTask) { cleanDestinationDir = false } -startTestContainer.finalizedBy('copyReportFiles') +startTestContainer.finalizedBy copyReportFiles // making sure the that fresh build of test classes is done before building the image buildTestImage.dependsOn shadowJar @@ -41,3 +44,8 @@ shadowJar { from sourceSets.test.output configurations = [project.configurations.testRuntime] } + +task integTest { + dependsOn startTestContainer + finalizedBy removeImages +} diff --git a/dc-feature-tests/runTests.sh b/dc-feature-tests/runTests.sh index 45582ab..a806666 100644 --- a/dc-feature-tests/runTests.sh +++ b/dc-feature-tests/runTests.sh @@ -3,14 +3,11 @@ : ${SLEEP_LENGTH:=2} wait_for() { - echo Waiting for $1 to listen on $2... >> /tmp/log + echo Waiting for $1 to listen on $2... >> /tmp/log while ! nc -z $1 $2; do echo sleeping >> /tmp/log ; sleep $SLEEP_LENGTH; done } - - wait_for "essiren" "9200" wait_for "essiren" "9300" -gradle -b /tmp/build.test.gradle --offline test - +gradle -b build.gradle --offline test From 005018451908e7e20b82eceea1904899f243bb2c Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Wed, 8 Mar 2017 15:06:22 +0200 Subject: [PATCH 23/35] ATTX-project/project-management#81 upload to archiva dc es api plugin --- common.gradle | 1 + .../attx-api-plugin/build.gradle | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/common.gradle b/common.gradle index 4d6c75f..e93db1f 100644 --- a/common.gradle +++ b/common.gradle @@ -6,6 +6,7 @@ ext { artifactRepoPort = "8081" jenkinsPort = "49001" pypiRepoPort = "5039" + dcGroupID = "org.uh.hulib.attx.dc" } if (!project.hasProperty("registryURL")) { diff --git a/dc-elasticsearch-siren/attx-api-plugin/build.gradle b/dc-elasticsearch-siren/attx-api-plugin/build.gradle index 40ff99f..343ed21 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/build.gradle +++ b/dc-elasticsearch-siren/attx-api-plugin/build.gradle @@ -18,3 +18,17 @@ task zip(type: Zip) { from configurations.runtime into(project.name + '-' + project.version) } + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "${artifactRepoURL}") { + authentication(userName: "${artifactRepoUser}", password: "${artifactRepoPassword}") + } + pom.project { + groupId = "${dcGroupID}" + description "ElasticSearch Siren API Plugin." + } + } + } +} From 42e0b8b9210856bbdbfeb4db18342d07ef9ad33a Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Wed, 8 Mar 2017 16:04:23 +0200 Subject: [PATCH 24/35] making release versions possible --- dc-elasticsearch-siren/attx-api-plugin/build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dc-elasticsearch-siren/attx-api-plugin/build.gradle b/dc-elasticsearch-siren/attx-api-plugin/build.gradle index 343ed21..00a2893 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/build.gradle +++ b/dc-elasticsearch-siren/attx-api-plugin/build.gradle @@ -1,5 +1,13 @@ apply plugin: 'java' +ext.version_nb = "1.0" + +if (!project.hasProperty("env")) { + ext.artifactVersion = "${version_nb}-SNAPSHOT" +} else if (project.env == "release"){ + ext.artifactVersion = "${version_nb}" +} + if (!hasProperty('mainClass')) { ext.mainClass = '' } @@ -26,6 +34,7 @@ uploadArchives { authentication(userName: "${artifactRepoUser}", password: "${artifactRepoPassword}") } pom.project { + version = "${artifactVersion}" groupId = "${dcGroupID}" description "ElasticSearch Siren API Plugin." } From 66fa54f8e520d3c81ce847ed14f064327afa8a2d Mon Sep 17 00:00:00 2001 From: jkesanie Date: Fri, 17 Mar 2017 15:11:02 +0200 Subject: [PATCH 25/35] refactoring according to ATTX-project/project-management#86 --- .../es/plugin => uh/hulib/attx/dc/es}/siren/ATTXApiPlugin.java | 2 +- .../hulib/attx/dc/es}/siren/AbstractRestHandler.java | 2 +- .../hulib/attx/dc/es}/siren/CollectionRestHandler.java | 2 +- .../es/plugin => uh/hulib/attx/dc/es}/siren/IDRestHandler.java | 2 +- .../es/plugin => uh/hulib/attx/dc/es}/siren/QueryParser.java | 2 +- .../plugin => uh/hulib/attx/dc/es}/siren/QueryParserTest.java | 3 ++- 6 files changed, 7 insertions(+), 6 deletions(-) rename dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/{hu/attx/apis/es/plugin => uh/hulib/attx/dc/es}/siren/ATTXApiPlugin.java (94%) rename dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/{hu/attx/apis/es/plugin => uh/hulib/attx/dc/es}/siren/AbstractRestHandler.java (99%) rename dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/{hu/attx/apis/es/plugin => uh/hulib/attx/dc/es}/siren/CollectionRestHandler.java (98%) rename dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/{hu/attx/apis/es/plugin => uh/hulib/attx/dc/es}/siren/IDRestHandler.java (98%) rename dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/{hu/attx/apis/es/plugin => uh/hulib/attx/dc/es}/siren/QueryParser.java (99%) rename dc-elasticsearch-siren/attx-api-plugin/src/test/java/org/{hu/attx/apis/es/plugin => uh/hulib/attx/dc/es}/siren/QueryParserTest.java (97%) diff --git a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/ATTXApiPlugin.java similarity index 94% rename from dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/ATTXApiPlugin.java index fc2a357..7383b8e 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/ATTXApiPlugin.java +++ b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/ATTXApiPlugin.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package org.hu.attx.apis.es.plugin.siren; +package org.uh.hulib.attx.dc.es.siren; import org.elasticsearch.plugins.AbstractPlugin; import org.elasticsearch.rest.RestModule; diff --git a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/AbstractRestHandler.java similarity index 99% rename from dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/AbstractRestHandler.java index 9b18309..d17edd6 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/AbstractRestHandler.java +++ b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/AbstractRestHandler.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package org.hu.attx.apis.es.plugin.siren; +package org.uh.hulib.attx.dc.es.siren; import java.util.Iterator; import java.util.Map; diff --git a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/CollectionRestHandler.java similarity index 98% rename from dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/CollectionRestHandler.java index f89683d..5fc67ee 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/CollectionRestHandler.java +++ b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/CollectionRestHandler.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package org.hu.attx.apis.es.plugin.siren; +package org.uh.hulib.attx.dc.es.siren; import java.net.URLDecoder; import org.elasticsearch.action.search.SearchRequestBuilder; diff --git a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/IDRestHandler.java similarity index 98% rename from dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/IDRestHandler.java index 7c2881f..023a3b6 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/IDRestHandler.java +++ b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/IDRestHandler.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package org.hu.attx.apis.es.plugin.siren; +package org.uh.hulib.attx.dc.es.siren; import java.net.URLDecoder; import java.util.ArrayList; diff --git a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/QueryParser.java similarity index 99% rename from dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java rename to dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/QueryParser.java index 09f9776..7ca03cd 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/hu/attx/apis/es/plugin/siren/QueryParser.java +++ b/dc-elasticsearch-siren/attx-api-plugin/src/main/java/org/uh/hulib/attx/dc/es/siren/QueryParser.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package org.hu.attx.apis.es.plugin.siren; +package org.uh.hulib.attx.dc.es.siren; import com.sindicetech.siren.qparser.tree.dsl.AbstractNodeQuery; import com.sindicetech.siren.qparser.tree.dsl.BooleanQuery; diff --git a/dc-elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java b/dc-elasticsearch-siren/attx-api-plugin/src/test/java/org/uh/hulib/attx/dc/es/siren/QueryParserTest.java similarity index 97% rename from dc-elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java rename to dc-elasticsearch-siren/attx-api-plugin/src/test/java/org/uh/hulib/attx/dc/es/siren/QueryParserTest.java index 6936585..435ce30 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/src/test/java/org/hu/attx/apis/es/plugin/siren/QueryParserTest.java +++ b/dc-elasticsearch-siren/attx-api-plugin/src/test/java/org/uh/hulib/attx/dc/es/siren/QueryParserTest.java @@ -3,8 +3,9 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package org.hu.attx.apis.es.plugin.siren; +package org.uh.hulib.attx.dc.es.siren; +import org.uh.hulib.attx.dc.es.siren.QueryParser; import com.sindicetech.siren.qparser.tree.dsl.AbstractNodeQuery; import com.sindicetech.siren.qparser.tree.dsl.BooleanQuery; import com.sindicetech.siren.qparser.tree.dsl.ConciseNodeQuery; From d92ee9af95f1aa6043efea3281218586285711c1 Mon Sep 17 00:00:00 2001 From: jkesanie Date: Fri, 17 Mar 2017 15:12:21 +0200 Subject: [PATCH 26/35] refactoring according to ATTX-project/project-management#86 --- commonJava.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commonJava.gradle b/commonJava.gradle index ba410fc..2b22cc8 100644 --- a/commonJava.gradle +++ b/commonJava.gradle @@ -4,7 +4,7 @@ apply plugin: 'maven-publish' apply plugin: 'com.github.johnrengelman.shadow' -String mavenGroupId = 'org.uh.attx.gc' +String mavenGroupId = 'org.uh.hulib.attx.dc' String mavenVersion = '1.0-SNAPSHOT' targetCompatibility = '1.8' From 97c36994ad938ebd2fa5667d5a63c2124a7a1818 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Tue, 21 Mar 2017 09:41:30 +0200 Subject: [PATCH 27/35] proper package name Changed due to https://github.com/ATTX-project/platform-deployment/issues/27#issuecomment-287997016 --- .../attx-api-plugin/src/main/resources/es-plugin.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dc-elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties b/dc-elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties index f30c42e..fbee725 100644 --- a/dc-elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties +++ b/dc-elasticsearch-siren/attx-api-plugin/src/main/resources/es-plugin.properties @@ -1 +1 @@ -plugin=org.hu.attx.apis.es.plugin.siren.ATTXApiPlugin +plugin=org.uh.hulib.attx.dc.es.siren.ATTXApiPlugin From cfcb4cb0013b8f064edb5a173d6a4bfae02cb64d Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Fri, 31 Mar 2017 10:18:36 +0300 Subject: [PATCH 28/35] ATTX-project/project-management#82 dc gradle and test setup --- .gitignore | 1 + build.gradle | 1 + common.gradle | 4 - commonJava.gradle | 3 +- dc-feature-tests/Dockerfile | 8 +- dc-feature-tests/build.gradle | 141 ++++++++++++++++-- dc-feature-tests/build.test.gradle | 41 ++++- dc-feature-tests/runTests.sh | 16 +- .../uh/hulib/attx/dc/test/DCTests.java} | 10 +- .../hulib/attx/dc/test/PlatformServices.java | 37 +++++ 10 files changed, 223 insertions(+), 39 deletions(-) rename dc-feature-tests/src/test/java/{NewEmptyJUnitTest.java => org/uh/hulib/attx/dc/test/DCTests.java} (83%) create mode 100644 dc-feature-tests/src/test/java/org/uh/hulib/attx/dc/test/PlatformServices.java diff --git a/.gitignore b/.gitignore index 6b6f2c9..cfdc75f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ gradle-app.setting # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +.idea/ # User-specific stuff: .idea/workspace.xml .idea/tasks.xml diff --git a/build.gradle b/build.gradle index a134d9d..df5fb13 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id "de.undercouch.download" version "3.1.2" id "com.chrisgahlert.gradle-dcompose-plugin" version "0.8.2" id "com.github.johnrengelman.shadow" version "1.2.4" + id "com.bmuschko.docker-remote-api" version "3.0.6" } apply plugin: 'java' apply plugin: 'base' // To add "clean" task to the root project. diff --git a/common.gradle b/common.gradle index e93db1f..a64c4c3 100644 --- a/common.gradle +++ b/common.gradle @@ -17,10 +17,6 @@ if (!project.hasProperty("artifactRepoURL")) { ext.artifactRepoURL = "http://${imageRepo}:${artifactRepoPort}/repository/attx-releases" } -if (!project.hasProperty("snapshotRepoURL")) { - ext.snapshotRepoURL = "http://${imageRepo}:${artifactRepoPort}/repository/attx-snapshots" -} - if (!project.hasProperty("artifactRepoUser")) { ext.artifactRepoUser = "" } diff --git a/commonJava.gradle b/commonJava.gradle index 2b22cc8..6ab4391 100644 --- a/commonJava.gradle +++ b/commonJava.gradle @@ -1,7 +1,6 @@ apply plugin: 'java' apply plugin: 'maven' apply plugin: 'maven-publish' - apply plugin: 'com.github.johnrengelman.shadow' String mavenGroupId = 'org.uh.hulib.attx.dc' @@ -14,7 +13,7 @@ sourceCompatibility = '1.8' repositories { // mavenCentral() maven { url "https://plugins.gradle.org/m2/"} - maven { url "$snapshotRepoURL"} + maven { url "$artifactRepoURL"} } dependencies { diff --git a/dc-feature-tests/Dockerfile b/dc-feature-tests/Dockerfile index 009e0e1..eae03d1 100644 --- a/dc-feature-tests/Dockerfile +++ b/dc-feature-tests/Dockerfile @@ -1,9 +1,15 @@ FROM frekele/gradle:3.3-jdk8 RUN apt-get update \ - && apt-get install -y netcat \ + && apt-get install -y wget \ && apt-get clean +ENV DOCKERIZE_VERSION v0.3.0 + +RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + RUN mkdir -p /tmp/ WORKDIR /tmp/ diff --git a/dc-feature-tests/build.gradle b/dc-feature-tests/build.gradle index 6eb9814..fcb6f8d 100644 --- a/dc-feature-tests/build.gradle +++ b/dc-feature-tests/build.gradle @@ -1,51 +1,162 @@ apply plugin: 'com.chrisgahlert.gradle-dcompose-plugin' -apply plugin: 'com.github.johnrengelman.shadow' +apply plugin: 'com.bmuschko.docker-remote-api' + +import com.bmuschko.gradle.docker.tasks.container.DockerWaitContainer + +dependencies { + testCompile \ + 'junit:junit:4.10', + 'info.cukes:cucumber-java8:1.2.5', + 'info.cukes:cucumber-junit:1.2.5', + 'com.mashape.unirest:unirest-java:1.4.9', + 'org.skyscreamer:jsonassert:1.4.0' + 'org.awaitility:awaitility-groovy:2.0.0' +} + +if (!project.hasProperty("testEnv") || project.testEnv == "dev") { + ext.testSet = "localhost" +} else if (project.testEnv == "CI"){ + ext.testSet = "container" +} else { + throw new GradleException("Build project environment option not recognised.") +} + +ext { + testImageWF = "latest" + testImageGM = "latest" + testImageFuseki = "latest" + testImageES5 = "latest" + testImageESSiren = "latest" + testImageUVShared = "latest" + testImageATTXDPUs = "latest" +} dcompose { createComposeFile.useTags = true - registry ("${registryURL}") {} + registry ("$registryURL") { + // no user/pass + } + networks { + dcTest + } essiren { forcePull = true forceRemoveImage = true - image = "${imageRepo}:${imageRepoPort}/essiren:latest" - exposedPorts = ['9200', '9300'] - portBindings = ['9200:9200', '9300:9300'] + image = "${imageRepo}:${imageRepoPort}/essiren:${testImageESSiren}" + networks = [dcTest] + hostName = 'essiren' + if (testSet == "localhost") { + portBindings = ['9200:9200', '9300:9300'] + } + } + + es5 { + forcePull = true + forceRemoveImage = true + image = "${imageRepo}:${imageRepoPort}/attx-es5:${testImageES5}" + networks = [dcTest] + dependsOn = [essiren] + hostName = 'es5' + if (testSet == "localhost") { + portBindings = ['9210:9210', '9310:9310'] + } } test { ignoreExitCode = true baseDir = file('.') dockerFilename = 'Dockerfile' - binds = ["/var/run/docker.sock:/run/docker.sock"] + if (testSet == "container") { + binds = ["/var/run/docker.sock:/run/docker.sock"] + } + dependsOn = [essiren, es5] command = ['sh', '-c', '/tmp/runTests.sh'] - dependsOn = [essiren] waitForCommand = true forceRemoveImage = true + attachStdout = true + networks = [dcTest] } } task copyReportFiles(type: DcomposeCopyFileFromContainerTask) { service = dcompose.test - containerPath = '/tmp/build/reports' - destinationDir = file("build/from-container/") + containerPath = '/tmp/build/reports/tests' + destinationDir = file("build/reports/") cleanDestinationDir = false } startTestContainer.finalizedBy copyReportFiles -// making sure the that fresh build of test classes is done before building the image -buildTestImage.dependsOn shadowJar -buildTestImage.dependsOn testClasses - - shadowJar { classifier = 'tests' from sourceSets.test.output configurations = [project.configurations.testRuntime] } -task integTest { +buildTestImage.dependsOn shadowJar +buildTestImage.dependsOn testClasses + +// TO DO: Figure out if we need the attxDPU container +//task checkDPUDone(type: DockerWaitContainer) { +// dependsOn startEs5Container +// targetContainerId {dcompose.attxdpus.containerId} +// doLast{ +// if(getExitCode() != 0) { +// println "ATTX DPU Container failed with exit code \${getExitCode()}" +// } else { +// println "Everything is peachy." +// } +// } +//} +// +//startTestContainer.dependsOn checkDPUDone + +task runContainerTests { dependsOn startTestContainer finalizedBy removeImages + doLast { + if(dcompose.test.exitCode != 0){ throw new GradleException("Tests within the container Failed!") } + } +} + +// TO DO: find a fix so we can run the test locally preferably while waiting for other stuff to be there. MYSQL is the one that we need to wait for. + +task runIntegTests(type: Test) { +// dependsOn checkDPUDone + dependsOn startEs5Container + + doFirst { + systemProperty 'frontend.port', dcompose.frontend.findHostPort(8080) + systemProperty 'frontend.host', dcompose.frontend.dockerHost + systemProperty 'wfapi.port', dcompose.wfapi.findHostPort(4301) + systemProperty 'wfapi.host', dcompose.wfapi.dockerHost + systemProperty 'fuseki.port', dcompose.fuseki.findHostPort(3030) + systemProperty 'fuseki.host', dcompose.fuseki.dockerHost + systemProperty 'gmapi.port', dcompose.gmapi.findHostPort(4302) + systemProperty 'gmapi.host', dcompose.gmapi.dockerHost + systemProperty 'essiren.port', dcompose.essiren.findHostPort(9200) + systemProperty 'essiren.tcp', dcompose.essiren.findHostPort(9300) + systemProperty 'essiren.host', dcompose.essiren.dockerHost + systemProperty 'es5.port', dcompose.es5.findHostPort(9210) + systemProperty 'es5.host', dcompose.es5.dockerHost + } + doLast { + systemProperties.remove 'frontend.port' + systemProperties.remove 'frontend.host' + systemProperties.remove 'wfapi.port' + systemProperties.remove 'wfapi.host' + systemProperties.remove 'fuseki.port' + systemProperties.remove 'fuseki.host' + systemProperties.remove 'gmapi.port' + systemProperties.remove 'gmapi.host' + systemProperties.remove 'essiren.port' + systemProperties.remove 'essiren.tcp' + systemProperties.remove 'essiren.host' + systemProperties.remove 'es5.port' + systemProperties.remove 'es5.host' + } + finalizedBy removeImages } + + diff --git a/dc-feature-tests/build.test.gradle b/dc-feature-tests/build.test.gradle index 37a4eeb..4413954 100644 --- a/dc-feature-tests/build.test.gradle +++ b/dc-feature-tests/build.test.gradle @@ -3,6 +3,43 @@ plugins { } dependencies { - testRuntime \ - fileTree(dir: 'build/libs', include: ['*.jar']) + testCompile fileTree(dir: 'build/libs', include: ['*.jar']) +} + +task integTest(type: Test){ + doFirst { + systemProperty 'frontend.port', 8080 + systemProperty 'frontend.host', 'frontend' + systemProperty 'wfapi.port', 4301 + systemProperty 'wfapi.host', 'wfapi' + systemProperty 'fuseki.port', 3030 + systemProperty 'fuseki.host', 'fuseki' + systemProperty 'gmapi.port', 4302 + systemProperty 'gmapi.host', 'gmapi' + systemProperty 'essiren.port', 9200 + systemProperty 'essiren.tcp', 9300 + systemProperty 'essiren.host', 'essiren' + systemProperty 'es5.port', 9210 + systemProperty 'es5.host', 'es5' + } + forkEvery = 2 + maxParallelForks = 2 + testLogging { + showStackTraces = true + } + doLast { + systemProperties.remove 'frontend.port' + systemProperties.remove 'frontend.host' + systemProperties.remove 'wfapi.port' + systemProperties.remove 'wfapi.host' + systemProperties.remove 'fuseki.port' + systemProperties.remove 'fuseki.host' + systemProperties.remove 'gmapi.port' + systemProperties.remove 'gmapi.host' + systemProperties.remove 'essiren.port' + systemProperties.remove 'essiren.tcp' + systemProperties.remove 'essiren.host' + systemProperties.remove 'es5.port' + systemProperties.remove 'es5.host' + } } diff --git a/dc-feature-tests/runTests.sh b/dc-feature-tests/runTests.sh index a806666..4531971 100644 --- a/dc-feature-tests/runTests.sh +++ b/dc-feature-tests/runTests.sh @@ -1,13 +1,9 @@ #!/bin/sh -: ${SLEEP_LENGTH:=2} +dockerize -wait http://essiren:9200 -timeout 60s +dockerize -wait tcp://essiren:9300 -timeout 60s +dockerize -wait http://es5:9210 -timeout 60s +# wait for es5 9310 apparently not working +# dockerize -wait tcp://es5:9310 -timeout 60s -wait_for() { - echo Waiting for $1 to listen on $2... >> /tmp/log - while ! nc -z $1 $2; do echo sleeping >> /tmp/log ; sleep $SLEEP_LENGTH; done -} - -wait_for "essiren" "9200" -wait_for "essiren" "9300" - -gradle -b build.gradle --offline test +gradle -b build.gradle --offline integTest diff --git a/dc-feature-tests/src/test/java/NewEmptyJUnitTest.java b/dc-feature-tests/src/test/java/org/uh/hulib/attx/dc/test/DCTests.java similarity index 83% rename from dc-feature-tests/src/test/java/NewEmptyJUnitTest.java rename to dc-feature-tests/src/test/java/org/uh/hulib/attx/dc/test/DCTests.java index 954f208..8dda7fe 100644 --- a/dc-feature-tests/src/test/java/NewEmptyJUnitTest.java +++ b/dc-feature-tests/src/test/java/org/uh/hulib/attx/dc/test/DCTests.java @@ -1,4 +1,4 @@ -/* +package org.uh.hulib.attx.dc.test;/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. @@ -8,16 +8,16 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Test; -import static org.junit.Assert.*; /** * * @author jkesanie */ -public class NewEmptyJUnitTest { +public class DCTests { + + private static PlatformServices s = new PlatformServices(); - public NewEmptyJUnitTest() { + public DCTests() { } @BeforeClass diff --git a/dc-feature-tests/src/test/java/org/uh/hulib/attx/dc/test/PlatformServices.java b/dc-feature-tests/src/test/java/org/uh/hulib/attx/dc/test/PlatformServices.java new file mode 100644 index 0000000..2120395 --- /dev/null +++ b/dc-feature-tests/src/test/java/org/uh/hulib/attx/dc/test/PlatformServices.java @@ -0,0 +1,37 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.uh.hulib.attx.dc.test; + +/** + * + * @author jkesanie + */ +public class PlatformServices { + + public String getESSiren() { + return "http://" + System.getProperty("essiren.host") + ":" + Integer.parseInt(System.getProperty("essiren.port")); + } + + public String getES5() { + return "http://" + System.getProperty("es5.host") + ":" + Integer.parseInt(System.getProperty("es5.port")); + } + + public String getFuseki() { + return "http://" + System.getProperty("fuseki.host") + ":" + Integer.parseInt(System.getProperty("fuseki.port")); + } + + public String getUV() { + return "http://" + System.getProperty("frontend.host") + ":" + Integer.parseInt(System.getProperty("frontend.port")); + } + + public String getGmapi() { + return "http://" + System.getProperty("gmapi.host") + ":" + Integer.parseInt(System.getProperty("gmapi.port")); + } + + public String getWfapi() { + return "http://" + System.getProperty("wfapi.host") + ":" + Integer.parseInt(System.getProperty("wfapi.port")); + } +} From 74f14d18d6adfa0aba4cae6114def11ad46e236e Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Fri, 31 Mar 2017 10:23:27 +0300 Subject: [PATCH 29/35] removing unecessary container checks --- dc-feature-tests/build.gradle | 16 ---------------- dc-feature-tests/build.test.gradle | 16 ---------------- 2 files changed, 32 deletions(-) diff --git a/dc-feature-tests/build.gradle b/dc-feature-tests/build.gradle index fcb6f8d..5f20726 100644 --- a/dc-feature-tests/build.gradle +++ b/dc-feature-tests/build.gradle @@ -127,14 +127,6 @@ task runIntegTests(type: Test) { dependsOn startEs5Container doFirst { - systemProperty 'frontend.port', dcompose.frontend.findHostPort(8080) - systemProperty 'frontend.host', dcompose.frontend.dockerHost - systemProperty 'wfapi.port', dcompose.wfapi.findHostPort(4301) - systemProperty 'wfapi.host', dcompose.wfapi.dockerHost - systemProperty 'fuseki.port', dcompose.fuseki.findHostPort(3030) - systemProperty 'fuseki.host', dcompose.fuseki.dockerHost - systemProperty 'gmapi.port', dcompose.gmapi.findHostPort(4302) - systemProperty 'gmapi.host', dcompose.gmapi.dockerHost systemProperty 'essiren.port', dcompose.essiren.findHostPort(9200) systemProperty 'essiren.tcp', dcompose.essiren.findHostPort(9300) systemProperty 'essiren.host', dcompose.essiren.dockerHost @@ -142,14 +134,6 @@ task runIntegTests(type: Test) { systemProperty 'es5.host', dcompose.es5.dockerHost } doLast { - systemProperties.remove 'frontend.port' - systemProperties.remove 'frontend.host' - systemProperties.remove 'wfapi.port' - systemProperties.remove 'wfapi.host' - systemProperties.remove 'fuseki.port' - systemProperties.remove 'fuseki.host' - systemProperties.remove 'gmapi.port' - systemProperties.remove 'gmapi.host' systemProperties.remove 'essiren.port' systemProperties.remove 'essiren.tcp' systemProperties.remove 'essiren.host' diff --git a/dc-feature-tests/build.test.gradle b/dc-feature-tests/build.test.gradle index 4413954..7a6cb6d 100644 --- a/dc-feature-tests/build.test.gradle +++ b/dc-feature-tests/build.test.gradle @@ -8,14 +8,6 @@ dependencies { task integTest(type: Test){ doFirst { - systemProperty 'frontend.port', 8080 - systemProperty 'frontend.host', 'frontend' - systemProperty 'wfapi.port', 4301 - systemProperty 'wfapi.host', 'wfapi' - systemProperty 'fuseki.port', 3030 - systemProperty 'fuseki.host', 'fuseki' - systemProperty 'gmapi.port', 4302 - systemProperty 'gmapi.host', 'gmapi' systemProperty 'essiren.port', 9200 systemProperty 'essiren.tcp', 9300 systemProperty 'essiren.host', 'essiren' @@ -28,14 +20,6 @@ task integTest(type: Test){ showStackTraces = true } doLast { - systemProperties.remove 'frontend.port' - systemProperties.remove 'frontend.host' - systemProperties.remove 'wfapi.port' - systemProperties.remove 'wfapi.host' - systemProperties.remove 'fuseki.port' - systemProperties.remove 'fuseki.host' - systemProperties.remove 'gmapi.port' - systemProperties.remove 'gmapi.host' systemProperties.remove 'essiren.port' systemProperties.remove 'essiren.tcp' systemProperties.remove 'essiren.host' From 9dfa6becaef686b7dca39e7778159da92ef60885 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Fri, 31 Mar 2017 16:34:43 +0300 Subject: [PATCH 30/35] missing comma --- dc-feature-tests/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dc-feature-tests/build.gradle b/dc-feature-tests/build.gradle index 5f20726..fe7efb3 100644 --- a/dc-feature-tests/build.gradle +++ b/dc-feature-tests/build.gradle @@ -9,7 +9,7 @@ dependencies { 'info.cukes:cucumber-java8:1.2.5', 'info.cukes:cucumber-junit:1.2.5', 'com.mashape.unirest:unirest-java:1.4.9', - 'org.skyscreamer:jsonassert:1.4.0' + 'org.skyscreamer:jsonassert:1.4.0', 'org.awaitility:awaitility-groovy:2.0.0' } From a54451781dc3974dbacbd93ef4d935877a637b6e Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Thu, 6 Apr 2017 12:33:56 +0300 Subject: [PATCH 31/35] ATTX-project/project-management#88 adding test helper to DC library --- dc-feature-tests/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dc-feature-tests/build.gradle b/dc-feature-tests/build.gradle index fe7efb3..24d23ce 100644 --- a/dc-feature-tests/build.gradle +++ b/dc-feature-tests/build.gradle @@ -10,7 +10,8 @@ dependencies { 'info.cukes:cucumber-junit:1.2.5', 'com.mashape.unirest:unirest-java:1.4.9', 'org.skyscreamer:jsonassert:1.4.0', - 'org.awaitility:awaitility-groovy:2.0.0' + 'org.awaitility:awaitility-groovy:2.0.0', + 'org.uh.hulib.attx.dev:dev-test-helper:1.3' } if (!project.hasProperty("testEnv") || project.testEnv == "dev") { From 7268ec2dcee54a0fd518b22a92904bfc710abb06 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Thu, 6 Apr 2017 15:38:27 +0300 Subject: [PATCH 32/35] hotfix version bump --- dc-feature-tests/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dc-feature-tests/build.gradle b/dc-feature-tests/build.gradle index 24d23ce..f7c31b8 100644 --- a/dc-feature-tests/build.gradle +++ b/dc-feature-tests/build.gradle @@ -11,7 +11,7 @@ dependencies { 'com.mashape.unirest:unirest-java:1.4.9', 'org.skyscreamer:jsonassert:1.4.0', 'org.awaitility:awaitility-groovy:2.0.0', - 'org.uh.hulib.attx.dev:dev-test-helper:1.3' + 'org.uh.hulib.attx.dev:dev-test-helper:1.4' } if (!project.hasProperty("testEnv") || project.testEnv == "dev") { From 91f99ea635fdede1c69c310a5527cadf3d1d7303 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Fri, 7 Apr 2017 11:58:45 +0300 Subject: [PATCH 33/35] ATTX-project/project-management#90 DC readme --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c69ee76..60d7afd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,14 @@ -# api-elasticsearch -Elasticsearch based implementation of the public restful API. +# Distribution Component + +This ATTX Distribution Component provides the interface between the Graph Component and the applications designed for consuming and disseminating the data produced by the Semantic Web Broker platform. + +The Distribution Component consists of: +* ElasticSearch 1.3.4 with Siren plugin (https://github.com/sirensolutions/siren) which has the role of indexing and making the Graph Store knowledge convenient accessible via an API; +* ElasticSearch 5.x which provides the latest functionality in order to index data as plain JSON (after applying a JSON-LD frame http://json-ld.org/spec/latest/json-ld-framing/), JSON-LD or capturing logs. + + +## Repository Structure + +Currently the repository consists of: +* Distribution Component - Integration Tests +* Elasticsearch 1.3.4 ATTX API plugin and associated tests From 24642aaa6ab2fc9b8103f9913549a1171dcf7a34 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Fri, 7 Apr 2017 12:31:37 +0300 Subject: [PATCH 34/35] small adjustment --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 60d7afd..2e580f0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ The Distribution Component consists of: * ElasticSearch 1.3.4 with Siren plugin (https://github.com/sirensolutions/siren) which has the role of indexing and making the Graph Store knowledge convenient accessible via an API; * ElasticSearch 5.x which provides the latest functionality in order to index data as plain JSON (after applying a JSON-LD frame http://json-ld.org/spec/latest/json-ld-framing/), JSON-LD or capturing logs. - ## Repository Structure Currently the repository consists of: From 631a2793cdd4a8c7dc09b26ad3c124e054bcd7c3 Mon Sep 17 00:00:00 2001 From: Stefan Negru Date: Fri, 7 Apr 2017 12:32:18 +0300 Subject: [PATCH 35/35] small adjustment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e580f0..ddb1b79 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ The Distribution Component consists of: ## Repository Structure -Currently the repository consists of: +The repository consists of: * Distribution Component - Integration Tests * Elasticsearch 1.3.4 ATTX API plugin and associated tests