Search in sources :

Example 1 with DeltaID

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

the class TopologicalSortingTest method testCycle2.

@Test(expected = DeltaModellingException.class)
public void testCycle2() {
    numNodes = 1;
    deltas = new DeltaID[numNodes];
    deltas[0] = new DeltaID("D0");
    TopologicalSorting<DeltaID> sorter = new TopologicalSorting<>(new HashSet<>(Arrays.asList(deltas)));
    // cycle
    sorter.addEdge(deltas[0], deltas[0]);
    sorter.sort();
}
Also used : DeltaID(abs.frontend.ast.DeltaID) Test(org.junit.Test)

Example 2 with DeltaID

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

the class TopologicalSortingTest method init0_1.

/**
 ***********************************************************************
 */
private TopologicalSorting<DeltaID> init0_1() {
    numNodes = 0;
    deltas = new DeltaID[numNodes];
    TopologicalSorting<DeltaID> sorter = new TopologicalSorting<>(new HashSet<>(Arrays.asList(deltas)));
    sorter.addEdge(new DeltaID("D0"), new DeltaID("D1"));
    return sorter;
}
Also used : DeltaID(abs.frontend.ast.DeltaID)

Example 3 with DeltaID

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

the class ABSUnitTestCaseTranslator method buildProductLine.

void buildProductLine(ModuleDecl module) {
    if (deltas.isEmpty()) {
        return;
    }
    console("Generating product line description...");
    productline = new ProductLine();
    productline.setName(CONFIGURATION_NAME);
    Feature feature = new Feature();
    feature.setName(FEATURE_NAME);
    productline.addFeature(feature);
    AppCond ac = new AppCondFeature(FEATURE_NAME);
    Set<String> applicationConditions = new HashSet<String>();
    DeltaClause lastClause = null;
    for (DeltaWrapper d : deltas) {
        DeltaClause clause = new DeltaClause();
        Deltaspec spec = new Deltaspec();
        String name = d.getDelta().getName();
        spec.setDeltaID(name);
        clause.setDeltaspec(spec);
        clause.setAppCond(ac);
        if (d.isLast()) {
            lastClause = clause;
        } else {
            applicationConditions.add(name);
        }
        productline.addDeltaClause(clause);
    }
    if (lastClause != null) {
        for (String n : applicationConditions) {
            lastClause.addAfterDeltaID(new DeltaID(n));
        }
    }
    product = new ProductDecl();
    product.setName(PRODUCT_NAME);
    ProductFeatureSet featureSet = new ProductFeatureSet();
    featureSet.addFeature(feature);
    product.setProductExpr(featureSet);
}
Also used : ProductDecl(abs.frontend.ast.ProductDecl) ProductFeatureSet(abs.frontend.ast.ProductFeatureSet) Feature(abs.frontend.ast.Feature) AppCondFeature(abs.frontend.ast.AppCondFeature) AppCondFeature(abs.frontend.ast.AppCondFeature) DeltaClause(abs.frontend.ast.DeltaClause) DeltaWrapper(apet.absunit.DeltaForGetSetFieldsBuilder.DeltaWrapper) Deltaspec(abs.frontend.ast.Deltaspec) DeltaID(abs.frontend.ast.DeltaID) AppCond(abs.frontend.ast.AppCond) ProductLine(abs.frontend.ast.ProductLine) HashSet(java.util.HashSet)

Aggregations

DeltaID (abs.frontend.ast.DeltaID)3 AppCond (abs.frontend.ast.AppCond)1 AppCondFeature (abs.frontend.ast.AppCondFeature)1 DeltaClause (abs.frontend.ast.DeltaClause)1 Deltaspec (abs.frontend.ast.Deltaspec)1 Feature (abs.frontend.ast.Feature)1 ProductDecl (abs.frontend.ast.ProductDecl)1 ProductFeatureSet (abs.frontend.ast.ProductFeatureSet)1 ProductLine (abs.frontend.ast.ProductLine)1 DeltaWrapper (apet.absunit.DeltaForGetSetFieldsBuilder.DeltaWrapper)1 HashSet (java.util.HashSet)1 Test (org.junit.Test)1