-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
stormcat24
committed
Oct 15, 2014
1 parent
6bfec93
commit aed0c9b
Showing
16 changed files
with
285 additions
and
30 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...t/scala/jp/co/cyberagent/aeromock/template/freemarker/FreemarkerTemplateServiceSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package jp.co.cyberagent.aeromock.template.freemarker | ||
|
||
import java.nio.file.Path | ||
|
||
import jp.co.cyberagent.aeromock.config.definition.ProjectDef | ||
import jp.co.cyberagent.aeromock.core.http.VariableManager | ||
import jp.co.cyberagent.aeromock.template.TemplateService | ||
import jp.co.cyberagent.aeromock.{AeromockTestModule, SpecSupport} | ||
import jp.co.cyberagent.aeromock.helper._ | ||
import org.specs2.mutable.{Specification, Tables} | ||
|
||
import scala.io.Source | ||
|
||
/** | ||
* | ||
* @author stormcat24 | ||
*/ | ||
class FreemarkerTemplateServiceSpec extends Specification with Tables with SpecSupport { | ||
|
||
"render" should { | ||
"tutorial" in { | ||
implicit val module = new AeromockTestModule { | ||
override val projectConfigPath: Path = getResourcePath(".").resolve("../../../../tutorial/freemarker/project.yaml").toRealPath() | ||
override val projectDefArround = (projectDef: ProjectDef) => {} | ||
} | ||
|
||
val service = inject[Option[TemplateService]].get | ||
VariableManager.initializeRequestMap(Map( | ||
"USER_AGENT" -> "test", | ||
"REQUEST_URI" -> "/test", | ||
"HOST" -> "localhost:3183", | ||
"QUERY_STRING" -> "", | ||
"REMOTE_HOST" -> "localhost" | ||
)) | ||
VariableManager.initializeOriginalVariableMap(new java.util.HashMap[String, AnyRef]()) | ||
|
||
trye(service.render(request("/test"))).isRight | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...t/scala/jp/co/cyberagent/aeromock/template/groovytemplate/GroovyTemplateServiceSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package jp.co.cyberagent.aeromock.template.groovytemplate | ||
|
||
import java.nio.file.Path | ||
|
||
import jp.co.cyberagent.aeromock.config.definition.ProjectDef | ||
import jp.co.cyberagent.aeromock.core.http.VariableManager | ||
import jp.co.cyberagent.aeromock.helper._ | ||
import jp.co.cyberagent.aeromock.template.TemplateService | ||
import jp.co.cyberagent.aeromock.{AeromockTestModule, SpecSupport} | ||
import org.specs2.mutable.{Tables, Specification} | ||
|
||
/** | ||
* | ||
* @author stormcat24 | ||
*/ | ||
class GroovyTemplateServiceSpec extends Specification with Tables with SpecSupport { | ||
|
||
"render" should { | ||
"tutorial" in { | ||
implicit val module = new AeromockTestModule { | ||
override val projectConfigPath: Path = getResourcePath(".").resolve("../../../../tutorial/groovytemplates/project.yaml").toRealPath() | ||
override val projectDefArround = (projectDef: ProjectDef) => {} | ||
} | ||
|
||
val service = inject[Option[TemplateService]].get | ||
VariableManager.initializeRequestMap(Map( | ||
"USER_AGENT" -> "test", | ||
"REQUEST_URI" -> "/test", | ||
"HOST" -> "localhost:3183", | ||
"QUERY_STRING" -> "", | ||
"REMOTE_HOST" -> "localhost" | ||
)) | ||
VariableManager.initializeOriginalVariableMap(new java.util.HashMap[String, AnyRef]()) | ||
|
||
trye(service.render(request("/test"))).isRight | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...t/scala/jp/co/cyberagent/aeromock/template/handlebars/HandlebarsTemplateServiceSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package jp.co.cyberagent.aeromock.template.handlebars | ||
|
||
import java.nio.file.Path | ||
|
||
import jp.co.cyberagent.aeromock.config.definition.ProjectDef | ||
import jp.co.cyberagent.aeromock.core.http.VariableManager | ||
import jp.co.cyberagent.aeromock.helper._ | ||
import jp.co.cyberagent.aeromock.template.TemplateService | ||
import jp.co.cyberagent.aeromock.{AeromockTestModule, SpecSupport} | ||
import org.specs2.mutable.{Tables, Specification} | ||
|
||
/** | ||
* | ||
* @author stormcat24 | ||
*/ | ||
class HandlebarsTemplateServiceSpec extends Specification with Tables with SpecSupport { | ||
|
||
"render" should { | ||
"tutorial" in { | ||
implicit val module = new AeromockTestModule { | ||
override val projectConfigPath: Path = getResourcePath(".").resolve("../../../../tutorial/handlebars/project.yaml").toRealPath() | ||
override val projectDefArround = (projectDef: ProjectDef) => {} | ||
} | ||
|
||
val service = inject[Option[TemplateService]].get | ||
VariableManager.initializeRequestMap(Map( | ||
"USER_AGENT" -> "test", | ||
"REQUEST_URI" -> "/test", | ||
"HOST" -> "localhost:3183", | ||
"QUERY_STRING" -> "", | ||
"REMOTE_HOST" -> "localhost" | ||
)) | ||
VariableManager.initializeOriginalVariableMap(new java.util.HashMap[String, AnyRef]()) | ||
|
||
trye(service.render(request("/test"))).isRight | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
.../src/test/scala/jp/co/cyberagent/aeromock/template/jade4j/Jade4jTemplateServiceSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package jp.co.cyberagent.aeromock.template.jade4j | ||
|
||
import java.nio.file.Path | ||
|
||
import jp.co.cyberagent.aeromock.config.definition.ProjectDef | ||
import jp.co.cyberagent.aeromock.core.http.VariableManager | ||
import jp.co.cyberagent.aeromock.helper._ | ||
import jp.co.cyberagent.aeromock.template.TemplateService | ||
import jp.co.cyberagent.aeromock.{AeromockTestModule, SpecSupport} | ||
import org.specs2.mutable.{Tables, Specification} | ||
|
||
/** | ||
* | ||
* @author stormcat24 | ||
*/ | ||
class Jade4jTemplateServiceSpec extends Specification with Tables with SpecSupport { | ||
|
||
"render" should { | ||
"tutorial" in { | ||
implicit val module = new AeromockTestModule { | ||
override val projectConfigPath: Path = getResourcePath(".").resolve("../../../../tutorial/jade4j/project.yaml").toRealPath() | ||
override val projectDefArround = (projectDef: ProjectDef) => {} | ||
} | ||
|
||
val service = inject[Option[TemplateService]].get | ||
VariableManager.initializeRequestMap(Map( | ||
"USER_AGENT" -> "test", | ||
"REQUEST_URI" -> "/test", | ||
"HOST" -> "localhost:3183", | ||
"QUERY_STRING" -> "", | ||
"REMOTE_HOST" -> "localhost" | ||
)) | ||
VariableManager.initializeOriginalVariableMap(new java.util.HashMap[String, AnyRef]()) | ||
|
||
trye(service.render(request("/test"))).isRight | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...est/scala/jp/co/cyberagent/aeromock/template/thymeleaf/ThymeleafTemplateServiceSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package jp.co.cyberagent.aeromock.template.thymeleaf | ||
|
||
import java.nio.file.Path | ||
|
||
import jp.co.cyberagent.aeromock.config.definition.ProjectDef | ||
import jp.co.cyberagent.aeromock.core.http.VariableManager | ||
import jp.co.cyberagent.aeromock.helper._ | ||
import jp.co.cyberagent.aeromock.template.TemplateService | ||
import jp.co.cyberagent.aeromock.{AeromockTestModule, SpecSupport} | ||
import org.specs2.mutable.{Tables, Specification} | ||
|
||
/** | ||
* | ||
* @author stormcat24 | ||
*/ | ||
class ThymeleafTemplateServiceSpec extends Specification with Tables with SpecSupport { | ||
|
||
"render" should { | ||
"tutorial" in { | ||
implicit val module = new AeromockTestModule { | ||
override val projectConfigPath: Path = getResourcePath(".").resolve("../../../../tutorial/thymeleaf/project.yaml").toRealPath() | ||
override val projectDefArround = (projectDef: ProjectDef) => {} | ||
} | ||
|
||
val service = inject[Option[TemplateService]].get | ||
VariableManager.initializeRequestMap(Map( | ||
"USER_AGENT" -> "test", | ||
"REQUEST_URI" -> "/test", | ||
"HOST" -> "localhost:3183", | ||
"QUERY_STRING" -> "", | ||
"REMOTE_HOST" -> "localhost" | ||
)) | ||
VariableManager.initializeOriginalVariableMap(new java.util.HashMap[String, AnyRef]()) | ||
|
||
trye(service.render(request("/test"))).isRight | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.