Search in sources :

Example 1 with KiekerResultManager

use of de.dagere.peass.dependency.KiekerResultManager in project peass by DaGeRe.

the class TestPeassFilter method testExecution.

@Test
public void testExecution() throws ViewNotFoundException, IOException, XmlPullParserException, InterruptedException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
    Assume.assumeFalse(EnvironmentVariables.isWindows());
    PeassFolders folders = new PeassFolders(CURRENT);
    final KiekerResultManager manager = new KiekerResultManager(folders, new ExecutionConfig(5), new KiekerConfig(true), new EnvironmentVariables());
    final TestSet testset = new TestSet();
    final TestCase testcase = new TestCase("defaultpackage.TestMe", "testMe", "");
    testset.addTest(testcase);
    final ModuleClassMapping mapping = new ModuleClassMapping(manager.getExecutor());
    final List<TraceElement> referenceTrace = regenerateTrace(manager, testset, testcase, mapping, 0);
    for (int i = 1; i <= 3; i++) {
        final List<TraceElement> compareTrace = regenerateTrace(manager, testset, testcase, mapping, i);
        checkRegeneratedTrace(referenceTrace, compareTrace);
    }
}
Also used : EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping) TraceElement(de.dagere.peass.dependency.analysis.data.TraceElement) KiekerResultManager(de.dagere.peass.dependency.KiekerResultManager) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) TestSet(de.dagere.peass.dependency.analysis.data.TestSet) Test(org.junit.jupiter.api.Test)

Example 2 with KiekerResultManager

use of de.dagere.peass.dependency.KiekerResultManager in project peass by DaGeRe.

the class TraceGeneratorStarter method runTests.

private KiekerResultManager runTests(final String newestVersion, final TestSet tests, final PeassFolders folders, final ExecutionConfig executionConfig) throws IOException, XmlPullParserException, InterruptedException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
    KiekerResultManager resultsManager = new KiekerResultManager(folders, executionConfig, new KiekerConfig(true), new EnvironmentVariables());
    resultsManager.executeKoPeMeKiekerRun(tests, newestVersion, folders.getDependencyLogFolder());
    return resultsManager;
}
Also used : EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) KiekerResultManager(de.dagere.peass.dependency.KiekerResultManager) KiekerConfig(de.dagere.peass.config.KiekerConfig)

Example 3 with KiekerResultManager

use of de.dagere.peass.dependency.KiekerResultManager in project peass by DaGeRe.

the class TraceGeneratorStarter method call.

@Override
public Void call() throws Exception {
    StaticTestSelection staticTestSelection = Constants.OBJECTMAPPER.readValue(staticSelectionFile, StaticTestSelection.class);
    String newestVersion = staticTestSelection.getNewestVersion();
    VersionStaticSelection version = staticTestSelection.getVersions().get(newestVersion);
    TestSet tests = version.getTests();
    ExecutionConfig executionConfig = executionMixin.getExecutionConfig();
    NonIncludedTestRemover.removeNotIncluded(tests, executionConfig);
    GitUtils.reset(projectFolder);
    PeassFolders folders = new PeassFolders(projectFolder);
    KiekerResultManager resultsManager = runTests(newestVersion, tests, folders, executionConfig);
    LOG.info("Analyzing tests: {}", tests.getTests());
    mapping = new ModuleClassMapping(folders.getProjectFolder(), resultsManager.getExecutor().getModules(), executionConfig);
    for (TestCase testcase : tests.getTests()) {
        writeTestcase(newestVersion, folders, resultsManager, testcase);
    }
    return null;
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping) VersionStaticSelection(de.dagere.peass.dependency.persistence.VersionStaticSelection) KiekerResultManager(de.dagere.peass.dependency.KiekerResultManager) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) TestSet(de.dagere.peass.dependency.analysis.data.TestSet) PeassFolders(de.dagere.peass.folders.PeassFolders)

Example 4 with KiekerResultManager

use of de.dagere.peass.dependency.KiekerResultManager in project peass by DaGeRe.

the class TraceGettingIT method executeTraceGetting.

private void executeTraceGetting(final File project, final String githash) throws IOException, ParseException, ViewNotFoundException, XmlPullParserException, InterruptedException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
    DependencyDetectorTestUtil.init(project);
    PeassFolders folders = new PeassFolders(TestConstants.CURRENT_FOLDER);
    final KiekerResultManager tracereader = new KiekerResultManager(folders, new ExecutionConfig(5), new KiekerConfig(true), new EnvironmentVariables());
    final TestSet testset = new TestSet();
    testset.addTest(new TestCase("viewtest.TestMe", "test", ""));
    tracereader.getExecutor().loadClasses();
    tracereader.executeKoPeMeKiekerRun(testset, "1", folders.getDependencyLogFolder());
    LOG.debug("Trace-Analysis..");
    final boolean worked = analyseTrace(new TestCase("viewtest.TestMe", "test", ""), VIEWS_FOLDER_TEST, new HashMap<>(), githash, tracereader.getXMLFileFolder(TestConstants.CURRENT_FOLDER));
    Assert.assertEquals(true, worked);
    tracereader.deleteTempFiles();
}
Also used : EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) KiekerResultManager(de.dagere.peass.dependency.KiekerResultManager) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) TestSet(de.dagere.peass.dependency.analysis.data.TestSet)

Aggregations

KiekerResultManager (de.dagere.peass.dependency.KiekerResultManager)4 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)3 KiekerConfig (de.dagere.peass.config.KiekerConfig)3 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)3 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)3 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)3 PeassFolders (de.dagere.peass.folders.PeassFolders)3 ModuleClassMapping (de.dagere.peass.dependency.analysis.ModuleClassMapping)2 TraceElement (de.dagere.peass.dependency.analysis.data.TraceElement)1 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)1 VersionStaticSelection (de.dagere.peass.dependency.persistence.VersionStaticSelection)1 Test (org.junit.jupiter.api.Test)1