Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
645895a0
Commit
645895a0
authored
Jan 14, 2016
by
Peter van 't Hof
Browse files
Add test addSummarizable
parent
5fe478bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-core/src/test/scala/nl/lumc/sasc/biopet/core/summary/SummaryQScriptTest.scala
View file @
645895a0
...
...
@@ -17,7 +17,7 @@ class SummaryQScriptTest extends TestNGSuite with Matchers {
@Test
def
testNoJobs
:
Unit
=
{
SummaryQScript
.
md5sumCache
.
clear
()
val
script
=
make
()
val
script
=
make
Qscript
()
script
.
addSummaryJobs
()
SummaryQScript
.
md5sumCache
shouldBe
empty
}
...
...
@@ -26,7 +26,7 @@ class SummaryQScriptTest extends TestNGSuite with Matchers {
def
testFiles
:
Unit
=
{
SummaryQScript
.
md5sumCache
.
clear
()
val
file
=
new
File
(
s
".${File.separator}bla"
)
val
script
=
make
(
files
=
Map
(
"file"
->
file
))
val
script
=
make
Qscript
(
files
=
Map
(
"file"
->
file
))
script
.
addSummaryJobs
()
SummaryQScript
.
md5sumCache
should
not
be
empty
SummaryQScript
.
md5sumCache
.
toMap
shouldBe
Map
(
...
...
@@ -38,7 +38,7 @@ class SummaryQScriptTest extends TestNGSuite with Matchers {
def
testDuplicateFiles
:
Unit
=
{
SummaryQScript
.
md5sumCache
.
clear
()
val
file
=
new
File
(
s
".${File.separator}bla"
)
val
script
=
make
(
files
=
Map
(
"file"
->
file
,
"file2"
->
file
))
val
script
=
make
Qscript
(
files
=
Map
(
"file"
->
file
,
"file2"
->
file
))
script
.
addSummaryJobs
()
SummaryQScript
.
md5sumCache
should
not
be
empty
SummaryQScript
.
md5sumCache
.
toMap
shouldBe
Map
(
...
...
@@ -46,12 +46,27 @@ class SummaryQScriptTest extends TestNGSuite with Matchers {
script
.
functions
.
size
shouldBe
2
}
@Test
def
testAddSummarizable
:
Unit
=
{
SummaryQScript
.
md5sumCache
.
clear
()
val
file
=
new
File
(
s
".${File.separator}bla"
)
val
script
=
makeQscript
()
script
.
addSummarizable
(
makeSummarizable
(
files
=
Map
(
"file"
->
file
,
"file2"
->
file
)),
"test"
)
script
.
summarizables
.
size
shouldBe
1
script
.
addSummaryJobs
()
SummaryQScript
.
md5sumCache
should
not
be
empty
SummaryQScript
.
md5sumCache
.
toMap
shouldBe
Map
(
new
File
(
s
".${File.separator}bla"
)
->
new
File
(
s
".${File.separator}bla.md5"
))
script
.
functions
.
size
shouldBe
2
}
}
object
SummaryQScriptTest
{
def
make
(
settings
:
Map
[
String
,
Any
]
=
Map
(),
files
:
Map
[
String
,
File
]
=
Map
(),
c
:
Map
[
String
,
Any
]
=
Map
())
=
def
make
Qscript
(
settings
:
Map
[
String
,
Any
]
=
Map
(),
files
:
Map
[
String
,
File
]
=
Map
(),
c
:
Map
[
String
,
Any
]
=
Map
())
=
new
SummaryQScript
with
QScript
{
outputDir
=
new
File
(
"."
)
override
def
globalConfig
=
new
Config
(
c
)
...
...
@@ -64,4 +79,9 @@ object SummaryQScriptTest {
def
biopetScript
()
:
Unit
=
???
def
root
:
Configurable
=
null
}
def
makeSummarizable
(
files
:
Map
[
String
,
File
]
=
Map
(),
stats
:
Map
[
String
,
Any
]
=
Map
())
=
new
Summarizable
{
def
summaryFiles
:
Map
[
String
,
File
]
=
files
def
summaryStats
:
Any
=
stats
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment