SEARCH-2: Update SolrAPIQueueClient to support fingerprint tests

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130920 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Joel Bernstein
2016-09-27 00:03:41 +00:00
parent 6941ba3c43
commit 8721fd2b2f
@@ -54,6 +54,8 @@ public class SOLRAPIQueueClient extends SOLRAPIClient
public static List<Transaction> transactionQueue = Collections.synchronizedList(new ArrayList());
public static Map<Long, List<Node>> nodeMap = Collections.synchronizedMap(new HashMap());
public static Map<Long, NodeMetaData> nodeMetaDataMap = Collections.synchronizedMap(new HashMap());
public static Map<Long, String> nodeContentMap = Collections.synchronizedMap(new HashMap());
private static boolean throwException;
public SOLRAPIQueueClient(NamespaceDAO namespaceDAO)
@@ -310,7 +312,13 @@ public class SOLRAPIQueueClient extends SOLRAPIClient
if(throwException) {
throw new ConnectException("THROWING EXCEPTION, better be ready!");
}
//Just put the nodeId innto the content so we query for this in tests.
if(nodeContentMap.containsKey(nodeId)) {
return new GetTextContentResponse(new DummyResponse(nodeContentMap.get(nodeId)));
}
return new GetTextContentResponse(new DummyResponse("Hello world "+nodeId));
}