1
1
#! /usr/bin/env groovy
2
2
3
3
/**
4
- * Copyright (c) 2018 Informatics Matters Ltd.
4
+ * Copyright (c) 2019 Informatics Matters Ltd.
5
5
*
6
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
7
* you may not use this file except in compliance with the License.
16
16
* limitations under the License.
17
17
*/
18
18
19
+ // Groovy 3.0.0 (to be released) contains a groovy.yaml.YamlSlurper.
20
+ // Until that's available we're forced to use something else...
21
+ @Grab (' org.yaml:snakeyaml:1.24' )
22
+
19
23
import java.nio.file.Files
20
24
import java.util.regex.Pattern
21
25
22
- import groovy.json.JsonSlurper
23
26
import groovy.text.SimpleTemplateEngine
24
27
28
+ import org.yaml.snakeyaml.Yaml
29
+
25
30
/**
26
31
* The Tester. A groovy class for the automated testing
27
32
* of Informatics Matters pipeline scripts. This class searches for
@@ -48,7 +53,7 @@ class Tester {
48
53
String executeAnchorDir = File . separator + ' src' + File . separator
49
54
String testFileSpec = ' **' + File . separator + " *${ testExt} "
50
55
String testSearchDir = ' ..' + File . separator + ' ..' + File . separator + ' ..'
51
- String sdExt = ' .dsd.json '
56
+ String sdExt = ' .dsd.yml '
52
57
String optionPrefix = ' arg.'
53
58
String metricsFile = ' output_metrics.txt'
54
59
String dumpOutPrefix = ' #'
@@ -191,7 +196,8 @@ class Tester {
191
196
currentServiceDescriptor = null
192
197
File sdFilenameFile = new File (sdFilename)
193
198
if (sdFilenameFile. exists()) {
194
- currentServiceDescriptor = new JsonSlurper (). parse(sdFilenameFile. toURI(). toURL())
199
+ Yaml yaml = new Yaml ()
200
+ currentServiceDescriptor = yaml. load(new FileInputStream (sdFilenameFile))
195
201
extractOptionsFromCurrentServiceDescriptor()
196
202
}
197
203
0 commit comments