Skip to content
Browse files
Merge branch 'master' into upgrade-htmlunit
* master:
  commons-compress -> 1.10
  Noting #1788
  Remove hardcode in tar test
  [FIXED JENKINS-10629] Unbroke stream with new tar implementation.
  Revert "Revert "FIXED JENKINS-10629] - Enable BigNumber mode to support archiving of files with size >8Gb""
  Revert "Revert "[JENKINS-10629] - Migrate the Tar archives handling code to commons-compress""
  Fix at-since from PR #1788
  Merge PR #1788: Make plugin manager pluggable

Originally-Committed-As: 3f98011bd4aae0ee6956d264c952782452389f79
  • Loading branch information
tfennelly committed Aug 26, 2015
2 parents a8a0a86 + 851f8fd commit 9823d43e2d9ebd9cccad7efca8eb965bc4aafedf
@@ -0,0 +1,41 @@
package hudson.core;

import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.PluginManagerStaplerOverride;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.TestExtension;

import static org.junit.Assert.*;

* Verify that the PluginManagerStaplerOverride extensions register and allow safely modifying PluginManager views
* @author Sam Van Oort
public class PluginManagerOverrideTest {

public JenkinsRule j = new JenkinsRule();

public void testViewOverrides() throws Exception {
// Verify extension registered correctly and comes back in overrides
assertTrue(PluginManagerStaplerOverride.all().get(0) instanceof BasicPluginManagerOverride);

// Verify we can load untouched resources
JenkinsRule.WebClient client = j.createWebClient();
assertEquals(200, client.goTo("self/pluginManager/available").getWebResponse().getStatusCode());

// Verify new view loads
HtmlPage p = j.createWebClient().goTo("self/pluginManager/newview");
assertEquals("LoremIpsum", p.getElementById("dummyElement").getTextContent());

/** Micro-implementation simply to allow adding a view resource */
public static class BasicPluginManagerOverride extends PluginManagerStaplerOverride {
@@ -0,0 +1,6 @@
<!-- Trivial dummy view with a dummy element to demonstrate adding view -->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<st:contentType value="text/html;charset=UTF-8" />
<div style="margin-top:1em" id="dummyElement">LoremIpsum</div>

0 comments on commit 9823d43

Please sign in to comment.