camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [05/27] git commit: Setup https solrj client correctly
Date Tue, 15 Jul 2014 11:39:59 GMT
Setup https solrj client correctly


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

Branch: refs/heads/master
Commit: e7f4ada8e54bd97d27cfdf58d251e0b7760c7edb
Parents: 2485a7f
Author: Doug Turnbull <dturnbull@o19s.com>
Authored: Mon Apr 28 22:19:04 2014 -0400
Committer: Doug Turnbull <dturnbull@o19s.com>
Committed: Mon Apr 28 22:19:04 2014 -0400

----------------------------------------------------------------------
 .../services/org/apache/camel/component/solrs   | 18 ++++++++++++++++++
 .../solr/SolrComponentTestSupport.java          |  2 +-
 .../camel/component/solr/SolrFixtures.java      | 20 ++++++--------------
 3 files changed, 25 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e7f4ada8/components/camel-solr/src/main/resources/META-INF/services/org/apache/camel/component/solrs
----------------------------------------------------------------------
diff --git a/components/camel-solr/src/main/resources/META-INF/services/org/apache/camel/component/solrs
b/components/camel-solr/src/main/resources/META-INF/services/org/apache/camel/component/solrs
new file mode 100644
index 0000000..f800534
--- /dev/null
+++ b/components/camel-solr/src/main/resources/META-INF/services/org/apache/camel/component/solrs
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+class=org.apache.camel.component.solr.SolrComponent

http://git-wip-us.apache.org/repos/asf/camel/blob/e7f4ada8/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrComponentTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrComponentTestSupport.java
b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrComponentTestSupport.java
index 118229e..08c14f4 100644
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrComponentTestSupport.java
+++ b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrComponentTestSupport.java
@@ -113,6 +113,6 @@ public class SolrComponentTestSupport extends SolrTestSupport {
 
     @Before
     public void clearIndex() throws Exception {
-    	solrFixtures.clearIndex();	
+    	SolrFixtures.clearIndex();	
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/e7f4ada8/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrFixtures.java
----------------------------------------------------------------------
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrFixtures.java
b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrFixtures.java
index 64cfb77..696da0c 100644
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrFixtures.java
+++ b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrFixtures.java
@@ -43,11 +43,15 @@ public class SolrFixtures {
     static void createSolrFixtures() throws Exception {
     	solrHttpsRunner = JettySolrFactory.createJettyTestFixture(true);
     	httpsPort = solrHttpsRunner.getLocalPort();
-    	log.info("Started Https Test Server: " + solrHttpsRunner.getBaseUrl());;
+    	log.info("Started Https Test Server: " + solrHttpsRunner.getBaseUrl());
+        solrHttpsServer = new HttpSolrServer("https://localhost:" + httpsPort + "/solr");
+        solrHttpsServer.setConnectionTimeout(60000);
     	
     	solrRunner = JettySolrFactory.createJettyTestFixture(false);
     	port = solrRunner.getLocalPort();
     	
+    	solrServer = new HttpSolrServer("http://localhost:" + port + "/solr");
+    	
     	log.info("Started Test Server: " + solrRunner.getBaseUrl());
 
     }
@@ -61,19 +65,7 @@ public class SolrFixtures {
         }
     }
     
-    public void clearFixtures() throws SolrServerException, IOException {
-    	 if (solrServer != null) {
-             // Clear the Solr index.
-             solrServer.deleteByQuery("*:*");
-             solrServer.commit();
-         }
-         if (solrHttpsServer != null) {
-         	solrHttpsServer.deleteByQuery("*:*");
-         	solrHttpsServer.commit();
-         }
-    }
-    
-    public void clearIndex() throws SolrServerException, IOException {
+    public static void clearIndex() throws SolrServerException, IOException {
     	 if (solrServer != null) {
              // Clear the Solr index.
              solrServer.deleteByQuery("*:*");


Mime
View raw message