Skip to content
Permalink
Browse files

Merge pull request #56 from jglick/UnsupportedOperationException-JENK…

…INS-39520

[JENKINS-39520] ExtensionList.removeAll is unimplemented
  • Loading branch information
jglick committed Nov 4, 2016
2 parents 035c7e2 + b95b07f commit f5c8342f2fd73f95e70471d64c2fdeb4f050e035
@@ -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
@@ -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;
@@ -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 {

0 comments on commit f5c8342

Please sign in to comment.
You can’t perform that action at this time.