Package hudson.model

Examples of hudson.model.TopLevelItem


        number = new NumberMetadataValue("number", "description", NUMBR_VAL2, false);
        list.add(number);
        MetadataJobProperty property2 = project2.getProperty(MetadataJobProperty.class);
        property2.addChildren(list);
        MetadataQuerySearch mqs = MetadataQuerySearch.parseQuery("number>5");
        TopLevelItem tli1 = project;
        TopLevelItem tli2 = project2;
        List itemList = new ArrayList();
        itemList.add(tli1);
        itemList.add(tli2);
        assertEquals(1, mqs.searchQuery(itemList).size());
    }
View Full Code Here


        number = new NumberMetadataValue("number", "description", NUMBR_VAL2, false);
        list.add(number);
        MetadataJobProperty property2 = project2.getProperty(MetadataJobProperty.class);
        property2.addChildren(list);
        MetadataQuerySearch mqs = MetadataQuerySearch.parseQuery("number<=9");
        TopLevelItem tli1 = project;
        TopLevelItem tli2 = project2;
        List itemList = new ArrayList();
        itemList.add(tli1);
        itemList.add(tli2);
       assertEquals(2, mqs.searchQuery(itemList).size());
    }
View Full Code Here

        number = new NumberMetadataValue("number", "description", NUMBR_VAL2, false);
        list.add(number);
        MetadataJobProperty property2 = project2.getProperty(MetadataJobProperty.class);
        property2.addChildren(list);
        MetadataQuerySearch mqs = MetadataQuerySearch.parseQuery("number<9");
        TopLevelItem tli1 = project;
        TopLevelItem tli2 = project2;
        List itemList = new ArrayList();
        itemList.add(tli1);
        itemList.add(tli2);
        assertEquals(1, mqs.searchQuery(itemList).size());
    }
View Full Code Here

     * @throws Exception if so.
     */
    @Test(expected = CliUtils.NoItemException.class)
    public void testGetContainerItemButNoJob() throws Exception {
        Hudson hudson = MockUtils.mockHudson();
        TopLevelItem itemMock = mock(TopLevelItem.class);
        when(hudson.getItem("fake")).thenReturn(itemMock);
        CliUtils.getContainer(null, "fake", null, false);
    }
View Full Code Here

            buildResult = Result.fromString(forcedBuildResult.toString());
        }
       
        LOG.info("marking job "+jobName+"#"+buildNumber+" as complete ("+buildResult+")");
        if (jobName instanceof String && buildNumber instanceof Integer){
            TopLevelItem it = Jenkins.getInstance().getItem((String)jobName);
            if (it instanceof JenkowWorkflowJob){
                JenkowWorkflowJob wfj = (JenkowWorkflowJob)it;
                JenkowWorkflowRun build = wfj.getBuildByNumber(((Integer)buildNumber).intValue());
                if (build != null){
                    build.markCompleted(buildResult);
View Full Code Here

            return;
        }
       
    if (jn != null){
      Jenkins jenkins = Jenkins.getInstance();
      TopLevelItem it = jenkins.getItem(jn);
      if (it == null){
                LOG.info("unable to launch job "+jn+", it=null");
      }else if (!(it instanceof Project)){
          LOG.info("unable to launch job "+jn+", because it's not a Project, but just "+it.getClass());
      }else{
        // TODO 8: would like to have AbstractProject here, but it doesn't have BuildWrappers.
          Project p = (Project)it;
       
        DescribableList wrappers = p.getBuildWrappersList();
View Full Code Here

class BuildLoggerMap {
    private final static Map<String,PrintStream> parentLoggerMap = new HashMap<String,PrintStream>();

    static PrintStream get(String jobName, int buildNumber){
      TopLevelItem it = Jenkins.getInstance().getItem(jobName);
      if (it instanceof JenkowWorkflowJob){
          JenkowWorkflowJob job = (JenkowWorkflowJob)it;
          JenkowWorkflowRun build = job.getBuildByNumber(buildNumber);
          if (build != null){
              try {
View Full Code Here

          Object bpObj = rtSvc.getVariable(execId,"jenkow_build_parent");
          Object bnObj = rtSvc.getVariable(execId,"jenkow_build_number");
          if (bpObj instanceof String && bnObj instanceof Integer){
            String parentJobName = (String)bpObj;
            int buildNum = ((Integer)bnObj).intValue();
            TopLevelItem it = Jenkins.getInstance().getItem(parentJobName);
            if (it instanceof Project){
              parentProj = (Project)it;
              Run build = parentProj.getLastBuild();
              if (build != null){
                if (build.getNumber() == buildNum){
View Full Code Here

    }

    @Test
    public void createProjectFromXMLSecurity() throws IOException {
        // mocks
        TopLevelItem toProject = Mockito.mock(TopLevelItem.class);
        ProjectService inst = spy(getInst());

        // make method succeed
        doReturn(false).when(inst).projectExists("toProject");
        when(hudson.createProjectFromXML("toProject", input)).thenReturn(toProject);
View Full Code Here

    @Override
    public int parseArguments(Parameters params) throws CmdLineException {
        Hudson h = Hudson.getInstance();
        String src = params.getParameter(0);

        TopLevelItem s = h.getItem(src);
        if (s==null)
            throw new CmdLineException(owner, "No such job '"+src+"' perhaps you meant "+ AbstractProject.findNearest(src)+"?");
        setter.addValue(s);
        return 1;
    }
View Full Code Here

TOP

Related Classes of hudson.model.TopLevelItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.