use of de.dagere.peass.testtransformation.TestTransformer in project peass by DaGeRe.
the class ContinuousExecutor method analyzeMeasurements.
private void analyzeMeasurements(final File measurementFolder) throws InterruptedException, IOException, JsonGenerationException, JsonMappingException, XmlPullParserException {
final ProjectStatistics statistics = new ProjectStatistics();
TestTransformer testTransformer = ExecutorCreator.createTestTransformer(folders, measurementConfig.getExecutionConfig(), measurementConfig);
TestExecutor executor = ExecutorCreator.createExecutor(folders, testTransformer, env);
ModuleClassMapping mapping = new ModuleClassMapping(folders.getProjectFolder(), executor.getModules(), measurementConfig.getExecutionConfig());
final AnalyseFullData afd = new AnalyseFullData(resultsFolders.getChangeFile(), statistics, mapping, measurementConfig.getStatisticsConfig());
afd.analyseFolder(measurementFolder);
Constants.OBJECTMAPPER.writeValue(resultsFolders.getStatisticsFile(), statistics);
}
use of de.dagere.peass.testtransformation.TestTransformer in project peass by DaGeRe.
the class DependencyTester method getExecutor.
protected synchronized TestExecutor getExecutor(final PeassFolders currentFolders, final String version) {
TestTransformer transformer = ExecutorCreator.createTestTransformer(currentFolders, configuration.getExecutionConfig(), configuration);
final TestExecutor testExecutor = ExecutorCreator.createExecutor(currentFolders, transformer, env);
return testExecutor;
}
use of de.dagere.peass.testtransformation.TestTransformer in project peass by DaGeRe.
the class TestExecutorCreation method testMavenExecutorCreation.
@Test
public void testMavenExecutorCreation() {
ExecutionConfig config = new ExecutionConfig();
TestTransformer testTransformer = ExecutorCreator.createTestTransformer(Mockito.mock(PeassFolders.class), config, new KiekerConfig(true));
Assert.assertNotNull(testTransformer);
}
use of de.dagere.peass.testtransformation.TestTransformer in project peass by DaGeRe.
the class IndirectSubclass method testSubsubclass.
@Test
public void testSubsubclass() {
TestTransformer transformer = Mockito.mock(TestTransformer.class);
MeasurementConfig value = new MeasurementConfig(2);
value.getExecutionConfig().setTestExecutor("de.dagere.peass.dependency.IndirectSubclass");
Mockito.when(transformer.getConfig()).thenReturn(value);
TestExecutor executor = ExecutorCreator.createExecutor(null, transformer, new EnvironmentVariables());
Assert.assertNotNull(executor);
}
use of de.dagere.peass.testtransformation.TestTransformer in project peass by DaGeRe.
the class ExecutorCreator method createTestTransformer.
public static TestTransformer createTestTransformer(final PeassFolders folders, final ExecutionConfig executionConfig, final KiekerConfig kiekerConfig) {
try {
Class<?> testTransformerClass = Class.forName(executionConfig.getTestTransformer());
if (!Arrays.asList(testTransformerClass.getInterfaces()).contains(TestTransformer.class)) {
throw new RuntimeException("TestTransformer needs to be implemented by " + executionConfig.getTestTransformer());
}
Constructor<?> constructor = testTransformerClass.getConstructor(File.class, ExecutionConfig.class, KiekerConfig.class);
TestTransformer transformer = (TestTransformer) constructor.newInstance(folders.getProjectFolder(), executionConfig, kiekerConfig);
return transformer;
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
LOG.debug("Initialization was not possible; this should be thrown uncatched");
e.printStackTrace();
throw new RuntimeException(e);
}
}
Aggregations