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
95b0f3ba
Commit
95b0f3ba
authored
Feb 24, 2016
by
Peter van 't Hof
Browse files
Added test on render method
parent
4a7c0788
Changes
3
Hide whitespace changes
Inline
Side-by-side
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/report/ReportBuilder.scala
View file @
95b0f3ba
...
...
@@ -216,7 +216,7 @@ object ReportBuilder {
protected
val
engine
=
new
TemplateEngine
()
/** Cache of temp file for templates from the classpath / jar */
private
var
templateCache
:
Map
[
String
,
File
]
=
Map
()
private
[
report
]
var
templateCache
:
Map
[
String
,
File
]
=
Map
()
/** This will give the total number of pages including all nested pages */
def
countPages
(
page
:
ReportPage
)
:
Int
=
{
...
...
public/biopet-core/src/test/resources/template.ssp
0 → 100644
View file @
95b0f3ba
<%@ var arg: String%>
${arg}
\ No newline at end of file
public/biopet-core/src/test/scala/nl/lumc/sasc/biopet/core/report/ReportBuilderTest.scala
0 → 100644
View file @
95b0f3ba
package
nl.lumc.sasc.biopet.core.report
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
/**
* Created by pjvanthof on 24/02/16.
*/
class
ReportBuilderTest
extends
TestNGSuite
with
Matchers
{
@Test
def
testRenderTemplate
:
Unit
=
{
ReportBuilder
.
templateCache
=
Map
()
ReportBuilder
.
templateCache
shouldBe
empty
ReportBuilder
.
renderTemplate
(
"/template.ssp"
,
Map
(
"arg"
->
"test"
))
shouldBe
"test"
ReportBuilder
.
templateCache
.
size
shouldBe
1
ReportBuilder
.
renderTemplate
(
"/template.ssp"
,
Map
(
"arg"
->
"bla"
))
shouldBe
"bla"
ReportBuilder
.
templateCache
.
size
shouldBe
1
}
}
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