package org.jenkinsci.plugins.p4_client.review; import static org.junit.Assert.assertEquals; import hudson.model.FreeStyleProject; import org.jenkinsci.plugins.p4_client.PerforceScm; import org.jenkinsci.plugins.p4_client.credentials.P4PasswordImpl; import org.jenkinsci.plugins.p4_client.populate.AutoCleanImpl; import org.jenkinsci.plugins.p4_client.populate.Populate; import org.jenkinsci.plugins.p4_client.workspace.StaticWorkspaceImpl; import org.jenkinsci.plugins.p4_client.workspace.Workspace; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; import com.cloudbees.plugins.credentials.CredentialsScope; import com.cloudbees.plugins.credentials.SystemCredentialsProvider; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class ReviewImplTest { private final String credential = "id"; private final static String P4PORT = "localhost:1999"; @Rule public JenkinsRule jenkins = new JenkinsRule(); @Test public void testStaticReviewImpl() throws Exception { P4PasswordImpl auth = new P4PasswordImpl(CredentialsScope.SYSTEM, credential, "desc", P4PORT, null, "jenkins", "jenkins"); SystemCredentialsProvider.getInstance().getCredentials().add(auth); SystemCredentialsProvider.getInstance().save(); String client = "test.ws"; FreeStyleProject project = jenkins .createFreeStyleProject("StaticReview"); Workspace workspace = new StaticWorkspaceImpl("none", client); Populate populate = new AutoCleanImpl(true, true); PerforceScm scm = new PerforceScm(credential, workspace, populate); project.setScm(scm); project.save(); HtmlPage page = jenkins.createWebClient().getPage(project, "review"); HtmlElement review = page.getElementByName("review"); assertEquals(review.getAttribute("type"), "text"); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 9672 | Paul Allen | Refactor name from 'p4_client' to 'p4'. | ||
#3 | 9472 | Paul Allen |
Added support to pin build at a label in the populate configuration. - includes help and updates to tests. |
||
#2 | 9115 | Paul Allen |
Initial implementation of workspace Cleanup and Sync options. - Includes 3 modes: Automatic Clean/Sync, Force Clean/Sync, Sync Only Automatic Clean/Sync Uses reconcile to clean up workspace and sync changes. Force Clean/Sync Force sync of all files (does not remove files yet...) Sync Only Normal sync with no cleanup TODO: - remove of files in Force Clean/Sync mode - Inline help - Update docs - Add unit/functional tests |
||
#1 | 8888 | Paul Allen |
Extended test coverage for Workspace and Credentials. - Removed ununsed methods. |