From 7f9f3c5105dac23c5e4e2df382d2aa8a20ded930 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Thu, 28 Feb 2013 21:47:39 +0000 Subject: [PATCH] tests: add test that hits update url git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1451370 13f79535-47bb-0310-9956-ffa450edef68 --- .../solr/cloud/BasicDistributedZkTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java index fed183dc03f..bf04323892a 100644 --- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java @@ -322,6 +322,7 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase { testMultipleCollections(); testANewCollectionInOneInstance(); testSearchByCollectionName(); + testUpdateByCollectionName(); testANewCollectionInOneInstanceWithManualShardAssignement(); testNumberOfCommitsWithCommitAfterAdd(); @@ -681,6 +682,21 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase { long oneDocs = client1.query(query).getResults().getNumFound(); assertEquals(3, oneDocs); } + + private void testUpdateByCollectionName() throws SolrServerException, IOException { + log.info("### STARTING testUpdateByCollectionName"); + SolrServer client = clients.get(0); + final String baseUrl = ((HttpSolrServer) client).getBaseURL().substring( + 0, + ((HttpSolrServer) client).getBaseURL().length() + - DEFAULT_COLLECTION.length() - 1); + + // the cores each have different names, but if we add the collection name to the url + // we should get mapped to the right core + // test hitting an update url + SolrServer client1 = createNewSolrServer(oneInstanceCollection, baseUrl); + client1.commit(); + } private void testANewCollectionInOneInstance() throws Exception { log.info("### STARTING testANewCollectionInOneInstance");