Search in sources :

Example 26 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class FeatureModel method attributeBounded.

@Test
public void attributeBounded() throws DeltaModellingException, WrongProgramArgumentException {
    Model model = assertParseOk("productline PL; features FM;" + "product P();" + "root FM { Int attr in [0..99]; }");
    model.flattenForProduct("P");
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 27 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class FeatureModel method attributeUnbounded2.

@Test
public void attributeUnbounded2() throws DeltaModellingException, WrongProgramArgumentException {
    Model model = assertParseOk("productline PL; features FM;" + "product P();" + "root FM { Int attr in [*..*]; }");
    model.flattenForProduct("P");
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 28 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class FeatureModel method attributeUnbounded.

@Test
public void attributeUnbounded() throws DeltaModellingException, WrongProgramArgumentException {
    Model model = assertParseOk("productline PL; features FM;" + "product P();" + "root FM { Int attr; }");
    model.flattenForProduct("P");
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 29 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class SearchSolutionsTest method SearchSolutions.

@Test
public void SearchSolutions() throws Exception {
    Model model = assertParseOk(helloprogram);
    model.setNullPrintStream();
    ChocoSolver s = model.instantiateCSModel();
    model.evaluateAllProductDeclarations();
    assertEquals(78, s.countSolutions());
    assertTrue(checkSol(s, model, "P1"));
    assertTrue(checkSol(s, model, "P2"));
    assertTrue(checkSol(s, model, "P3"));
    assertTrue(!checkSol(s, model, "P4"));
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 30 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class SearchSolutionsTest method SearchSolutionsNoAttr.

@Test
public void SearchSolutionsNoAttr() {
    Model model = assertParseOk(helloprogram);
    model.dropAttributes();
    ChocoSolver s = model.instantiateCSModel();
    assertEquals(8, s.countSolutions());
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Aggregations

Model (abs.frontend.ast.Model)226 Test (org.junit.Test)170 FrontendTest (abs.frontend.FrontendTest)93 ClassDecl (abs.frontend.ast.ClassDecl)57 DeltaDecl (abs.frontend.ast.DeltaDecl)30 SemanticConditionList (abs.frontend.analyser.SemanticConditionList)24 FunctionDecl (abs.frontend.ast.FunctionDecl)15 PrintStream (java.io.PrintStream)14 ModifyClassModifier (abs.frontend.ast.ModifyClassModifier)12 SkipStmt (abs.frontend.ast.SkipStmt)11 AbsNature (org.absmodels.abs.plugin.builder.AbsNature)11 ExpFunctionDef (abs.frontend.ast.ExpFunctionDef)9 ModuleDecl (abs.frontend.ast.ModuleDecl)9 CompilationUnit (abs.frontend.ast.CompilationUnit)7 DeltaTraitModifier (abs.frontend.ast.DeltaTraitModifier)7 ModifyMethodModifier (abs.frontend.ast.ModifyMethodModifier)7 PartialFunctionDecl (abs.frontend.ast.PartialFunctionDecl)7 PureExp (abs.frontend.ast.PureExp)7 TraitExpr (abs.frontend.ast.TraitExpr)7 WrongProgramArgumentException (abs.common.WrongProgramArgumentException)6