@Before
  public void setUp() throws Exception {
    java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit")
        .setLevel(java.util.logging.Level.SEVERE);

    j.jenkins.setAuthorizationStrategy(new FullControlOnceLoggedInAuthorizationStrategy());
    j.jenkins.setSecurityRealm(j.createDummySecurityRealm());

    createKnowledgeBase();
    project = j.createFreeStyleProject("x");
    project.getBuildersList().add(new FailureBuilder());
    project.getPublishersList().add(new ClaimPublisher());
    build = project.scheduleBuild2(0).get();
  }
Пример #2
0
 @Override
 public void onRenamed(Item item, String oldName, String newName) {
   // update DownstreamTrigger of other projects that point to this object.
   // can't we generalize this?
   for (Project<?, ?> p : Hudson.getInstance().getProjects()) {
     DownstreamTrigger t = p.getPublishersList().get(DownstreamTrigger.class);
     if (t != null) {
       if (t.onJobRenamed(oldName, newName)) {
         try {
           p.save();
         } catch (IOException e) {
           LOGGER.log(
               Level.WARNING,
               "Failed to persist project setting during rename from "
                   + oldName
                   + " to "
                   + newName,
               e);
         }
       }
     }
   }
 }