use of org.jvnet.hudson.test.Email in project maven-plugin by jenkinsci.
the class AbstractMaven3xBuildTest method testMavenWithDependencyVersionInEnvVar.
@Test
@Email("https://groups.google.com/d/msg/hudson-users/Xhw00UopVN0/FA9YqDAIsSYJ")
public void testMavenWithDependencyVersionInEnvVar() throws Exception {
MavenModuleSet m = j.jenkins.createProject(MavenModuleSet.class, "p");
MavenInstallation mavenInstallation = configureMaven3x();
ParametersDefinitionProperty parametersDefinitionProperty = new ParametersDefinitionProperty(new StringParameterDefinition("JUNITVERSION", "3.8.2"));
m.addProperty(parametersDefinitionProperty);
m.setMaven(mavenInstallation.getName());
m.getReporters().add(new TestReporter());
m.setScm(new ExtractResourceSCM(getClass().getResource("envars-maven-project.zip")));
m.setGoals("clean test-compile -Dmaven.compiler.target=1.8 -Dmaven.compiler.source=1.8");
MavenModuleSetBuild mmsb = j.buildAndAssertSuccess(m);
assertFalse(mmsb.getProject().getModules().isEmpty());
}
use of org.jvnet.hudson.test.Email in project jenkins by jenkinsci.
the class HudsonTest method computerConfigureLink.
/**
* Configure link from "/computer/(built-in)/" should work.
*/
@Test
@Email("http://www.nabble.com/Master-slave-refactor-td21361880.html")
public void computerConfigureLink() throws Exception {
HtmlPage page = j.createWebClient().goTo("computer/(built-in)/configure");
j.submit(page.getFormByName("config"));
}
use of org.jvnet.hudson.test.Email in project jenkins by jenkinsci.
the class HudsonTest method simpleConfigSubmit.
/**
* Performs a very basic round-trip of a non-empty system configuration screen.
* This makes sure that the structured form submission is working (to some limited extent.)
*/
@Test
@LocalData
@Email("http://www.nabble.com/Hudson.configure-calling-deprecated-Descriptor.configure-td19051815.html")
public void simpleConfigSubmit() throws Exception {
// just load the page and resubmit
HtmlPage configPage = j.createWebClient().goTo("configure");
HtmlForm form = configPage.getFormByName("config");
j.submit(form);
// Load tools page and resubmit too
HtmlPage toolsConfigPage = j.createWebClient().goTo("configureTools");
HtmlForm toolsForm = toolsConfigPage.getFormByName("config");
j.submit(toolsForm);
// make sure all the pieces are intact
assertEquals(2, j.jenkins.getNumExecutors());
assertSame(Mode.NORMAL, j.jenkins.getMode());
assertSame(SecurityRealm.NO_AUTHENTICATION, j.jenkins.getSecurityRealm());
assertSame(AuthorizationStrategy.UNSECURED, j.jenkins.getAuthorizationStrategy());
assertEquals(5, j.jenkins.getQuietPeriod());
List<JDK> jdks = j.jenkins.getJDKs();
// Hudson adds one more
assertEquals(3, jdks.size());
assertJDK(jdks.get(0), "jdk1", "/tmp");
assertJDK(jdks.get(1), "jdk2", "/tmp");
AntInstallation[] ants = j.jenkins.getDescriptorByType(Ant.DescriptorImpl.class).getInstallations();
assertEquals(2, ants.length);
assertAnt(ants[0], "ant1", "/tmp");
assertAnt(ants[1], "ant2", "/tmp");
}
use of org.jvnet.hudson.test.Email in project jenkins by jenkinsci.
the class HudsonTest method deleteHudsonComputer.
/**
* Configure link from "/computer/(built-in)/" should work.
*/
@Test
@Email("http://www.nabble.com/Master-slave-refactor-td21361880.html")
public void deleteHudsonComputer() throws Exception {
WebClient wc = j.createWebClient();
HtmlPage page = wc.goTo("computer/(built-in)/");
for (HtmlAnchor a : page.getAnchors()) {
assertFalse(a.getHrefAttribute(), a.getHrefAttribute().endsWith("delete"));
}
wc.setThrowExceptionOnFailingStatusCode(false);
// try to delete it by hitting the final URL directly
WebRequest req = new WebRequest(new URL(wc.getContextPath() + "computer/(built-in)/doDelete"), HttpMethod.POST);
page = wc.getPage(wc.addCrumb(req));
assertEquals(HttpURLConnection.HTTP_BAD_REQUEST, page.getWebResponse().getStatusCode());
// the built-in computer object should be still here
page = wc.goTo("computer/(built-in)/");
assertEquals(HttpURLConnection.HTTP_OK, page.getWebResponse().getStatusCode());
}
use of org.jvnet.hudson.test.Email in project jenkins by jenkinsci.
the class JnlpAccessWithSecuredHudsonTest method anonymousCanAlwaysLoadJARs.
@PresetData(DataSet.NO_ANONYMOUS_READACCESS)
@Email("http://markmail.org/message/on4wkjdaldwi2atx")
@Test
public void anonymousCanAlwaysLoadJARs() throws Exception {
ApiTokenTestHelper.enableLegacyBehavior();
r.jenkins.setNodes(Collections.singletonList(createNewJnlpSlave("test")));
JenkinsRule.WebClient wc = r.createWebClient();
HtmlPage p = wc.withBasicApiToken(User.getById("alice", true)).goTo("computer/test/");
// this fresh WebClient doesn't have a login cookie and represent JNLP launcher
JenkinsRule.WebClient jnlpAgent = r.createWebClient();
// parse the JNLP page into DOM to list up the jars.
XmlPage jnlp = (XmlPage) wc.goTo("computer/test/jenkins-agent.jnlp", "application/x-java-jnlp-file");
URL baseUrl = jnlp.getUrl();
Document dom = new DOMReader().read(jnlp.getXmlDocument());
for (Object jar : dom.selectNodes("//jar")) {
URL url = new URL(baseUrl, ((Element) jar).attributeValue("href"));
System.out.println(url);
// now make sure that these URLs are unprotected
Page jarResource = jnlpAgent.getPage(url);
assertTrue(jarResource.getWebResponse().getContentType().toLowerCase(Locale.ENGLISH).startsWith("application/"));
}
}
Aggregations