Skip to content

Commit

Permalink
Merge branch 'master' into upgrade-htmlunit
Browse files Browse the repository at this point in the history
* 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 9823d43
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/src/main/java/hudson/core/PluginManagerOverrideTest.java
@@ -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 {

@Rule
public JenkinsRule j = new JenkinsRule();

@Test
public void testViewOverrides() throws Exception {
// Verify extension registered correctly and comes back in overrides
assertEquals(1,PluginManagerStaplerOverride.all().size());
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 */
@TestExtension("testViewOverrides")
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>
</j:jelly>

0 comments on commit 9823d43

Please sign in to comment.