Search in sources :

Example 21 with Predicate

use of com.yahoo.document.predicate.Predicate in project vespa by vespa-engine.

the class PredicateFieldValueTest method requireThatWrappedValueIsPredicate.

@Test
public void requireThatWrappedValueIsPredicate() {
    Predicate predicate = SimplePredicates.newPredicate();
    PredicateFieldValue value = new PredicateFieldValue(predicate);
    assertSame(predicate, value.getWrappedValue());
}
Also used : Predicate(com.yahoo.document.predicate.Predicate) Test(org.junit.Test)

Example 22 with Predicate

use of com.yahoo.document.predicate.Predicate in project vespa by vespa-engine.

the class PredicateFieldValueTest method requireThatPredicateFieldValueCanBeAssigned.

@Test
public void requireThatPredicateFieldValueCanBeAssigned() {
    Predicate predicate = SimplePredicates.newPredicate();
    PredicateFieldValue value = new PredicateFieldValue();
    value.assign(new PredicateFieldValue(predicate));
    assertSame(predicate, value.getPredicate());
}
Also used : Predicate(com.yahoo.document.predicate.Predicate) Test(org.junit.Test)

Example 23 with Predicate

use of com.yahoo.document.predicate.Predicate in project vespa by vespa-engine.

the class PredicateFieldValueTest method requireThatXmlOutputIsPredicateLanguage.

@Test
public void requireThatXmlOutputIsPredicateLanguage() {
    Predicate predicate = new FeatureSet("key", "valueA", "valueB");
    XmlStream expected = new XmlStream();
    expected.beginTag("tag");
    expected.addContent(predicate.toString());
    expected.endTag();
    assertEquals(expected.toString(), printXml("tag", new PredicateFieldValue(predicate)));
}
Also used : XmlStream(com.yahoo.document.serialization.XmlStream) FeatureSet(com.yahoo.document.predicate.FeatureSet) Predicate(com.yahoo.document.predicate.Predicate) Test(org.junit.Test)

Example 24 with Predicate

use of com.yahoo.document.predicate.Predicate in project vespa by vespa-engine.

the class PredicateFieldValueTest method requireThatPredicateCanBeAssigned.

@Test
public void requireThatPredicateCanBeAssigned() {
    Predicate predicate = SimplePredicates.newPredicate();
    PredicateFieldValue value = new PredicateFieldValue();
    value.assign(predicate);
    assertSame(predicate, value.getPredicate());
}
Also used : Predicate(com.yahoo.document.predicate.Predicate) Test(org.junit.Test)

Example 25 with Predicate

use of com.yahoo.document.predicate.Predicate in project vespa by vespa-engine.

the class PredicateFieldValueTest method requireThatAccessorsWork.

@Test
public void requireThatAccessorsWork() {
    PredicateFieldValue value = new PredicateFieldValue();
    Predicate predicate = SimplePredicates.newPredicate();
    value.setPredicate(predicate);
    assertSame(predicate, value.getPredicate());
}
Also used : Predicate(com.yahoo.document.predicate.Predicate) Test(org.junit.Test)

Aggregations

Predicate (com.yahoo.document.predicate.Predicate)45 Test (org.junit.Test)33 Conjunction (com.yahoo.document.predicate.Conjunction)7 Disjunction (com.yahoo.document.predicate.Disjunction)6 Negation (com.yahoo.document.predicate.Negation)6 ArrayList (java.util.ArrayList)4 List (java.util.List)4 FeatureConjunction (com.yahoo.document.predicate.FeatureConjunction)3 FeatureRange (com.yahoo.document.predicate.FeatureRange)3 FeatureSet (com.yahoo.document.predicate.FeatureSet)3 IndexableFeatureConjunction (com.yahoo.search.predicate.index.conjunction.IndexableFeatureConjunction)3 Map (java.util.Map)3 DataType (com.yahoo.document.DataType)2 FieldValue (com.yahoo.document.datatypes.FieldValue)2 IntegerFieldValue (com.yahoo.document.datatypes.IntegerFieldValue)2 LongFieldValue (com.yahoo.document.datatypes.LongFieldValue)2 PredicateFieldValue (com.yahoo.document.datatypes.PredicateFieldValue)2 RangePartition (com.yahoo.document.predicate.RangePartition)2 ExpressionAssert.assertVerifyCtx (com.yahoo.vespa.indexinglanguage.expressions.ExpressionAssert.assertVerifyCtx)2 ExpressionAssert.assertVerifyCtxThrows (com.yahoo.vespa.indexinglanguage.expressions.ExpressionAssert.assertVerifyCtxThrows)2