Merge branch 'stable-2.11'

* stable-2.11:
  Add "Uploaded patch set 1" message for the UI changes
  Disallow publish change edit when user has not signed CLA
  Subscribe to proper project when nested projects exist
  SideBySide: Fix Render=Slow to disable on huge files
  Prefer JavaScript clipboard API if available
  Hide hasFlash inside of UserAgent.Flash.isInstalled
  Remove PluginSafeDialogBox, PluginSafePopupPanel
  Replace vanilla parboiled with grappa library
  Update Guice to version 4.0

Change-Id: I2cd443f9edb755cf69cdf055f26d4936a838a49e
This commit is contained in:
David Pursehouse
2015-08-03 22:47:41 +09:00
8 changed files with 77 additions and 5 deletions

View File

@@ -190,6 +190,28 @@ public class SubmoduleSectionParserTest extends LocalDiskRepositoryTestCase {
expectedSubscriptions);
}
@Test
public void testSubmodulesParseWithSubProjectFound() throws Exception {
Map<String, SubmoduleSection> sectionsToReturn = new TreeMap<>();
sectionsToReturn.put("a/b", new SubmoduleSection(
"ssh://localhost/a/b", "a/b", "."));
Map<String, String> reposToBeFound = new HashMap<>();
reposToBeFound.put("a/b", "a/b");
reposToBeFound.put("b", "b");
Branch.NameKey superBranchNameKey =
new Branch.NameKey(new Project.NameKey("super-project"),
"refs/heads/master");
Set<SubmoduleSubscription> expectedSubscriptions = Sets.newHashSet();
expectedSubscriptions
.add(new SubmoduleSubscription(superBranchNameKey, new Branch.NameKey(
new Project.NameKey("a/b"), "refs/heads/master"), "a/b"));
execute(superBranchNameKey, sectionsToReturn, reposToBeFound,
expectedSubscriptions);
}
private void execute(final Branch.NameKey superProjectBranch,
final Map<String, SubmoduleSection> sectionsToReturn,
final Map<String, String> reposToBeFound,
@@ -217,10 +239,9 @@ public class SubmoduleSectionParserTest extends LocalDiskRepositoryTestCase {
projectNameCandidate = projectNameCandidate.substring(0, //
projectNameCandidate.length() - Constants.DOT_GIT_EXT.length());
}
if (projectNameCandidate.equals(reposToBeFound.get(id))) {
if (reposToBeFound.containsValue(projectNameCandidate)) {
expect(projectCache.get(new Project.NameKey(projectNameCandidate)))
.andReturn(createNiceMock(ProjectState.class));
break;
} else {
expect(projectCache.get(new Project.NameKey(projectNameCandidate)))
.andReturn(null);