Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
10342ec5
Commit
10342ec5
authored
8 years ago
by
Wai Yi Leung
Browse files
Options
Downloads
Patches
Plain Diff
Extended tests.
parent
048dc6d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biopet-extensions/src/test/scala/nl/lumc/sasc/biopet/extensions/clever/CleverFixVCFTest.scala
+48
-0
48 additions, 0 deletions
...lumc/sasc/biopet/extensions/clever/CleverFixVCFTest.scala
with
48 additions
and
0 deletions
biopet-extensions/src/test/scala/nl/lumc/sasc/biopet/extensions/clever/CleverFixVCFTest.scala
+
48
−
0
View file @
10342ec5
package
nl.lumc.sasc.biopet.extensions.clever
package
nl.lumc.sasc.biopet.extensions.clever
import
java.io.File
import
java.nio.file.Paths
import
org.scalatest.Matchers
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
import
org.testng.annotations.Test
import
scala.io.Source
/**
/**
* Created by wyleung on 13-5-16.
* Created by wyleung on 13-5-16.
*/
*/
class
CleverFixVCFTest
extends
TestNGSuite
with
Matchers
{
class
CleverFixVCFTest
extends
TestNGSuite
with
Matchers
{
/** Returns the absolute path to test resource directory as a File object */
private
[
clever
]
val
resourceDir
:
File
=
new
File
(
Paths
.
get
(
getClass
.
getResource
(
"."
).
toURI
).
toString
)
/** Given a resource file name, returns the the absolute path to it as a File object */
private
[
clever
]
def
resourceFile
(
p
:
String
)
:
File
=
new
File
(
resourceDir
,
p
)
val
rawCleverVCF
=
resourceFile
(
"test.clever.vcf"
)
val
expectedCleverVCF
=
resourceFile
(
"expectedresult.clever.vcf"
)
@Test
@Test
def
replacementSucces
=
{
def
replacementSucces
=
{
CleverFixVCF
.
replaceHeaderLine
(
CleverFixVCF
.
replaceHeaderLine
(
...
@@ -31,4 +44,39 @@ class CleverFixVCFTest extends TestNGSuite with Matchers {
...
@@ -31,4 +44,39 @@ class CleverFixVCFTest extends TestNGSuite with Matchers {
)
should
equal
(
vcfRecordExpected
+
"\n"
)
)
should
equal
(
vcfRecordExpected
+
"\n"
)
}
}
@Test
def
mainTest
=
{
val
output
=
File
.
createTempFile
(
"clever"
,
".test.vcf"
)
output
.
deleteOnExit
()
val
result
=
CleverFixVCF
.
main
(
Array
(
"-i"
,
rawCleverVCF
.
getAbsolutePath
,
"-o"
,
output
.
getAbsolutePath
,
"-s"
,
"testsample"
))
val
exp
=
Source
.
fromFile
(
expectedCleverVCF
).
getLines
()
val
obs
=
Source
.
fromFile
(
output
).
getLines
()
(
exp
zip
obs
).
foreach
(
_
match
{
case
(
a
,
b
)
=>
{
a
shouldEqual
(
b
)
}
case
_
=>
})
}
@Test
def
javaCommand
=
{
val
output
=
File
.
createTempFile
(
"clever"
,
".test.vcf"
)
output
.
deleteOnExit
()
val
cfvcf
=
new
CleverFixVCF
(
null
)
cfvcf
.
input
=
rawCleverVCF
cfvcf
.
output
=
output
cfvcf
.
sampleName
=
"testsample"
cfvcf
.
cmdLine
should
include
(
"'-s' 'testsample'"
)
cfvcf
.
cmdLine
should
include
(
s
"'-i' '${rawCleverVCF}'"
)
cfvcf
.
cmdLine
should
include
(
s
"'-o' '${output}'"
)
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment