diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/io/trygvis/esper/testing/jenkins/CreateMissingMavenModuleJobsApp.java | 29 | ||||
-rw-r--r-- | src/test/java/io/trygvis/esper/testing/jenkins/SetJobTypeApp.java | 28 |
2 files changed, 23 insertions, 34 deletions
diff --git a/src/test/java/io/trygvis/esper/testing/jenkins/CreateMissingMavenModuleJobsApp.java b/src/test/java/io/trygvis/esper/testing/jenkins/CreateMissingMavenModuleJobsApp.java index 13a78d7..bdf4018 100644 --- a/src/test/java/io/trygvis/esper/testing/jenkins/CreateMissingMavenModuleJobsApp.java +++ b/src/test/java/io/trygvis/esper/testing/jenkins/CreateMissingMavenModuleJobsApp.java @@ -1,24 +1,20 @@ package io.trygvis.esper.testing.jenkins; -import java.net.URI; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.List; -import java.util.UUID; - +import com.jolbox.bonecp.*; import fj.*; +import fj.data.*; +import io.trygvis.esper.testing.*; import io.trygvis.esper.testing.core.db.*; -import org.apache.abdera.Abdera; -import org.codehaus.httpcache4j.cache.HTTPCache; +import io.trygvis.esper.testing.util.*; +import org.apache.abdera.*; +import org.codehaus.httpcache4j.cache.*; -import com.jolbox.bonecp.BoneCPDataSource; - -import fj.data.Option; -import io.trygvis.esper.testing.Config; -import io.trygvis.esper.testing.util.HttpClient; +import java.net.*; +import java.sql.*; +import java.util.List; +import java.util.*; -import static io.trygvis.esper.testing.jenkins.JenkinsClient.apiXml; +import static io.trygvis.esper.testing.jenkins.JenkinsClient.*; public class CreateMissingMavenModuleJobsApp { public static void main(String[] args) throws Exception { @@ -33,12 +29,11 @@ public class CreateMissingMavenModuleJobsApp { // PreparedStatement s2 = c.prepareStatement("UPDATE jenkins_job SET job_type=? WHERE uuid=?"); PreparedStatement s = c.prepareStatement("SELECT " + JenkinsDao.JENKINS_JOB + " FROM jenkins_job WHERE job_type='MAVEN_MODULE'"); - ResultSet rs = s.executeQuery(); JenkinsDao dao = new JenkinsDao(c); FileDao fileDao = new FileDao(c); - List<JenkinsJobDto> jobs = dao.toJobList(rs); + List<JenkinsJobDto> jobs = Util.toList(s, JenkinsDao.jenkinsJob); System.out.println("jobs.size() = " + jobs.size()); diff --git a/src/test/java/io/trygvis/esper/testing/jenkins/SetJobTypeApp.java b/src/test/java/io/trygvis/esper/testing/jenkins/SetJobTypeApp.java index f272feb..25e629c 100644 --- a/src/test/java/io/trygvis/esper/testing/jenkins/SetJobTypeApp.java +++ b/src/test/java/io/trygvis/esper/testing/jenkins/SetJobTypeApp.java @@ -1,21 +1,18 @@ package io.trygvis.esper.testing.jenkins; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.List; - +import com.jolbox.bonecp.*; import fj.*; -import org.apache.abdera.Abdera; -import org.codehaus.httpcache4j.cache.HTTPCache; - -import com.jolbox.bonecp.BoneCPDataSource; +import fj.data.*; +import io.trygvis.esper.testing.*; +import io.trygvis.esper.testing.util.*; +import org.apache.abdera.*; +import org.codehaus.httpcache4j.cache.*; -import fj.data.Option; -import io.trygvis.esper.testing.Config; -import io.trygvis.esper.testing.util.HttpClient; +import java.sql.*; +import java.util.List; -import static io.trygvis.esper.testing.jenkins.JenkinsClient.apiXml; +import static io.trygvis.esper.testing.jenkins.JenkinsClient.*; +import static io.trygvis.esper.testing.jenkins.JenkinsDao.*; public class SetJobTypeApp { public static void main(String[] args) throws Exception { @@ -30,11 +27,8 @@ public class SetJobTypeApp { PreparedStatement s2 = c.prepareStatement("UPDATE jenkins_job SET job_type=? WHERE uuid=?"); PreparedStatement s = c.prepareStatement("SELECT " + JenkinsDao.JENKINS_JOB + " FROM jenkins_job WHERE job_type IS NULL"); - ResultSet rs = s.executeQuery(); - - JenkinsDao dao = new JenkinsDao(c); - List<JenkinsJobDto> jobs = dao.toJobList(rs); + List<JenkinsJobDto> jobs = Util.toList(s, jenkinsJob); System.out.println("jobs.size() = " + jobs.size()); |