aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/io/trygvis
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/io/trygvis')
-rw-r--r--src/test/java/io/trygvis/esper/testing/jenkins/CreateMissingMavenModuleJobsApp.java10
1 files changed, 8 insertions, 2 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 f03086b..a8f8ce7 100644
--- a/src/test/java/io/trygvis/esper/testing/jenkins/CreateMissingMavenModuleJobsApp.java
+++ b/src/test/java/io/trygvis/esper/testing/jenkins/CreateMissingMavenModuleJobsApp.java
@@ -8,6 +8,7 @@ import java.util.List;
import java.util.UUID;
import fj.*;
+import io.trygvis.esper.testing.core.db.*;
import org.apache.abdera.Abdera;
import org.codehaus.httpcache4j.cache.HTTPCache;
@@ -35,6 +36,7 @@ public class CreateMissingMavenModuleJobsApp {
ResultSet rs = s.executeQuery();
JenkinsDao dao = new JenkinsDao(c);
+ FileDao fileDao = new FileDao(c);
List<JenkinsJobDto> jobs = dao.toJobList(rs);
@@ -49,7 +51,9 @@ public class CreateMissingMavenModuleJobsApp {
URI url = URI.create(u);
- Option<P2<JenkinsJobXml,byte[]>> xmlOption = client.fetchJob(apiXml(url));
+ URI uri = apiXml(url);
+
+ Option<P2<JenkinsJobXml,byte[]>> xmlOption = client.fetchJob(uri);
if(xmlOption.isNone()) {
System.out.println("None");
@@ -63,7 +67,9 @@ public class CreateMissingMavenModuleJobsApp {
continue;
}
- UUID uuid = dao.insertJob(jobDto.server, url, jobXml.type, jobXml.displayName);
+ UUID file = fileDao.store(uri, "application/xml", xmlOption.some()._2());
+
+ UUID uuid = dao.insertJob(jobDto.server, file, url, jobXml.type, jobXml.displayName);
System.out.println("New job: " + uuid);
}