use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class AbstractBaseTest method assertFiledList.
public void assertFiledList(String name, String... expected) {
Document document = outputDocumentList.get(0);
List<String> actual = document.getFieldValues(name);
Assert.assertThat(actual, CoreMatchers.hasItems(expected));
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class AbstractBaseTest method assertFiled.
public void assertFiled(int position, String name, String expected) {
if (outputDocumentList.size() <= position) {
Assert.fail("There is no output document for position: " + position);
}
Document document = outputDocumentList.get(position);
String actual = document.getFieldValue(name);
Assert.assertEquals(expected, actual);
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class DocumentDifferTest method testDiffDocuments.
@Test
public void testDiffDocuments() {
Document document1 = DocumentBuilder.document().field("foo", "bar").field("change", "old").create();
Document document2 = DocumentBuilder.document().field("foo", "bar").field("change", "new").create();
DocumentDiff diff = DocumentDiffer.compare(document1, document2);
Assert.assertEquals(1, diff.getFieldDiffs().size());
Assert.assertEquals(FieldDiff.DiffType.DIFF, diff.getFieldDiffs().get(0).getDiffType());
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class DocumentDifferTest method testEqualDocuments.
@Test
public void testEqualDocuments() {
Document document1 = DocumentBuilder.document().field("foo", "bar").create();
Document document2 = DocumentBuilder.document().field("foo", "bar").create();
DocumentDiff diff = DocumentDiffer.compare(document1, document2);
Assert.assertEquals(0, diff.getFieldDiffs().size());
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class DuplicateRemovalFilterTest method testDuplicateRemovalFilter.
@Test
public void testDuplicateRemovalFilter() {
configure();
Document document1 = DocumentBuilder.document().field("duplicateField", "foo").field("field2", "one").create();
Document document2 = DocumentBuilder.document().field("duplicateField", "foo").field("field2", "two").create();
Document document3 = DocumentBuilder.document().field("duplicateField", "bar").field("field2", "three").create();
document(document1, document2, document3);
assertNumberOfDocuments(2);
assertNumberOfFields(2);
assertInitWasDelegated();
assertEndWasDelegated();
}
Aggregations