mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +00:00
Search-98, Formatting changes
This commit is contained in:
@@ -302,8 +302,6 @@ public abstract class AbstractAlfrescoDistributedTest extends SolrTestCaseJ4
|
|||||||
public void assertNodesPerShardGreaterThan(int count) throws Exception {
|
public void assertNodesPerShardGreaterThan(int count) throws Exception {
|
||||||
List<SolrCore> cores = getJettyCores(jettyShards);
|
List<SolrCore> cores = getJettyCores(jettyShards);
|
||||||
Query query = new TermQuery(new Term(FIELD_DOC_TYPE, SolrInformationServer.DOC_TYPE_NODE));
|
Query query = new TermQuery(new Term(FIELD_DOC_TYPE, SolrInformationServer.DOC_TYPE_NODE));
|
||||||
try {
|
|
||||||
|
|
||||||
for (SolrCore core : cores) {
|
for (SolrCore core : cores) {
|
||||||
RefCounted<SolrIndexSearcher> refCounted = null;
|
RefCounted<SolrIndexSearcher> refCounted = null;
|
||||||
try {
|
try {
|
||||||
@@ -317,11 +315,6 @@ public abstract class AbstractAlfrescoDistributedTest extends SolrTestCaseJ4
|
|||||||
refCounted.decref();
|
refCounted.decref();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void waitForDocCountCore(SolrCore core,
|
private void waitForDocCountCore(SolrCore core,
|
||||||
@@ -1424,7 +1417,8 @@ public abstract class AbstractAlfrescoDistributedTest extends SolrTestCaseJ4
|
|||||||
SOLRAPIQueueClient.transactionQueue.add(transaction);
|
SOLRAPIQueueClient.transactionQueue.add(transaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum JettyInstances {
|
public enum JettyInstances
|
||||||
|
{
|
||||||
PER_SHARD,
|
PER_SHARD,
|
||||||
PER_CORE,
|
PER_CORE,
|
||||||
SINGLE;
|
SINGLE;
|
||||||
@@ -1433,40 +1427,47 @@ public abstract class AbstractAlfrescoDistributedTest extends SolrTestCaseJ4
|
|||||||
/**
|
/**
|
||||||
* A JUnit Rule to setup Jetty
|
* A JUnit Rule to setup Jetty
|
||||||
*/
|
*/
|
||||||
public class JettyServerRule extends ExternalResource {
|
public class JettyServerRule extends ExternalResource
|
||||||
|
{
|
||||||
|
|
||||||
final String[] coreNames;
|
final String[] coreNames;
|
||||||
final int numShards;
|
final int numShards;
|
||||||
final JettyInstances jettyStrategy;
|
final JettyInstances jettyStrategy;
|
||||||
|
|
||||||
public JettyServerRule(int numShards, JettyInstances jettyStategy, String ...coreNames) {
|
public JettyServerRule(int numShards, JettyInstances jettyStategy, String ...coreNames)
|
||||||
|
{
|
||||||
this.coreNames = coreNames;
|
this.coreNames = coreNames;
|
||||||
this.numShards = numShards;
|
this.numShards = numShards;
|
||||||
this.jettyStrategy = jettyStategy;
|
this.jettyStrategy = jettyStategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JettyServerRule(int numShards) {
|
public JettyServerRule(int numShards)
|
||||||
|
{
|
||||||
coreNames = new String[]{DEFAULT_TEST_CORENAME};
|
coreNames = new String[]{DEFAULT_TEST_CORENAME};
|
||||||
this.jettyStrategy = JettyInstances.PER_SHARD;
|
this.jettyStrategy = JettyInstances.PER_SHARD;
|
||||||
this.numShards = numShards;
|
this.numShards = numShards;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void before() throws Throwable {
|
protected void before() throws Throwable
|
||||||
|
{
|
||||||
distribSetUp();
|
distribSetUp();
|
||||||
RandVal.uniqueValues = new HashSet(); // reset random values
|
RandVal.uniqueValues = new HashSet(); // reset random values
|
||||||
createServers(jettyStrategy, coreNames, numShards);
|
createServers(jettyStrategy, coreNames, numShards);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void after() {
|
protected void after()
|
||||||
|
{
|
||||||
|
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
destroyServers();
|
destroyServers();
|
||||||
distribTearDown();
|
distribTearDown();
|
||||||
} catch (Exception e) {
|
|
||||||
FileUtils.deleteDirectory(testDir);
|
FileUtils.deleteDirectory(testDir);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user