karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject karaf-decanter git commit: Allow REST test to run independently of local elastic search
Date Wed, 17 Feb 2016 17:09:18 GMT
Repository: karaf-decanter
Updated Branches:
  refs/heads/master b4a4bbf99 -> f7c6055b8


Allow REST test to run independently of local elastic search


Project: http://git-wip-us.apache.org/repos/asf/karaf-decanter/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-decanter/commit/f7c6055b
Tree: http://git-wip-us.apache.org/repos/asf/karaf-decanter/tree/f7c6055b
Diff: http://git-wip-us.apache.org/repos/asf/karaf-decanter/diff/f7c6055b

Branch: refs/heads/master
Commit: f7c6055b89f0053960f9cd1301a5b59c467eec1e
Parents: b4a4bbf
Author: Christian Schneider <chris@die-schneider.net>
Authored: Wed Feb 17 18:09:12 2016 +0100
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Wed Feb 17 18:09:12 2016 +0100

----------------------------------------------------------------------
 .../elasticsearch/rest/TestElasticsearchAppender.java  | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-decanter/blob/f7c6055b/appender/elasticsearch-rest/src/test/java/org/apache/karaf/decanter/appender/elasticsearch/rest/TestElasticsearchAppender.java
----------------------------------------------------------------------
diff --git a/appender/elasticsearch-rest/src/test/java/org/apache/karaf/decanter/appender/elasticsearch/rest/TestElasticsearchAppender.java
b/appender/elasticsearch-rest/src/test/java/org/apache/karaf/decanter/appender/elasticsearch/rest/TestElasticsearchAppender.java
index fdb2f15..3646597 100644
--- a/appender/elasticsearch-rest/src/test/java/org/apache/karaf/decanter/appender/elasticsearch/rest/TestElasticsearchAppender.java
+++ b/appender/elasticsearch-rest/src/test/java/org/apache/karaf/decanter/appender/elasticsearch/rest/TestElasticsearchAppender.java
@@ -33,15 +33,22 @@ import org.apache.karaf.decanter.marshaller.json.JsonMarshaller;
 
 public class TestElasticsearchAppender {
 
+    private static final String CLUSTER_NAME = "elasticsearch-test";
+    private static final String HOST = "127.0.0.1";
+    private static final int PORT = 9301;
+    private static final int HTTP_PORT = 9201;
+
     @Test
     public void testAppender() throws Exception {
 
         Settings settings = settingsBuilder()
-                .put("cluster.name", "elasticsearch")
+                .put("cluster.name", CLUSTER_NAME)
                 .put("http.enabled", "true")
                 .put("node.data", true)
                 .put("path.data", "target/data")
-                .put("network.host", "127.0.0.1")
+                .put("network.host", HOST)
+                .put("port", PORT)
+                .put("http.port", HTTP_PORT)
                 .put("index.store.type", "memory")
                 .put("index.store.fs.memory.enabled", "true")
                 .put("path.plugins", "target/plugins")
@@ -50,7 +57,7 @@ public class TestElasticsearchAppender {
         Node node = nodeBuilder().settings(settings).node();
 
         Marshaller marshaller = new JsonMarshaller();
-        ElasticsearchAppender appender = new ElasticsearchAppender(marshaller, "http://127.0.0.1:9200",
null, null);
+        ElasticsearchAppender appender = new ElasticsearchAppender(marshaller, "http://"
+ HOST + ":" + HTTP_PORT, null, null);
         appender.handleEvent(new Event("testTopic", MapBuilder.<String, String>newMapBuilder().put("a",
"b").put("c", "d").map()));
         appender.handleEvent(new Event("testTopic", MapBuilder.<String, String>newMapBuilder().put("a",
"b").put("c", "d").map()));
         appender.handleEvent(new Event("testTopic", MapBuilder.<String, String>newMapBuilder().put("a",
"b").put("c", "d").map()));


Mime
View raw message