Search in sources :

Example 11 with Email

use of org.jvnet.hudson.test.Email in project junit-plugin by jenkinsci.

the class CaseResultTest method testRemoteApiNoDetails.

@Email("http://jenkins.361315.n4.nabble.com/Change-remote-API-visibility-for-CaseResult-getStdout-getStderr-td395102.html")
@Test
public void testRemoteApiNoDetails() throws Exception {
    FreeStyleBuild b = configureTestBuild("test-remoteapi");
    XmlPage page = (XmlPage) rule.createWebClient().goTo("job/test-remoteapi/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/api/xml?depth=-1", "application/xml");
    int found = 0;
    found = page.getByXPath(composeXPath(MAX_VISIBILITY_FIELDS)).size();
    assertTrue("Should have found an element, but found " + found, found > 0);
    found = page.getByXPath(composeXPath(REDUCED_VISIBILITY_FIELDS)).size();
    assertTrue("Should have found 0 elements, but found " + found, found == 0);
    found = page.getByXPath(composeXPath(OTHER_FIELDS)).size();
    assertTrue("Should have found an element, but found " + found, found > 0);
}
Also used : XmlPage(com.gargoylesoftware.htmlunit.xml.XmlPage) FreeStyleBuild(hudson.model.FreeStyleBuild) Email(org.jvnet.hudson.test.Email) Test(org.junit.Test)

Example 12 with Email

use of org.jvnet.hudson.test.Email in project junit-plugin by jenkinsci.

the class CaseResultTest method testRemoteApiNameOnly.

@Email("http://jenkins.361315.n4.nabble.com/Change-remote-API-visibility-for-CaseResult-getStdout-getStderr-td395102.html")
@Test
public void testRemoteApiNameOnly() throws Exception {
    FreeStyleBuild b = configureTestBuild("test-remoteapi");
    XmlPage page = (XmlPage) rule.createWebClient().goTo("job/test-remoteapi/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/api/xml?depth=-10", "application/xml");
    int found = 0;
    found = page.getByXPath(composeXPath(MAX_VISIBILITY_FIELDS)).size();
    assertTrue("Should have found an element, but found " + found, found > 0);
    found = page.getByXPath(composeXPath(REDUCED_VISIBILITY_FIELDS)).size();
    assertTrue("Should have found 0 elements, but found " + found, found == 0);
    found = page.getByXPath(composeXPath(OTHER_FIELDS)).size();
    assertTrue("Should have found 0 elements, but found " + found, found == 0);
}
Also used : XmlPage(com.gargoylesoftware.htmlunit.xml.XmlPage) FreeStyleBuild(hudson.model.FreeStyleBuild) Email(org.jvnet.hudson.test.Email) Test(org.junit.Test)

Example 13 with Email

use of org.jvnet.hudson.test.Email in project maven-plugin by jenkinsci.

the class MavenBuildTest method testMavenWithDependencyVersionInEnvVar.

@Email("https://groups.google.com/d/msg/hudson-users/Xhw00UopVN0/FA9YqDAIsSYJ")
@Test
public void testMavenWithDependencyVersionInEnvVar() throws Exception {
    MavenModuleSet m = j.jenkins.createProject(MavenModuleSet.class, "p");
    MavenInstallation mavenInstallation = Maven36xBuildTest.configureMaven36();
    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());
}
Also used : MavenInstallation(hudson.tasks.Maven.MavenInstallation) StringParameterDefinition(hudson.model.StringParameterDefinition) ParametersDefinitionProperty(hudson.model.ParametersDefinitionProperty) ExtractResourceSCM(org.jvnet.hudson.test.ExtractResourceSCM) Email(org.jvnet.hudson.test.Email) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)13 Email (org.jvnet.hudson.test.Email)13 HtmlPage (com.gargoylesoftware.htmlunit.html.HtmlPage)5 XmlPage (com.gargoylesoftware.htmlunit.xml.XmlPage)4 FreeStyleBuild (hudson.model.FreeStyleBuild)4 SearchTest (hudson.search.SearchTest)3 SmokeTest (org.jvnet.hudson.test.SmokeTest)3 Page (com.gargoylesoftware.htmlunit.Page)2 HtmlForm (com.gargoylesoftware.htmlunit.html.HtmlForm)2 ParametersDefinitionProperty (hudson.model.ParametersDefinitionProperty)2 StringParameterDefinition (hudson.model.StringParameterDefinition)2 MavenInstallation (hudson.tasks.Maven.MavenInstallation)2 URL (java.net.URL)2 ExtractResourceSCM (org.jvnet.hudson.test.ExtractResourceSCM)2 WebClient (org.jvnet.hudson.test.JenkinsRule.WebClient)2 WebRequest (com.gargoylesoftware.htmlunit.WebRequest)1 HtmlAnchor (com.gargoylesoftware.htmlunit.html.HtmlAnchor)1 Slave (hudson.model.Slave)1 AntInstallation (hudson.tasks.Ant.AntInstallation)1 Shell (hudson.tasks.Shell)1