@Test void testUpdatingAvailableBuildsFromNoSuccessfullyImported() { List<BranchBuilds> branchBuilds = new ArrayList<>(Arrays.asList( createBranchBuilds("trunk", build5, build1, build6, build3, build7), createBranchBuilds("branch", build2, build4))); Map<BuildIdentifier, BuildImportSummary> buildImportSummaries = createBuildImportSummaries(branchBuilds); availableBuildsList.updateBuildsWithSuccessfullyImportedBuilds(branchBuilds, buildImportSummaries); assertNumberOfBuilds("trunk", 0); assertNumberOfBuilds("branch", 0); }
public synchronized void updateBuildsWithSuccessfullyImportedBuilds(final List<BranchBuilds> branchBuildsList, final Map<BuildIdentifier, BuildImportSummary> buildImportSummaries) { List<BranchBuilds> result = new ArrayList<BranchBuilds>(); for (BranchBuilds branchBuilds : branchBuildsList) { BranchBuilds resultBranchBuilds = new BranchBuilds(); resultBranchBuilds.setBranch(branchBuilds.getBranch()); List<BuildLink> resultBuilds = new ArrayList<BuildLink>(); resultBranchBuilds.setBuilds(resultBuilds); for (BuildLink buildLink : branchBuilds.getBuilds()) { BuildIdentifier buildIdentifier = new BuildIdentifier(branchBuilds.getBranch().getName(), buildLink .getBuild().getName()); BuildImportSummary summary = buildImportSummaries.get(buildIdentifier); if (summary != null && summary.getStatus().isSuccess()) { resultBuilds.add(buildLink); } } updateAliasesForRecentBuilds(resultBranchBuilds); BuildSorter.sort(resultBranchBuilds.getBuilds()); result.add(resultBranchBuilds); } updateBuilds(result); logAvailableBuildsInformation(); }
AvailableBuildsList { public synchronized void updateBuildsWithSuccessfullyImportedBuilds(final List<BranchBuilds> branchBuildsList, final Map<BuildIdentifier, BuildImportSummary> buildImportSummaries) { List<BranchBuilds> result = new ArrayList<BranchBuilds>(); for (BranchBuilds branchBuilds : branchBuildsList) { BranchBuilds resultBranchBuilds = new BranchBuilds(); resultBranchBuilds.setBranch(branchBuilds.getBranch()); List<BuildLink> resultBuilds = new ArrayList<BuildLink>(); resultBranchBuilds.setBuilds(resultBuilds); for (BuildLink buildLink : branchBuilds.getBuilds()) { BuildIdentifier buildIdentifier = new BuildIdentifier(branchBuilds.getBranch().getName(), buildLink .getBuild().getName()); BuildImportSummary summary = buildImportSummaries.get(buildIdentifier); if (summary != null && summary.getStatus().isSuccess()) { resultBuilds.add(buildLink); } } updateAliasesForRecentBuilds(resultBranchBuilds); BuildSorter.sort(resultBranchBuilds.getBuilds()); result.add(resultBranchBuilds); } updateBuilds(result); logAvailableBuildsInformation(); } }
AvailableBuildsList { public synchronized void updateBuildsWithSuccessfullyImportedBuilds(final List<BranchBuilds> branchBuildsList, final Map<BuildIdentifier, BuildImportSummary> buildImportSummaries) { List<BranchBuilds> result = new ArrayList<BranchBuilds>(); for (BranchBuilds branchBuilds : branchBuildsList) { BranchBuilds resultBranchBuilds = new BranchBuilds(); resultBranchBuilds.setBranch(branchBuilds.getBranch()); List<BuildLink> resultBuilds = new ArrayList<BuildLink>(); resultBranchBuilds.setBuilds(resultBuilds); for (BuildLink buildLink : branchBuilds.getBuilds()) { BuildIdentifier buildIdentifier = new BuildIdentifier(branchBuilds.getBranch().getName(), buildLink .getBuild().getName()); BuildImportSummary summary = buildImportSummaries.get(buildIdentifier); if (summary != null && summary.getStatus().isSuccess()) { resultBuilds.add(buildLink); } } updateAliasesForRecentBuilds(resultBranchBuilds); BuildSorter.sort(resultBranchBuilds.getBuilds()); result.add(resultBranchBuilds); } updateBuilds(result); logAvailableBuildsInformation(); }  }
AvailableBuildsList { public synchronized void updateBuildsWithSuccessfullyImportedBuilds(final List<BranchBuilds> branchBuildsList, final Map<BuildIdentifier, BuildImportSummary> buildImportSummaries) { List<BranchBuilds> result = new ArrayList<BranchBuilds>(); for (BranchBuilds branchBuilds : branchBuildsList) { BranchBuilds resultBranchBuilds = new BranchBuilds(); resultBranchBuilds.setBranch(branchBuilds.getBranch()); List<BuildLink> resultBuilds = new ArrayList<BuildLink>(); resultBranchBuilds.setBuilds(resultBuilds); for (BuildLink buildLink : branchBuilds.getBuilds()) { BuildIdentifier buildIdentifier = new BuildIdentifier(branchBuilds.getBranch().getName(), buildLink .getBuild().getName()); BuildImportSummary summary = buildImportSummaries.get(buildIdentifier); if (summary != null && summary.getStatus().isSuccess()) { resultBuilds.add(buildLink); } } updateAliasesForRecentBuilds(resultBranchBuilds); BuildSorter.sort(resultBranchBuilds.getBuilds()); result.add(resultBranchBuilds); } updateBuilds(result); logAvailableBuildsInformation(); }  synchronized List<BranchBuilds> getBranchBuildsList(); synchronized BranchBuilds getBranchBuilds(final String branchName); synchronized void updateBuildsWithSuccessfullyImportedBuilds(final List<BranchBuilds> branchBuildsList,
			final Map<BuildIdentifier, BuildImportSummary> buildImportSummaries); synchronized void refreshAliases(); synchronized void addImportedBuild(final BuildImportSummary buildImportSummary); void removeBuild(final BuildIdentifier buildIdentifier); String resolveAliasBuildName(final String branchName, final String buildName); void logAvailableBuildsInformation(); }
AvailableBuildsList { public synchronized void updateBuildsWithSuccessfullyImportedBuilds(final List<BranchBuilds> branchBuildsList, final Map<BuildIdentifier, BuildImportSummary> buildImportSummaries) { List<BranchBuilds> result = new ArrayList<BranchBuilds>(); for (BranchBuilds branchBuilds : branchBuildsList) { BranchBuilds resultBranchBuilds = new BranchBuilds(); resultBranchBuilds.setBranch(branchBuilds.getBranch()); List<BuildLink> resultBuilds = new ArrayList<BuildLink>(); resultBranchBuilds.setBuilds(resultBuilds); for (BuildLink buildLink : branchBuilds.getBuilds()) { BuildIdentifier buildIdentifier = new BuildIdentifier(branchBuilds.getBranch().getName(), buildLink .getBuild().getName()); BuildImportSummary summary = buildImportSummaries.get(buildIdentifier); if (summary != null && summary.getStatus().isSuccess()) { resultBuilds.add(buildLink); } } updateAliasesForRecentBuilds(resultBranchBuilds); BuildSorter.sort(resultBranchBuilds.getBuilds()); result.add(resultBranchBuilds); } updateBuilds(result); logAvailableBuildsInformation(); }  synchronized List<BranchBuilds> getBranchBuildsList(); synchronized BranchBuilds getBranchBuilds(final String branchName); synchronized void updateBuildsWithSuccessfullyImportedBuilds(final List<BranchBuilds> branchBuildsList,
			final Map<BuildIdentifier, BuildImportSummary> buildImportSummaries); synchronized void refreshAliases(); synchronized void addImportedBuild(final BuildImportSummary buildImportSummary); void removeBuild(final BuildIdentifier buildIdentifier); String resolveAliasBuildName(final String branchName, final String buildName); void logAvailableBuildsInformation();  }