Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.serena.rlc.provider.jenkins; import com.serena.rlc.provider.domain.ActionInfo; import com.serena.rlc.provider.domain.ActionInfoResult; import com.serena.rlc.provider.domain.ExecutionInfo; import com.serena.rlc.provider.domain.Field; import com.serena.rlc.provider.domain.FieldInfo; import com.serena.rlc.provider.domain.FieldValueInfo; import com.serena.rlc.provider.domain.ProviderInfoResult; import com.serena.rlc.provider.exceptions.ProviderException; import java.io.IOException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; /** * * @author rcook */ public class JenkinsTest { /** * @param args the command line arguments */ public static void main(String[] args) throws ProviderException, IOException { System.out.println(URLEncoder.encode( "http://10.31.25.44:8080/jenkins/job/Build Job 2/api/json?tree=actions[parameterDefinitions[*,defaultParameterValue[*]]]&pretty=1", "UTF-8")); /* ApplicationContext context = new ClassPathXmlApplicationContext("serena-provider-jenkins-1.0.xml"); JenkinsExecutionProvider jenkinsProvider = (JenkinsExecutionProvider) context.getBean("executionProvider"); System.out.println(jenkinsProvider.toString()); ActionInfoResult actions = jenkinsProvider.getActions(); ActionInfo ai = jenkinsProvider.getActionInfo("buildJob");*/ /* FieldInfo fieldInfo = jenkinsProvider.getFieldValues("objecttype", null); for (FieldValueInfo val : fieldInfo.getValues()) { System.out.println(val.getId() + " - " + val.getName()); } List<Field> properties = new ArrayList<>(); properties.add(new Field("objecttype", "objecttype", "defect")); properties.add(new Field("project", "project", "")); properties.add(new Field("workspace", "workspace", "/workspace/12345")); properties.add(new Field("fetch", "fetch", "")); properties.add(new Field("query", "query", "")); properties.add(new Field("order", "order", "")); properties.add(new Field("scopeup", "scopeup", "")); properties.add(new Field("scopedown", "scopedown", "")); */ //ExecutionInfo results = jenkinsProvider.execute("Build", null, null, null); } }