Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions src/main/java/ecdar/abstractions/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/
public class Project {
private final static String GLOBAL_DCL_FILENAME = "GlobalDeclarations";
private final static String SYSTEM_DCL_FILENAME = "SystemDeclarations";
private final static String QUERIES_FILENAME = "Queries";
private final static String JSON_FILENAME_EXTENSION = ".json";
private static final String FOLDER_NAME_COMPONENTS = "Components";
Expand All @@ -34,15 +33,13 @@ public class Project {
private final ObservableList<EcdarSystem> systems;
private final ObservableList<MutationTestPlan> testPlans;
private final ObjectProperty<Declarations> globalDeclarations;
private final ObjectProperty<Declarations> systemDeclarations;

public Project() {
queries = FXCollections.observableArrayList();
components = FXCollections.observableArrayList();
systems = FXCollections.observableArrayList();
testPlans = FXCollections.observableArrayList();
globalDeclarations = new SimpleObjectProperty<>(new Declarations("Global Declarations"));
systemDeclarations = new SimpleObjectProperty<>(new Declarations("System Declarations"));
}

public ObservableList<Query> getQueries() {
Expand All @@ -69,14 +66,6 @@ public void setGlobalDeclarations(final Declarations declarations) {
globalDeclarations.set(declarations);
}

public Declarations getSystemDeclarations() {
return systemDeclarations.get();
}

public void setSystemDeclarations(final Declarations declarations) {
systemDeclarations.set(declarations);
}

/**
* Serializes and stores this as JSON files at a given directory.
* @param directory object containing path to the desired directory to store at
Expand All @@ -97,13 +86,6 @@ public void serialize(final File directory) throws IOException {
globalWriter.close();
}

{
// Save system declarations
final Writer systemDclWriter = getSaveFileWriter(SYSTEM_DCL_FILENAME);
getNewGson().toJson(getSystemDeclarations().serialize(), systemDclWriter);
systemDclWriter.close();
}

// Save components
for (final Component component : getComponents()) {
final Writer writer = getSaveFileWriter(component.getName(), FOLDER_NAME_COMPONENTS);
Expand Down Expand Up @@ -211,10 +193,6 @@ private void deserializeFileHelper(final File file) throws IOException {
final JsonObject globalJsonObj = new JsonParser().parse(fileContent).getAsJsonObject();
setGlobalDeclarations(new Declarations(globalJsonObj));
break;
case SYSTEM_DCL_FILENAME + JSON_FILENAME_EXTENSION:
final JsonObject sysJsonObj = new JsonParser().parse(fileContent).getAsJsonObject();
setSystemDeclarations(new Declarations(sysJsonObj));
break;
case QUERIES_FILENAME + JSON_FILENAME_EXTENSION:
new JsonParser().parse(fileContent).getAsJsonArray().forEach(jsonElement -> {
final Query newQuery = new Query((JsonObject) jsonElement);
Expand Down Expand Up @@ -362,7 +340,6 @@ public void reset() {
*/
public void clean() {
getGlobalDeclarations().clearDeclarationsText();
getSystemDeclarations().clearDeclarationsText();

queries.clear();

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/ecdar/backend/EcdarDocument.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ private void generateXmlDocument(final Project project) throws BackendException

// Set global declarations
xmlDocument.setProperty(DECLARATION_PROPERTY_TAG, project.getGlobalDeclarations().getDeclarationsText());

// Set the system declaration
xmlDocument.setProperty(SYSTEM_DCL_TAG, project.getSystemDeclarations().getDeclarationsText());
}

/**
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/ecdar/controllers/ProjectPaneController.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ public void initialize(final URL location, final ResourceBundle resources) {
});
filesList.getChildren().add(globalDclPresentation);

// Bind system declarations and add mouse event
final FilePresentation systemDclPresentation = new FilePresentation(Ecdar.getProject().getSystemDeclarations());
systemDclPresentation.setOnMousePressed(event -> {
event.consume();
EcdarController.getActiveCanvasPresentation().getController().setActiveModel(Ecdar.getProject().getSystemDeclarations());
});
filesList.getChildren().add(systemDclPresentation);

Ecdar.getProject().getComponents().addListener(new ListChangeListener<Component>() {
@Override
public void onChanged(final Change<? extends Component> c) {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/ecdar/mutation/ExportHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,11 @@ void start() {
private static void storeMutantXml(final MutationTestCase testCase) throws BackendException, IOException, URISyntaxException {
final Component mutant = testCase.getMutant();

// make a project with the mutant
// Make a project with the mutant
final Project project = new Project();
project.getComponents().add(mutant);
project.setGlobalDeclarations(Ecdar.getProject().getGlobalDeclarations());
mutant.updateIOList(); // Update io in order to get the right system declarations for the mutant
project.setSystemDeclarations(new SimpleComponentsSystemDeclarations(mutant));

BackendHelper.storeBackendModel(project, "mutants" + File.separator + "xml", testCase.getId());
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/ecdar/mutation/TestCaseGenerationHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,12 @@ public int getMaxConcurrentJobs() {
private void generateTestCase(final MutationTestCase testCase, final int tries) {
final Component mutant = testCase.getMutant();

// make a project with the test model and the mutant
// Make a project with the test model and the mutant
final Project project = new Project();
mutant.setName(MutationTestPlanController.MUTANT_NAME);
project.getComponents().addAll(testModel, mutant);
project.setGlobalDeclarations(Ecdar.getProject().getGlobalDeclarations());
mutant.updateIOList(); // Update io in order to get the right system declarations for the mutant
project.setSystemDeclarations(new SimpleComponentsSystemDeclarations(testModel, mutant));

new Thread(() -> {
try {
Expand Down