本文整理汇总了Java中org.jenkinsci.plugins.workflow.steps.StepConfigTester类的典型用法代码示例。如果您正苦于以下问题:Java StepConfigTester类的具体用法?Java StepConfigTester怎么用?Java StepConfigTester使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StepConfigTester类属于org.jenkinsci.plugins.workflow.steps包,在下文中一共展示了StepConfigTester类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configRoundTrip
import org.jenkinsci.plugins.workflow.steps.StepConfigTester; //导入依赖的package包/类
@Test public void configRoundTrip() {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
IdCredentials registryCredentials = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, "registryCreds", null, "me", "pass");
CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), registryCredentials);
StepConfigTester sct = new StepConfigTester(story.j);
Map<String,Object> registryConfig = new TreeMap<String,Object>();
registryConfig.put("url", "https://docker.my.com/");
registryConfig.put("credentialsId", registryCredentials.getId());
Map<String,Object> config = Collections.<String,Object>singletonMap("registry", registryConfig);
RegistryEndpointStep step = DescribableHelper.instantiate(RegistryEndpointStep.class, config);
step = sct.configRoundTrip(step);
DockerRegistryEndpoint registry = step.getRegistry();
assertNotNull(registry);
assertEquals("https://docker.my.com/", registry.getUrl());
assertEquals(registryCredentials.getId(), registry.getCredentialsId());
assertEquals(config, DescribableHelper.uninstantiate(step));
}
});
}
示例2: configRoundTrip
import org.jenkinsci.plugins.workflow.steps.StepConfigTester; //导入依赖的package包/类
@Test public void configRoundTrip() {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
IdCredentials serverCredentials = new DockerServerCredentials(CredentialsScope.GLOBAL, "serverCreds", null, "clientKey", "clientCertificate", "serverCaCertificate");
CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), serverCredentials);
StepConfigTester sct = new StepConfigTester(story.j);
Map<String,Object> serverConfig = new TreeMap<String,Object>();
serverConfig.put("uri", "tcp://host:2375");
serverConfig.put("credentialsId", serverCredentials.getId());
Map<String,Object> config = Collections.<String,Object>singletonMap("server", serverConfig);
ServerEndpointStep step = DescribableHelper.instantiate(ServerEndpointStep.class, config);
step = sct.configRoundTrip(step);
DockerServerEndpoint server = step.getServer();
assertNotNull(server);
assertEquals("tcp://host:2375", server.getUri());
assertEquals(serverCredentials.getId(), server.getCredentialsId());
assertEquals(config, DescribableHelper.uninstantiate(step));
}
});
}
示例3: configRoundTrip
import org.jenkinsci.plugins.workflow.steps.StepConfigTester; //导入依赖的package包/类
@Test
public void configRoundTrip() throws Exception {
story.addStep(new Statement() {
@SuppressWarnings("rawtypes")
@Override
public void evaluate() throws Throwable {
CredentialsStore store = CredentialsProvider.lookupStores(story.j.getInstance()).iterator().next();
assertThat(store, instanceOf(SystemCredentialsProvider.StoreImpl.class));
Domain domain = new Domain("docker", "A domain for docker credentials",
Collections.<DomainSpecification> singletonList(new DockerServerDomainSpecification()));
DockerServerCredentials c = new DockerServerCredentials(CredentialsScope.GLOBAL,
"docker-client-cert", "desc", "clientKey", "clientCertificate", "serverCaCertificate");
store.addDomain(domain, c);
BindingStep s = new StepConfigTester(story.j)
.configRoundTrip(new BindingStep(Collections.<MultiBinding> singletonList(
new DockerServerCredentialsBinding("DOCKER_CERT_PATH", "docker-client-cert"))));
story.j.assertEqualDataBoundBeans(s.getBindings(), Collections.singletonList(
new DockerServerCredentialsBinding("DOCKER_CERT_PATH", "docker-client-cert")));
}
});
}
示例4: testConfigureParameterizedBuildFilter
import org.jenkinsci.plugins.workflow.steps.StepConfigTester; //导入依赖的package包/类
@Test
public void testConfigureParameterizedBuildFilter() throws Exception {
ParameterizedRunFilter filter = new ParameterizedRunFilter("${PARAM}");
SelectRunStep step = new SelectRunStep("test");
step.setFilter(filter);
new StepConfigTester(j).configRoundTrip(step);
j.assertEqualDataBoundBeans(filter, step.getFilter());
}
示例5: configRoundTrip
import org.jenkinsci.plugins.workflow.steps.StepConfigTester; //导入依赖的package包/类
@Test
public void configRoundTrip() throws Exception{
TelegramSendStep step1 = new TelegramSendStep("message");
step1.setChatId("123456789");
step1.setToken("token");
step1.setFailOnError(true);
TelegramSendStep step2 = new StepConfigTester(jenkinsRule).configRoundTrip(step1);
jenkinsRule.assertEqualDataBoundBeans(step1,step2);
}
开发者ID:FluffyFairyGames,项目名称:jenkins-telegram-plugin,代码行数:11,代码来源:TelegramSendStepIntegrationTest.java
示例6: configRoundTrip
import org.jenkinsci.plugins.workflow.steps.StepConfigTester; //导入依赖的package包/类
@Test
public void configRoundTrip() throws Exception {
MattermostSendStep step1 = new MattermostSendStep("message");
step1.setColor("good");
step1.setChannel("#channel");
step1.setIcon("icon");
step1.setEndpoint("teamDomain");
step1.setFailOnError(true);
MattermostSendStep step2 = new StepConfigTester(jenkinsRule).configRoundTrip(step1);
jenkinsRule.assertEqualDataBoundBeans(step1, step2);
}
开发者ID:jovandeginste,项目名称:jenkins-mattermost-plugin,代码行数:13,代码来源:MattermostSendStepIntegrationTest.java
示例7: configRoundTrip
import org.jenkinsci.plugins.workflow.steps.StepConfigTester; //导入依赖的package包/类
@Test public void configRoundTrip() {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
WithContainerStep s1 = new WithContainerStep("java");
s1.setArgs("--link db:db");
story.j.assertEqualDataBoundBeans(s1, new StepConfigTester(story.j).configRoundTrip(s1));
story.j.jenkins.getDescriptorByType(DockerTool.DescriptorImpl.class).setInstallations(new DockerTool("docker15", "/usr/local/docker15", Collections.<ToolProperty<?>>emptyList()));
s1.setToolName("docker15");
story.j.assertEqualDataBoundBeans(s1, new StepConfigTester(story.j).configRoundTrip(s1));
}
});
}
示例8: configRoundTrip
import org.jenkinsci.plugins.workflow.steps.StepConfigTester; //导入依赖的package包/类
@Test public void configRoundTrip() throws Exception {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
SSHUserPrivateKey c = new DummyPrivateKey("creds", "bob", "secret", "the-key");
CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c);
SSHUserPrivateKeyBinding binding = new SSHUserPrivateKeyBinding("keyFile", "creds");
binding.setPassphraseVariable("passphrase");
binding.setUsernameVariable("user");
BindingStep s = new StepConfigTester(story.j).configRoundTrip(new BindingStep(
Collections.<MultiBinding>singletonList(binding)));
story.j.assertEqualDataBoundBeans(s.getBindings(), Collections.singletonList(binding));
}
});
}
示例9: configRoundTrip
import org.jenkinsci.plugins.workflow.steps.StepConfigTester; //导入依赖的package包/类
@Test public void configRoundTrip() throws Exception {
story.addStep(new Statement() {
@SuppressWarnings("rawtypes")
@Override public void evaluate() throws Throwable {
UsernamePasswordCredentialsImpl c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, "creds", "sample", "bob", "s3cr3t");
CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c);
BindingStep s = new StepConfigTester(story.j).configRoundTrip(new BindingStep(Collections.<MultiBinding>singletonList(new UsernamePasswordBinding("userpass", "creds"))));
story.j.assertEqualDataBoundBeans(s.getBindings(), Collections.singletonList(new UsernamePasswordBinding("userpass", "creds")));
CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), new FileCredentialsImpl(CredentialsScope.GLOBAL, "secrets", "sample", "secrets.zip",
SecretBytes.fromBytes(new byte[] {0x50,0x4B,0x05,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}))); // https://en.wikipedia.org/wiki/Zip_(file_format)#Limits
new SnippetizerTester(story.j).assertRoundTrip(new BindingStep(Collections.<MultiBinding>singletonList(new ZipFileBinding("file", "secrets"))),
"withCredentials([[$class: 'ZipFileBinding', credentialsId: 'secrets', variable: 'file']]) {\n // some block\n}");
}
});
}