Apache Lucene open-source search software
SOLR-5488: Changing Facets testing to use DOM rather than string operations
Erick Erickson38643894d1f8
diff --git a/solr/core/src/test/org/apache/solr/analytics/facet/AbstractAnalyticsFacetTest.java b/solr/core/src/test/org/apache/solr/analytics/facet/AbstractAnalyticsFacetTest.javaindex f8af2967772..dba19a8aaa9 100644--- a/solr/core/src/test/org/apache/solr/analytics/facet/AbstractAnalyticsFacetTest.java+++ b/solr/core/src/test/org/apache/solr/analytics/facet/AbstractAnalyticsFacetTest.java@@ -17,8 +17,10 @@package org.apache.solr.analytics.facet;+import java.io.ByteArrayInputStream;import java.io.File;import java.io.FileNotFoundException;+import java.io.IOException;import java.util.ArrayList;import java.util.Collection;import java.util.Collections;@@ -35,6 +37,18 @@ import org.apache.solr.request.SolrQueryRequest;import com.google.common.collect.ObjectArrays;import org.apache.solr.util.ExternalPaths;+import org.w3c.dom.Document;+import org.w3c.dom.Node;+import org.w3c.dom.NodeList;+import org.xml.sax.InputSource;+import org.xml.sax.SAXException;++import javax.xml.parsers.DocumentBuilder;+import javax.xml.parsers.DocumentBuilderFactory;+import javax.xml.parsers.ParserConfigurationException;+import javax.xml.xpath.XPathConstants;+import javax.xml.xpath.XPathExpressionException;+import javax.xml.xpath.XPathFactory;@SuppressCodecs({"Lucene3x","Lucene40","Lucene41","Lucene42","Appending","Asserting"})public class AbstractAnalyticsFacetTest extends SolrTestCaseJ4 {@@ -42,24 +56,84 @@ public class AbstractAnalyticsFacetTest extends SolrTestCaseJ4 {protected String latestType = "";- public String getFacetXML(String response, String requestName, String facetType, String facet) {- String cat = "\n <lst name=\""+requestName+"\">";- String begin = " <lst name=\""+facetType+"\">\n";- String end = "\n </lst>";- int beginInt = response.indexOf(begin, response.indexOf(cat))+begin.length();- int endInt = response.indexOf(end, beginInt);- String fieldStr = response.substring(beginInt, endInt);- begin = " <lst name=\""+facet+"\">";- end = "\n </lst>";- beginInt = fieldStr.indexOf(begin);- endInt = fieldStr.indexOf(end, beginInt);- String facetStr = "";- if (beginInt>=0) {- facetStr = fieldStr.substring(beginInt+begin.length(),endInt);+ private static Document doc;+ private static XPathFactory xPathFact = XPathFactory.newInstance();+ private static String rawResponse;++ protected static void setResponse(String response) throws ParserConfigurationException, IOException, SAXException {+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();+ factory.setNamespaceAware(true); // never forget this!+ DocumentBuilder builder = factory.newDocumentBuilder();+ doc = builder.parse(new InputSource(new ByteArrayInputStream(response.getBytes("UTF-8"))));+ xPathFact = XPathFactory.newInstance();+ rawResponse = response;+ }++ protected String getRawResponse() {+ return rawResponse;+ }++ protected Node getNode(String xPath) throws XPathExpressionException {+ return (Node)xPathFact.newXPath().compile(xPath).evaluate(doc, XPathConstants.NODE);+ }+ private NodeList getNodes(String n1, String n2, String n3, String element, String n4) throws XPathExpressionException {+ // Construct the XPath expression. The form better not change or all these will fail.+ StringBuilder sb = new StringBuilder("/response/lst[@name='stats']/lst[@name='").append(n1).append("']");+ sb.append("/lst[@name='").append(n2).append("']");+ sb.append("/lst[@name='").append(n3).append("']");+ sb.append("//").append(element).append("[@name='").append(n4).append("']");+ return (NodeList)xPathFact.newXPath().compile(sb.toString()).evaluate(doc, XPathConstants.NODESET);++ }+ protected ArrayList<String> getStringList(String n1, String n2, String n3, String element, String n4)+ throws XPathExpressionException {+ ArrayList<String> ret = new ArrayList<String>();+ NodeList nodes = getNodes(n1, n2, n3, element, n4);+ for (int idx = 0; idx < nodes.getLength(); ++idx) {+ ret.add(nodes.item(idx).getTextContent());}- return facetStr+" ";+ return ret;}-++ protected ArrayList<Integer> getIntegerList(String n1, String n2, String n3, String element, String n4)+ throws XPathExpressionException {+ ArrayList<Integer> ret = new ArrayList<Integer>();+ NodeList nodes = getNodes(n1, n2, n3, element, n4);+ for (int idx = 0; idx < nodes.getLength(); ++idx) {+ ret.add(Integer.parseInt(nodes.item(idx).getTextContent()));+ }+ return ret;+ }+ protected ArrayList<Long> getLongList(String n1, String n2, String n3, String element, String n4)+ throws XPathExpressionException {+ ArrayList<Long> ret = new ArrayList<Long>();+ NodeList nodes = getNodes(n1, n2, n3, element, n4);+ for (int idx = 0; idx < nodes.getLength(); ++idx) {+ ret.add(Long.parseLong(nodes.item(idx).getTextContent()));+ }+ return ret;+ }+ protected ArrayList<Float> getFloatList(String n1, String n2, String n3, String element, String n4)+ throws XPathExpressionException {+ ArrayList<Float> ret = new ArrayList<Float>();+ NodeList nodes = getNodes(n1, n2, n3, element, n4);+ for (int idx = 0; idx < nodes.getLength(); ++idx) {+ ret.add(Float.parseFloat(nodes.item(idx).getTextContent()));+ }+ return ret;+ }++ protected ArrayList<Double> getDoubleList(String n1, String n2, String n3, String element, String n4)+ throws XPathExpressionException {+ ArrayList<Double> ret = new ArrayList<Double>();+ NodeList nodes = getNodes(n1, n2, n3, element, n4);+ for (int idx = 0; idx < nodes.getLength(); ++idx) {+ ret.add(Double.parseDouble(nodes.item(idx).getTextContent()));+ }+ return ret;+ }++public static void increment(List<Long> list, int idx){Long i = list.remove(idx);list.add(idx, i+1);@@ -84,41 +158,6 @@ public class AbstractAnalyticsFacetTest extends SolrTestCaseJ4 {this.latestType = latestType;}- @SuppressWarnings({ "unchecked", "rawtypes" })- public ArrayList xmlToList(String facit, String type, String name) {- ArrayList list;- if (type.equals("double")) {- list = new ArrayList<Double>();- } else if (type.equals("int")) {- list = new ArrayList<Integer>();- } else if (type.equals("long")) {- list = new ArrayList<Long>();- } else if (type.equals("float")) {- list = new ArrayList<Float>();- } else {- list = new ArrayList<String>();- }- String find = "<"+type+" name=\""+name+"\">";- String endS = "</"+type+">";- int findAt = facit.indexOf(find)+find.length();- while (findAt>find.length()) {- int end = facit.indexOf(endS, findAt);- if (type.equals("double")) {- list.add(Double.parseDouble(facit.substring(findAt, end)));- } else if (type.equals("int")) {- list.add(Integer.parseInt(facit.substring(findAt, end)));- } else if (type.equals("long")) {- list.add(Long.parseLong(facit.substring(findAt, end)));- } else if (type.equals("float")) {- list.add(Float.parseFloat(facit.substring(findAt, end)));- } else {- list.add(facit.substring(findAt, end));- }- findAt = facit.indexOf(find, end)+find.length();- }- return list;- }-@SuppressWarnings({ "unchecked", "rawtypes" })public <T extends Number & Comparable<T>> ArrayList calculateNumberStat(ArrayList<ArrayList<T>> lists, String stat) {ArrayList result;diff --git a/solr/core/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasTest.java b/solr/core/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasTest.javaindex 3c915555515..7c9d740be75 100644--- a/solr/core/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasTest.java+++ b/solr/core/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasTest.java@@ -45,8 +45,6 @@ public class FieldFacetExtrasTest extends AbstractAnalyticsFacetTest {static ArrayList<ArrayList<Integer>> intDoubleTestStart;static ArrayList<ArrayList<Integer>> intStringTestStart;- static String response;-@BeforeClasspublic static void beforeClass() throws Exception {initCore("solrconfig-basic.xml","schema-analytics.xml");@@ -106,85 +104,72 @@ public class FieldFacetExtrasTest extends AbstractAnalyticsFacetTest {}assertU(commit());- response = h.query(request(fileToStringArr(fileName)));+ setResponse(h.query(request(fileToStringArr(fileName))));}@SuppressWarnings("unchecked")@Testpublic void limitTest() throws Exception {- String longLimit = getFacetXML(response, "lr", "fieldFacets", "long_ld");- Collection<Double> lon = (ArrayList<Double>)xmlToList(longLimit, "double", "mean");- assertEquals(lon.size(),5);- String floatLimit = getFacetXML(response, "lr", "fieldFacets", "float_fd");- Collection<Double> flo = (ArrayList<Double>)xmlToList(floatLimit, "double", "median");- assertEquals(flo.size(),3);- String doubleLimit = getFacetXML(response, "lr", "fieldFacets", "double_dd");- Collection<Long> doub = (ArrayList<Long>)xmlToList(doubleLimit, "long", "count");- assertEquals(doub.size(),7);- String stringLimit = getFacetXML(response, "lr", "fieldFacets", "string_sd");- Collection<Integer> string = (ArrayList<Integer>)xmlToList(stringLimit, "int", "percentile_20");- assertEquals(string.size(),1);+ Collection<Double> lon = getDoubleList("lr", "fieldFacets", "long_ld", "double", "mean");+ assertEquals(getRawResponse(), lon.size(),5);+ Collection<Double> flo = getDoubleList("lr", "fieldFacets", "float_fd", "double", "median");+ assertEquals(getRawResponse(), flo.size(),3);+ Collection<Long> doub = getLongList("lr", "fieldFacets", "double_dd", "long", "count");+ assertEquals(getRawResponse(), doub.size(),7);+ Collection<Integer> string = getIntegerList("lr", "fieldFacets", "string_sd", "int", "percentile_20");+ assertEquals(getRawResponse(), string.size(),1);}@SuppressWarnings("unchecked")@Testpublic void offsetTest() throws Exception {- String xml;Collection<Double> lon;List<Double> all = new ArrayList<Double>();- xml = getFacetXML(response, "off0", "fieldFacets", "long_ld");- lon = (ArrayList<Double>)xmlToList(xml, "double", "mean");- assertEquals(lon.size(),2);+ lon = getDoubleList("off0", "fieldFacets", "long_ld", "double", "mean");+ assertEquals(getRawResponse(), lon.size(),2);assertArrayEquals(new Double[]{ 1.5, 2.0 }, lon.toArray(new Double[0]));all.addAll(lon);- xml = getFacetXML(response, "off1", "fieldFacets", "long_ld");- lon = (ArrayList<Double>)xmlToList(xml, "double", "mean");- assertEquals(lon.size(),2);+ lon = getDoubleList("off1", "fieldFacets", "long_ld", "double", "mean");+ assertEquals(getRawResponse(), lon.size(),2);assertArrayEquals(new Double[]{ 3.0, 4.0 }, lon.toArray(new Double[0]));all.addAll(lon);- xml = getFacetXML(response, "off2", "fieldFacets", "long_ld");- lon = (ArrayList<Double>)xmlToList(xml, "double", "mean");- assertEquals(lon.size(),3);+ lon = getDoubleList("off2", "fieldFacets", "long_ld", "double", "mean");+ assertEquals(getRawResponse(), lon.size(),3);assertArrayEquals(new Double[]{ 5.0, 5.75, 6.0 }, lon.toArray(new Double[0]));all.addAll(lon);- xml = getFacetXML(response, "offAll", "fieldFacets", "long_ld");- lon = (ArrayList<Double>)xmlToList(xml, "double", "mean");- assertEquals(lon.size(),7);+ lon = getDoubleList("offAll", "fieldFacets", "long_ld", "double", "mean");+ assertEquals(getRawResponse(), lon.size(),7);assertArrayEquals(all.toArray(new Double[0]), lon.toArray(new Double[0]));}@SuppressWarnings("unchecked")@Testpublic void sortTest() throws Exception {- String longSort = getFacetXML(response, "sr", "fieldFacets", "long_ld");- Collection<Double> lon = (ArrayList<Double>)xmlToList(longSort, "double", "mean");+ Collection<Double> lon = getDoubleList("sr", "fieldFacets", "long_ld", "double", "mean");ArrayList<Double> longTest = calculateNumberStat(intLongTestStart, "mean");Collections.sort(longTest);- assertEquals(longTest,lon);+ assertEquals(getRawResponse(), longTest,lon);- String floatSort = getFacetXML(response, "sr", "fieldFacets", "float_fd");- Collection<Double> flo = (ArrayList<Double>)xmlToList(floatSort, "double", "median");+ Collection<Double> flo = getDoubleList("sr", "fieldFacets", "float_fd", "double", "median");ArrayList<Double> floatTest = calculateNumberStat(intFloatTestStart, "median");Collections.sort(floatTest,Collections.reverseOrder());- assertEquals(floatTest,flo);+ assertEquals(getRawResponse(), floatTest,flo);- String doubleSort = getFacetXML(response, "sr", "fieldFacets", "double_dd");- Collection<Long> doub = (ArrayList<Long>)xmlToList(doubleSort, "long", "count");+ Collection<Long> doub = getLongList("sr", "fieldFacets", "double_dd", "long", "count");ArrayList<Long> doubleTest = (ArrayList<Long>)calculateStat(intDoubleTestStart, "count");Collections.sort(doubleTest);- assertEquals(doubleTest,doub);+ assertEquals(getRawResponse(), doubleTest,doub);- String stringSort = getFacetXML(response, "sr", "fieldFacets", "string_sd");- Collection<Integer> string = (ArrayList<Integer>)xmlToList(stringSort, "int", "percentile_20");+ Collection<Integer> string = getIntegerList("sr", "fieldFacets", "string_sd", "int", "percentile_20");ArrayList<Integer> stringTest = (ArrayList<Integer>)calculateStat(intStringTestStart, "perc_20");Collections.sort(stringTest,Collections.reverseOrder());- assertEquals(stringTest,string);+ assertEquals(getRawResponse(), stringTest,string);}}diff --git a/solr/core/src/test/org/apache/solr/analytics/facet/FieldFacetTest.java b/solr/core/src/test/org/apache/solr/analytics/facet/FieldFacetTest.javaindex 895c43b6546..38a3c16e815 100644--- a/solr/core/src/test/org/apache/solr/analytics/facet/FieldFacetTest.java+++ b/solr/core/src/test/org/apache/solr/analytics/facet/FieldFacetTest.java@@ -85,8 +85,6 @@ public class FieldFacetTest extends AbstractAnalyticsFacetTest{private static ArrayList<ArrayList<Integer>> multiDateTestStart;private static ArrayList<Long> multiDateTestMissing;- static String response;-@BeforeClasspublic static void beforeClass() throws Exception {initCore("solrconfig-basic.xml","schema-analytics.xml");@@ -390,533 +388,445 @@ public class FieldFacetTest extends AbstractAnalyticsFacetTest{}assertU(commit());- response = h.query(request(fileToStringArr(fileName)));+ setResponse(h.query(request(fileToStringArr(fileName))));}@SuppressWarnings("unchecked")@Testpublic void sumTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "sum","fieldFacets", "date_dtd");- Collection<Double> intDate = (ArrayList<Double>)xmlToList(intDateFacet, "double", "int");+ Collection<Double> intDate = getDoubleList("sum","fieldFacets", "date_dtd", "double", "int");ArrayList<Double> intDateTest = calculateNumberStat(intDateTestStart, "sum");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "sum","fieldFacets", "string_sd");- Collection<Double> intString = (ArrayList<Double>)xmlToList(intStringFacet, "double", "int");+ Collection<Double> intString = getDoubleList("sum","fieldFacets", "string_sd", "double", "int");ArrayList<Double> intStringTest = calculateNumberStat(intStringTestStart, "sum");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "sum","fieldFacets", "date_dtd");- Collection<Double> longDate = (ArrayList<Double>)xmlToList(longDateFacet, "double", "long");+ Collection<Double> longDate = getDoubleList("sum","fieldFacets", "date_dtd", "double", "long");ArrayList<Double> longDateTest = calculateNumberStat(longDateTestStart, "sum");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "sum","fieldFacets", "string_sd");- Collection<Double> longString = (ArrayList<Double>)xmlToList(longStringFacet, "double", "long");+ Collection<Double> longString = getDoubleList("sum","fieldFacets", "string_sd", "double", "long");ArrayList<Double> longStringTest = calculateNumberStat(longStringTestStart, "sum");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "sum","fieldFacets", "date_dtd");- Collection<Double> floatDate = (ArrayList<Double>)xmlToList(floatDateFacet, "double", "float");+ Collection<Double> floatDate = getDoubleList("sum","fieldFacets", "date_dtd", "double", "float");ArrayList<Double> floatDateTest = calculateNumberStat(floatDateTestStart, "sum");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "sum","fieldFacets", "string_sd");- Collection<Double> floatString = (ArrayList<Double>)xmlToList(floatStringFacet, "double", "float");+ Collection<Double> floatString = getDoubleList("sum","fieldFacets", "string_sd", "double", "float");ArrayList<Double> floatStringTest = calculateNumberStat(floatStringTestStart, "sum");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "sum","fieldFacets", "date_dtd");- Collection<Double> doubleDate = (ArrayList<Double>)xmlToList(doubleDateFacet, "double", "double");+ Collection<Double> doubleDate = getDoubleList("sum","fieldFacets", "date_dtd", "double", "double");ArrayList<Double> doubleDateTest = calculateNumberStat(doubleDateTestStart, "sum");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "sum","fieldFacets", "string_sd");- Collection<Double> doubleString = (ArrayList<Double>)xmlToList(doubleStringFacet, "double", "double");+ Collection<Double> doubleString = getDoubleList("sum","fieldFacets", "string_sd", "double", "double");ArrayList<Double> doubleStringTest = calculateNumberStat(doubleStringTestStart, "sum");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);}@SuppressWarnings("unchecked")@Testpublic void meanTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "mean","fieldFacets", "date_dtd");- Collection<Double> intDate = (ArrayList<Double>)xmlToList(intDateFacet, "double", "int");+ Collection<Double> intDate = getDoubleList("mean","fieldFacets", "date_dtd", "double", "int");ArrayList<Double> intDateTest = calculateNumberStat(intDateTestStart, "mean");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "mean","fieldFacets", "string_sd");- Collection<Double> intString = (ArrayList<Double>)xmlToList(intStringFacet, "double", "int");+ Collection<Double> intString = getDoubleList("mean","fieldFacets", "string_sd", "double", "int");ArrayList<Double> intStringTest = calculateNumberStat(intStringTestStart, "mean");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "mean","fieldFacets", "date_dtd");- Collection<Double> longDate = (ArrayList<Double>)xmlToList(longDateFacet, "double", "long");+ Collection<Double> longDate = getDoubleList("mean","fieldFacets", "date_dtd", "double", "long");ArrayList<Double> longDateTest = calculateNumberStat(longDateTestStart, "mean");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "mean","fieldFacets", "string_sd");- Collection<Double> longString = (ArrayList<Double>)xmlToList(longStringFacet, "double", "long");+ Collection<Double> longString = getDoubleList("mean","fieldFacets", "string_sd", "double", "long");ArrayList<Double> longStringTest = calculateNumberStat(longStringTestStart, "mean");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "mean","fieldFacets", "date_dtd");- Collection<Double> floatDate = (ArrayList<Double>)xmlToList(floatDateFacet, "double", "float");+ Collection<Double> floatDate = getDoubleList("mean","fieldFacets", "date_dtd", "double", "float");ArrayList<Double> floatDateTest = calculateNumberStat(floatDateTestStart, "mean");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "mean","fieldFacets", "string_sd");- Collection<Double> floatString = (ArrayList<Double>)xmlToList(floatStringFacet, "double", "float");+ Collection<Double> floatString = getDoubleList("mean","fieldFacets", "string_sd", "double", "float");ArrayList<Double> floatStringTest = calculateNumberStat(floatStringTestStart, "mean");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "mean","fieldFacets", "date_dtd");- Collection<Double> doubleDate = (ArrayList<Double>)xmlToList(doubleDateFacet, "double", "double");+ Collection<Double> doubleDate = getDoubleList("mean","fieldFacets", "date_dtd", "double", "double");ArrayList<Double> doubleDateTest = calculateNumberStat(doubleDateTestStart, "mean");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "mean","fieldFacets", "string_sd");- Collection<Double> doubleString = (ArrayList<Double>)xmlToList(doubleStringFacet, "double", "double");+ Collection<Double> doubleString = getDoubleList("mean","fieldFacets", "string_sd", "double", "double");ArrayList<Double> doubleStringTest = calculateNumberStat(doubleStringTestStart, "mean");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);}@SuppressWarnings("unchecked")@Testpublic void sumOfSquaresFacetAscTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "sumOfSquares","fieldFacets", "date_dtd");- Collection<Double> intDate = (ArrayList<Double>)xmlToList(intDateFacet, "double", "int");+ Collection<Double> intDate = getDoubleList("sumOfSquares","fieldFacets", "date_dtd", "double", "int");ArrayList<Double> intDateTest = calculateNumberStat(intDateTestStart, "sumOfSquares");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "sumOfSquares","fieldFacets", "string_sd");- Collection<Double> intString = (ArrayList<Double>)xmlToList(intStringFacet, "double", "int");+ Collection<Double> intString = getDoubleList("sumOfSquares","fieldFacets", "string_sd", "double", "int");ArrayList<Double> intStringTest = calculateNumberStat(intStringTestStart, "sumOfSquares");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "sumOfSquares","fieldFacets", "date_dtd");- Collection<Double> longDate = (ArrayList<Double>)xmlToList(longDateFacet, "double", "long");+ Collection<Double> longDate = getDoubleList("sumOfSquares","fieldFacets", "date_dtd", "double", "long");ArrayList<Double> longDateTest = calculateNumberStat(longDateTestStart, "sumOfSquares");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "sumOfSquares","fieldFacets", "string_sd");- Collection<Double> longString = (ArrayList<Double>)xmlToList(longStringFacet, "double", "long");+ Collection<Double> longString = getDoubleList("sumOfSquares","fieldFacets", "string_sd", "double", "long");ArrayList<Double> longStringTest = calculateNumberStat(longStringTestStart, "sumOfSquares");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "sumOfSquares","fieldFacets", "date_dtd");- Collection<Double> floatDate = (ArrayList<Double>)xmlToList(floatDateFacet, "double", "float");+ Collection<Double> floatDate = getDoubleList("sumOfSquares","fieldFacets", "date_dtd", "double", "float");ArrayList<Double> floatDateTest = calculateNumberStat(floatDateTestStart, "sumOfSquares");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "sumOfSquares","fieldFacets", "string_sd");- Collection<Double> floatString = (ArrayList<Double>)xmlToList(floatStringFacet, "double", "float");+ Collection<Double> floatString = getDoubleList("sumOfSquares","fieldFacets", "string_sd", "double", "float");ArrayList<Double> floatStringTest = calculateNumberStat(floatStringTestStart, "sumOfSquares");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "sumOfSquares","fieldFacets", "date_dtd");- Collection<Double> doubleDate = (ArrayList<Double>)xmlToList(doubleDateFacet, "double", "double");+ Collection<Double> doubleDate = getDoubleList("sumOfSquares","fieldFacets", "date_dtd", "double", "double");ArrayList<Double> doubleDateTest = calculateNumberStat(doubleDateTestStart, "sumOfSquares");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "sumOfSquares","fieldFacets", "string_sd");- Collection<Double> doubleString = (ArrayList<Double>)xmlToList(doubleStringFacet, "double", "double");+ Collection<Double> doubleString = getDoubleList("sumOfSquares","fieldFacets", "string_sd", "double", "double");ArrayList<Double> doubleStringTest = calculateNumberStat(doubleStringTestStart, "sumOfSquares");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);}@SuppressWarnings("unchecked")@Testpublic void stddevFacetAscTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "stddev","fieldFacets", "date_dtd");- ArrayList<Double> intDate = (ArrayList<Double>)xmlToList(intDateFacet, "double", "int");+ ArrayList<Double> intDate = getDoubleList("stddev","fieldFacets", "date_dtd", "double", "int");ArrayList<Double> intDateTest = calculateNumberStat(intDateTestStart, "stddev");- assertTrue(checkStddevs(intDate,intDateTest));+ checkStddevs(intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "stddev","fieldFacets", "string_sd");- ArrayList<Double> intString = (ArrayList<Double>)xmlToList(intStringFacet, "double", "int");+ ArrayList<Double> intString = getDoubleList("stddev","fieldFacets", "string_sd", "double", "int");ArrayList<Double> intStringTest = calculateNumberStat(intStringTestStart, "stddev");- assertTrue(checkStddevs(intString,intStringTest));+ checkStddevs(intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "stddev","fieldFacets", "date_dtd");- ArrayList<Double> longDate = (ArrayList<Double>)xmlToList(longDateFacet, "double", "long");+ ArrayList<Double> longDate = getDoubleList("stddev","fieldFacets", "date_dtd", "double", "long");ArrayList<Double> longDateTest = calculateNumberStat(longDateTestStart, "stddev");- assertTrue(checkStddevs(longDate,longDateTest));+ checkStddevs(longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "stddev","fieldFacets", "string_sd");- ArrayList<Double> longString = (ArrayList<Double>)xmlToList(longStringFacet, "double", "long");+ ArrayList<Double> longString = getDoubleList("stddev","fieldFacets", "string_sd", "double", "long");ArrayList<Double> longStringTest = calculateNumberStat(longStringTestStart, "stddev");- assertTrue(checkStddevs(longString,longStringTest));+ checkStddevs(longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "stddev","fieldFacets", "date_dtd");- ArrayList<Double> floatDate = (ArrayList<Double>)xmlToList(floatDateFacet, "double", "float");+ ArrayList<Double> floatDate = getDoubleList("stddev","fieldFacets", "date_dtd", "double", "float");ArrayList<Double> floatDateTest = calculateNumberStat(floatDateTestStart, "stddev");- assertTrue(checkStddevs(floatDate,floatDateTest));+ checkStddevs(floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "stddev","fieldFacets", "string_sd");- ArrayList<Double> floatString = (ArrayList<Double>)xmlToList(floatStringFacet, "double", "float");+ ArrayList<Double> floatString = getDoubleList("stddev","fieldFacets", "string_sd", "double", "float");ArrayList<Double> floatStringTest = calculateNumberStat(floatStringTestStart, "stddev");- assertTrue(checkStddevs(floatString,floatStringTest));+ checkStddevs(floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "stddev","fieldFacets", "date_dtd");- ArrayList<Double> doubleDate = (ArrayList<Double>)xmlToList(doubleDateFacet, "double", "double");+ ArrayList<Double> doubleDate = getDoubleList("stddev","fieldFacets", "date_dtd", "double", "double");ArrayList<Double> doubleDateTest = calculateNumberStat(doubleDateTestStart, "stddev");- assertTrue(checkStddevs(doubleDate,doubleDateTest));+ checkStddevs(doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "stddev","fieldFacets", "string_sd");- ArrayList<Double> doubleString = (ArrayList<Double>)xmlToList(doubleStringFacet, "double", "double");+ ArrayList<Double> doubleString = getDoubleList("stddev","fieldFacets", "string_sd", "double", "double");ArrayList<Double> doubleStringTest = calculateNumberStat(doubleStringTestStart, "stddev");- assertTrue(checkStddevs(doubleString,doubleStringTest));+ checkStddevs(doubleString,doubleStringTest);}@SuppressWarnings("unchecked")@Testpublic void medianFacetAscTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "median","fieldFacets", "date_dtd");- Collection<Double> intDate = (ArrayList<Double>)xmlToList(intDateFacet, "double", "int");+ Collection<Double> intDate = getDoubleList( "median","fieldFacets", "date_dtd", "double", "int");ArrayList<Double> intDateTest = calculateNumberStat(intDateTestStart, "median");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "median","fieldFacets", "string_sd");- Collection<Double> intString = (ArrayList<Double>)xmlToList(intStringFacet, "double", "int");+ Collection<Double> intString = getDoubleList("median","fieldFacets", "string_sd", "double", "int");ArrayList<Double> intStringTest = calculateNumberStat(intStringTestStart, "median");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "median","fieldFacets", "date_dtd");- Collection<Double> longDate = (ArrayList<Double>)xmlToList(longDateFacet, "double", "long");+ Collection<Double> longDate = getDoubleList("median","fieldFacets", "date_dtd", "double", "long");ArrayList<Double> longDateTest = calculateNumberStat(longDateTestStart, "median");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "median","fieldFacets", "string_sd");- Collection<Double> longString = (ArrayList<Double>)xmlToList(longStringFacet, "double", "long");+ Collection<Double> longString = getDoubleList("median","fieldFacets", "string_sd", "double", "long");ArrayList<Double> longStringTest = calculateNumberStat(longStringTestStart, "median");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "median","fieldFacets", "date_dtd");- Collection<Double> floatDate = (ArrayList<Double>)xmlToList(floatDateFacet, "double", "float");+ Collection<Double> floatDate = getDoubleList("median","fieldFacets", "date_dtd", "double", "float");ArrayList<Double> floatDateTest = calculateNumberStat(floatDateTestStart, "median");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "median","fieldFacets", "string_sd");- Collection<Double> floatString = (ArrayList<Double>)xmlToList(floatStringFacet, "double", "float");+ Collection<Double> floatString = getDoubleList("median","fieldFacets", "string_sd", "double", "float");ArrayList<Double> floatStringTest = calculateNumberStat(floatStringTestStart, "median");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "median","fieldFacets", "date_dtd");- Collection<Double> doubleDate = (ArrayList<Double>)xmlToList(doubleDateFacet, "double", "double");+ Collection<Double> doubleDate = getDoubleList("median","fieldFacets", "date_dtd", "double", "double");ArrayList<Double> doubleDateTest = calculateNumberStat(doubleDateTestStart, "median");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "median","fieldFacets", "string_sd");- Collection<Double> doubleString = (ArrayList<Double>)xmlToList(doubleStringFacet, "double", "double");+ Collection<Double> doubleString = getDoubleList("median","fieldFacets", "string_sd", "double", "double");ArrayList<Double> doubleStringTest = calculateNumberStat(doubleStringTestStart, "median");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);}@SuppressWarnings("unchecked")@Testpublic void perc20Test() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "percentile_20n","fieldFacets", "date_dtd");- Collection<Integer> intDate = (ArrayList<Integer>)xmlToList(intDateFacet, "int", "int");+ Collection<Integer> intDate = getIntegerList("percentile_20n","fieldFacets", "date_dtd", "int", "int");ArrayList<Integer> intDateTest = (ArrayList<Integer>)calculateStat(intDateTestStart, "perc_20");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "percentile_20n","fieldFacets", "string_sd");- Collection<Integer> intString = (ArrayList<Integer>)xmlToList(intStringFacet, "int", "int");+ Collection<Integer> intString = getIntegerList("percentile_20n","fieldFacets", "string_sd", "int", "int");ArrayList<Integer> intStringTest = (ArrayList<Integer>)calculateStat(intStringTestStart, "perc_20");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "percentile_20n","fieldFacets", "date_dtd");- Collection<Long> longDate = (ArrayList<Long>)xmlToList(longDateFacet, "long", "long");+ Collection<Long> longDate = getLongList("percentile_20n","fieldFacets", "date_dtd", "long", "long");ArrayList<Long> longDateTest = (ArrayList<Long>)calculateStat(longDateTestStart, "perc_20");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "percentile_20n","fieldFacets", "string_sd");- Collection<Long> longString = (ArrayList<Long>)xmlToList(longStringFacet, "long", "long");+ Collection<Long> longString = getLongList("percentile_20n","fieldFacets", "string_sd", "long", "long");ArrayList<Long> longStringTest = (ArrayList<Long>)calculateStat(longStringTestStart, "perc_20");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "percentile_20n","fieldFacets", "date_dtd");- Collection<Float> floatDate = (ArrayList<Float>)xmlToList(floatDateFacet, "float", "float");+ Collection<Float> floatDate = getFloatList("percentile_20n","fieldFacets", "date_dtd", "float", "float");ArrayList<Float> floatDateTest = (ArrayList<Float>)calculateStat(floatDateTestStart, "perc_20");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "percentile_20n","fieldFacets", "string_sd");- Collection<Float> floatString = (ArrayList<Float>)xmlToList(floatStringFacet, "float", "float");+ Collection<Float> floatString = getFloatList("percentile_20n","fieldFacets", "string_sd", "float", "float");ArrayList<Float> floatStringTest = (ArrayList<Float>)calculateStat(floatStringTestStart, "perc_20");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "percentile_20n","fieldFacets", "date_dtd");- Collection<Double> doubleDate = (ArrayList<Double>)xmlToList(doubleDateFacet, "double", "double");+ Collection<Double> doubleDate = getDoubleList("percentile_20n","fieldFacets", "date_dtd", "double", "double");ArrayList<Double> doubleDateTest = (ArrayList<Double>)calculateStat(doubleDateTestStart, "perc_20");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "percentile_20n","fieldFacets", "string_sd");- Collection<Double> doubleString = (ArrayList<Double>)xmlToList(doubleStringFacet, "double", "double");+ Collection<Double> doubleString = getDoubleList("percentile_20n","fieldFacets", "string_sd", "double", "double");ArrayList<Double> doubleStringTest = (ArrayList<Double>)calculateStat(doubleStringTestStart, "perc_20");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);//Date Int- String dateIntFacet = getFacetXML(response, "percentile_20","fieldFacets", "int_id");- Collection<String> dateInt = (ArrayList<String>)xmlToList(dateIntFacet, "date", "date");+ Collection<String> dateInt = getStringList("percentile_20","fieldFacets", "int_id", "date", "date");ArrayList<String> dateIntTest = (ArrayList<String>)calculateStat(dateIntTestStart, "perc_20");- assertEquals(dateInt,dateIntTest);+ assertEquals(getRawResponse(),dateInt,dateIntTest);//Date Long- String dateStringFacet = getFacetXML(response, "percentile_20","fieldFacets", "long_ld");- Collection<String> dateString = (ArrayList<String>)xmlToList(dateStringFacet, "date", "date");+ Collection<String> dateString = getStringList("percentile_20","fieldFacets", "long_ld", "date", "date");ArrayList<String> dateLongTest = (ArrayList<String>)calculateStat(dateLongTestStart, "perc_20");- assertEquals(dateString,dateLongTest);+ assertEquals(getRawResponse(),dateString,dateLongTest);//String Int- String stringIntFacet = getFacetXML(response, "percentile_20","fieldFacets", "int_id");- Collection<String> stringInt = (ArrayList<String>)xmlToList(stringIntFacet, "str", "str");+ Collection<String> stringInt = getStringList("percentile_20","fieldFacets", "int_id", "str", "str");ArrayList<String> stringIntTest = (ArrayList<String>)calculateStat(stringIntTestStart, "perc_20");- assertEquals(stringInt,stringIntTest);+ assertEquals(getRawResponse(),stringInt,stringIntTest);//String Long- String stringLongFacet = getFacetXML(response, "percentile_20","fieldFacets", "long_ld");- Collection<String> stringLong = (ArrayList<String>)xmlToList(stringLongFacet, "str", "str");+ Collection<String> stringLong = getStringList("percentile_20","fieldFacets", "long_ld", "str", "str");ArrayList<String> stringLongTest = (ArrayList<String>)calculateStat(stringLongTestStart, "perc_20");- assertEquals(stringLong,stringLongTest);+ assertEquals(getRawResponse(),stringLong,stringLongTest);}@SuppressWarnings("unchecked")@Testpublic void perc60Test() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "percentile_60n","fieldFacets", "date_dtd");- Collection<Integer> intDate = (ArrayList<Integer>)xmlToList(intDateFacet, "int", "int");+ Collection<Integer> intDate = getIntegerList("percentile_60n","fieldFacets", "date_dtd", "int", "int");ArrayList<Integer> intDateTest = (ArrayList<Integer>)calculateStat(intDateTestStart, "perc_60");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "percentile_60n","fieldFacets", "string_sd");- Collection<Integer> intString = (ArrayList<Integer>)xmlToList(intStringFacet, "int", "int");+ Collection<Integer> intString = getIntegerList("percentile_60n","fieldFacets", "string_sd", "int", "int");ArrayList<Integer> intStringTest = (ArrayList<Integer>)calculateStat(intStringTestStart, "perc_60");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "percentile_60n","fieldFacets", "date_dtd");- Collection<Long> longDate = (ArrayList<Long>)xmlToList(longDateFacet, "long", "long");+ Collection<Long> longDate = getLongList("percentile_60n","fieldFacets", "date_dtd", "long", "long");ArrayList<Long> longDateTest = (ArrayList<Long>)calculateStat(longDateTestStart, "perc_60");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "percentile_60n","fieldFacets", "string_sd");- Collection<Long> longString = (ArrayList<Long>)xmlToList(longStringFacet, "long", "long");+ Collection<Long> longString = getLongList("percentile_60n","fieldFacets", "string_sd", "long", "long");ArrayList<Long> longStringTest = (ArrayList<Long>)calculateStat(longStringTestStart, "perc_60");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "percentile_60n","fieldFacets", "date_dtd");- Collection<Float> floatDate = (ArrayList<Float>)xmlToList(floatDateFacet, "float", "float");+ Collection<Float> floatDate = getFloatList("percentile_60n","fieldFacets", "date_dtd", "float", "float");ArrayList<Float> floatDateTest = (ArrayList<Float>)calculateStat(floatDateTestStart, "perc_60");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "percentile_60n","fieldFacets", "string_sd");- Collection<Float> floatString = (ArrayList<Float>)xmlToList(floatStringFacet, "float", "float");+ Collection<Float> floatString = getFloatList("percentile_60n","fieldFacets", "string_sd", "float", "float");ArrayList<Float> floatStringTest = (ArrayList<Float>)calculateStat(floatStringTestStart, "perc_60");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "percentile_60n","fieldFacets", "date_dtd");- Collection<Double> doubleDate = (ArrayList<Double>)xmlToList(doubleDateFacet, "double", "double");+ Collection<Double> doubleDate = getDoubleList("percentile_60n","fieldFacets", "date_dtd", "double", "double");ArrayList<Double> doubleDateTest = (ArrayList<Double>)calculateStat(doubleDateTestStart, "perc_60");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "percentile_60n","fieldFacets", "string_sd");- Collection<Double> doubleString = (ArrayList<Double>)xmlToList(doubleStringFacet, "double", "double");+ Collection<Double> doubleString = getDoubleList("percentile_60n","fieldFacets", "string_sd", "double", "double");ArrayList<Double> doubleStringTest = (ArrayList<Double>)calculateStat(doubleStringTestStart, "perc_60");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);//Date Int- String dateIntFacet = getFacetXML(response, "percentile_60","fieldFacets", "int_id");- Collection<String> dateInt = (ArrayList<String>)xmlToList(dateIntFacet, "date", "date");+ Collection<String> dateInt = getStringList("percentile_60","fieldFacets", "int_id", "date", "date");ArrayList<String> dateIntTest = (ArrayList<String>)calculateStat(dateIntTestStart, "perc_60");- assertEquals(dateInt,dateIntTest);+ assertEquals(getRawResponse(),dateInt,dateIntTest);//Date Long- String dateStringFacet = getFacetXML(response, "percentile_60","fieldFacets", "long_ld");- Collection<String> dateString = (ArrayList<String>)xmlToList(dateStringFacet, "date", "date");+ Collection<String> dateString = getStringList("percentile_60","fieldFacets", "long_ld", "date", "date");ArrayList<String> dateLongTest = (ArrayList<String>)calculateStat(dateLongTestStart, "perc_60");- assertEquals(dateString,dateLongTest);+ assertEquals(getRawResponse(),dateString,dateLongTest);//String Int- String stringIntFacet = getFacetXML(response, "percentile_60","fieldFacets", "int_id");- Collection<String> stringInt = (ArrayList<String>)xmlToList(stringIntFacet, "str", "str");+ Collection<String> stringInt = getStringList("percentile_60","fieldFacets", "int_id", "str", "str");ArrayList<String> stringIntTest = (ArrayList<String>)calculateStat(stringIntTestStart, "perc_60");- assertEquals(stringInt,stringIntTest);+ assertEquals(getRawResponse(),stringInt,stringIntTest);//String Long- String stringLongFacet = getFacetXML(response, "percentile_60","fieldFacets", "long_ld");- Collection<String> stringLong = (ArrayList<String>)xmlToList(stringLongFacet, "str", "str");+ Collection<String> stringLong = getStringList("percentile_60","fieldFacets", "long_ld", "str", "str");ArrayList<String> stringLongTest = (ArrayList<String>)calculateStat(stringLongTestStart, "perc_60");- assertEquals(stringLong,stringLongTest);+ assertEquals(getRawResponse(),stringLong,stringLongTest);}@SuppressWarnings("unchecked")@Testpublic void minTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "minn","fieldFacets", "date_dtd");- Collection<Integer> intDate = (ArrayList<Integer>)xmlToList(intDateFacet, "int", "int");+ Collection<Integer> intDate = getIntegerList("minn","fieldFacets", "date_dtd", "int", "int");ArrayList<Integer> intDateTest = (ArrayList<Integer>)calculateStat(intDateTestStart, "min");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "minn","fieldFacets", "string_sd");- Collection<Integer> intString = (ArrayList<Integer>)xmlToList(intStringFacet, "int", "int");+ Collection<Integer> intString = getIntegerList("minn","fieldFacets", "string_sd", "int", "int");ArrayList<Integer> intStringTest = (ArrayList<Integer>)calculateStat(intStringTestStart, "min");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "minn","fieldFacets", "date_dtd");- Collection<Long> longDate = (ArrayList<Long>)xmlToList(longDateFacet, "long", "long");+ Collection<Long> longDate = getLongList("minn","fieldFacets", "date_dtd", "long", "long");ArrayList<Long> longDateTest = (ArrayList<Long>)calculateStat(longDateTestStart, "min");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "minn","fieldFacets", "string_sd");- Collection<Long> longString = (ArrayList<Long>)xmlToList(longStringFacet, "long", "long");+ Collection<Long> longString = getLongList("minn","fieldFacets", "string_sd", "long", "long");ArrayList<Long> longStringTest = (ArrayList<Long>)calculateStat(longStringTestStart, "min");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "minn","fieldFacets", "date_dtd");- Collection<Float> floatDate = (ArrayList<Float>)xmlToList(floatDateFacet, "float", "float");+ Collection<Float> floatDate = getFloatList("minn","fieldFacets", "date_dtd", "float", "float");ArrayList<Float> floatDateTest = (ArrayList<Float>)calculateStat(floatDateTestStart, "min");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "minn","fieldFacets", "string_sd");- Collection<Float> floatString = (ArrayList<Float>)xmlToList(floatStringFacet, "float", "float");+ Collection<Float> floatString = getFloatList("minn","fieldFacets", "string_sd", "float", "float");ArrayList<Float> floatStringTest = (ArrayList<Float>)calculateStat(floatStringTestStart, "min");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "minn","fieldFacets", "date_dtd");- Collection<Double> doubleDate = (ArrayList<Double>)xmlToList(doubleDateFacet, "double", "double");+ Collection<Double> doubleDate = getDoubleList("minn","fieldFacets", "date_dtd", "double", "double");ArrayList<Double> doubleDateTest = (ArrayList<Double>)calculateStat(doubleDateTestStart, "min");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "minn","fieldFacets", "string_sd");- Collection<Double> doubleString = (ArrayList<Double>)xmlToList(doubleStringFacet, "double", "double");+ Collection<Double> doubleString = getDoubleList("minn","fieldFacets", "string_sd", "double", "double");ArrayList<Double> doubleStringTest = (ArrayList<Double>)calculateStat(doubleStringTestStart, "min");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);//Date Int- String dateIntFacet = getFacetXML(response, "min","fieldFacets", "int_id");- Collection<String> dateInt = (ArrayList<String>)xmlToList(dateIntFacet, "date", "date");+ Collection<String> dateInt = getStringList("min","fieldFacets", "int_id", "date", "date");ArrayList<String> dateIntTest = (ArrayList<String>)calculateStat(dateIntTestStart, "min");- assertEquals(dateInt,dateIntTest);+ assertEquals(getRawResponse(),dateInt,dateIntTest);//Date Long- String dateStringFacet = getFacetXML(response, "min","fieldFacets", "long_ld");- Collection<String> dateString = (ArrayList<String>)xmlToList(dateStringFacet, "date", "date");+ Collection<String> dateString = getStringList("min","fieldFacets", "long_ld", "date", "date");ArrayList<String> dateLongTest = (ArrayList<String>)calculateStat(dateLongTestStart, "min");- assertEquals(dateString,dateLongTest);+ assertEquals(getRawResponse(),dateString,dateLongTest);//String Int- String stringIntFacet = getFacetXML(response, "min","fieldFacets", "int_id");- Collection<String> stringInt = (ArrayList<String>)xmlToList(stringIntFacet, "str", "str");+ Collection<String> stringInt = getStringList("min","fieldFacets", "int_id", "str", "str");ArrayList<String> stringIntTest = (ArrayList<String>)calculateStat(stringIntTestStart, "min");- assertEquals(stringInt,stringIntTest);+ assertEquals(getRawResponse(),stringInt,stringIntTest);//String Long- String stringLongFacet = getFacetXML(response, "min","fieldFacets", "long_ld");- Collection<String> stringLong = (ArrayList<String>)xmlToList(stringLongFacet, "str", "str");+ Collection<String> stringLong = getStringList("min","fieldFacets", "long_ld", "str", "str");ArrayList<String> stringLongTest = (ArrayList<String>)calculateStat(stringLongTestStart, "min");- assertEquals(stringLong,stringLongTest);+ assertEquals(getRawResponse(),stringLong,stringLongTest);}@SuppressWarnings("unchecked")@Testpublic void maxTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "maxn","fieldFacets", "date_dtd");- Collection<Integer> intDate = (ArrayList<Integer>)xmlToList(intDateFacet, "int", "int");+ Collection<Integer> intDate = getIntegerList("maxn","fieldFacets", "date_dtd", "int", "int");ArrayList<Integer> intDateTest = (ArrayList<Integer>)calculateStat(intDateTestStart, "max");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "maxn","fieldFacets", "string_sd");- Collection<Integer> intString = (ArrayList<Integer>)xmlToList(intStringFacet, "int", "int");+ Collection<Integer> intString = getIntegerList("maxn","fieldFacets", "string_sd", "int", "int");ArrayList<Integer> intStringTest = (ArrayList<Integer>)calculateStat(intStringTestStart, "max");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "maxn","fieldFacets", "date_dtd");- Collection<Long> longDate = (ArrayList<Long>)xmlToList(longDateFacet, "long", "long");+ Collection<Long> longDate = getLongList("maxn","fieldFacets", "date_dtd", "long", "long");ArrayList<Long> longDateTest = (ArrayList<Long>)calculateStat(longDateTestStart, "max");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "maxn","fieldFacets", "string_sd");- Collection<Long> longString = (ArrayList<Long>)xmlToList(longStringFacet, "long", "long");+ Collection<Long> longString = getLongList("maxn","fieldFacets", "string_sd", "long", "long");ArrayList<Long> longStringTest = (ArrayList<Long>)calculateStat(longStringTestStart, "max");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "maxn","fieldFacets", "date_dtd");- Collection<Float> floatDate = (ArrayList<Float>)xmlToList(floatDateFacet, "float", "float");+ Collection<Float> floatDate = getFloatList("maxn","fieldFacets", "date_dtd", "float", "float");ArrayList<Float> floatDateTest = (ArrayList<Float>)calculateStat(floatDateTestStart, "max");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "maxn","fieldFacets", "string_sd");- Collection<Float> floatString = (ArrayList<Float>)xmlToList(floatStringFacet, "float", "float");+ Collection<Float> floatString = getFloatList("maxn","fieldFacets", "string_sd", "float", "float");ArrayList<Float> floatStringTest = (ArrayList<Float>)calculateStat(floatStringTestStart, "max");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "maxn","fieldFacets", "date_dtd");- Collection<Double> doubleDate = (ArrayList<Double>)xmlToList(doubleDateFacet, "double", "double");+ Collection<Double> doubleDate = getDoubleList("maxn","fieldFacets", "date_dtd", "double", "double");ArrayList<Double> doubleDateTest = (ArrayList<Double>)calculateStat(doubleDateTestStart, "max");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "maxn","fieldFacets", "string_sd");- Collection<Double> doubleString = (ArrayList<Double>)xmlToList(doubleStringFacet, "double", "double");+ Collection<Double> doubleString = getDoubleList("maxn","fieldFacets", "string_sd", "double", "double");ArrayList<Double> doubleStringTest = (ArrayList<Double>)calculateStat(doubleStringTestStart, "max");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);//String Int- String stringIntFacet = getFacetXML(response, "max","fieldFacets", "int_id");- Collection<String> stringInt = (ArrayList<String>)xmlToList(stringIntFacet, "str", "str");+ Collection<String> stringInt = getStringList("max","fieldFacets", "int_id", "str", "str");ArrayList<String> stringIntTest = (ArrayList<String>)calculateStat(stringIntTestStart, "max");- assertEquals(stringInt,stringIntTest);+ assertEquals(getRawResponse(),stringInt,stringIntTest);//String Long- String stringLongFacet = getFacetXML(response, "max","fieldFacets", "long_ld");- Collection<String> stringLong = (ArrayList<String>)xmlToList(stringLongFacet, "str", "str");+ Collection<String> stringLong = getStringList("max","fieldFacets", "long_ld", "str", "str");ArrayList<String> stringLongTest = (ArrayList<String>)calculateStat(stringLongTestStart, "max");- assertEquals(stringLong,stringLongTest);+ assertEquals(getRawResponse(),stringLong,stringLongTest);//Date Int- String dateIntFacet = getFacetXML(response, "max","fieldFacets", "int_id");- Collection<String> dateInt = (ArrayList<String>)xmlToList(dateIntFacet, "date", "date");+ Collection<String> dateInt = getStringList("max","fieldFacets", "int_id", "date", "date");ArrayList<String> dateIntTest = (ArrayList<String>)calculateStat(dateIntTestStart, "max");- assertEquals(dateInt,dateIntTest);+ assertEquals(getRawResponse(),dateInt,dateIntTest);//Date Long- String dateStringFacet = getFacetXML(response, "max","fieldFacets", "long_ld");- Collection<String> dateString = (ArrayList<String>)xmlToList(dateStringFacet, "date", "date");+ Collection<String> dateString = getStringList("max","fieldFacets", "long_ld", "date", "date");ArrayList<String> dateLongTest = (ArrayList<String>)calculateStat(dateLongTestStart, "max");- assertEquals(dateString,dateLongTest);+ assertEquals(getRawResponse(),dateString,dateLongTest);}@@ -924,274 +834,237 @@ public class FieldFacetTest extends AbstractAnalyticsFacetTest{@Testpublic void uniqueTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "uniquen", "fieldFacets", "date_dtd");- Collection<Long> intDate = (ArrayList<Long>)xmlToList(intDateFacet, "long", "int");+ Collection<Long> intDate = getLongList("uniquen", "fieldFacets", "date_dtd", "long", "int");ArrayList<Long> intDateTest = (ArrayList<Long>)calculateStat(intDateTestStart, "unique");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "uniquen", "fieldFacets", "string_sd");- Collection<Long> intString = (ArrayList<Long>)xmlToList(intStringFacet, "long", "int");+ Collection<Long> intString = getLongList("uniquen", "fieldFacets", "string_sd", "long", "int");ArrayList<Long> intStringTest = (ArrayList<Long>)calculateStat(intStringTestStart, "unique");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "uniquen", "fieldFacets", "date_dtd");- Collection<Long> longDate = (ArrayList<Long>)xmlToList(longDateFacet, "long", "long");+ Collection<Long> longDate = getLongList("uniquen", "fieldFacets", "date_dtd", "long", "long");ArrayList<Long> longDateTest = (ArrayList<Long>)calculateStat(longDateTestStart, "unique");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "uniquen", "fieldFacets", "string_sd");- Collection<Long> longString = (ArrayList<Long>)xmlToList(longStringFacet, "long", "long");+ Collection<Long> longString = getLongList("uniquen", "fieldFacets", "string_sd", "long", "long");ArrayList<Long> longStringTest = (ArrayList<Long>)calculateStat(longStringTestStart, "unique");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "uniquen", "fieldFacets", "date_dtd");- Collection<Long> floatDate = (ArrayList<Long>)xmlToList(floatDateFacet, "long", "float");+ Collection<Long> floatDate = getLongList("uniquen", "fieldFacets", "date_dtd", "long", "float");ArrayList<Long> floatDateTest = (ArrayList<Long>)calculateStat(floatDateTestStart, "unique");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "uniquen", "fieldFacets", "string_sd");- Collection<Long> floatString = (ArrayList<Long>)xmlToList(floatStringFacet, "long", "float");+ Collection<Long> floatString = getLongList("uniquen", "fieldFacets", "string_sd", "long", "float");ArrayList<Long> floatStringTest = (ArrayList<Long>)calculateStat(floatStringTestStart, "unique");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "uniquen", "fieldFacets", "date_dtd");- Collection<Long> doubleDate = (ArrayList<Long>)xmlToList(doubleDateFacet, "long", "double");+ Collection<Long> doubleDate = getLongList("uniquen", "fieldFacets", "date_dtd", "long", "double");ArrayList<Long> doubleDateTest = (ArrayList<Long>)calculateStat(doubleDateTestStart, "unique");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "uniquen", "fieldFacets", "string_sd");- Collection<Long> doubleString = (ArrayList<Long>)xmlToList(doubleStringFacet, "long", "double");+ Collection<Long> doubleString = getLongList("uniquen", "fieldFacets", "string_sd", "long", "double");ArrayList<Long> doubleStringTest = (ArrayList<Long>)calculateStat(doubleStringTestStart, "unique");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);//Date Int- String dateIntFacet = getFacetXML(response, "unique", "fieldFacets", "int_id");- Collection<Long> dateInt = (ArrayList<Long>)xmlToList(dateIntFacet, "long", "date");+ Collection<Long> dateInt = getLongList("unique", "fieldFacets", "int_id", "long", "date");ArrayList<Long> dateIntTest = (ArrayList<Long>)calculateStat(dateIntTestStart, "unique");- assertEquals(dateInt,dateIntTest);+ assertEquals(getRawResponse(),dateInt,dateIntTest);//Date Long- String dateStringFacet = getFacetXML(response, "unique", "fieldFacets", "long_ld");- Collection<Long> dateString = (ArrayList<Long>)xmlToList(dateStringFacet, "long", "date");+ Collection<Long> dateString = getLongList("unique", "fieldFacets", "long_ld", "long", "date");ArrayList<Long> dateLongTest = (ArrayList<Long>)calculateStat(dateLongTestStart, "unique");- assertEquals(dateString,dateLongTest);+ assertEquals(getRawResponse(),dateString,dateLongTest);//String Int- String stringIntFacet = getFacetXML(response, "unique", "fieldFacets", "int_id");- Collection<Long> stringInt = (ArrayList<Long>)xmlToList(stringIntFacet, "long", "str");+ Collection<Long> stringInt = getLongList("unique", "fieldFacets", "int_id", "long", "str");ArrayList<Long> stringIntTest = (ArrayList<Long>)calculateStat(stringIntTestStart, "unique");- assertEquals(stringInt,stringIntTest);+ assertEquals(getRawResponse(),stringInt,stringIntTest);//String Long- String stringLongFacet = getFacetXML(response, "unique", "fieldFacets", "long_ld");- Collection<Long> stringLong = (ArrayList<Long>)xmlToList(stringLongFacet, "long", "str");+ Collection<Long> stringLong = getLongList("unique", "fieldFacets", "long_ld", "long", "str");ArrayList<Long> stringLongTest = (ArrayList<Long>)calculateStat(stringLongTestStart, "unique");- assertEquals(stringLong,stringLongTest);+ assertEquals(getRawResponse(),stringLong,stringLongTest);}@SuppressWarnings("unchecked")@Testpublic void countTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "countn", "fieldFacets", "date_dtd");- Collection<Long> intDate = (ArrayList<Long>)xmlToList(intDateFacet, "long", "int");+ Collection<Long> intDate = getLongList("countn", "fieldFacets", "date_dtd", "long", "int");ArrayList<Long> intDateTest = (ArrayList<Long>)calculateStat(intDateTestStart, "count");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);//Int String- String intStringFacet = getFacetXML(response, "countn", "fieldFacets", "string_sd");- Collection<Long> intString = (ArrayList<Long>)xmlToList(intStringFacet, "long", "int");+ Collection<Long> intString = getLongList("countn", "fieldFacets", "string_sd", "long", "int");ArrayList<Long> intStringTest = (ArrayList<Long>)calculateStat(intStringTestStart, "count");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(),intString,intStringTest);//Long Date- String longDateFacet = getFacetXML(response, "countn", "fieldFacets", "date_dtd");- Collection<Long> longDate = (ArrayList<Long>)xmlToList(longDateFacet, "long", "long");+ Collection<Long> longDate = getLongList("countn", "fieldFacets", "date_dtd", "long", "long");ArrayList<Long> longDateTest = (ArrayList<Long>)calculateStat(longDateTestStart, "count");- assertEquals(longDate,longDateTest);+ assertEquals(getRawResponse(),longDate,longDateTest);//Long String- String longStringFacet = getFacetXML(response, "countn", "fieldFacets", "string_sd");- Collection<Long> longString = (ArrayList<Long>)xmlToList(longStringFacet, "long", "long");+ Collection<Long> longString = getLongList("countn", "fieldFacets", "string_sd", "long", "long");ArrayList<Long> longStringTest = (ArrayList<Long>)calculateStat(longStringTestStart, "count");- assertEquals(longString,longStringTest);+ assertEquals(getRawResponse(),longString,longStringTest);//Float Date- String floatDateFacet = getFacetXML(response, "countn", "fieldFacets", "date_dtd");- Collection<Long> floatDate = (ArrayList<Long>)xmlToList(floatDateFacet, "long", "float");+ Collection<Long> floatDate = getLongList("countn", "fieldFacets", "date_dtd", "long", "float");ArrayList<Long> floatDateTest = (ArrayList<Long>)calculateStat(floatDateTestStart, "count");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(),floatDate,floatDateTest);//Float String- String floatStringFacet = getFacetXML(response, "countn", "fieldFacets", "string_sd");- Collection<Long> floatString = (ArrayList<Long>)xmlToList(floatStringFacet, "long", "float");+ Collection<Long> floatString = getLongList("countn", "fieldFacets", "string_sd", "long", "float");ArrayList<Long> floatStringTest = (ArrayList<Long>)calculateStat(floatStringTestStart, "count");- assertEquals(floatString,floatStringTest);+ assertEquals(getRawResponse(),floatString,floatStringTest);//Double Date- String doubleDateFacet = getFacetXML(response, "countn", "fieldFacets", "date_dtd");- Collection<Long> doubleDate = (ArrayList<Long>)xmlToList(doubleDateFacet, "long", "double");+ Collection<Long> doubleDate = getLongList("countn", "fieldFacets", "date_dtd", "long", "double");ArrayList<Long> doubleDateTest = (ArrayList<Long>)calculateStat(doubleDateTestStart, "count");- assertEquals(doubleDate,doubleDateTest);+ assertEquals(getRawResponse(),doubleDate,doubleDateTest);//Double String- String doubleStringFacet = getFacetXML(response, "countn", "fieldFacets", "string_sd");- Collection<Long> doubleString = (ArrayList<Long>)xmlToList(doubleStringFacet, "long", "double");+ Collection<Long> doubleString = getLongList("countn", "fieldFacets", "string_sd", "long", "double");ArrayList<Long> doubleStringTest = (ArrayList<Long>)calculateStat(doubleStringTestStart, "count");- assertEquals(doubleString,doubleStringTest);+ assertEquals(getRawResponse(),doubleString,doubleStringTest);//Date Int- String dateIntFacet = getFacetXML(response, "count", "fieldFacets", "int_id");- Collection<Long> dateInt = (ArrayList<Long>)xmlToList(dateIntFacet, "long", "date");+ Collection<Long> dateInt = getLongList("count", "fieldFacets", "int_id", "long", "date");ArrayList<Long> dateIntTest = (ArrayList<Long>)calculateStat(dateIntTestStart, "count");- assertEquals(dateIntTest,dateInt);+ assertEquals(getRawResponse(),dateIntTest,dateInt);//Date Long- String dateLongFacet = getFacetXML(response, "count", "fieldFacets", "long_ld");- Collection<Long> dateLong = (ArrayList<Long>)xmlToList(dateLongFacet, "long", "date");+ Collection<Long> dateLong = getLongList("count", "fieldFacets", "long_ld", "long", "date");ArrayList<Long> dateLongTest = (ArrayList<Long>)calculateStat(dateLongTestStart, "count");- assertEquals(dateLong,dateLongTest);+ assertEquals(getRawResponse(),dateLong,dateLongTest);//String Int- String stringIntFacet = getFacetXML(response, "count", "fieldFacets", "int_id");- Collection<Long> stringInt = (ArrayList<Long>)xmlToList(stringIntFacet, "long", "str");+ Collection<Long> stringInt = getLongList("count", "fieldFacets", "int_id", "long", "str");ArrayList<Long> stringIntTest = (ArrayList<Long>)calculateStat(stringIntTestStart, "count");- assertEquals(stringInt,stringIntTest);+ assertEquals(getRawResponse(),stringInt,stringIntTest);//String Long- String stringLongFacet = getFacetXML(response, "count", "fieldFacets", "long_ld");- Collection<Long> stringLong = (ArrayList<Long>)xmlToList(stringLongFacet, "long", "str");+ Collection<Long> stringLong = getLongList("count", "fieldFacets", "long_ld", "long", "str");ArrayList<Long> stringLongTest = (ArrayList<Long>)calculateStat(stringLongTestStart, "count");- assertEquals(stringLong,stringLongTest);+ assertEquals(getRawResponse(),stringLong,stringLongTest);}@SuppressWarnings("unchecked")@Testpublic void missingTest() throws Exception {//Int Date- String intDateFacet = getFacetXML(response, "missingn", "fieldFacets", "date_dtd");- Collection<Long> intDate = (ArrayList<Long>)xmlToList(intDateFacet, "long", "int");+ Collection<Long> intDate = getLongList("missingn", "fieldFacets", "date_dtd", "long", "int");setLatestType("int");- assertEquals(intDateTestMissing,intDate);+ assertEquals(getRawResponse(),intDateTestMissing,intDate);//Int String- String intStringFacet = getFacetXML(response, "missingn", "fieldFacets", "string_sd");- Collection<Long> intString = (ArrayList<Long>)xmlToList(intStringFacet, "long", "int");- assertEquals(intStringTestMissing,intString);+ Collection<Long> intString = getLongList("missingn", "fieldFacets", "string_sd", "long", "int");+ assertEquals(getRawResponse(),intStringTestMissing,intString);//Long Date- String longDateFacet = getFacetXML(response, "missingn", "fieldFacets", "date_dtd");- Collection<Long> longDate = (ArrayList<Long>)xmlToList(longDateFacet, "long", "long");+ Collection<Long> longDate = getLongList("missingn", "fieldFacets", "date_dtd", "long", "long");setLatestType("long");- assertEquals(longDateTestMissing,longDate);+ assertEquals(getRawResponse(),longDateTestMissing,longDate);//Long String- String longStringFacet = getFacetXML(response, "missingn", "fieldFacets", "string_sd");- Collection<Long> longString = (ArrayList<Long>)xmlToList(longStringFacet, "long", "long");- assertEquals(longStringTestMissing,longString);+ Collection<Long> longString = getLongList("missingn", "fieldFacets", "string_sd", "long", "long");+ assertEquals(getRawResponse(),longStringTestMissing,longString);//Float Date- String floatDateFacet = getFacetXML(response, "missingn", "fieldFacets", "date_dtd");- Collection<Long> floatDate = (ArrayList<Long>)xmlToList(floatDateFacet, "long", "float");+ Collection<Long> floatDate = getLongList("missingn", "fieldFacets", "date_dtd", "long", "float");setLatestType("float");- assertEquals(floatDateTestMissing,floatDate);+ assertEquals(getRawResponse(),floatDateTestMissing,floatDate);//Float String- String floatStringFacet = getFacetXML(response, "missingn", "fieldFacets", "string_sd");- Collection<Long> floatString = (ArrayList<Long>)xmlToList(floatStringFacet, "long", "float");- assertEquals(floatStringTestMissing,floatString);+ Collection<Long> floatString = getLongList("missingn", "fieldFacets", "string_sd", "long", "float");+ assertEquals(getRawResponse(),floatStringTestMissing,floatString);//Double Date- String doubleDateFacet = getFacetXML(response, "missingn", "fieldFacets", "date_dtd");- Collection<Long> doubleDate = (ArrayList<Long>)xmlToList(doubleDateFacet, "long", "double");+ Collection<Long> doubleDate = getLongList("missingn", "fieldFacets", "date_dtd", "long", "double");setLatestType("double");- assertEquals(doubleDateTestMissing,doubleDate);+ assertEquals(getRawResponse(),doubleDateTestMissing,doubleDate);//Double String- String doubleStringFacet = getFacetXML(response, "missingn", "fieldFacets", "string_sd");- Collection<Long> doubleString = (ArrayList<Long>)xmlToList(doubleStringFacet, "long", "double");- assertEquals(doubleStringTestMissing,doubleString);+ Collection<Long> doubleString = getLongList("missingn", "fieldFacets", "string_sd", "long", "double");+ assertEquals(getRawResponse(),doubleStringTestMissing,doubleString);//Date Int- String dateIntFacet = getFacetXML(response, "missing", "fieldFacets", "int_id");- Collection<Long> dateInt = (ArrayList<Long>)xmlToList(dateIntFacet, "long", "date");+ Collection<Long> dateInt = getLongList("missing", "fieldFacets", "int_id", "long", "date");setLatestType("date");- assertEquals(dateIntTestMissing,dateInt);+ assertEquals(getRawResponse(),dateIntTestMissing,dateInt);//Date Long- String dateStringFacet = getFacetXML(response, "missing", "fieldFacets", "long_ld");- Collection<Long> dateLong = (ArrayList<Long>)xmlToList(dateStringFacet, "long", "date");- assertEquals(dateLongTestMissing,dateLong);+ Collection<Long> dateLong = getLongList("missing", "fieldFacets", "long_ld", "long", "date");+ assertEquals(getRawResponse(),dateLongTestMissing,dateLong);//String Int- String stringIntFacet = getFacetXML(response, "missing", "fieldFacets", "int_id");- Collection<Long> stringInt = (ArrayList<Long>)xmlToList(stringIntFacet, "long", "str");+ Collection<Long> stringInt = getLongList("missing", "fieldFacets", "int_id", "long", "str");setLatestType("string");- assertEquals(stringIntTestMissing,stringInt);+ assertEquals(getRawResponse(),stringIntTestMissing,stringInt);//String Long- String stringLongFacet = getFacetXML(response, "missing", "fieldFacets", "long_ld");- Collection<Long> stringLong = (ArrayList<Long>)xmlToList(stringLongFacet, "long", "str");- assertEquals(stringLongTestMissing,stringLong);+ Collection<Long> stringLong = getLongList("missing", "fieldFacets", "long_ld", "long", "str");+ assertEquals(getRawResponse(),stringLongTestMissing,stringLong);}@SuppressWarnings("unchecked")@Testpublic void multiValueTest() throws Exception {//Long- String longFacet = getFacetXML(response, "multivalued", "fieldFacets", "long_ldm");- Collection<Double> lon = (ArrayList<Double>)xmlToList(longFacet, "double", "mean");+ Collection<Double> lon = getDoubleList("multivalued", "fieldFacets", "long_ldm", "double", "mean");ArrayList<Double> longTest = calculateNumberStat(multiLongTestStart, "mean");- assertEquals(lon,longTest);+ assertEquals(getRawResponse(),lon,longTest);//Date- String dateFacet = getFacetXML(response, "multivalued", "fieldFacets", "date_dtdm");- Collection<Double> date = (ArrayList<Double>)xmlToList(dateFacet, "double", "mean");+ Collection<Double> date = getDoubleList("multivalued", "fieldFacets", "date_dtdm", "double", "mean");ArrayList<Double> dateTest = calculateNumberStat(multiDateTestStart, "mean");- assertEquals(date,dateTest);+ assertEquals(getRawResponse(),date,dateTest);//String- String stringFacet = getFacetXML(response, "multivalued", "fieldFacets", "string_sdm");- Collection<Double> string = (ArrayList<Double>)xmlToList(stringFacet, "double", "mean");+ Collection<Double> string = getDoubleList("multivalued", "fieldFacets", "string_sdm", "double", "mean");ArrayList<Double> stringTest = calculateNumberStat(multiStringTestStart, "mean");- assertEquals(string,stringTest);+ assertEquals(getRawResponse(),string,stringTest);}@SuppressWarnings("unchecked")@Testpublic void missingFacetTest() throws Exception {//int MultiDate- String stringFacet = getFacetXML(response, "missingf", "fieldFacets", "date_dtdm");- assertTrue(stringFacet.contains("<lst name=\"(MISSING)\">"));- ArrayList<Double> string = (ArrayList<Double>)xmlToList(stringFacet, "double", "mean");+ String xPath = "/response/lst[@name='stats']/lst[@name='missingf']/lst[@name='fieldFacets']/lst[@name='date_dtdm']/lst[@name='(MISSING)']";+ assertNotNull(getRawResponse(), getNode(xPath));++ ArrayList<Double> string = getDoubleList("missingf", "fieldFacets", "date_dtdm", "double", "mean");string.remove(0);ArrayList<Double> stringTest = calculateNumberStat(multiDateTestStart, "mean");- assertEquals(string,stringTest);+ assertEquals(getRawResponse(), string,stringTest);//Int String- String intStringFacet = getFacetXML(response, "missingf", "fieldFacets", "string_sd");- assertTrue(intStringFacet.contains("<lst name=\"(MISSING)\">")&&!intStringFacet.contains("<lst name=\"str0\">"));- List<Double> intString = (ArrayList<Double>)xmlToList(intStringFacet, "double", "mean");+ xPath = "/response/lst[@name='stats']/lst[@name='missingf']/lst[@name='fieldFacets']/lst[@name='string_sd']/lst[@name='(MISSING)']";+ assertNotNull(getRawResponse(), getNode(xPath));++ xPath = "/response/lst[@name='stats']/lst[@name='missingf']/lst[@name='fieldFacets']/lst[@name='string_sd']/lst[@name='str0']";+ assertNull(getRawResponse(), getNode(xPath));+ List<Double> intString = getDoubleList("missingf", "fieldFacets", "string_sd", "double", "mean");intString.remove(0);ArrayList<Double> intStringTest = calculateNumberStat(intStringTestStart, "mean");- assertEquals(intString,intStringTest);+ assertEquals(getRawResponse(), intString,intStringTest);//Int Date- String intDateFacet = getFacetXML(response, "missingf", "fieldFacets", "date_dtd");- Collection<Double> intDate = (ArrayList<Double>)xmlToList(intDateFacet, "double", "mean");+ Collection<Double> intDate = getDoubleList("missingf", "fieldFacets", "date_dtd", "double", "mean");ArrayList<ArrayList<Double>> intDateMissingTestStart = (ArrayList<ArrayList<Double>>) intDateTestStart.clone();ArrayList<Double> intDateTest = calculateNumberStat(intDateMissingTestStart, "mean");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(),intDate,intDateTest);}- private boolean checkStddevs(ArrayList<Double> list1, ArrayList<Double> list2) {+ private void checkStddevs(ArrayList<Double> list1, ArrayList<Double> list2) {for (int i = 0; i<list1.size(); i++) {if ((Math.abs(list1.get(i)-list2.get(i))<.00000000001) == false) {- return false;+ assertEquals(getRawResponse(), list1.get(i), list2.get(i), 0.00000000001);}}- return true;}}diff --git a/solr/core/src/test/org/apache/solr/analytics/facet/QueryFacetTest.java b/solr/core/src/test/org/apache/solr/analytics/facet/QueryFacetTest.javaindex 32635c82eaa..d63d72b2439 100644--- a/solr/core/src/test/org/apache/solr/analytics/facet/QueryFacetTest.java+++ b/solr/core/src/test/org/apache/solr/analytics/facet/QueryFacetTest.java@@ -102,30 +102,26 @@ public class QueryFacetTest extends AbstractAnalyticsFacetTest {assertU(commit());//Query ascending tests- String response = h.query(request(fileToStringArr(fileName)));+ setResponse(h.query(request(fileToStringArr(fileName))));//Int One- String int1Query = getFacetXML(response, "ir", "queryFacets", "float1");- ArrayList<Double> int1 = (ArrayList<Double>)xmlToList(int1Query, "double", "sum");+ ArrayList<Double> int1 = getDoubleList("ir", "queryFacets", "float1", "double", "sum");ArrayList<Double> int1Test = calculateNumberStat(int1TestStart, "sum");- assertEquals(int1,int1Test);+ assertEquals(getRawResponse(), int1, int1Test);//Int Two- String int2Query = getFacetXML(response, "ir", "queryFacets", "float2");- ArrayList<Integer> int2 = (ArrayList<Integer>)xmlToList(int2Query, "int", "percentile_8");+ ArrayList<Integer> int2 = getIntegerList("ir", "queryFacets", "float2", "int", "percentile_8");ArrayList<Integer> int2Test = (ArrayList<Integer>)calculateStat(int2TestStart, "perc_8");- assertEquals(int2,int2Test);+ assertEquals(getRawResponse(), int2, int2Test);//Long- String long1Query = getFacetXML(response, "lr", "queryFacets", "string");- ArrayList<Double> long1 = (ArrayList<Double>)xmlToList(long1Query, "double", "median");+ ArrayList<Double> long1 = getDoubleList("lr", "queryFacets", "string", "double", "median");ArrayList<Double> long1Test = calculateNumberStat(longTestStart, "median");- assertEquals(long1,long1Test);+ assertEquals(getRawResponse(),long1,long1Test);//Float- String float1Query = getFacetXML(response, "fr", "queryFacets", "lad");- ArrayList<Double> float1 = (ArrayList<Double>)xmlToList(float1Query, "double", "mean");+ ArrayList<Double> float1 = getDoubleList("fr", "queryFacets", "lad", "double", "mean");ArrayList<Double> float1Test = calculateNumberStat(floatTestStart, "mean");- assertEquals(float1,float1Test);+ assertEquals(getRawResponse(), float1, float1Test);}}diff --git a/solr/core/src/test/org/apache/solr/analytics/facet/RangeFacetTest.java b/solr/core/src/test/org/apache/solr/analytics/facet/RangeFacetTest.javaindex 6e9562b101d..e62f7ec52ce 100644--- a/solr/core/src/test/org/apache/solr/analytics/facet/RangeFacetTest.java+++ b/solr/core/src/test/org/apache/solr/analytics/facet/RangeFacetTest.java@@ -47,8 +47,6 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {static ArrayList<ArrayList<Float>> floatDoubleTestStart;static ArrayList<ArrayList<Float>> floatDateTestStart;- static String response;-@BeforeClasspublic static void beforeClass() throws Exception {initCore("solrconfig-basic.xml","schema-analytics.xml");@@ -117,7 +115,7 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {assertU(commit());- response = h.query(request(fileToStringArr(fileName)));+ setResponse(h.query(request(fileToStringArr(fileName))));}@SuppressWarnings("unchecked")@@ -125,42 +123,36 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {public void rangeTest() throws Exception {//Int Long- String intLongRange = getFacetXML(response, "ri", "rangeFacets", "long_ld");- ArrayList<Double> intLong = (ArrayList<Double>)xmlToList(intLongRange, "long", "count");+ ArrayList<Long> intLong = getLongList("ri", "rangeFacets", "long_ld", "long", "count");ArrayList<Long> intLongTest = calculateStat(transformLists(intLongTestStart, 5, 30, 5, false, true, false, false, false), "count");- assertEquals(intLong,intLongTest);+ assertEquals(getRawResponse(), intLong,intLongTest);//Int Double- String intDoubleRange = getFacetXML(response, "ri", "rangeFacets", "double_dd");- ArrayList<Double> intDouble = (ArrayList<Double>)xmlToList(intDoubleRange, "double", "mean");+ ArrayList<Double> intDouble = getDoubleList("ri", "rangeFacets", "double_dd", "double", "mean");ArrayList<Double> intDoubleTest = calculateNumberStat(transformLists(intDoubleTestStart, 3, 39, 7, false, false, true, false, true), "mean");- assertEquals(intDouble,intDoubleTest);+ assertEquals(getRawResponse(), intDouble,intDoubleTest);//Int Date- String intDateRange = getFacetXML(response, "ri", "rangeFacets", "date_dtd");- ArrayList<Long> intDate = (ArrayList<Long>)xmlToList(intDateRange, "long", "count");+ ArrayList<Long> intDate = getLongList("ri", "rangeFacets", "date_dtd", "long", "count");ArrayList<Long> intDateTest = (ArrayList<Long>)calculateStat(transformLists(intDateTestStart, 7, 44, 7, false, true, false, true, true), "count");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(), intDate,intDateTest);//Float Long- String floatLongRange = getFacetXML(response, "rf", "rangeFacets", "long_ld");- ArrayList<Double> floatLong = (ArrayList<Double>)xmlToList(floatLongRange, "double", "median");+ ArrayList<Double> floatLong = getDoubleList("rf", "rangeFacets", "long_ld", "double", "median");ArrayList<Double> floatLongTest = calculateNumberStat(transformLists(floatLongTestStart, 0, 29, 4, false, true, true, true, true), "median");- assertEquals(floatLong,floatLongTest);+ assertEquals(getRawResponse(), floatLong,floatLongTest);//Float Double- String floatDoubleRange = getFacetXML(response, "rf", "rangeFacets", "double_dd");- ArrayList<Long> floatDouble = (ArrayList<Long>)xmlToList(floatDoubleRange, "long", "count");+ ArrayList<Long> floatDouble = getLongList("rf", "rangeFacets", "double_dd", "long", "count");ArrayList<Long> floatDoubleTest = (ArrayList<Long>)calculateStat(transformLists(floatDoubleTestStart, 4, 47, 11, false, false, false, true, false), "count");- assertEquals(floatDouble,floatDoubleTest);+ assertEquals(getRawResponse(), floatDouble,floatDoubleTest);//Float Date- String floatDateRange = getFacetXML(response, "rf", "rangeFacets", "date_dtd");- ArrayList<Double> floatDate = (ArrayList<Double>)xmlToList(floatDateRange, "double", "sumOfSquares");+ ArrayList<Double> floatDate = getDoubleList("rf", "rangeFacets", "date_dtd", "double", "sumOfSquares");ArrayList<Double> floatDateTest = calculateNumberStat(transformLists(floatDateTestStart, 4, 46, 5, false, false, true, true, false), "sumOfSquares");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(), floatDate,floatDateTest);}@@ -168,84 +160,72 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {@Testpublic void hardendRangeTest() throws Exception {//Int Long- String intLongRange = getFacetXML(response, "hi", "rangeFacets", "long_ld");- ArrayList<Double> intLong = (ArrayList<Double>)xmlToList(intLongRange, "double", "sum");+ ArrayList<Double> intLong = getDoubleList("hi", "rangeFacets", "long_ld", "double", "sum");ArrayList<Double> intLongTest = calculateNumberStat(transformLists(intLongTestStart, 5, 30, 5, true, true, false, false, false), "sum");- assertEquals(intLong,intLongTest);+ assertEquals(getRawResponse(), intLong,intLongTest);//Int Double- String intDoubleRange = getFacetXML(response, "hi", "rangeFacets", "double_dd");- ArrayList<Double> intDouble = (ArrayList<Double>)xmlToList(intDoubleRange, "double", "mean");+ ArrayList<Double> intDouble = getDoubleList("hi", "rangeFacets", "double_dd", "double", "mean");ArrayList<Double> intDoubleTest = calculateNumberStat(transformLists(intDoubleTestStart, 3, 39, 7, true, false, true, false, true), "mean");- assertEquals(intDouble,intDoubleTest);+ assertEquals(getRawResponse(), intDouble,intDoubleTest);//Int Date- String intDateRange = getFacetXML(response, "hi", "rangeFacets", "date_dtd");- ArrayList<Long> intDate = (ArrayList<Long>)xmlToList(intDateRange, "long", "count");+ ArrayList<Long> intDate = getLongList("hi", "rangeFacets", "date_dtd", "long", "count");ArrayList<Long> intDateTest = (ArrayList<Long>)calculateStat(transformLists(intDateTestStart, 7, 44, 7, true, true, false, true, true), "count");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(), intDate,intDateTest);//Float Long- String floatLongRange = getFacetXML(response, "hf", "rangeFacets", "long_ld");- ArrayList<Double> floatLong = (ArrayList<Double>)xmlToList(floatLongRange, "double", "median");+ ArrayList<Double> floatLong = getDoubleList("hf", "rangeFacets", "long_ld", "double", "median");ArrayList<Double> floatLongTest = calculateNumberStat(transformLists(floatLongTestStart, 0, 29, 4, true, true, true, true, true), "median");- assertEquals(floatLong,floatLongTest);+ assertEquals(getRawResponse(), floatLong,floatLongTest);//Float Double- String floatDoubleRange = getFacetXML(response, "hf", "rangeFacets", "double_dd");- ArrayList<Long> floatDouble = (ArrayList<Long>)xmlToList(floatDoubleRange, "long", "count");+ ArrayList<Long> floatDouble = getLongList("hf", "rangeFacets", "double_dd", "long", "count");ArrayList<Long> floatDoubleTest = (ArrayList<Long>)calculateStat(transformLists(floatDoubleTestStart, 4, 47, 11, true, false, false, true, false), "count");- assertEquals(floatDouble,floatDoubleTest);+ assertEquals(getRawResponse(), floatDouble,floatDoubleTest);//Float Date- String floatDateRange = getFacetXML(response, "hf", "rangeFacets", "date_dtd");- ArrayList<Double> floatDate = (ArrayList<Double>)xmlToList(floatDateRange, "double", "sumOfSquares");+ ArrayList<Double> floatDate = getDoubleList("hf", "rangeFacets", "date_dtd", "double", "sumOfSquares");ArrayList<Double> floatDateTest = calculateNumberStat(transformLists(floatDateTestStart, 4, 46, 5, true, false, true, true, false), "sumOfSquares");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(), floatDate,floatDateTest);}@SuppressWarnings("unchecked")@Testpublic void multiGapTest() throws Exception {//Int Long- String intLongRange = getFacetXML(response, "mi", "rangeFacets", "long_ld");- ArrayList<Double> intLong = (ArrayList<Double>)xmlToList(intLongRange, "double", "sum");+ ArrayList<Double> intLong = getDoubleList("mi", "rangeFacets", "long_ld", "double", "sum");ArrayList<Double> intLongTest = calculateNumberStat(transformLists(intLongTestStart, 5, 30, "4,2,6,3", false, true, false, false, false), "sum");- assertEquals(intLong,intLongTest);+ assertEquals(getRawResponse(), intLong,intLongTest);//Int Double- String intDoubleRange = getFacetXML(response, "mi", "rangeFacets", "double_dd");- ArrayList<Double> intDouble = (ArrayList<Double>)xmlToList(intDoubleRange, "double", "mean");+ ArrayList<Double> intDouble = getDoubleList("mi", "rangeFacets", "double_dd", "double", "mean");ArrayList<Double> intDoubleTest = calculateNumberStat(transformLists(intDoubleTestStart, 3, 39, "3,1,7", false, false, true, false, true), "mean");- assertEquals(intDouble,intDoubleTest);+ assertEquals(getRawResponse(), intDouble,intDoubleTest);//Int Date- String intDateRange = getFacetXML(response, "mi", "rangeFacets", "date_dtd");- ArrayList<Long> intDate = (ArrayList<Long>)xmlToList(intDateRange, "long", "count");+ ArrayList<Long> intDate = getLongList("mi", "rangeFacets", "date_dtd", "long", "count");ArrayList<Long> intDateTest = (ArrayList<Long>)calculateStat(transformLists(intDateTestStart, 7, 44, "2,7", false, true, false, true, true), "count");- assertEquals(intDate,intDateTest);+ assertEquals(getRawResponse(), intDate,intDateTest);//Float Long- String floatLongRange = getFacetXML(response, "mf", "rangeFacets", "long_ld");- ArrayList<Double> floatLong = (ArrayList<Double>)xmlToList(floatLongRange, "double", "median");+ ArrayList<Double> floatLong = getDoubleList("mf", "rangeFacets", "long_ld", "double", "median");ArrayList<Double> floatLongTest = calculateNumberStat(transformLists(floatLongTestStart, 0, 29, "1,4", false, true, true, true, true), "median");;- assertEquals(floatLong,floatLongTest);+ assertEquals(getRawResponse(), floatLong,floatLongTest);//Float Double- String floatDoubleRange = getFacetXML(response, "mf", "rangeFacets", "double_dd");- ArrayList<Long> floatDouble = (ArrayList<Long>)xmlToList(floatDoubleRange, "long", "count");+ ArrayList<Long> floatDouble = getLongList("mf", "rangeFacets", "double_dd", "long", "count");ArrayList<Long> floatDoubleTest = (ArrayList<Long>)calculateStat(transformLists(floatDoubleTestStart, 4, 47, "2,3,11", false, false, false, true, false), "count");- assertEquals(floatDouble,floatDoubleTest);+ assertEquals(getRawResponse(), floatDouble,floatDoubleTest);//Float Date- String floatDateRange = getFacetXML(response, "mf", "rangeFacets", "date_dtd");- ArrayList<Double> floatDate = (ArrayList<Double>)xmlToList(floatDateRange, "double", "sumOfSquares");+ ArrayList<Double> floatDate = getDoubleList("mf", "rangeFacets", "date_dtd", "double", "sumOfSquares");ArrayList<Double> floatDateTest = calculateNumberStat(transformLists(floatDateTestStart, 4, 46, "4,5", false, false, true, true, false), "sumOfSquares");- assertEquals(floatDate,floatDateTest);+ assertEquals(getRawResponse(), floatDate,floatDateTest);}private <T> ArrayList<ArrayList<T>> transformLists(ArrayList<ArrayList<T>> listsStart, int start, int end, int gap