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();
}
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;
}
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);
}
Aggregations