Package hudson.model

Examples of hudson.model.DependencyGraph


     *      True if any upstream projects are building or in queue, false otherwise.
     */
    @SuppressWarnings("rawtypes")
        private boolean areUpstreamsBuilding(AbstractProject<?,?> downstreamProject,
        AbstractProject<?,?> excludeProject) {
      DependencyGraph graph = Jenkins.getInstance().getDependencyGraph();
      Set<AbstractProject> tups = graph.getTransitiveUpstream(downstreamProject);
      for (AbstractProject tup : tups) {
        if(tup!=excludeProject && (tup.isBuilding() || tup.isInQueue()))
          return true;
      }
      return false;
View Full Code Here


      }
      return false;
    }

    private boolean inDownstreamProjects(AbstractProject<?,?> downstreamProject) {
      DependencyGraph graph = Jenkins.getInstance().getDependencyGraph();
      Set<AbstractProject> tups = graph.getTransitiveUpstream(downstreamProject);
   
      for (AbstractProject tup : tups) {
        List<AbstractProject<?,?>> downstreamProjects = getUpstreamProject().getDownstreamProjects();
        for (AbstractProject<?,?> dp : downstreamProjects) {
          if(dp!=getUpstreamProject() && dp!=downstreamProject && dp==tup)
View Full Code Here

       
        addModuleAsPluginDependency(this.module, pluginModule);
       
        when(this.module.getAllMavenModules()).thenReturn(Lists.newArrayList(this.module, pluginModule));
       
        DependencyGraph graph = MockHelper.mockDependencyGraph(
                Lists.<AbstractProject<?,?>>newArrayList(this.module, pluginModule));
        graph.build();
       
        @SuppressWarnings("rawtypes")
        List<AbstractProject> downstream = graph.getDownstream(pluginModule);
        Assert.assertEquals(1, downstream.size());
        Assert.assertSame(this.module, downstream.get(0));
    }
View Full Code Here

     *      Receives the progress report.
     */
    public static boolean execute(AbstractBuild build, BuildListener listener) {
        PrintStream logger = listener.getLogger();
        // Check all downstream Project of the project, not just those defined by BuildTrigger
        final DependencyGraph graph = Jenkins.getInstance().getDependencyGraph();
        List<Dependency> downstreamProjects = new ArrayList<Dependency>(
                graph.getDownstreamDependencies(build.getProject()));
        // Sort topologically
        Collections.sort(downstreamProjects, new Comparator<Dependency>() {
            public int compare(Dependency lhs, Dependency rhs) {
                // Swapping lhs/rhs to get reverse sort:
                return graph.compare(rhs.getDownstreamProject(), lhs.getDownstreamProject());
            }
        });

        for (Dependency dep : downstreamProjects) {
            AbstractProject p = dep.getDownstreamProject();
View Full Code Here

    /**
     * Rebuilds the dependency map.
     */
    public void rebuildDependencyGraph() {
        DependencyGraph graph = new DependencyGraph();
        graph.build();
        // volatile acts a as a memory barrier here and therefore guarantees
        // that graph is fully build, before it's visible to other threads
        dependencyGraph = graph;
    }
View Full Code Here

      return upStreamParameters;
    }
    }
   
    private boolean inDownstreamProjects(AbstractProject downstreamProject) {
        DependencyGraph graph = Hudson.getInstance().getDependencyGraph();
        Set<AbstractProject> tups = graph.getTransitiveUpstream(downstreamProject);
       
        for (AbstractProject tup : tups) {
            for (AbstractProject<?,?> dp : getParent().getDownstreamProjects()) {
                if(dp!=getParent() && dp!=downstreamProject && dp==tup)
                    return true;
View Full Code Here

     * @return
     *      True if any upstream projects are building or in queue, false otherwise.
     */
    private boolean areUpstreamsBuilding(AbstractProject downstreamProject,
                                                   AbstractProject excludeProject) {
        DependencyGraph graph = Hudson.getInstance().getDependencyGraph();
        Set<AbstractProject> tups = graph.getTransitiveUpstream(downstreamProject);
        for (AbstractProject tup : tups) {
            if(tup!=excludeProject && (tup.isBuilding() || tup.isInQueue()))
                return true;
        }
        return false;
View Full Code Here

        CauseOfBlockage cob = super.getCauseOfBlockage();
        if (cob != null)
            return cob;

        if (!getParent().isAggregatorStyleBuild()) {
            DependencyGraph graph = Hudson.getInstance().getDependencyGraph();
            for (AbstractProject tup : graph.getTransitiveUpstream(this)) {
                if(getParent() == tup.getParent() && (tup.isBuilding() || tup.isInQueue()))
                        return new BecauseOfUpstreamModuleBuildInProgress(tup);
            }
        }
View Full Code Here

     *      Receives the progress report.
     */
    public static boolean execute(AbstractBuild build, BuildListener listener) {
        PrintStream logger = listener.getLogger();
        // Check all downstream Project of the project, not just those defined by BuildTrigger
        final DependencyGraph graph = Hudson.getInstance().getDependencyGraph();
        List<Dependency> downstreamProjects = new ArrayList<Dependency>(
                graph.getDownstreamDependencies(build.getProject()));
        // Sort topologically
        Collections.sort(downstreamProjects, new Comparator<Dependency>() {
            public int compare(Dependency lhs, Dependency rhs) {
                // Swapping lhs/rhs to get reverse sort:
                return graph.compare(rhs.getDownstreamProject(), lhs.getDownstreamProject());
            }
        });

        for (Dependency dep : downstreamProjects) {
            AbstractProject p = dep.getDownstreamProject();
View Full Code Here

TOP

Related Classes of hudson.model.DependencyGraph

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.