SimpleSortField extends SortField { public String getField() { return field; } SimpleSortField(String field, Boolean reverse); String getField(); @Override org.apache.lucene.search.SortField sortField(Schema schema); Set<String> postProcessingFields(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); final String field; }
@Test public void testBuild() { SimpleSortField sortField = new SimpleSortField("field", true); assertEquals("SortField is not created", "field", sortField.getField()); assertTrue("SortField reverse is not set", sortField.reverse); }
@Test public void testBuildDefaults() { SimpleSortField sortField = new SimpleSortField("field", null); assertEquals("SortField is not created", "field", sortField.getField()); assertEquals("SortField reverse is not set to default", SortField.DEFAULT_REVERSE, sortField.reverse); }