Search in sources :

Example 1 with TestExecutor

use of de.dagere.peass.execution.utils.TestExecutor 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);
}
Also used : TestExecutor(de.dagere.peass.execution.utils.TestExecutor) TestTransformer(de.dagere.peass.testtransformation.TestTransformer) AnalyseFullData(de.dagere.peass.analysis.measurement.AnalyseFullData) ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping) ProjectStatistics(de.dagere.peass.analysis.measurement.ProjectStatistics)

Example 2 with TestExecutor

use of de.dagere.peass.execution.utils.TestExecutor in project peass by DaGeRe.

the class DependencyTester method runOnce.

public void runOnce(final TestCase testcase, final String version, final int vmid, final File logFolder) throws IOException, InterruptedException, JAXBException, XmlPullParserException {
    final TestExecutor testExecutor = getExecutor(folders, version);
    final OnceRunner runner = new OnceRunner(folders, testExecutor, getCurrentOrganizer(), this);
    runner.runOnce(testcase, version, vmid, logFolder);
}
Also used : TestExecutor(de.dagere.peass.execution.utils.TestExecutor)

Example 3 with TestExecutor

use of de.dagere.peass.execution.utils.TestExecutor 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;
}
Also used : TestExecutor(de.dagere.peass.execution.utils.TestExecutor) TestTransformer(de.dagere.peass.testtransformation.TestTransformer)

Example 4 with TestExecutor

use of de.dagere.peass.execution.utils.TestExecutor in project peass by DaGeRe.

the class TestDependencyManager method testBigFolderDeletion.

@Test
public void testBigFolderDeletion() throws IOException, InterruptedException, XmlPullParserException {
    final PeassFolders folders = new PeassFolders(TestConstants.CURRENT_FOLDER);
    final TestExecutor testExecutorMock = Mockito.mock(TestExecutor.class);
    final File testFolder = new File(folders.getTempMeasurementFolder(), "MyTestClass/15231312");
    final File rubishFile = new File(testFolder, "myRubish.txt");
    prepareMock(folders, testExecutorMock, testFolder, rubishFile);
    JUnitTestTransformer transformer = new JUnitTestTransformer(folders.getProjectFolder(), new MeasurementConfig(5));
    Mockito.when(testExecutorMock.getTestTransformer()).thenReturn(transformer);
    DependencyManager manager = new DependencyManager(testExecutorMock, folders);
    manager.setDeleteFolderSize(1);
    manager.initialyGetTraces("1");
    Assert.assertFalse(rubishFile.exists());
    Assert.assertFalse(testFolder.exists());
}
Also used : TestExecutor(de.dagere.peass.execution.utils.TestExecutor) MeasurementConfig(de.dagere.peass.config.MeasurementConfig) JUnitTestTransformer(de.dagere.peass.testtransformation.JUnitTestTransformer) File(java.io.File) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 5 with TestExecutor

use of de.dagere.peass.execution.utils.TestExecutor in project peass by DaGeRe.

the class TestExecutorCreator method testMavenExecutorCreation.

@Test
public void testMavenExecutorCreation() throws IOException {
    File pomFile = new File(temporaryFolder, "pom.xml");
    FileUtils.touch(pomFile);
    TestExecutor executor = createExecutor("default", Mockito.mock(JUnitTestTransformer.class));
    MatcherAssert.assertThat(executor, IsInstanceOf.instanceOf(MavenTestExecutor.class));
}
Also used : TestExecutor(de.dagere.peass.execution.utils.TestExecutor) MavenTestExecutor(de.dagere.peass.execution.maven.pom.MavenTestExecutor) GradleTestExecutor(de.dagere.peass.execution.gradle.GradleTestExecutor) MavenTestExecutor(de.dagere.peass.execution.maven.pom.MavenTestExecutor) JUnitTestTransformer(de.dagere.peass.testtransformation.JUnitTestTransformer) File(java.io.File) Test(org.junit.jupiter.api.Test)

Aggregations

TestExecutor (de.dagere.peass.execution.utils.TestExecutor)22 Test (org.junit.jupiter.api.Test)10 JUnitTestTransformer (de.dagere.peass.testtransformation.JUnitTestTransformer)9 File (java.io.File)8 PeassFolders (de.dagere.peass.folders.PeassFolders)7 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)6 GradleTestExecutor (de.dagere.peass.execution.gradle.GradleTestExecutor)5 MavenTestExecutor (de.dagere.peass.execution.maven.pom.MavenTestExecutor)5 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)5 TestTransformer (de.dagere.peass.testtransformation.TestTransformer)5 InvocationOnMock (org.mockito.invocation.InvocationOnMock)4 JmhTestTransformer (de.dagere.peass.dependency.jmh.JmhTestTransformer)3 Kopemedata (de.dagere.kopeme.generated.Kopemedata)2 Result (de.dagere.kopeme.generated.Result)2 TestcaseType (de.dagere.kopeme.generated.TestcaseType)2 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)2 JmhTestExecutor (de.dagere.peass.dependency.jmh.JmhTestExecutor)2 IOException (java.io.IOException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 JAXBException (javax.xml.bind.JAXBException)2