Search in sources :

Example 11 with ModuleClassMapping

use of de.dagere.peass.dependency.analysis.ModuleClassMapping in project peass by DaGeRe.

the class TestBenchmarkDetection method testMultimoduleBenchmarkDetection.

@Test
public void testMultimoduleBenchmarkDetection() throws FileNotFoundException, IOException, XmlPullParserException {
    JmhTestTransformer jmhTransformer = new JmhTestTransformer(JmhTestConstants.MULTIMODULE_VERSION, JMH_CONFIG);
    ProjectModules modules = new ProjectModules(Arrays.asList(new File[] { new File(JmhTestConstants.MULTIMODULE_VERSION, "base-module"), new File(JmhTestConstants.MULTIMODULE_VERSION, "using-module") }));
    ModuleClassMapping mapping = new ModuleClassMapping(JmhTestConstants.MULTIMODULE_VERSION, modules, new ExecutionConfig());
    TestSet tests = jmhTransformer.findModuleTests(mapping, null, modules);
    Iterator<TestCase> iterator = tests.getTests().iterator();
    TestCase test = iterator.next();
    Assert.assertEquals("de.dagere.peass.ExampleBenchmarkBasic#testMethod", test.getExecutable());
    TestCase testUsing = iterator.next();
    Assert.assertEquals("de.dagere.peass.ExampleBenchmarkUsing#testMethod", testUsing.getExecutable());
}
Also used : JmhTestTransformer(de.dagere.peass.dependency.jmh.JmhTestTransformer) ProjectModules(de.dagere.peass.execution.utils.ProjectModules) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) TestSet(de.dagere.peass.dependency.analysis.data.TestSet) Test(org.junit.jupiter.api.Test)

Example 12 with ModuleClassMapping

use of de.dagere.peass.dependency.analysis.ModuleClassMapping in project peass by DaGeRe.

the class TraceViewGenerator method generateViews.

public boolean generateViews(final ResultsFolders resultsFolders, final TestSet examinedTests) throws IOException, XmlPullParserException, ParseException, ViewNotFoundException, InterruptedException {
    LOG.debug("Generating views for {}", version);
    boolean allWorked = true;
    GitUtils.reset(folders.getProjectFolder());
    ProjectModules modules = dependencyManager.getExecutor().getModules();
    ExecutionConfig executionConfig = dependencyManager.getTestTransformer().getConfig().getExecutionConfig();
    ModuleClassMapping mapping = new ModuleClassMapping(folders.getProjectFolder(), modules, executionConfig);
    List<File> classpathFolders = getClasspathFolders(modules);
    for (TestCase testcase : examinedTests.getTests()) {
        final OneTraceGenerator oneViewGenerator = new OneTraceGenerator(resultsFolders, folders, testcase, traceFileMapping, version, classpathFolders, mapping, kiekerConfig);
        final boolean workedLocal = oneViewGenerator.generateTrace(version);
        allWorked &= workedLocal;
    }
    return allWorked;
}
Also used : ProjectModules(de.dagere.peass.execution.utils.ProjectModules) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) OneTraceGenerator(de.dagere.peass.dependency.traces.OneTraceGenerator) File(java.io.File)

Aggregations

ModuleClassMapping (de.dagere.peass.dependency.analysis.ModuleClassMapping)12 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)7 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)6 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)6 ProjectModules (de.dagere.peass.execution.utils.ProjectModules)5 File (java.io.File)4 Test (org.junit.jupiter.api.Test)4 JmhTestTransformer (de.dagere.peass.dependency.jmh.JmhTestTransformer)3 ProjectChanges (de.dagere.peass.analysis.changes.ProjectChanges)2 StatisticsConfig (de.dagere.peass.config.StatisticsConfig)2 KiekerResultManager (de.dagere.peass.dependency.KiekerResultManager)2 PeassFolders (de.dagere.peass.folders.PeassFolders)2 GitCommit (de.dagere.peass.vcs.GitCommit)2 LinkedList (java.util.LinkedList)2 Test (org.junit.Test)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 Change (de.dagere.peass.analysis.changes.Change)1 AnalyseFullData (de.dagere.peass.analysis.measurement.AnalyseFullData)1 ProjectStatistics (de.dagere.peass.analysis.measurement.ProjectStatistics)1 KiekerConfig (de.dagere.peass.config.KiekerConfig)1