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