-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring: Move TLR, ID & LiSSA to projects in ArDoCo.
- Loading branch information
Showing
656 changed files
with
294 additions
and
377,871 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.github.ardoco.core</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>${revision}</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>pipeline-core</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.github.ardoco.core</groupId> | ||
<artifactId>common</artifactId> | ||
<version>${revision}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.reflections</groupId> | ||
<artifactId>reflections</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>log4j-over-slf4j</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>default-testCompile</id> | ||
<goals> | ||
<goal>testCompile</goal> | ||
</goals> | ||
<phase>test-compile</phase> | ||
<configuration combine.self="override"> | ||
<!-- Enforce compilation of test classes --> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-install-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>install-test-jar</id> | ||
<goals> | ||
<goal>install-file</goal> | ||
</goals> | ||
<phase>install</phase> | ||
<configuration> | ||
<file>${project.build.directory}/${project.build.finalName}-tests.jar</file> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>${project.artifactId}</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>tests</classifier> | ||
<packaging>jar</packaging> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>test-jar</id> | ||
<goals> | ||
<goal>test-jar</goal> | ||
</goals> | ||
<phase>package</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...re/execution/ProjectPipelineDataImpl.java → ...re/execution/ProjectPipelineDataImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 46 additions & 0 deletions
46
...line-core/src/test/java/edu/kit/kastel/mcse/ardoco/core/execution/CodeRunnerBaseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* Licensed under MIT 2023-2024. */ | ||
package edu.kit.kastel.mcse.ardoco.core.execution; | ||
|
||
import java.io.File; | ||
import java.nio.file.Files; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import edu.kit.kastel.mcse.ardoco.core.common.RepositoryHandler; | ||
|
||
public class CodeRunnerBaseTest extends RunnerBaseTest { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(CodeRunnerBaseTest.class); | ||
protected static final String inputCodeRepository = "https://github.com/ArDoCo/TeaStore.git"; | ||
|
||
protected String inputCodeModel = null; | ||
protected static String commitHash = "bdc49020a55cfa97eaabbb25744fefbc2697defa"; | ||
|
||
@BeforeEach | ||
void setupCodeDirectories() throws Exception { | ||
if (inputCodeModel != null) { | ||
logger.debug("Already initialized"); | ||
return; | ||
} | ||
|
||
var inputCodeModelDirectory = new File(directory.toFile(), "code"); | ||
inputCodeModelDirectory.mkdir(); | ||
var inputCodeModel = new File(inputCodeModelDirectory, "codeModel.acm"); | ||
this.getClass().getResourceAsStream("/code/teastore/codeModel.acm").transferTo(Files.newOutputStream(inputCodeModel.toPath())); | ||
this.inputCodeModel = inputCodeModelDirectory.getAbsolutePath(); | ||
|
||
if (System.getenv("testCodeFull") != null) { | ||
var inputCodeModelDirectoryFull = new File(directory.toFile(), "code-full"); | ||
inputCodeModelDirectoryFull.mkdir(); | ||
this.inputCodeModel = inputCodeModelDirectoryFull.getAbsolutePath(); | ||
var successfulClone = RepositoryHandler.shallowCloneRepository(inputCodeRepository, this.inputCodeModel, commitHash); | ||
if (!successfulClone) { | ||
Assertions.fail("Could not clone repository."); | ||
} | ||
} | ||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...re/execution/ConfigurationHelperTest.java → ...re/execution/ConfigurationHelperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
pipeline-core/src/test/java/edu/kit/kastel/mcse/ardoco/core/execution/RunnerBaseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* Licensed under MIT 2023-2024. */ | ||
package edu.kit.kastel.mcse.ardoco.core.execution; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.util.Objects; | ||
|
||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import edu.kit.kastel.mcse.ardoco.core.execution.runner.ArDoCoRunner; | ||
|
||
public class RunnerBaseTest { | ||
private static final Logger logger = LoggerFactory.getLogger(RunnerBaseTest.class); | ||
|
||
protected String outputDir = "../target/testout-" + this.getClass().getSimpleName(); | ||
protected String inputText = null; | ||
protected String inputModelArchitecture = null; | ||
protected String inputModelArchitectureUml = null; | ||
protected String additionalConfigs = null; | ||
protected String projectName = "teastore"; | ||
protected Path directory; | ||
|
||
@BeforeEach | ||
void setupDirectories() throws Exception { | ||
new File(outputDir).mkdirs(); | ||
|
||
if (inputText != null) { | ||
logger.debug("Already initialized"); | ||
return; | ||
} | ||
|
||
this.directory = Files.createTempDirectory("RunnerTest" + this.getClass().getName()); | ||
var inputText = new File(directory.toFile(), "inputText.txt"); | ||
var inputModelArchitecture = new File(directory.toFile(), "inputModelArchitecture.repository"); | ||
var inputModelArchitectureUml = new File(directory.toFile(), "inputModelArchitecture.uml"); | ||
var inputDiagram = new File(directory.toFile(), "teastore-paper.png"); | ||
|
||
var additionalConfigs = new File(directory.toFile(), "additionalConfigs.txt"); | ||
|
||
this.getClass().getResourceAsStream("/teastore.txt").transferTo(Files.newOutputStream(inputText.toPath())); | ||
this.getClass().getResourceAsStream("/teastore.repository").transferTo(Files.newOutputStream(inputModelArchitecture.toPath())); | ||
this.getClass().getResourceAsStream("/teastore.uml").transferTo(Files.newOutputStream(inputModelArchitectureUml.toPath())); | ||
this.getClass().getResourceAsStream("/additionalConfig.txt").transferTo(Files.newOutputStream(additionalConfigs.toPath())); | ||
this.getClass().getResourceAsStream("/teastore-paper.png").transferTo(Files.newOutputStream(inputDiagram.toPath())); | ||
|
||
this.inputText = inputText.getAbsolutePath(); | ||
this.inputModelArchitecture = inputModelArchitecture.getAbsolutePath(); | ||
this.inputModelArchitectureUml = inputModelArchitectureUml.getAbsolutePath(); | ||
this.additionalConfigs = additionalConfigs.getAbsolutePath(); | ||
|
||
Runtime.getRuntime().addShutdownHook(new Thread(() -> { | ||
try { | ||
// Recursively delete files from directory | ||
Files.walk(directory).sorted((a, b) -> -a.compareTo(b)).forEach(p -> { | ||
try { | ||
Files.delete(p); | ||
} catch (IOException e) { | ||
logger.warn("Error when cleaning up!", e); | ||
} | ||
}); | ||
} catch (IOException e) { | ||
logger.warn("Error when cleaning up!", e); | ||
} | ||
})); | ||
} | ||
|
||
@AfterEach | ||
void cleanUp() { | ||
for (File file : Objects.requireNonNull(new File(outputDir).listFiles())) { | ||
if (!file.getName().equals(".gitkeep")) { | ||
try { | ||
Files.delete(file.toPath()); | ||
} catch (IOException e) { | ||
logger.warn("Error when cleaning up!", e); | ||
} | ||
} | ||
} | ||
} | ||
|
||
@SuppressWarnings("java:S5960") | ||
@Test | ||
@DisplayName("Test SetUp") | ||
void testInput() { | ||
File inputTextFile = new File(inputText); | ||
File inputModelArchitectureFile = new File(inputModelArchitecture); | ||
File inputModelArchitectureUmlFile = new File(inputModelArchitectureUml); | ||
File outputDirFile = new File(outputDir); | ||
File additionalConfigsFile = new File(additionalConfigs); | ||
|
||
Assertions.assertAll(// | ||
() -> Assertions.assertTrue(inputTextFile.exists()),// | ||
() -> Assertions.assertTrue(inputModelArchitectureFile.exists()),// | ||
() -> Assertions.assertTrue(inputModelArchitectureUmlFile.exists()),// | ||
() -> Assertions.assertTrue(outputDirFile.exists()),// | ||
() -> Assertions.assertTrue(additionalConfigsFile.exists())// | ||
); | ||
} | ||
|
||
protected void testRunnerAssertions(ArDoCoRunner runner) { | ||
Assertions.assertAll(// | ||
() -> Assertions.assertNotNull(runner),// | ||
() -> Assertions.assertTrue(runner.isSetUp())// | ||
); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.