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
This commit is contained in:
Mark Robert Miller 2013-02-28 21:47:39 +00:00
parent f5e2e50c7f
commit 7f9f3c5105
1 changed files with 16 additions and 0 deletions

View File

@ -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");