Search in sources :

Example 6 with TestDocumentProcessor1

use of com.yahoo.docproc.DocumentProcessingAbstractTestCase.TestDocumentProcessor1 in project vespa by vespa-engine.

the class SchemaMappingAndAccessesTest method testSchemaMapNoDocType.

public void testSchemaMapNoDocType() {
    SchemaMap map = new SchemaMap(null);
    map.addMapping("mychain", "com.yahoo.MyDocProc", null, "inDoc1", "inProc1");
    map.addMapping("mychain", "com.yahoo.MyDocProc", null, "inDoc2", "inProc2");
    Map<Pair<String, String>, String> cMap = map.chainMap("mychain", "com.yahoo.MyDocProc");
    DocumentProcessor proc = new TestDocumentProcessor1();
    proc.setFieldMap(cMap);
    Map<String, String> dMap = proc.getDocMap("mydoctype");
    assertEquals("inDoc1", dMap.get("inProc1"));
    assertEquals("inDoc2", dMap.get("inProc2"));
}
Also used : DocumentProcessor(com.yahoo.docproc.DocumentProcessor) TestDocumentProcessor1(com.yahoo.docproc.DocumentProcessingAbstractTestCase.TestDocumentProcessor1) Pair(com.yahoo.collections.Pair)

Aggregations

TestDocumentProcessor1 (com.yahoo.docproc.DocumentProcessingAbstractTestCase.TestDocumentProcessor1)6 Document (com.yahoo.document.Document)4 HashMap (java.util.HashMap)4 StringFieldValue (com.yahoo.document.datatypes.StringFieldValue)3 Pair (com.yahoo.collections.Pair)2 DocumentProcessor (com.yahoo.docproc.DocumentProcessor)2 DocumentId (com.yahoo.document.DocumentId)2 DocumentType (com.yahoo.document.DocumentType)2 SpanTree (com.yahoo.document.annotation.SpanTree)2 Field (com.yahoo.docproc.Accesses.Field)1 StructDataType (com.yahoo.document.StructDataType)1 Annotation (com.yahoo.document.annotation.Annotation)1 AnnotationType (com.yahoo.document.annotation.AnnotationType)1 Struct (com.yahoo.document.datatypes.Struct)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1