Package hudson.model

Examples of hudson.model.AbstractProject


    }
   
    @Test
    @LocalData
    public void testLoadingAllBuildInformationFromPreviousVersion(){
       AbstractProject project = (AbstractProject) j.jenkins.getItem("project1");
       DiskUsageProperty property = (DiskUsageProperty) project.getProperty(DiskUsageProperty.class);   
       assertEquals("Builds information should be loaded.", 8, property.getDiskUsageOfBuilds().size(), 0);
    }
View Full Code Here


    public String getUrlName() {
        return Messages.UrlName();
    }
   
    public void setDiskUsage(Long size) throws IOException{
        AbstractProject project = build.getProject();
        DiskUsageProperty property = (DiskUsageProperty) project.getProperty(DiskUsageProperty.class);
        if(property==null){
            DiskUsageUtil.addProperty(project);
            property = (DiskUsageProperty) project.getProperty(DiskUsageProperty.class);
        }
        DiskUsageBuildInformation information = property.getDiskUsageBuildInformation(build.getId());
        if(information!=null){
            information.setSize(size);
        }
View Full Code Here

   
    /**
     * @return Disk usage of the build (included child builds)
     */
    public Long getDiskUsage() {
        AbstractProject project = build.getProject();
        DiskUsageProperty property = (DiskUsageProperty) project.getProperty(DiskUsageProperty.class);
        if(property==null){
            DiskUsageUtil.addProperty(project);
            property = (DiskUsageProperty) project.getProperty(DiskUsageProperty.class);
        }
        return property.getDiskUsageOfBuild(build.getId());
    }
View Full Code Here

        return property.getDiskUsageOfBuild(build.getId());
    }
   
    public Long getAllDiskUsage(){
        Long buildsDiskUsage = getDiskUsage();
        AbstractProject project = build.getProject();
        if(project instanceof ItemGroup){
           buildsDiskUsage += getBuildsDiskUsageAllSubItems((ItemGroup)project);
        }      
        return buildsDiskUsage;
    }
View Full Code Here

            if(item instanceof ItemGroup){
                buildsDiskUsage += getBuildsDiskUsageAllSubItems((ItemGroup)item);
            }
            else{
                if(item instanceof AbstractProject){
                    AbstractProject project = (AbstractProject) item;
                    DiskUsageProperty property = (DiskUsageProperty) project.getProperty(DiskUsageProperty.class);
                    if(property==null){
                        DiskUsageUtil.addProperty(project);
                        property = (DiskUsageProperty) project.getProperty(DiskUsageProperty.class);
                    }
                    Set<DiskUsageBuildInformation> informations = property.getDiskUsageOfBuilds();
                    for(DiskUsageBuildInformation information :  informations){
                        if(information.getNumber() == build.getNumber()){
                            buildsDiskUsage += information.getSize();
View Full Code Here

        if(diskUsage!=null){
            buildDiskUsage = diskUsage.buildUsage;
            Node node = build.getBuiltOn();
            if(node!=null && diskUsage.wsUsage!=null && diskUsage.wsUsage > 0){
                DiskUsageProperty property = (DiskUsageProperty) build.getProject().getProperty(DiskUsageProperty.class);
                AbstractProject project = build.getProject().getRootProject();
                if(property!=null && (project instanceof TopLevelItem))
                    property.putSlaveWorkspaceSize(node, node.getWorkspaceFor((TopLevelItem)project).getRemote(), diskUsage.wsUsage);
            }
            diskUsage=null;
        }
View Full Code Here

    }
   
    @Test
    @LocalData
    public void testNotBreakLazyLoading() throws IOException{
        AbstractProject project = (AbstractProject) j.jenkins.getItem("project1");
        int loadedBuilds = project._getRuns().getLoadedBuilds().size();
        assertTrue("This tests does not sense if there are loaded all builds.",8>loadedBuilds);
        j.jenkins.getPlugin(DiskUsagePlugin.class).refreshGlobalInformation();
        assertEquals("Size of builds should be loaded.", 47000, j.jenkins.getPlugin(DiskUsagePlugin.class).getCashedGlobalBuildsDiskUsage(), 0);
        assertTrue("No new build should be loaded.", loadedBuilds <= project._getRuns().getLoadedBuilds().size());
    }
View Full Code Here

     *      which becomes a part of the "console output" of this build.
     */
    @Override
    public void onStarted(AbstractBuild build, TaskListener listener) {
        logger.entering(BuildContributorsController.class.getName(), "onStarted({0})", build);
        AbstractProject project = build.getProject();
        JobProperty property = project.getProperty(MetadataJobProperty.class);
        if (property == null) {
            return;
        }
        MetadataBuildAction action = build.getAction(MetadataBuildAction.class);
        if (action == null) {
View Full Code Here

     */
    public List<TopLevelItem> searchQuery(List<TopLevelItem> all) throws Exception {
        List<TopLevelItem> matchedItems = new LinkedList<TopLevelItem>();
        for (TopLevelItem item : all) {
            if (item instanceof AbstractProject) {
                AbstractProject project = (AbstractProject)item;
                MetadataJobProperty property =
                        (MetadataJobProperty)project.getProperty(MetadataJobProperty.class);
                if (property != null) {
                    CommonTreeNodeStream nodes = new CommonTreeNodeStream(queryTree);
                    QueryWalker walker = new QueryWalker(nodes);
                    boolean matchStatus = walker.evaluate(property);
                    if (matchStatus) {
View Full Code Here

    private static final Logger logger = Logger.getLogger(JobCreatedController.class.getName());

    @Override
    public void onCreated(Item item) {
        if (item instanceof AbstractProject) {
            AbstractProject project = (AbstractProject)item;
            JobProperty metadataJobProperty = project.getProperty(MetadataJobProperty.class);
            if (metadataJobProperty == null) {
                try {
                    project.addProperty(new MetadataJobProperty());
                } catch (IOException e) {
                    logger.info("Could not create initial MetadataJobProperty for " + project.getName());
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of hudson.model.AbstractProject

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.