@Test @ConfiguredWithCode("JdkConfiguratorTest.yml") public void should_configure_maven_tools_and_global_config() { final Object descriptor = j.jenkins.getDescriptorOrDie(JDK.class); Assert.assertNotNull(descriptor); Assert.assertEquals(1, ((JDK.DescriptorImpl) descriptor).getInstallations().length); JDK jdk = ((JDK.DescriptorImpl) descriptor).getInstallations()[0]; Assert.assertEquals("jdk8", jdk.getName()); Assert.assertEquals("/jdk", jdk.getHome()); InstallSourceProperty installSourceProperty = jdk.getProperties().get(InstallSourceProperty.class); Assert.assertEquals(1, installSourceProperty.installers.size()); JDKInstaller installer = installSourceProperty.installers.get(JDKInstaller.class); Assert.assertEquals("jdk-8u181-oth-JPR", installer.id); Assert.assertTrue(installer.acceptLicense); } }
@Override public void buildEnvVars(AbstractBuild<?,?> build, Map<String, String> env) { // Add each SCM's env vars, appending indices where needed to avoid collisions for (int i = 0; i < scms.size(); i++) { try { EnvVars currScmVars = new EnvVars(); scms.get(i).buildEnvVars(build, currScmVars); for (Entry<String, String> entry : currScmVars.entrySet()) { if (env.containsKey(entry.getKey())) { // We have a collision; append the index of this SCM to the env var name env.put(entry.getKey() + "_" + i, entry.getValue()); } else { // No collision; just put the var as usual env.put(entry.getKey(), entry.getValue()); } } } catch(NullPointerException npe) {} } }
+ ENTROPY.nextInt((int)TimeUnit.MINUTES.toMillis(HEALTH_REPORT_CACHE_REFRESH_MIN / 2)); reports = new ArrayList<HealthReport>(); List<FolderHealthMetric.Reporter> reporters = new ArrayList<FolderHealthMetric.Reporter>(healthMetrics.size()); boolean recursive = false; boolean topLevelOnly = true;
+ ENTROPY.nextInt((int)TimeUnit.MINUTES.toMillis(HEALTH_REPORT_CACHE_REFRESH_MIN / 2)); reports = new ArrayList<HealthReport>(); List<FolderHealthMetric.Reporter> reporters = new ArrayList<FolderHealthMetric.Reporter>(healthMetrics.size()); boolean recursive = false; boolean topLevelOnly = true;
/** * Make sure we can load the data before we supported views and the configuration of the view * correctly comes back. */ @LocalData @Test public void dataCompatibility() throws Exception { Folder f = (Folder) r.jenkins.getItem("foo"); ListView pv = (ListView)f.getPrimaryView(); assertEquals(2,pv.getColumns().size()); assertEquals(JobColumn.class, pv.getColumns().get(0).getClass()); assertEquals(BuildButtonColumn.class, pv.getColumns().get(1).getClass()); // we only have 2 columns in the zip but we expect a lot more in the out-of-the-box ListView. assertTrue(2<new ListView("test").getColumns().size()); }