use of org.apache.solr.ltr.feature.ValueFeature in project lucene-solr by apache.
the class TestManagedFeatureStore method testFeatureStoreGet.
@Test
public void testFeatureStoreGet() throws FeatureException {
final FeatureStore fs = fstore.getFeatureStore("fstore-testFeature2");
for (int i = 0; i < 5; i++) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("value", i);
final String name = "c" + i;
fstore.addFeature(createMap(name, ValueFeature.class.getCanonicalName(), params), "fstore-testFeature2");
}
for (int i = 0; i < 5; i++) {
final Feature f = fs.get("c" + i);
assertEquals("c" + i, f.getName());
assertTrue(f instanceof ValueFeature);
final ValueFeature vf = (ValueFeature) f;
assertEquals(i, vf.getValue());
}
}
Aggregations