Search in sources :

Example 76 with Model

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

the class RecoverTest method intfTest4.

@Test
public void intfTest4() {
    Model m = assertParseError(" interface I { I m() } class C { }");
    assertContainsDeclWithName(m, "I");
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 77 with Model

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

the class RecoverTest method importTest.

@Test
public void importTest() {
    Model m = assertParseError("x class C { }");
    assertContainsDeclWithName(m, "C");
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 78 with Model

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

the class AnnotationTests method testMethodParam.

@Test
public void testMethodParam() {
    Model m = assertParseOkAnn("class C { Unit m([Far] I i) { } }");
    ClassDecl decl = getFirstClassDecl(m);
    assertHasLocAnnotation(decl.getMethod(0).getMethodSig().getParam(0).getType(), "Far");
}
Also used : ClassDecl(abs.frontend.ast.ClassDecl) Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 79 with Model

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

the class AnnotationTests method testClassParam.

@Test
public void testClassParam() {
    Model m = assertParseOkAnn("class C([Far] I i) { }");
    ClassDecl decl = getFirstClassDecl(m);
    assertHasLocAnnotation(decl.getParam(0).getType(), "Far");
}
Also used : ClassDecl(abs.frontend.ast.ClassDecl) Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 80 with Model

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

the class ABSUnitTestCaseTranslator method validateOutput.

private void validateOutput() {
    CompilationUnit unit = new CompilationUnit();
    ModuleDecl cm = module.treeCopyNoTransform();
    unit.addModuleDecl(cm);
    for (DeltaWrapper d : deltas) {
        unit.addDeltaDecl(d.getDelta().treeCopyNoTransform());
    }
    unit.setProductLine(productline.treeCopyNoTransform());
    unit.addProductDecl(product.treeCopyNoTransform());
    Model copy = model.treeCopyNoTransform();
    copy.addCompilationUnit(unit);
    validateOutput(copy.treeCopyNoTransform(), null);
    validateOutput(copy.treeCopyNoTransform(), module.getName().concat(".").concat(PRODUCT_NAME));
}
Also used : CompilationUnit(abs.frontend.ast.CompilationUnit) DeltaWrapper(apet.absunit.DeltaForGetSetFieldsBuilder.DeltaWrapper) Model(abs.frontend.ast.Model) ModuleDecl(abs.frontend.ast.ModuleDecl)

Aggregations

Model (abs.frontend.ast.Model)224 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