aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-01-06 02:28:10 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2013-01-06 02:28:47 +0100
commit15d61bce4cc56b2ee6b87e46eaff2afcf0b7cdaa (patch)
treef79ee79b982ab46724bbd94577bb0c3eb7fca16a
parent9199316feef9d751ce73bb71d065345b585d3126 (diff)
downloadesper-testing-15d61bce4cc56b2ee6b87e46eaff2afcf0b7cdaa.tar.gz
esper-testing-15d61bce4cc56b2ee6b87e46eaff2afcf0b7cdaa.tar.bz2
esper-testing-15d61bce4cc56b2ee6b87e46eaff2afcf0b7cdaa.tar.xz
esper-testing-15d61bce4cc56b2ee6b87e46eaff2afcf0b7cdaa.zip
o Relaxed parsing of xml files in case the file is missing.
-rwxr-xr-xsrc/main/java/io/trygvis/esper/testing/web/resource/JenkinsResource.java12
-rw-r--r--src/main/webapp/apps/jenkinsApp/build.html2
-rw-r--r--src/main/webapp/apps/jenkinsApp/jenkinsApp.js2
-rwxr-xr-xsrc/main/webapp/apps/jenkinsApp/job.html2
-rw-r--r--src/main/webapp/apps/jenkinsApp/server-list.html3
-rw-r--r--src/main/webapp/apps/jenkinsApp/server.html3
6 files changed, 21 insertions, 3 deletions
diff --git a/src/main/java/io/trygvis/esper/testing/web/resource/JenkinsResource.java b/src/main/java/io/trygvis/esper/testing/web/resource/JenkinsResource.java
index bd0c613..3169096 100755
--- a/src/main/java/io/trygvis/esper/testing/web/resource/JenkinsResource.java
+++ b/src/main/java/io/trygvis/esper/testing/web/resource/JenkinsResource.java
@@ -1,5 +1,6 @@
package io.trygvis.esper.testing.web.resource;
+import fj.data.*;
import io.trygvis.esper.testing.*;
import io.trygvis.esper.testing.jenkins.*;
import io.trygvis.esper.testing.jenkins.xml.*;
@@ -151,9 +152,16 @@ public class JenkinsResource extends AbstractResource {
protected SqlF<JenkinsBuildDto, JenkinsBuildJson> getJenkinsBuildJson = new SqlF<JenkinsBuildDto, JenkinsBuildJson>() {
public JenkinsBuildJson apply(JenkinsBuildDto dto) throws SQLException {
- JenkinsBuildXml xml = daos.fileDao.load(dto.file).toFj().
+ Option<JenkinsBuildXml> xmlO = daos.fileDao.load(dto.file).toFj().
bind(xmlParser.parseDocument).
- bind(JenkinsBuildXml.parse).some();
+ bind(JenkinsBuildXml.parse);
+
+ if(xmlO.isNone()) {
+ return new JenkinsBuildJson(dto.uuid, dto.createdDate, new DateTime(dto.createdDate),
+ "unknown", 0, 0);
+ }
+
+ JenkinsBuildXml xml = xmlO.some();
return new JenkinsBuildJson(dto.uuid, dto.createdDate, new DateTime(xml.timestamp),
xml.result.orSome("unknown"), xml.number, xml.duration);
diff --git a/src/main/webapp/apps/jenkinsApp/build.html b/src/main/webapp/apps/jenkinsApp/build.html
index 02fa60b..7239c90 100644
--- a/src/main/webapp/apps/jenkinsApp/build.html
+++ b/src/main/webapp/apps/jenkinsApp/build.html
@@ -1,5 +1,7 @@
<div class="container">
+ <navbar/>
+
<div class="page-header">
<h1>Jenkins Build</h1>
</div>
diff --git a/src/main/webapp/apps/jenkinsApp/jenkinsApp.js b/src/main/webapp/apps/jenkinsApp/jenkinsApp.js
index 1cd2d2a..e42c67b 100644
--- a/src/main/webapp/apps/jenkinsApp/jenkinsApp.js
+++ b/src/main/webapp/apps/jenkinsApp/jenkinsApp.js
@@ -1,6 +1,6 @@
'use strict';
-var jenkinsApp = angular.module('jenkinsApp', ['jenkinsServer', 'jenkinsJob', 'jenkinsBuild', 'pagingTableService']).config(function ($routeProvider) {
+var jenkinsApp = angular.module('jenkinsApp', ['jenkinsServer', 'jenkinsJob', 'jenkinsBuild', 'core.directives', 'pagingTableService']).config(function ($routeProvider) {
$routeProvider.
when('/', {controller: ServerListCtrl, templateUrl: '/apps/jenkinsApp/server-list.html?noCache=' + noCache}).
when('/server/:uuid', {controller: ServerCtrl, templateUrl: '/apps/jenkinsApp/server.html?noCache=' + noCache}).
diff --git a/src/main/webapp/apps/jenkinsApp/job.html b/src/main/webapp/apps/jenkinsApp/job.html
index 027748a..8942ab7 100755
--- a/src/main/webapp/apps/jenkinsApp/job.html
+++ b/src/main/webapp/apps/jenkinsApp/job.html
@@ -1,5 +1,7 @@
<div class="container">
+ <navbar/>
+
<div class="page-header">
<h1>Jenkins Job</h1>
</div>
diff --git a/src/main/webapp/apps/jenkinsApp/server-list.html b/src/main/webapp/apps/jenkinsApp/server-list.html
index e488186..9e297e6 100644
--- a/src/main/webapp/apps/jenkinsApp/server-list.html
+++ b/src/main/webapp/apps/jenkinsApp/server-list.html
@@ -1,4 +1,7 @@
<div class="container">
+
+ <navbar/>
+
<div class="page-header">
<h1>Jenkins Servers</h1>
</div>
diff --git a/src/main/webapp/apps/jenkinsApp/server.html b/src/main/webapp/apps/jenkinsApp/server.html
index 03be57e..7fbd9f5 100644
--- a/src/main/webapp/apps/jenkinsApp/server.html
+++ b/src/main/webapp/apps/jenkinsApp/server.html
@@ -1,5 +1,8 @@
<div class="container">
+ <navbar/>
+
+
<div class="page-header">
<h1>Jenkins Server</h1>
</div>