@Override public boolean add(FingerprintFacet e) { facets.add(e); return true; }
/** * @param paneId panel name * @return the actual state of panel */ public boolean toggleCollapsed(String paneId) throws IOException { if (collapsed.contains(paneId)) { collapsed.remove(paneId); return false; } else { collapsed.add(paneId); return true; } }
/** * Bare-minimum configuration mechanism to change the update center. */ @RequirePOST public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Jenkins hudson = Jenkins.getInstance(); hudson.checkPermission(CONFIGURE_UPDATECENTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals(UpdateCenter.ID_DEFAULT)) sites.remove(s); } sites.add(new UpdateSite(UpdateCenter.ID_DEFAULT, site)); return new HttpRedirect("advanced"); }
@Override public boolean add(FingerprintFacet e) { facets.add(e); return true; }
/** * @param paneId panel name * @return the actual state of panel */ public boolean toggleCollapsed(String paneId) throws IOException { if (collapsed.contains(paneId)) { collapsed.remove(paneId); return false; } else { collapsed.add(paneId); return true; } }
/** * Configures the update center setting for the test. * By default, we load updates from local proxy to avoid network traffic as much as possible. */ protected void configureUpdateCenter() throws Exception { final String updateCenterUrl = "http://localhost:"+ JavaNetReverseProxy.getInstance().localPort+"/update-center.json"; // don't waste bandwidth talking to the update center DownloadService.neverUpdate = true; UpdateSite.neverUpdate = true; PersistedList<UpdateSite> sites = hudson.getUpdateCenter().getSites(); sites.clear(); sites.add(new UpdateSite("default", updateCenterUrl)); }
/** * Bare-minimum configuration mechanism to change the update center. */ public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals("default")) sites.remove(s); } sites.add(new UpdateSite("default",site)); return HttpResponses.redirectToContextRoot(); }
/** * Bare-minimum configuration mechanism to change the update center. */ public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals("default")) sites.remove(s); } sites.add(new UpdateSite("default",site)); return HttpResponses.redirectToContextRoot(); }
/** * Bare-minimum configuration mechanism to change the update center. */ public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals("default")) sites.remove(s); } sites.add(new UpdateSite("default",site)); return HttpResponses.redirectToContextRoot(); }
/** * Configures the update center setting for the test. By default, we load * updates from local proxy to avoid network traffic as much as possible. */ protected void configureUpdateCenter() throws Exception { final String updateCenterUrl = "http://localhost:" + JavaNetReverseProxy.getInstance().localPort + "/update-center.json"; // don't waste bandwidth talking to the update center DownloadService.neverUpdate = true; UpdateSite.neverUpdate = true; PersistedList<UpdateSite> sites = hudson.getUpdateCenter().getSites(); sites.clear(); sites.add(new UpdateSite("default", updateCenterUrl)); }
/** * Configures the update center setting for the test. * By default, we load updates from local proxy to avoid network traffic as much as possible. */ protected void configureUpdateCenter() throws Exception { final String updateCenterUrl = "http://localhost:"+ JavaNetReverseProxy.getInstance().localPort+"/update-center.json"; // don't waste bandwidth talking to the update center DownloadService.neverUpdate = true; UpdateSite.neverUpdate = true; PersistedList<UpdateSite> sites = hudson.getUpdateCenter().getSites(); sites.clear(); sites.add(new UpdateSite("default", updateCenterUrl)); }
/** * Bare-minimum configuration mechanism to change the update center. */ public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals("default")) { sites.remove(s); } } sites.add(new UpdateSite("default", site)); return HttpResponses.redirectToContextRoot(); }
/** * Configures the update center setting for the test. * By default, we load updates from local proxy to avoid network traffic as much as possible. */ protected void configureUpdateCenter() throws Exception { final String updateCenterUrl = "http://localhost:"+ JavaNetReverseProxy.getInstance().localPort+"/update-center.json"; // don't waste bandwidth talking to the update center DownloadService.neverUpdate = true; UpdateSite.neverUpdate = true; PersistedList<UpdateSite> sites = jenkins.getUpdateCenter().getSites(); sites.clear(); sites.add(new UpdateSite("default", updateCenterUrl)); }
/** * This web method requires POST, admin rights and nonnull repo. * Responds with redirect to monitor page * * @param repo to be ignored. Never null */ @RequirePOST @ValidateRepoName @RequireAdminRights @RespondWithRedirect public void doIgnore(@Nonnull @GHRepoName GitHubRepositoryName repo) { if (!ignored.contains(repo)) { ignored.add(repo); } resolveProblem(repo); }
/** * Bare-minimum configuration mechanism to change the update center. */ @RequirePOST public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Jenkins hudson = Jenkins.getInstance(); hudson.checkPermission(CONFIGURE_UPDATECENTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals(UpdateCenter.ID_DEFAULT)) sites.remove(s); } sites.add(new UpdateSite(UpdateCenter.ID_DEFAULT, site)); return new HttpRedirect("advanced"); }
/** * Configures the update center setting for the test. * By default, we load updates from local proxy to avoid network traffic as much as possible. */ protected void configureUpdateCenter() throws Exception { final String updateCenterUrl; jettyLevel(Level.WARNING); try { updateCenterUrl = "http://localhost:"+ JavaNetReverseProxy.getInstance().localPort+"/update-center.json"; } finally { jettyLevel(Level.INFO); } // don't waste bandwidth talking to the update center DownloadService.neverUpdate = true; UpdateSite.neverUpdate = true; PersistedList<UpdateSite> sites = jenkins.getUpdateCenter().getSites(); sites.clear(); sites.add(new UpdateSite("default", updateCenterUrl)); }
@Override public void evaluate() throws Throwable { sampleGitRepo.init(); sampleGitRepo.write("Jenkinsfile", "def _scm = scm; semaphore 'wait'; node {checkout _scm; echo readFile('file')}"); sampleGitRepo.write("file", "initial content"); sampleGitRepo.git("add", "Jenkinsfile"); sampleGitRepo.git("commit", "--all", "--message=flow"); WorkflowMultiBranchProject mp = story.j.jenkins.createProject(WorkflowMultiBranchProject.class, "p"); mp.getSourcesList().add(new BranchSource(new GitSCMSource(null, sampleGitRepo.toString(), "", "*", "", false), new DefaultBranchPropertyStrategy(new BranchProperty[0]))); WorkflowJob p = WorkflowMultiBranchProjectTest.scheduleAndFindBranchProject(mp, "master"); SemaphoreStep.waitForStart("wait/1", null); WorkflowRun b1 = p.getLastBuild(); assertNotNull(b1); } });
@Test public void deletedJenkinsfile() throws Exception { sampleGitRepo.init(); sampleGitRepo.write("Jenkinsfile", "node { echo 'Hello World' }"); sampleGitRepo.git("add", "Jenkinsfile"); sampleGitRepo.git("commit", "--all", "--message=flow"); WorkflowMultiBranchProject mp = r.jenkins.createProject(WorkflowMultiBranchProject.class, "p"); mp.getSourcesList().add(new BranchSource(new GitSCMSource(null, sampleGitRepo.toString(), "", "*", "", false))); WorkflowJob p = WorkflowMultiBranchProjectTest.scheduleAndFindBranchProject(mp, "master"); assertEquals(1, mp.getItems().size()); r.waitUntilNoActivity(); WorkflowRun b1 = p.getLastBuild(); assertEquals(1, b1.getNumber()); sampleGitRepo.git("rm", "Jenkinsfile"); sampleGitRepo.git("commit", "--all", "--message=remove"); WorkflowRun b2 = r.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); r.assertLogContains("Jenkinsfile not found", b2); }
@Test public void durabilityHintByPropertyStep() throws Exception { sampleRepo.init(); sampleRepo.write("Jenkinsfile", "properties([durabilityHint('" + FlowDurabilityHint.SURVIVABLE_NONATOMIC.getName()+"')])\n"+ "echo 'whynot'"); sampleRepo.git("add", "Jenkinsfile"); sampleRepo.git("commit", "--all", "--message=flow"); WorkflowMultiBranchProject mp = r.jenkins.createProject(WorkflowMultiBranchProject.class, "p"); mp.getSourcesList().add(new BranchSource(new GitSCMSource(null, sampleRepo.toString(), "", "*", "", false))); WorkflowJob p = scheduleAndFindBranchProject(mp, "master"); r.waitUntilNoActivity(); WorkflowRun b1 = p.getLastBuild(); Assert.assertEquals(Result.SUCCESS, b1.getResult()); DurabilityHintJobProperty prop = p.getProperty(DurabilityHintJobProperty.class); Assert.assertEquals(FlowDurabilityHint.SURVIVABLE_NONATOMIC, prop.getHint()); }