Package hudson.model

Examples of hudson.model.Hudson


        JSONObject refspec = new JSONObject();
        refspec.put("refspec", "* * * * *");
        json.put(propertyKey, refspec);
        expect(req.bindJSON(TimerTrigger.class, refspec)).andReturn(new TimerTrigger("* * * * *")).anyTimes();
        mockStatic(Hudson.class);
        Hudson hudson = createMock(Hudson.class);
        expect(hudson.getDescriptorOrDie(TimerTrigger.class)).andReturn(descriptor).anyTimes();
        expect(hudson.getItem("p2")).andReturn(p2).anyTimes();
        expect(hudson.getItem("p3")).andReturn(p3).anyTimes();
        expect(Hudson.getInstance()).andReturn(hudson).anyTimes();
        replay(Hudson.class, hudson, req);
    }
View Full Code Here


        bind(ReflectionProvider.class).toInstance(reflection);
    }

    @Provides
    private Hudson getHudson() {
        Hudson hudson = Hudson.getInstance();
        checkState(hudson != null);
        return hudson;
    }
View Full Code Here

        assertTrue(map.isEmpty());
    }

    @Test
    public void testConvertToProjectProperties3() throws IOException {
        Hudson hudson = createMock(Hudson.class);
        Mailer.DescriptorImpl descriptor = createMock(Mailer.DescriptorImpl.class);
        String mailerName = "hudson-tasks-Mailer";
        expect(descriptor.getJsonSafeClassName()).andReturn(mailerName);
        expect(hudson.getDescriptorOrDie(Mailer.class)).andReturn(descriptor);
        mockStatic(Hudson.class);
        expect(Hudson.getInstance()).andReturn(hudson).anyTimes();
        prepareJob();

        DescribableList<Publisher, Descriptor<Publisher>> list
View Full Code Here

     * @throws Exception if any.
     */
    @Test
    @Ignore
    public void testLoadLegacyMatrixProject() throws Exception {
        Hudson hudson = createMock(Hudson.class);
        expect(hudson.getNodes()).andReturn(Lists.<Node>newArrayList()).anyTimes();
        expect(hudson.getInitLevel()).andReturn(InitMilestone.STARTED).anyTimes();
        expect(hudson.getRootDir()).andReturn(new File("./target/matrix")).anyTimes();
        ExtensionList<TransientProjectActionFactory> actionList = ExtensionList.create(hudson,
            TransientProjectActionFactory.class);
        expect(hudson.getExtensionList(TransientProjectActionFactory.class)).andReturn(actionList).anyTimes();
        ExtensionList<SaveableListener> saveableListenerList = ExtensionList.create(hudson, SaveableListener.class);
        expect(hudson.getExtensionList(SaveableListener.class)).andReturn(saveableListenerList).anyTimes();
        expect(hudson.getAllItems(MatrixConfiguration.class)).andReturn(Lists.<MatrixConfiguration>newArrayList()).anyTimes();
        mockStatic(Hudson.class);
        expect(Hudson.getInstance()).andReturn(hudson).anyTimes();
        replayAll();
        MatrixProject project = (MatrixProject) Items.getConfigFile(config).read();
        project.setAllowSave(false);
View Full Code Here

        List<Job> jobs = new ArrayList<Job>();
        jobs.add(project1);
        jobs.add(child1);
        jobs.add(child);

        Hudson hudson = createMock(Hudson.class);
        mockStatic(Hudson.class);
        expect(hudson.getAllItems(Job.class)).andReturn(jobs).anyTimes();
        expect(Hudson.getInstance()).andReturn(hudson).anyTimes();
        replay(Hudson.class, hudson);

        //Can't unlink from null project
        assertFalse(CascadingUtil.unlinkProjectFromCascadingParents(null, cascadingName));
View Full Code Here

        List<Job> jobs = new ArrayList<Job>();
        jobs.add(project1);
        jobs.add(project2);
        jobs.add(project3);

        Hudson hudson = createMock(Hudson.class);
        mockStatic(Hudson.class);
        expect(hudson.getAllItems(Job.class)).andReturn(jobs);
        expect(Hudson.getInstance()).andReturn(hudson);
        replay(Hudson.class, hudson);

        CascadingUtil.unlinkProjectFromCascadingParents(project1, "p2");
        //Project3 should disappear from project1's children.
View Full Code Here

        FreeStyleProjectMock project2 = new FreeStyleProjectMock("child");
        project2.setCascadingProject(project1);
        jobs.add(project1);
        jobs.add(project2);
        mockStatic(Hudson.class);
        Hudson hudson = createMock(Hudson.class);
        expect(hudson.getAllItems(Job.class)).andReturn(jobs);
        expect(Hudson.getInstance()).andReturn(hudson);
        replay(Hudson.class, hudson);
        CascadingUtil.renameCascadingParentLinks(oldName, newName);
        verify(Hudson.class, hudson);
        assertEquals(newName, project2.getCascadingProjectName());
View Full Code Here

        jobs.add(project1);
        jobs.add(project2);
        jobs.add(project3);
        jobs.add(project4);

        Hudson hudson = createMock(Hudson.class);
        mockStatic(Hudson.class);
        expect(hudson.getAllItems(Job.class)).andReturn(jobs).anyTimes();
        expect(Hudson.getInstance()).andReturn(hudson).anyTimes();
        replay(Hudson.class, hudson);

        project2.setCascadingProject(project1);
        CascadingUtil.linkCascadingProjectsToChild(project1, "p2");
View Full Code Here

        jobs.add(project1);
        jobs.add(project2);
        jobs.add(project3);
        jobs.add(project4);

        Hudson hudson = createMock(Hudson.class);
        mockStatic(Hudson.class);
        expect(hudson.getAllItems(Job.class)).andReturn(jobs).anyTimes();
        expect(Hudson.getInstance()).andReturn(hudson).anyTimes();
        replay(Hudson.class, hudson);

        project2.setCascadingProject(project1);
        CascadingUtil.linkCascadingProjectsToChild(project1, "p2");
View Full Code Here

        JSONObject archiver = new JSONObject();
        archiver.put("javadoc_dir", "dir");
        archiver.put("keep_all", true);
        JSONObject json = new JSONObject();
        json.put(javadocArchiverKey, archiver);
        Hudson hudson = createMock(Hudson.class);
        Descriptor<Publisher> javadocDescriptor = new JavadocArchiver.DescriptorImpl();
        expect(hudson.getDescriptorOrDie(JavadocArchiver.class)).andReturn(javadocDescriptor);
        JavadocArchiver javadocArchiver = new JavadocArchiver("dir", true);
        expect(req.bindJSON(JavadocArchiver.class, archiver)).andReturn(javadocArchiver).anyTimes();

        List<Descriptor<Publisher>> descriptors = new ArrayList<Descriptor<Publisher>>();
        descriptors.add(javadocDescriptor);
View Full Code Here

TOP

Related Classes of hudson.model.Hudson

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.