use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.
the class TestNodePreparatorTreeStructure method testColorSettingRemoved.
@Test
public void testColorSettingRemoved() {
final MeasuredNode childNode = new MeasuredNode("Call#myMethod", "public void Call.myMethod()", null);
childNode.setStatistic(new TestcaseStatistic(5.0, Double.NaN, 0.01, Double.NaN, 15, -3, true, 10, 0));
rootNode.getChildren().add(childNode);
csd.setNodes(rootNode);
NodePreparator preparator = new NodePreparator(csd);
preparator.prepare();
GraphNode root = preparator.getRootNode();
Assert.assertEquals(NodePreparator.COLOR_SLOWER, root.getColor());
Assert.assertEquals(NodePreparator.COLOR_SLOWER, root.getChildren().get(0).getColor());
}
use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.
the class TestNodePreperatorColor method prepareTree.
private void prepareTree() {
final TestcaseStatistic statistic = new TestcaseStatistic(1, 2, 0.1, 0.1, 100, 3, true, 3, 5);
final MeasuredNode child1 = new MeasuredNode("ClassA.method1", "public void ClassA.method1()", "public void ClassA.method1()");
final MeasuredNode child2 = new MeasuredNode("ClassA.method2", "public void ClassA.method2()", "public void ClassA.method2()");
root.setChilds(Arrays.asList(new MeasuredNode[] { child1, child2 }));
final MeasuredNode child11 = new MeasuredNode("ClassA.method11", "public void ClassA.method11()", "public void ClassA.method11()");
final MeasuredNode child12 = new MeasuredNode("ClassA.method12", "public void ClassA.method12()", "public void ClassA.method12()");
final MeasuredNode child13 = new MeasuredNode("ClassA.method13", "public void ClassA.method13()", "public void ClassA.method13()");
child1.setChilds(Arrays.asList(new MeasuredNode[] { child11, child12, child13 }));
setChildrenStatistic(statistic, root);
}
use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.
the class LevelCauseSearcherTest method testCauseSearchingConstantLevels.
@Test
public void testCauseSearchingConstantLevels() throws InterruptedException, IOException, IllegalStateException, XmlPullParserException, AnalysisConfigurationException, ViewNotFoundException, JAXBException {
buildRoots();
CauseSearcherConfig config = new CauseSearcherConfig(new TestCase("Test#test"), false, 0.1, false, true, RCAStrategy.LEVELWISE, 2);
searchChanges(config);
StrategyTestUtil.checkChanges(changes);
final TestcaseStatistic nodeStatistic = data.getNodes().getStatistic();
final double expectedT = new TTest().t(nodeStatistic.getStatisticsOld(), nodeStatistic.getStatisticsCurrent());
Assert.assertEquals(expectedT, nodeStatistic.getTvalue(), 0.01);
}
use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic 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(" ")));
}
}
use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass-ci-plugin by jenkinsci.
the class TestMeasurementVisualizer method testParameterizedVisualization.
@Test
public void testParameterizedVisualization() {
HashSet<String> tests = new LinkedHashSet<>();
tests.add("de.dagere.peass.ExampleTest#test(JUNIT_PARAMETERIZED-0)");
tests.add("de.dagere.peass.ExampleTest#test(JUNIT_PARAMETERIZED-1)");
File exampleDataFolder = new File("src/test/resources/demo-results-measurements/measurement_a12a0b7f4c162794fca0e7e3fcc6ea3b3a2cbc2b_49f75e8877c2e9b7cf6b56087121a35fdd73ff8b/");
Run run = Mockito.mock(Run.class);
VisualizationFolderManager visualizationFolderManager = Mockito.mock(VisualizationFolderManager.class);
DefaultMeasurementVisualizer visualizer = new DefaultMeasurementVisualizer(exampleDataFolder, "a12a0b7f4c162794fca0e7e3fcc6ea3b3a2cbc2b", run, visualizationFolderManager, tests);
visualizer.visualizeMeasurements();
ArgumentCaptor<MeasurementVisualizationAction> captor = ArgumentCaptor.forClass(MeasurementVisualizationAction.class);
Mockito.verify(run, Mockito.times(2)).addAction(captor.capture());
MeasurementVisualizationAction action1 = captor.getAllValues().get(0);
Assert.assertEquals(action1.getDisplayName(), "measurement_ExampleTest_test(JUNIT_PARAMETERIZED-0)");
MeasurementVisualizationAction action2 = captor.getAllValues().get(1);
Assert.assertEquals(action2.getDisplayName(), "measurement_ExampleTest_test(JUNIT_PARAMETERIZED-1)");
Map<String, TestcaseStatistic> noWarmupStatistics = visualizer.getNoWarmupStatistics();
Assert.assertTrue(noWarmupStatistics.containsKey("de.dagere.peass.ExampleTest#test(JUNIT_PARAMETERIZED-0)"));
Assert.assertTrue(noWarmupStatistics.containsKey("de.dagere.peass.ExampleTest#test(JUNIT_PARAMETERIZED-1)"));
}
Aggregations