Package hudson.model

Examples of hudson.model.ItemGroup


            if (s.equals(".")) {
                continue;
            }

            if (ctx instanceof ItemGroup) {
                ItemGroup g = (ItemGroup) ctx;
                Item i = g.getItem(s);
                if (i==null || !i.hasPermission(Item.READ)) {
                    ctx=null;    // can't go up further
                    break;
                }
                ctx=i;
View Full Code Here


     *      null if either such {@link Item} doesn't exist under the given full name,
     *      or it exists but it's no an instance of the given type.
     */
    public <T extends Item> T getItemByFullName(String fullName, Class<T> type) {
        StringTokenizer tokens = new StringTokenizer(fullName,"/");
        ItemGroup parent = this;

        if(!tokens.hasMoreTokens()) return null;    // for example, empty full name.

        while(true) {
            Item item = parent.getItem(tokens.nextToken());
            if(!tokens.hasMoreTokens()) {
                if(type.isInstance(item))
                    return type.cast(item);
                else
                    return null;
View Full Code Here

        DiskUsageProperty property = project.getProperty(DiskUsageProperty.class);
        if(property!=null){
            diskUsage += property.getAllNonSlaveOrCustomWorkspaceSize();
        }
        if(project instanceof ItemGroup){
            ItemGroup group = (ItemGroup) project;
            for(Object i:group.getItems()){
                if(i instanceof AbstractProject){
                    AbstractProject p = (AbstractProject) i;
                    DiskUsageProperty prop = (DiskUsageProperty) p.getProperty(DiskUsageProperty.class);
                    if(prop!=null){
                        diskUsage += prop.getAllNonSlaveOrCustomWorkspaceSize();
View Full Code Here

        DiskUsageProperty property = project.getProperty(DiskUsageProperty.class);
        if(property!=null){
            diskUsage += property.getAllWorkspaceSize();
        }
        if(project instanceof ItemGroup){
            ItemGroup group = (ItemGroup) project;
            for(Object i:group.getItems()){
                if(i instanceof AbstractProject){
                    AbstractProject p = (AbstractProject) i;
                    DiskUsageProperty prop = (DiskUsageProperty) p.getProperty(DiskUsageProperty.class);
                    if(prop!=null){
                        diskUsage += prop.getAllWorkspaceSize();
View Full Code Here

        Long buildsDiskUsage = 0l;
        Long locked = 0l;
        Long notLoaded = 0L;
        for(Object item: group.getItems()){
            if(item instanceof ItemGroup){
               ItemGroup subGroup = (ItemGroup) item;
               buildsDiskUsage += getBuildsDiskUsageAllSubItems(subGroup, older, yonger).get("all");
               locked += getBuildsDiskUsageAllSubItems(subGroup, older, yonger).get("locked");
               notLoaded += getBuildsDiskUsageAllSubItems(subGroup, older, yonger).get("notLoaded");
            }
            else{
View Full Code Here

        Long buildsDiskUsage = 0l;
        Long locked = 0l;
        Long notLoaded = 0l;
        if (project != null) {
            if(project instanceof ItemGroup){
               ItemGroup group = (ItemGroup) project;
               Map<String,Long> sizes = getBuildsDiskUsageAllSubItems(group, older, yonger);
               buildsDiskUsage += sizes.get("all");
               locked += sizes.get("locked");
               notLoaded += sizes.get("notLoaded");
            }
View Full Code Here

    private JobStateRecipe withShortUrl(String url) {
        when(job.getShortUrl()).thenReturn(url);

        // This might not necessarily belong here,
        // but I don't need to introduce the concept of a parent anywhere else yet.
        ItemGroup parent = mock(ItemGroup.class);
        when(parent.getUrl()).thenReturn("job/");
        when(job.getParent()).thenReturn(parent);

        return this;
    }
View Full Code Here

    HealthReport healthMock = mock(HealthReport.class);
    when(healthMock.getDescription()).thenReturn("Fine");
    when(healthMock.getScore()).thenReturn(100);
   
    AbstractMavenProject job = mock(AbstractMavenProject.class);
    ItemGroup parent = mock(ItemGroup.class);
    when(parent.getFullDisplayName()).thenReturn("");
    when(job.getParent()).thenReturn(parent);
        when(job.getFullDisplayName()).thenReturn("fsProject");
        when(job.getLastBuild()).thenReturn(build);
        when(job.getBuildHealth()).thenReturn(healthMock);
   
View Full Code Here

        HealthReport healthMock = mock(HealthReport.class);
        when(healthMock.getDescription()).thenReturn("Cloudy");
        when(healthMock.getScore()).thenReturn(0);

        AbstractMavenProject job = mock(AbstractMavenProject.class);
    ItemGroup parent = mock(ItemGroup.class);
    when(parent.getFullDisplayName()).thenReturn("");
    when(job.getParent()).thenReturn(parent);
        when(job.getFullDisplayName()).thenReturn("fsProject");
        when(job.getLastBuild()).thenReturn(build);
        when(job.getBuildHealth()).thenReturn(healthMock);
     
View Full Code Here

    public static RelativeLocation of(Job job) {
        return new RelativeLocation(job);
    }

    public String name() {
        ItemGroup ig = null;

        StaplerRequest request = Stapler.getCurrentRequest();
        for( Ancestor a : request.getAncestors() ) {
            if(a.getObject() instanceof BuildMonitorView) {
                ig = ((View) a.getObject()).getOwnerItemGroup();
View Full Code Here

TOP

Related Classes of hudson.model.ItemGroup

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.