Search in sources :

Example 1 with StringField

use of com.yahoo.prelude.fastsearch.StringField in project vespa by vespa-engine.

the class DocsumDefinitionTestCase method testReading.

@Test
public void testReading() {
    String summary_cf = "file:src/test/java/com/yahoo/prelude/fastsearch/test/documentdb-info.cfg";
    DocsumDefinitionSet set = createDocsumDefinitionSet(summary_cf);
    String[] defs = new String[] { "[default,default]", "[version1,version1]", "[withranklog,withranklog]", "[version2,version2]", "[version3,version3]", "[version4,version4]", "[version5,version5]" };
    String setAsString = set.toString();
    for (String d : defs) {
        assertFalse(setAsString.indexOf(d) == -1);
    }
    assertEquals(7, set.size());
    DocsumDefinition docsum0 = set.getDocsumDefinition("default");
    assertNotNull(docsum0);
    assertEquals("default", docsum0.getName());
    assertEquals(19, docsum0.getFieldCount());
    assertNull(docsum0.getField(19));
    assertEquals("DSHOST", docsum0.getField(7).getName());
    assertTrue(docsum0.getField(1) instanceof StringField);
    assertTrue(docsum0.getField(6) instanceof ByteField);
    assertTrue(docsum0.getField(7) instanceof IntegerField);
    assertTrue(docsum0.getField(18) instanceof DataField);
}
Also used : DataField(com.yahoo.prelude.fastsearch.DataField) StringField(com.yahoo.prelude.fastsearch.StringField) DocsumDefinition(com.yahoo.prelude.fastsearch.DocsumDefinition) ByteField(com.yahoo.prelude.fastsearch.ByteField) DocsumDefinitionSet(com.yahoo.prelude.fastsearch.DocsumDefinitionSet) IntegerField(com.yahoo.prelude.fastsearch.IntegerField) Test(org.junit.Test)

Aggregations

ByteField (com.yahoo.prelude.fastsearch.ByteField)1 DataField (com.yahoo.prelude.fastsearch.DataField)1 DocsumDefinition (com.yahoo.prelude.fastsearch.DocsumDefinition)1 DocsumDefinitionSet (com.yahoo.prelude.fastsearch.DocsumDefinitionSet)1 IntegerField (com.yahoo.prelude.fastsearch.IntegerField)1 StringField (com.yahoo.prelude.fastsearch.StringField)1 Test (org.junit.Test)1