Package org.emftrace.metamodel.QUARCModel.Constraints

Examples of org.emftrace.metamodel.QUARCModel.Constraints.TechnicalPropertiesCatalogue


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));
View Full Code Here


   
  }
 
  @Test
  public void testForBug() {
    TechnicalPropertiesCatalogue catalogue = ConstraintsFactory.eINSTANCE.createTechnicalPropertiesCatalogue();
    TechnicalProperty tp1 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp1.setName("foo");
    TechnicalProperty tp2 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp2.setName("bar");
   
    catalogue.getCatalogueProperties().add(tp1);
    catalogue.getCatalogueProperties().add(tp2);   
   
    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);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "bar", 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(tp2));
View Full Code Here

   
  }

  @Test
  public void testForCategoryBug() {
    TechnicalPropertiesCatalogue catalogue = ConstraintsFactory.eINSTANCE.createTechnicalPropertiesCatalogue();
    TechnicalPropertyCategory cat = ConstraintsFactory.eINSTANCE.createTechnicalPropertyCategory();
    cat.setName("cat");
    TechnicalProperty tp1 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp1.setName("foo");
    TechnicalProperty tp2 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp2.setName("bar");
   
    catalogue.getCatalogueProperties().add(cat);
    cat.getEntries().add(tp1);
    cat.getEntries().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "cat", 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(cat));
View Full Code Here

    GSS gss = gssfactory.createGSS();
    TagsCatalogue tags = gssfactory.createTagsCatalogue();
   
    ConstraintsFactory constraintsFactory = new ConstraintsFactoryImpl();
   
    TechnicalPropertiesCatalogue technicalPropertiesCatalogue = constraintsFactory.createTechnicalPropertiesCatalogue();
    PredefinedConstraintSetCatalogue predefinedConstraintSetCatalogue = constraintsFactory.createPredefinedConstraintSetCatalogue();
   
    QueryFactory queryFactory = new QueryFactoryImpl();
   
    GSSQueryContainment gssQueryContainment = queryFactory.createGSSQueryContainment();
View Full Code Here

public class ExcludeEObjectConditionTest extends QUARCCoreTestCase{

  @Test
  public void testWithExclude() {
    TechnicalPropertiesCatalogue catalogue = ConstraintsFactory.eINSTANCE.createTechnicalPropertiesCatalogue();
    TechnicalProperty tp1 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp1.setName("foo");
    TechnicalProperty tp2 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp2.setName("foo");
   
    catalogue.getCatalogueProperties().add(tp1);
    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "foo", 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );
   
    List<EObject> excludeList = new ArrayList<EObject>();
    excludeList.add(tp2);
    ExcludeEObjectCondition condition0 = new ExcludeEObjectCondition(excludeList);


    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1.AND(condition0)));
   
    IQueryResult result = statement.execute();
   
View Full Code Here

    assertEquals(1, result.size());
  }
 
  @Test
  public void testWithoutExclude() {
    TechnicalPropertiesCatalogue catalogue = ConstraintsFactory.eINSTANCE.createTechnicalPropertiesCatalogue();
    TechnicalProperty tp1 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp1.setName("foo");
    TechnicalProperty tp2 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp2.setName("foo");

   
    catalogue.getCatalogueProperties().add(tp1);
    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "foo", 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );
   
    List<EObject> excludeList = new ArrayList<EObject>();

    ExcludeEObjectCondition condition0 = new ExcludeEObjectCondition(excludeList);


    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1.AND(condition0)));
   
    IQueryResult result = statement.execute();
   
View Full Code Here

public class NGramCheckConditionTest {

  @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");
   
    catalogue.getCatalogueProperties().add(tp1);
    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "foo", 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );


    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1));
   
    IQueryResult result = statement.execute();
   
View Full Code Here

    assertEquals(1, result.size());
  }
 
  @Test
  public void testForIsSatisfiedIfTextIsNullTrue() {
    TechnicalPropertiesCatalogue catalogue = ConstraintsFactory.eINSTANCE.createTechnicalPropertiesCatalogue();
    TechnicalProperty tp1 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp1.setName("foo");
    TechnicalProperty tp2 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp2.setName("bar");
   
    catalogue.getCatalogueProperties().add(tp1);
    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, null, 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );


    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1));
   
    IQueryResult result = statement.execute();
   
View Full Code Here

    assertEquals(2, result.size());
  }
 
  @Test
  public void testForIsSatisfiedIfTextIsNullFalse() {
    TechnicalPropertiesCatalogue catalogue = ConstraintsFactory.eINSTANCE.createTechnicalPropertiesCatalogue();
    TechnicalProperty tp1 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp1.setName("foo");
    TechnicalProperty tp2 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp2.setName("bar");
   
    catalogue.getCatalogueProperties().add(tp1);
    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, null, 0.8f, true, false);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );

    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1));
   
    IQueryResult result = statement.execute();
   
View Full Code Here

    assertEquals(0, result.size());
  }
 
  @Test
  public void testForWordByWordTrue() {
    TechnicalPropertiesCatalogue catalogue = ConstraintsFactory.eINSTANCE.createTechnicalPropertiesCatalogue();
    TechnicalProperty tp1 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp1.setName("foo bar");
    TechnicalProperty tp2 = ConstraintsFactory.eINSTANCE.createBooleanTechnicalProperty();
    tp2.setName("bar bar");
   
    catalogue.getCatalogueProperties().add(tp1);
    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "foo", 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );

    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1));
   
    IQueryResult result = statement.execute();
   
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.QUARCModel.Constraints.TechnicalPropertiesCatalogue

Copyright © 2018 www.massapicom. 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.