@Test void testCompareMultipleScenariosRemoved() { List<Scenario> baseScenarios = getScenarios(SCENARIO_NAME_2); List<Scenario> comparisonScenarios = getScenarios(SCENARIO_NAME_1, SCENARIO_NAME_2, SCENARIO_NAME_3); Scenario removedScenario1 = comparisonScenarios.get(0); Scenario removedScenario2 = comparisonScenarios.get(2); ScenarioDiffInfo scenarioDiffInfo = getScenarioDiffInfo(0, 0, 0, 0); initMocks(baseScenarios, comparisonScenarios, scenarioDiffInfo); UseCaseDiffInfo useCaseDiffInfo = scenarioComparator.compare(USE_CASE_NAME); double expectedChangeRate = 200.0 / 3.0; assertEquals(expectedChangeRate, useCaseDiffInfo.getChangeRate(), 0.0); assertEquals(0, useCaseDiffInfo.getAdded()); assertEquals(0, useCaseDiffInfo.getChanged()); assertEquals(2, useCaseDiffInfo.getRemoved()); assertTrue(useCaseDiffInfo.getAddedElements().isEmpty()); assertEquals(removedScenario1.getName(), useCaseDiffInfo.getRemovedElements().get(0).getScenario().getName()); assertEquals(removedScenario2.getName(), useCaseDiffInfo.getRemovedElements().get(1).getScenario().getName()); }
public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; }
ScenarioComparator extends AbstractStructureComparator<Scenario, String, ScenarioSummary> { public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; } }
ScenarioComparator extends AbstractStructureComparator<Scenario, String, ScenarioSummary> { public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; } ScenarioComparator(ComparisonParameters parameters); }
ScenarioComparator extends AbstractStructureComparator<Scenario, String, ScenarioSummary> { public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; } ScenarioComparator(ComparisonParameters parameters); UseCaseDiffInfo compare(final String baseUseCaseName); }
ScenarioComparator extends AbstractStructureComparator<Scenario, String, ScenarioSummary> { public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; } ScenarioComparator(ComparisonParameters parameters); UseCaseDiffInfo compare(final String baseUseCaseName);  }