Package com.sematext.searchschemer.reader.senseidb

Source Code of com.sematext.searchschemer.reader.senseidb.SenseiDBFieldsDefinitionReaderTest

package com.sematext.searchschemer.reader.senseidb;

import java.io.File;

import junit.framework.TestCase;

import org.junit.Test;

import com.sematext.searchschemer.index.FieldAttributes;
import com.sematext.searchschemer.type.FieldType;

public class SenseiDBFieldsDefinitionReaderTest extends TestCase {
  @Test
  public void testReader() throws Exception {
    SenseiDBFieldsDefinitionReader reader = new SenseiDBFieldsDefinitionReader(new File(getClass().getClassLoader()
        .getResource("senseidb/test_senseidb_schema.xml").getFile()));
    assertEquals(4, reader.readFields().size());
  }
 
  @Test
  public void testReaderFields() throws Exception {
    SenseiDBFieldsDefinitionReader reader = new SenseiDBFieldsDefinitionReader(new File(getClass().getClassLoader()
        .getResource("senseidb/test_senseidb_schema_small.xml").getFile()));
    assertEquals(1, reader.readFields().size());
    FieldAttributes field = reader.readFields().get(0);
    assertNotNull(field);
    assertEquals("contents", field.name());
    assertEquals(FieldType.TEXT, field.fieldType());
    assertTrue(field.store());
    assertTrue(field.analyzed());
    assertTrue(field.multiValued());
    assertTrue(field.indexed());
  }
}
TOP

Related Classes of com.sematext.searchschemer.reader.senseidb.SenseiDBFieldsDefinitionReaderTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.