Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #56 from jglick/UnsupportedOperationException-JENK…
Browse files Browse the repository at this point in the history
…INS-39520

[JENKINS-39520] ExtensionList.removeAll is unimplemented
  • Loading branch information
jglick committed Nov 4, 2016
2 parents 035c7e2 + b95b07f commit f5c8342
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Expand Up @@ -150,7 +150,9 @@ private static void doAddSpecificDescriptors() {
}
}
LOGGER.log(Level.FINE, "clearing {0}", old);
all().removeAll(old);
for (CustomOrganizationFolderDescriptor d : old) {
all().remove(d);
}
if (ExtensionList.lookup(MultiBranchProjectFactoryDescriptor.class).isEmpty()) {
LOGGER.fine("no MultiBranchProjectFactoryDescriptor");
return; // nothing like workflow-multibranch installed, so do not even offer this option
Expand Down
Expand Up @@ -32,6 +32,7 @@
import hudson.model.View;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
Expand Down Expand Up @@ -112,6 +113,17 @@ public void dynamicLoadReversed() throws Exception {
assertEquals(Collections.singletonList("MockNavigator"), newItemTypes());
}

@Issue("JENKINS-39520")
@SuppressWarnings("deprecation") // ExtensionList.add simulating dynamic installation
@Test
public void dynamicLoad2() throws Exception {
assertEquals(Collections.emptyList(), newItemTypes());
ExtensionList.lookup(SCMNavigatorDescriptor.class).add(new SomeNavigatorNoFactoryInstalledDescriptor());
ExtensionList.lookup(MultiBranchProjectFactoryDescriptor.class).add(new SomeNavigatorSomeFactoryInstalledDescriptor2());
ExtensionList.lookup(SCMNavigatorDescriptor.class).add(new SomeNavigatorSomeFactoryInstalledDescriptor1());
assertEquals(Arrays.asList("MockNavigator", "MockNavigator"), newItemTypes());
}

@Issue("JENKINS-31949")
@Test
public void insideFolder() throws Exception {
Expand Down

0 comments on commit f5c8342

Please sign in to comment.