Skip to content

Commit

Permalink
Merge 6bf12ff into cc95967
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe444 committed Jun 7, 2019
2 parents cc95967 + 6bf12ff commit ebf18b0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
4 changes: 2 additions & 2 deletions judge-d-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@
<dependency>
<groupId>com.hltech</groupId>
<artifactId>vaunt-validator</artifactId>
<version>1.0.8</version>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>com.hltech</groupId>
<artifactId>vaunt-core</artifactId>
<version>1.0.8</version>
<version>1.0.9</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ class JmsContractValidatorUT extends Specification {

def "If there is matching capability for each expectations - validation results with success"() {
given:
def expectations = [new Contract(DestinationType.QUEUE, 'dst', new StringSchema()),
new Contract(DestinationType.TOPIC, 'dst', new StringSchema()),
new Contract(DestinationType.QUEUE, 'dst2', new StringSchema()),
new Contract(DestinationType.QUEUE, 'dst', new NumberSchema())]
def expectations = [new Contract(DestinationType.QUEUE, 'dst', createStringSchema()),
new Contract(DestinationType.TOPIC, 'dst', createStringSchema()),
new Contract(DestinationType.QUEUE, 'dst2', createStringSchema()),
new Contract(DestinationType.QUEUE, 'dst', createNumberSchema())]

and:
def capabilities = [new Contract(DestinationType.QUEUE, 'dst', new NumberSchema()),
new Contract(DestinationType.TOPIC, 'dst', new StringSchema()),
new Contract(DestinationType.QUEUE, 'dst2', new StringSchema()),
new Contract(DestinationType.QUEUE, 'dst', new StringSchema()),
new Contract(DestinationType.QUEUE, 'weirdDst', new NumberSchema())]
def capabilities = [new Contract(DestinationType.QUEUE, 'dst', createNumberSchema()),
new Contract(DestinationType.TOPIC, 'dst', createStringSchema()),
new Contract(DestinationType.QUEUE, 'dst2', createStringSchema()),
new Contract(DestinationType.QUEUE, 'dst', createStringSchema()),
new Contract(DestinationType.QUEUE, 'weirdDst', createNumberSchema())]

when:
def results = validator.validate(expectations, capabilities)
Expand All @@ -109,18 +109,18 @@ class JmsContractValidatorUT extends Specification {

def "If there are some unmatched expectations - validation results with success"() {
given:
def expectations = [new Contract(DestinationType.QUEUE, 'dst', new StringSchema()),
new Contract(DestinationType.TOPIC, 'dst', new StringSchema()),
new Contract(DestinationType.QUEUE, 'dst2', new StringSchema()),
new Contract(DestinationType.QUEUE, 'dst', new NumberSchema()),
new Contract(DestinationType.QUEUE, 'weirdDst', new NumberSchema()),
new Contract(DestinationType.QUEUE, 'dst', new NullSchema())]
def expectations = [new Contract(DestinationType.QUEUE, 'dst', createStringSchema()),
new Contract(DestinationType.TOPIC, 'dst', createStringSchema()),
new Contract(DestinationType.QUEUE, 'dst2', createStringSchema()),
new Contract(DestinationType.QUEUE, 'dst', createNumberSchema()),
new Contract(DestinationType.QUEUE, 'weirdDst', createNumberSchema()),
new Contract(DestinationType.QUEUE, 'dst', createNullSchema())]

and:
def capabilities = [new Contract(DestinationType.QUEUE, 'dst', new NumberSchema()),
new Contract(DestinationType.TOPIC, 'dst', new StringSchema()),
new Contract(DestinationType.QUEUE, 'dst2', new StringSchema()),
new Contract(DestinationType.QUEUE, 'dst', new StringSchema())]
def capabilities = [new Contract(DestinationType.QUEUE, 'dst', createNumberSchema()),
new Contract(DestinationType.TOPIC, 'dst', createStringSchema()),
new Contract(DestinationType.QUEUE, 'dst2', createStringSchema()),
new Contract(DestinationType.QUEUE, 'dst', createStringSchema())]

when:
def results = validator.validate(expectations, capabilities)
Expand All @@ -142,4 +142,22 @@ class JmsContractValidatorUT extends Specification {
result.errors.size() == 0
} == 4
}

def createNumberSchema() {
def schema = new NumberSchema()
schema.setId('id')
return schema
}

def createStringSchema() {
def schema = new StringSchema()
schema.setId('id')
return schema
}

def createNullSchema() {
def schema = new NullSchema()
schema.setId('id')
return schema
}
}

0 comments on commit ebf18b0

Please sign in to comment.