Example #1
0
 @Before
 public void setUp() throws Exception {
   File f = new File(new File(System.getProperty("user.home")), ".jenkins-ci.org");
   if (!f.exists()) {
     LOGGER.warning(f + " doesn't exist. Skipping JDK installation tests");
   } else {
     Properties prop = new Properties();
     FileInputStream in = new FileInputStream(f);
     try {
       prop.load(in);
       String u = prop.getProperty("oracle.userName");
       String p = prop.getProperty("oracle.password");
       if (u == null || p == null) {
         LOGGER.warning(
             f
                 + " doesn't contain oracle.userName and oracle.password. Skipping JDK installation tests.");
       } else {
         DescriptorImpl d = j.jenkins.getDescriptorByType(DescriptorImpl.class);
         d.doPostCredential(u, p);
       }
     } finally {
       in.close();
     }
   }
 }