public class NGramCheckEObjectConditionTest extends QUARCCoreTestCase{
@Test
public void testForName() {
TechnicalPropertiesCatalogue catalogue = ConstraintsFactory.eINSTANCE.createTechnicalPropertiesCatalogue();
TechnicalProperty tp1 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
tp1.setName("foo");
TechnicalProperty tp2 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
tp2.setName("bar");
TechnicalProperty tp3 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
tp3.setName("abc");
TechnicalProperty tp4 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
tp4.setName("test");
TechnicalProperty tp5 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
tp5.setName("dummy");
catalogue.getCatalogueProperties().add(tp3);
catalogue.getCatalogueProperties().add(tp4);
catalogue.getCatalogueProperties().add(tp5);
catalogue.getCatalogueProperties().add(tp1);
catalogue.getCatalogueProperties().add(tp2);
NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
3, "foo", 0.8f, true, true);
NGramCheckEObjectCondition condition = new NGramCheckEObjectCondition(
ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
nGramCheckCondition,catalogue );
SELECT statement = new SELECT(new FROM(catalogue
.getCatalogueProperties()), new WHERE(condition));
IQueryResult result = statement.execute();
assertTrue( result.contains(tp1));