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
5fe478bc
Commit
5fe478bc
authored
Jan 14, 2016
by
Peter van 't Hof
Browse files
Added simple test for summaryQscript
parent
acbf24e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-core/src/test/scala/nl/lumc/sasc/biopet/core/summary/SummaryQScriptTest.scala
0 → 100644
View file @
5fe478bc
package
nl.lumc.sasc.biopet.core.summary
import
java.io.File
import
nl.lumc.sasc.biopet.utils.config.
{
Config
,
Configurable
}
import
org.broadinstitute.gatk.queue.
{
QScript
,
QSettings
}
import
org.broadinstitute.gatk.queue.function.QFunction
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
import
SummaryQScriptTest._
/**
* Created by pjvanthof on 14/01/16.
*/
class
SummaryQScriptTest
extends
TestNGSuite
with
Matchers
{
@Test
def
testNoJobs
:
Unit
=
{
SummaryQScript
.
md5sumCache
.
clear
()
val
script
=
make
()
script
.
addSummaryJobs
()
SummaryQScript
.
md5sumCache
shouldBe
empty
}
@Test
def
testFiles
:
Unit
=
{
SummaryQScript
.
md5sumCache
.
clear
()
val
file
=
new
File
(
s
".${File.separator}bla"
)
val
script
=
make
(
files
=
Map
(
"file"
->
file
))
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
}
@Test
def
testDuplicateFiles
:
Unit
=
{
SummaryQScript
.
md5sumCache
.
clear
()
val
file
=
new
File
(
s
".${File.separator}bla"
)
val
script
=
make
(
files
=
Map
(
"file"
->
file
,
"file2"
->
file
))
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
())
=
new
SummaryQScript
with
QScript
{
outputDir
=
new
File
(
"."
)
override
def
globalConfig
=
new
Config
(
c
)
def
summarySettings
:
Map
[
String
,
Any
]
=
settings
def
summaryFiles
:
Map
[
String
,
File
]
=
files
val
tempFile
=
File
.
createTempFile
(
"summary"
,
".json"
)
tempFile
.
deleteOnExit
()
def
summaryFile
:
File
=
tempFile
def
init
()
:
Unit
=
???
def
biopetScript
()
:
Unit
=
???
def
root
:
Configurable
=
null
}
}
\ 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