11#! /usr/bin/env groovy
22
33/**
4- * Copyright (c) 2018 Informatics Matters Ltd.
4+ * Copyright (c) 2019 Informatics Matters Ltd.
55 *
66 * Licensed under the Apache License, Version 2.0 (the "License");
77 * you may not use this file except in compliance with the License.
1616 * limitations under the License.
1717 */
1818
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+
1923import java.nio.file.Files
2024import java.util.regex.Pattern
2125
22- import groovy.json.JsonSlurper
2326import groovy.text.SimpleTemplateEngine
2427
28+ import org.yaml.snakeyaml.Yaml
29+
2530/**
2631 * The Tester. A groovy class for the automated testing
2732 * of Informatics Matters pipeline scripts. This class searches for
@@ -48,7 +53,7 @@ class Tester {
4853 String executeAnchorDir = File . separator + ' src' + File . separator
4954 String testFileSpec = ' **' + File . separator + " *${ testExt} "
5055 String testSearchDir = ' ..' + File . separator + ' ..' + File . separator + ' ..'
51- String sdExt = ' .dsd.json '
56+ String sdExt = ' .dsd.yml '
5257 String optionPrefix = ' arg.'
5358 String metricsFile = ' output_metrics.txt'
5459 String dumpOutPrefix = ' #'
@@ -191,7 +196,8 @@ class Tester {
191196 currentServiceDescriptor = null
192197 File sdFilenameFile = new File (sdFilename)
193198 if (sdFilenameFile. exists()) {
194- currentServiceDescriptor = new JsonSlurper (). parse(sdFilenameFile. toURI(). toURL())
199+ Yaml yaml = new Yaml ()
200+ currentServiceDescriptor = yaml. load(new FileInputStream (sdFilenameFile))
195201 extractOptionsFromCurrentServiceDescriptor()
196202 }
197203
0 commit comments