当前位置: 首页>>代码示例>>Java>>正文


Java Descriptor.FormException方法代码示例

本文整理汇总了Java中hudson.model.Descriptor.FormException方法的典型用法代码示例。如果您正苦于以下问题:Java Descriptor.FormException方法的具体用法?Java Descriptor.FormException怎么用?Java Descriptor.FormException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hudson.model.Descriptor的用法示例。


在下文中一共展示了Descriptor.FormException方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doTestConnection

import hudson.model.Descriptor; //导入方法依赖的package包/类
public FormValidation doTestConnection(
        @QueryParameter("mirrorGateAPIUrl") final String mirrorGateAPIUrl,
        @QueryParameter("mirrorgateCredentialsId") final String credentialsId)
        throws Descriptor.FormException {
    MirrorGateService testMirrorGateService = getMirrorGateService();
    if (testMirrorGateService != null) {
        MirrorGateResponse response
                = testMirrorGateService.testConnection();
        return response.getResponseCode() == HttpStatus.SC_OK
                ? FormValidation.ok("Success")
                : FormValidation.error("Failure<"
                        + response.getResponseCode() + ">");
    } else {
        return FormValidation.error("Failure");
    }
}
 
开发者ID:BBVA,项目名称:mirrorgate-jenkins-builds-collector,代码行数:17,代码来源:MirrorGatePublisher.java

示例2: NomadSlave

import hudson.model.Descriptor; //导入方法依赖的package包/类
public NomadSlave(
    NomadCloud cloud,
    String name,
    String nodeDescription,
    NomadSlaveTemplate template,
    String labelString,
    Mode mode,
    hudson.slaves.RetentionStrategy retentionStrategy,
    List<? extends NodeProperty<?>> nodeProperties
) throws Descriptor.FormException, IOException {
    super(
        name,
        nodeDescription,
        template.getRemoteFs(),
        template.getNumExecutors(),
        mode,
        labelString,
        new JNLPLauncher(),
        retentionStrategy,
        nodeProperties
    );

    this.cloud = cloud;
}
 
开发者ID:iverberk,项目名称:jenkins-nomad,代码行数:25,代码来源:NomadSlave.java

示例3: reconfigure

import hudson.model.Descriptor; //导入方法依赖的package包/类
/**
 * This method is called whenever the Job form is saved. We use the 'on' property
 * to determine if the controls are selected.
 *
 * @param req - The request
 * @param form - A JSONObject containing the submitted form data from the job configuration
 * @return a {@link JobProperty} object representing the tagging added to the job
 * @throws hudson.model.Descriptor.FormException if querying of form throws an error
 */
@Override
public JobProperty<?> reconfigure(StaplerRequest req, @Nonnull JSONObject form)
        throws Descriptor.FormException {

  DatadogJobProperty prop = (DatadogJobProperty) super.reconfigure(req, form);
  System.out.println(form);
  boolean isEnableFile = form.getBoolean("enableFile");
  boolean isEnableTagProperties = form.getBoolean("enableProperty");

  if(!isEnableFile) {
      prop.tagFile = null;
      prop.emitOnCheckout = false;
  }
  if(!isEnableTagProperties) {
      prop.tagProperties = null;
  }


  return prop;
}
 
开发者ID:DataDog,项目名称:jenkins-datadog-plugin,代码行数:30,代码来源:DatadogJobProperty.java

示例4: DockerSlave

import hudson.model.Descriptor; //导入方法依赖的package包/类
public DockerSlave(String slaveName, String nodeDescription, ComputerLauncher launcher, String containerId,
                   DockerSlaveTemplate dockerSlaveTemplate, String cloudId, ProvisioningActivity.Id provisioningId)
        throws IOException, Descriptor.FormException {
    super(slaveName,
            nodeDescription, //description
            dockerSlaveTemplate.getRemoteFs(),
            dockerSlaveTemplate.getNumExecutors(),
            dockerSlaveTemplate.getMode(),
            dockerSlaveTemplate.getLabelString(),
            launcher,
            dockerSlaveTemplate.getRetentionStrategyCopy(),
            dockerSlaveTemplate.getNodeProperties()
    );
    this.displayName = slaveName; // initial value
    this.containerId = containerId;
    this.cloudId = cloudId;
    setDockerSlaveTemplate(dockerSlaveTemplate);
    this.provisioningId = provisioningId;
}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:20,代码来源:DockerSlave.java

示例5: configure

import hudson.model.Descriptor; //导入方法依赖的package包/类
@Override
public boolean configure(StaplerRequest sr, JSONObject formData)
        throws Descriptor.FormException {
    mirrorGateAPIUrl = sr.getParameter("mirrorGateAPIUrl");
    mirrorgateCredentialsId = sr.getParameter("_.mirrorgateCredentialsId");
    extraURLs = sr.getParameter("extraURLs");

    save();
    return super.configure(sr, formData);
}
 
开发者ID:BBVA,项目名称:mirrorgate-jenkins-builds-collector,代码行数:11,代码来源:MirrorGatePublisher.java

示例6: SetCommitStatusStep

import hudson.model.Descriptor; //导入方法依赖的package包/类
@DataBoundConstructor
public SetCommitStatusStep(String serverUrl, String credentials, String commitId, String state, String key, String url)
		throws Descriptor.FormException {
	this.serverUrl = serverUrl;
	this.credentials = credentials;
	this.commitId = commitId;
	this.state = state;
	this.key = key;
	this.url = url;

	if (StringUtils.isBlank(serverUrl)) {
		throw new Descriptor.FormException("Can not be empty", "serverUrl");
	}
	if (StringUtils.isBlank(credentials)) {
		throw new Descriptor.FormException("Can not be empty", "credentials");
	}
	if (StringUtils.isBlank(commitId)) {
		throw new Descriptor.FormException("Can not be empty", "commitId");
	}
	if (StringUtils.isBlank(state)) {
		throw new Descriptor.FormException("Can not be empty", "state");
	}
	if (StringUtils.isBlank(key)) {
		throw new Descriptor.FormException("Can not be empty", "key");
	}
	if (StringUtils.isBlank(url)) {
		throw new Descriptor.FormException("Can not be empty", "url");
	}
}
 
开发者ID:Error22,项目名称:pipeline-bitbucket-server-steps-plugin,代码行数:30,代码来源:SetCommitStatusStep.java

示例7: get

import hudson.model.Descriptor; //导入方法依赖的package包/类
@SuppressWarnings("unused")
public T get(Descriptor<T> descriptor) {
    for (T item : this) {
        if (descriptor.isInstance(item)) {
            return item;
        }
    }
    try {
        return descriptor.newInstance(null, new JSONObject());
    } catch (Descriptor.FormException e) {
        throw new AssertionError(e);
    }
}
 
开发者ID:inFullMobile,项目名称:restricted-register-plugin,代码行数:14,代码来源:DescribableCollection.java

示例8: testDoTestConnection

import hudson.model.Descriptor; //导入方法依赖的package包/类
@Test
public void testDoTestConnection() {
    if (telegramServiceStub != null) {
        telegramServiceStub.setResponse(response);
    }
    descriptor.setTelegramService(telegramServiceStub);
    try {
        FormValidation result = descriptor.doTestConnection("authToken", "room", "buildServerUrl");
        assertEquals(result.kind, expectedResult);
    } catch (Descriptor.FormException e) {
        e.printStackTrace();
        assertTrue(false);
    }
}
 
开发者ID:FluffyFairyGames,项目名称:jenkins-telegram-plugin,代码行数:15,代码来源:TelegramNotifierTest.java

示例9: prepareExecutorFor

import hudson.model.Descriptor; //导入方法依赖的package包/类
private Node prepareExecutorFor(final AbstractProject job) throws Descriptor.FormException, IOException, InterruptedException {
    LOGGER.info("Creating a Container slave to host " + job.toString() + "#" + job.getNextBuildNumber());

    // Immediately create a slave for this item
    // Real provisioning will happen later
    String slaveName = "Container for " + job.getName() + "#" + job.getNextBuildNumber();
    String description = "Container slave for building " + job.getFullName();
    HyperSlaves plugin = HyperSlaves.get();
    return new HyperSlave(slaveName, description, null, plugin.createStandardJobProvisionerFactory(job));
}
 
开发者ID:hyperhq,项目名称:hyper-slaves-plugin,代码行数:11,代码来源:ProvisionQueueListener.java

示例10: ParallelsDesktopVMSlave

import hudson.model.Descriptor; //导入方法依赖的package包/类
@DataBoundConstructor
public ParallelsDesktopVMSlave(ParallelsDesktopVM vm, ParallelsDesktopConnectorSlaveComputer connector)
		throws IOException, Descriptor.FormException
{
	super(vm.getSlaveName(), "", vm.getRemoteFS(), 1, Mode.NORMAL, vm.getLabels(), vm.getLauncher(),
			new ParallelsDesktopCloudRetentionStrategy(), new ArrayList<NodeProperty<?>>());
	this.connector = connector;
	this.vm = vm;
}
 
开发者ID:Parallels,项目名称:jenkins-parallels,代码行数:10,代码来源:ParallelsDesktopVMSlave.java

示例11: ParallelsDesktopConnectorSlave

import hudson.model.Descriptor; //导入方法依赖的package包/类
@DataBoundConstructor
public ParallelsDesktopConnectorSlave(ParallelsDesktopCloud owner, String name, String remoteFS, 
		ComputerLauncher launcher, boolean useAsBuilder)
		throws IOException, Descriptor.FormException
{
	super(name, "", remoteFS, 1, Mode.NORMAL, "", launcher,
			useAsBuilder ? new RetentionStrategy.Always() : new RetentionStrategy.Demand(1, 1),
			new ArrayList<NodeProperty<?>>());
	this.owner = owner;
	this.useAsBuilder = useAsBuilder;
}
 
开发者ID:Parallels,项目名称:jenkins-parallels,代码行数:12,代码来源:ParallelsDesktopConnectorSlave.java

示例12: testDoTestConnection

import hudson.model.Descriptor; //导入方法依赖的package包/类
@Test
public void testDoTestConnection() {
	if (mattermostServiceStub != null) {
		mattermostServiceStub.setResponse(response);
	}
	descriptor.setMattermostService(mattermostServiceStub);
	try {
		FormValidation result = descriptor.doTestConnection("host", "room", "", "buildServerUrl");
		assertEquals(result.kind, expectedResult);
	} catch (Descriptor.FormException e) {
		e.printStackTrace();
		assertTrue(false);
	}
}
 
开发者ID:jovandeginste,项目名称:jenkins-mattermost-plugin,代码行数:15,代码来源:MattermostNotifierTest.java

示例13: DockerSlaveSingle

import hudson.model.Descriptor; //导入方法依赖的package包/类
public DockerSlaveSingle(@Nonnull String name,
                         @Nonnull String nodeDescription,
                         @Nonnull DockerSlaveConfig config,
                         @Nonnull YADockerConnector connector,
                         @Nonnull ProvisioningActivity.Id activityId)
        throws IOException, Descriptor.FormException {
    super(name, nodeDescription,
            config.getRemoteFs(), config.getNumExecutors(), config.getMode(),
            "",
            config.getLauncher(), config.getRetentionStrategy(), config.getNodeProperties());
    this.connector = connector;
    this.activityId = activityId;
    this.config = config;

}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:16,代码来源:DockerSlaveSingle.java

示例14: nullRetention

import hudson.model.Descriptor; //导入方法依赖的package包/类
@Test
public void nullRetention() throws Descriptor.FormException {
    final DockerSlaveTemplate template = new DockerSlaveTemplate("id");
    template.setRetentionStrategy(null);

    assertThat(notAllowedStrategy(template), is(true));
}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:8,代码来源:DockerProvisioningStrategyTest.java

示例15: dockerOnceRetention1

import hudson.model.Descriptor; //导入方法依赖的package包/类
@Test
public void dockerOnceRetention1() throws Descriptor.FormException {
    final DockerSlaveTemplate template = new DockerSlaveTemplate("id");
    template.setRetentionStrategy(new DockerOnceRetentionStrategy(3));

    assertThat(notAllowedStrategy(template), is(false));
}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:8,代码来源:DockerProvisioningStrategyTest.java


注:本文中的hudson.model.Descriptor.FormException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。