mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
SEARCH-121: Facet fields need to return a List in the search context
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130683 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -146,8 +146,9 @@ public class ResultMapperTests
|
||||
assertEquals("searchInsteadFor",searchContext.getSpellCheck().getType());
|
||||
assertEquals(1,searchContext.getSpellCheck().getSuggestions().size());
|
||||
assertEquals("alfresco",searchContext.getSpellCheck().getSuggestions().get(0));
|
||||
assertEquals("content.size",searchContext.getFacetsFields().getLabel());
|
||||
assertEquals(5,searchContext.getFacetsFields().getBuckets().size());
|
||||
assertEquals(1, searchContext.getFacetsFields().size());
|
||||
assertEquals("content.size",searchContext.getFacetsFields().get(0).getLabel());
|
||||
assertEquals(5,searchContext.getFacetsFields().get(0).getBuckets().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -157,7 +158,7 @@ public class ResultMapperTests
|
||||
assertFalse(mapper.isNullContext(new SearchContext(1l,null,null,null)));
|
||||
assertFalse(mapper.isNullContext(new SearchContext(0l,null,null,new SpellCheckContext(null, null))));
|
||||
assertFalse(mapper.isNullContext(new SearchContext(0l,Arrays.asList(new FacetQueryContext(null, 0)),null,null)));
|
||||
assertFalse(mapper.isNullContext(new SearchContext(0l,null,new FacetFieldContext(null, null),null)));
|
||||
assertFalse(mapper.isNullContext(new SearchContext(0l,null,Arrays.asList(new FacetFieldContext(null, null)),null)));
|
||||
}
|
||||
|
||||
private ResultSet mockResultset(List<Long> archivedNodes) throws JSONException
|
||||
|
@@ -118,7 +118,7 @@ public class SearchQuerySerializerTests
|
||||
|
||||
FacetFieldContext ffc = new FacetFieldContext("theLabel", Arrays.asList(new Bucket("b1", 23), new Bucket("b2", 34)));
|
||||
SearchContext searchContext = new SearchContext(23l, Arrays.asList(new FacetQueryContext("f1", 15), new FacetQueryContext("f2", 20)),
|
||||
ffc,
|
||||
Arrays.asList(ffc),
|
||||
new SpellCheckContext("aFlag", Arrays.asList("bish", "bash")));
|
||||
CollectionWithPagingInfo<ExecutionResult> coll = CollectionWithPagingInfo.asPaged(null, Arrays.asList(exec1), false, 2, null, searchContext);
|
||||
String out = helper.writeResponse(coll);
|
||||
@@ -127,7 +127,7 @@ public class SearchQuerySerializerTests
|
||||
assertTrue("There must 'facetQueries f1' json output", out.contains("{\"label\":\"f1\",\"count\":15}"));
|
||||
assertTrue("There must 'facetQueries f2' json output", out.contains("{\"label\":\"f2\",\"count\":20}"));
|
||||
assertTrue("There must 'spellCheck' json output", out.contains("\"spellCheck\":{\"type\":\"aFlag\",\"suggestions\":[\"bish\",\"bash\"]}"));
|
||||
assertTrue("There must 'facetsFields' json output", out.contains("\"facetsFields\":{\"label\":\"theLabel\",\"buckets\""));
|
||||
assertTrue("There must 'facetsFields' json output", out.contains("\"facetsFields\":[{\"label\":\"theLabel\",\"buckets\""));
|
||||
assertTrue("There must 'bucket1' json output", out.contains("{\"label\":\"b1\",\"count\":23}"));
|
||||
assertTrue("There must 'bucket2' json output", out.contains("{\"label\":\"b2\",\"count\":34}"));
|
||||
|
||||
|
Reference in New Issue
Block a user