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
343ac6e1
Commit
343ac6e1
authored
Nov 17, 2015
by
Peter van 't Hof
Browse files
Added test to SampleLibraryTag
parent
fd445e8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-core/src/test/scala/nl/lumc/sasc/biopet/core/SampleLibraryTagTest.scala
0 → 100644
View file @
343ac6e1
package
nl.lumc.sasc.biopet.core
import
nl.lumc.sasc.biopet.utils.config.
{
Config
,
Configurable
}
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
/**
* Created by pjvanthof on 17/11/15.
*/
class
SampleLibraryTagTest
extends
TestNGSuite
with
Matchers
{
@Test
def
testDefault
:
Unit
=
{
val
o
=
new
SampleLibraryTag
{
override
def
root
:
Configurable
=
null
override
def
globalConfig
=
new
Config
(
Map
())
}
o
.
sampleId
shouldBe
None
o
.
libId
shouldBe
None
}
@Test
def
testInherit
:
Unit
=
{
val
o1
=
new
SampleLibraryTag
{
override
def
root
:
Configurable
=
null
override
def
globalConfig
=
new
Config
(
Map
())
}
o1
.
sampleId
=
Some
(
"sampleName"
)
o1
.
libId
=
Some
(
"libName"
)
o1
.
sampleId
shouldBe
Some
(
"sampleName"
)
o1
.
libId
shouldBe
Some
(
"libName"
)
val
o2
=
new
SampleLibraryTag
{
override
def
root
:
Configurable
=
o1
override
def
globalConfig
=
new
Config
(
Map
())
}
o2
.
sampleId
shouldBe
o1
.
sampleId
o2
.
libId
shouldBe
o1
.
libId
}
}
public/biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/config/Configurable.scala
View file @
343ac6e1
...
...
@@ -20,7 +20,7 @@ import nl.lumc.sasc.biopet.utils.ConfigUtils.ImplicitConversions
trait
Configurable
extends
ImplicitConversions
{
/** Should be object of parant object */
val
root
:
Configurable
def
root
:
Configurable
def
globalConfig
:
Config
=
if
(
root
!=
null
)
root
.
globalConfig
else
Config
.
global
/** suffix to the path */
...
...
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