Skip to content

Commit

Permalink
Merge pull request #96 from spinnaker/jenkins-23
Browse files Browse the repository at this point in the history
fix xml parsing for jenkins
  • Loading branch information
tomaslin committed May 19, 2016
2 parents be6fb13 + 83da372 commit 0208eda
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.simpleframework.xml.Root
* Represents a build artifact
*/
@CompileStatic
@Root(name = 'artifact')
@Root(name = 'artifact', strict=false)
class BuildArtifact {
@Element(required = false)
String fileName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import org.simpleframework.xml.Root
* Represents a Project returned by the Jenkins service in the project list
*/
@CompileStatic
@Root(name='job')
@Root(name = 'job', strict = false)
class Project {
@ElementList(inline = true, name = "job", required=false)
@ElementList(inline = true, name = "job", required = false)
List<Project> list

@Element String name
@Element
String name
@Element(required = false)
Build lastBuild
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.simpleframework.xml.Root
/**
* Represents a list of projects
*/
@Root(name = 'hudson')
@Root(name = 'hudson', strict = false)
@CompileStatic
class ProjectsList {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.simpleframework.xml.Root
* Represents a build artifact
*/
@CompileStatic
@Root(name = 'action')
@Root(name = 'action', strict = false)
class TestResults {
@Element(required = false)
int failCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.simpleframework.xml.Root
/**
* Represents a list of builds
*/
@Root
@Root(strict=false)
@CompileStatic
class BuildsList {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import org.simpleframework.xml.Root
/**
* Represents a Jenkins job downstream project
*/
@Root(name = 'downstreamProject')
@Root(name = 'downstreamProject', strict=false)
class DownstreamProject extends RelatedProject {
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.simpleframework.xml.Root
/**
* Represents a list of projects
*/
@Root(name = 'hudson')
@Root(name = 'hudson', strict=false)
@CompileStatic
class JobList {

Expand All @@ -33,6 +33,7 @@ class JobList {

}

@Root(strict=false)
class Job {
@ElementList(inline = true, name = "job", required=false)
List<Job> list
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.netflix.spinnaker.igor.jenkins.client.model

import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import org.simpleframework.xml.Element
import org.simpleframework.xml.ElementList
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.netflix.spinnaker.igor.jenkins.client.model

import org.simpleframework.xml.Element
import org.simpleframework.xml.Root

/**
* Represents a upstream/downstream project for a Jenkins job
*/
@Root(strict=false)
class RelatedProject {
@Element
String name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,19 @@ class ScmDetails {
}
}

@Root(strict=false)
class Action{
@Element(required = false)
LastBuiltRevision lastBuiltRevision
}

@Root(strict=false)
class LastBuiltRevision{
@ElementList(inline = true, name = "branch")
List<Branch> branch
}

@Root(strict=false)
class Branch{
@Element(required = false)
String name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import org.simpleframework.xml.Root
/**
* Represents a Jenkins job upstream project
*/
@Root(name = 'upstreamProject')
@Root(name = 'upstreamProject', strict=false)
class UpstreamProject extends RelatedProject {
}

0 comments on commit 0208eda

Please sign in to comment.