Skip to content

Commit

Permalink
Feature/fix testing (#314) (#315)
Browse files Browse the repository at this point in the history
* add new test case

* use new surefire version to re-enable tests

* reroll unnecessary changes and bump
  • Loading branch information
wow-such-code authored May 6, 2022
1 parent a6d24cf commit 6eda4e3
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>life.qbic</groupId>
<artifactId>data-model-lib</artifactId>
<version>2.17.0</version> <!-- <<QUBE_FORCE_BUMP>> -->
<version>2.17.0</version>
<name>data-model-lib</name>
<url>http://github.com/qbicsoftware/data-model-lib</url>
<description>Data models. A collection of QBiC's central data models and DTOs. </description>
Expand Down Expand Up @@ -171,7 +171,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.0.0-M5</version>
<configuration>
<includes>
<include>**/*Spec</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class OxfordNanoporeExperimentSpec extends Specification {
* according to the schema
*/
@Shared
Map minimalWorkingSimpleDataStructure
Map minimalSimpleDataStructure
/**
* Newer map that stores the Oxford Nanopore folder structure
* according to the schema that puts some reports in its own folder and adds a new report
* Newer map that stores the Oxford Nanopore folder structure according to the
* schema that puts some reports in its own folder and adds a barcode alignment report
*/
@Shared
Map minimalWorkingSimpleDataStructureWithReportsFolder
Map extendedDataStructureWithReportsFolder
/**
* Map that that stores the Oxford Nanopore folder structure
* according to the schema containing unclassified read information
Expand All @@ -37,23 +37,24 @@ class OxfordNanoporeExperimentSpec extends Specification {
Map minimalWorkingPooledDataStructure

def setupSpec() {
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("valid-example.json")
minimalWorkingSimpleDataStructure = (Map) new JsonSlurper().parse(stream)
def folder = "nanopore/"
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(folder+"valid-example.json")
minimalSimpleDataStructure = (Map) new JsonSlurper().parse(stream)
// new example with slightly different structure
stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("valid-example-newer.json")
minimalWorkingSimpleDataStructureWithReportsFolder = (Map) new JsonSlurper().parse(stream)
stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(folder+"valid-example-v2.json")
extendedDataStructureWithReportsFolder = (Map) new JsonSlurper().parse(stream)
// read in unclassified example
stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("valid-example-unclassified.json")
stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(folder+"valid-example-unclassified.json")
unclassifiedWorkingDataStructure = (Map) new JsonSlurper().parse(stream)
// read in pooled example
stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("valid-example-pooled.json")
stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(folder+"valid-example-pooled.json")
minimalWorkingPooledDataStructure = (Map) new JsonSlurper().parse(stream)
stream.close()
}

def "Create simple sample Oxford Nanopore experiment successfully"() {
given:
final def example = minimalWorkingSimpleDataStructure
final def example = minimalSimpleDataStructure

when:
final def experiment = OxfordNanoporeExperiment.create(example)
Expand All @@ -65,9 +66,9 @@ class OxfordNanoporeExperimentSpec extends Specification {
assert measurements[0].libraryPreparationKit == "SQK-LSK109"
}

def "Create simple sample Oxford Nanopore experiment successfully for newer structure"() {
def "Create sample Oxford Nanopore experiment successfully for newer structure"() {
given:
final def example = minimalWorkingSimpleDataStructureWithReportsFolder
final def example = extendedDataStructureWithReportsFolder

when:
final def experiment = OxfordNanoporeExperiment.create(example)
Expand All @@ -76,7 +77,7 @@ class OxfordNanoporeExperimentSpec extends Specification {
then:
assert experiment.sampleCode == "QABCD001AB"
assert measurements.size() == 1
assert measurements[0].libraryPreparationKit == "SQK-LSK109-XL"
assert measurements[0].asicTemp == "32.631687"
}

def "Create a simple pooled Oxford Nanopore experiment successfully"() {
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 6eda4e3

Please sign in to comment.