use of de.dagere.peass.analysis.measurement.ProjectStatistics 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.analysis.measurement.ProjectStatistics in project peass by DaGeRe.
the class TestChangedIterationReading method testChangedIterationReading.
@Test
public void testChangedIterationReading() throws InterruptedException {
VersionComparator.setVersions(Arrays.asList(new GitCommit("a23e385264c31def8dcda86c3cf64faa698c62d8", null, null, null), new GitCommit("33ce17c04b5218c25c40137d4d09f40fbb3e4f0f", null, null, null)));
ProjectStatistics statistics = new ProjectStatistics();
AnalyseFullData afd = new AnalyseFullData(new File("target/changes.json"), statistics, null, new StatisticsConfig());
afd.analyseFolder(new File(DATA_FOLDER, "measurement_a23e385264c31def8dcda86c3cf64faa698c62d8_33ce17c04b5218c25c40137d4d09f40fbb3e4f0f/measurements"));
TestcaseStatistic testcaseStatistic = statistics.getStatistics().get("a23e385264c31def8dcda86c3cf64faa698c62d8").get(new TestCase("de.test.CalleeTest#onlyCallMethod2"));
System.out.println(testcaseStatistic);
System.out.println(testcaseStatistic.getDeviationCurrent());
System.out.println(testcaseStatistic.getDeviationOld());
MatcherAssert.assertThat(testcaseStatistic.getDeviationCurrent(), Matchers.lessThan(800000d));
MatcherAssert.assertThat(testcaseStatistic.getDeviationOld(), Matchers.lessThan(800000d));
}
use of de.dagere.peass.analysis.measurement.ProjectStatistics in project peass-ci-plugin by jenkinsci.
the class TestMeasureVersionAction method testPrefix.
@Test
public void testPrefix() {
final ProjectChanges changes = getChanges();
HashMap<String, HistogramValues> measurements = new HashMap<String, HistogramValues>();
measurements.put("de.package.ClassA#method1", null);
measurements.put("de.package.ClassA#method2", null);
measurements.put("de.package.ClassB#method2", null);
measurements.put("de.package.otherpackage.ClassC#method2", null);
MeasureVersionAction action = new MeasureVersionAction(new MeasurementConfig(5), changes.getVersion("1"), new ProjectStatistics(), new HashMap<>(), measurements, new HashMap<>());
Assert.assertEquals("ClassA", action.getReducedName("de.package.ClassA"));
Assert.assertEquals("otherpackage.ClassC", action.getReducedName("de.package.otherpackage.ClassC"));
}
use of de.dagere.peass.analysis.measurement.ProjectStatistics in project peass-ci-plugin by jenkinsci.
the class TestMeasureVersionAction method testIsChanged.
@Test
public void testIsChanged() {
final ProjectChanges changes = getChanges();
MeasureVersionAction action = new MeasureVersionAction(new MeasurementConfig(5), changes.getVersion("1"), new ProjectStatistics(), new HashMap<>(), new HashMap<>(), new HashMap<>());
Assert.assertTrue(action.testIsChanged("de.package.ClassA#method1"));
Assert.assertTrue(action.testIsChanged("de.package.ClassA#method2"));
Assert.assertTrue(action.testIsChanged("de.package.ClassB#method2"));
}
use of de.dagere.peass.analysis.measurement.ProjectStatistics in project peass-ci-plugin by jenkinsci.
the class TestStatisticsReading method testTestcaseNaming.
@Test
public void testTestcaseNaming() throws JsonParseException, JsonMappingException, IOException {
File statisticsFile = new File("src/test/resources/statistics.json");
Constants.OBJECTMAPPER.registerModules(new SimpleModule().addKeyDeserializer(TestCase.class, new TestcaseKeyDeserializer()));
ProjectStatistics statistics = Constants.OBJECTMAPPER.readValue(statisticsFile, ProjectStatistics.class);
Map<TestCase, TestcaseStatistic> testcase = statistics.getStatistics().values().iterator().next();
for (TestCase test : testcase.keySet()) {
MatcherAssert.assertThat(test.getClazz(), Matchers.not(Matchers.containsString(" ")));
}
}
Aggregations