use of com.onespatial.jrc.tns.oml_to_rif.model.rif.filter.nonterminal.logical.NotNode in project hale by halestudio.
the class TestCqlToMappingConditionTranslator method testTranslateNegatedEquality.
/**
* Tests translating a CQL expression that negates the result of a simple
* equality filter.
*
* @throws TranslationException
* if any errors occurred during the translation
* @throws CQLException
* if any errors occurred parsing the CQL string
*/
@Test
public void testTranslateNegatedEquality() throws CQLException, TranslationException {
// $NON-NLS-1$
String cqlPredicate = "ATTR1 <> '17'";
ModelMappingCondition result = digester.translate(CQL.toFilter(cqlPredicate));
assertNotNull(result);
assertNotNull(result.getRoot());
assertThat(result.getRoot(), is(instanceOf(NotNode.class)));
NotNode notNode = (NotNode) result.getRoot();
assertThat(notNode.getChildren().size(), is(equalTo(1)));
assertThat(notNode.getChild(0), is(instanceOf(EqualToNode.class)));
EqualToNode equalNode = (EqualToNode) notNode.getChild(0);
assertThat(equalNode.getChildren().size(), is(equalTo(0)));
// $NON-NLS-1$ //$NON-NLS-2$
checkComparisonRightLiteral(equalNode, "ATTR1", "17");
}
Aggregations