Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
stormcat24 committed Oct 14, 2014
1 parent cf4b2ed commit 6bfec93
Show file tree
Hide file tree
Showing 18 changed files with 234 additions and 8 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package jp.co.cyberagent.aeromock.core

import jp.co.cyberagent.aeromock.SpecSupport
import jp.co.cyberagent.aeromock.core.bootstrap.{BootstrapManager, EnabledMode}
import org.specs2.mutable.{Specification, Tables}

/**
*
* @author stormcat24
*/
class BootstrapManagerFreemarkerSpec extends Specification with Tables with SpecSupport {

"BootstrapManager" should {
"delegete" in {
BootstrapManager.delegate.collectFirst {
case (EnabledMode.FREEMARKER, either) => either
} must beSome(beRight())
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package jp.co.cyberagent.aeromock.template.freemarker

import jp.co.cyberagent.aeromock.SpecSupport
import jp.co.cyberagent.aeromock.helper._
import org.specs2.mutable.{Tables, Specification}

/**
*
* @author stormcat24
*/
class FreemarkerBootstrapSpec extends Specification with Tables with SpecSupport {

"FreemarkerBootstrap" should {
"process" in {
// TODO to be right
trye(new FreemarkerBootstrap().process()).isLeft
}
}
}
2 changes: 1 addition & 1 deletion aeromock-freemarker/test/static/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Loading Bootstrap -->
<link href="aeromock/components/flatui/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="aeromock/components/flatui/bootstrap/css/jp.co.cyberagent.aeromock.core.bootstrap.css" rel="stylesheet">

<!-- Loading Flat UI -->
<link href="aeromock/components/flatui/css/flat-ui.css" rel="stylesheet">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package jp.co.cyberagent.aeromock.core.bootstrap

import jp.co.cyberagent.aeromock.SpecSupport
import org.specs2.mutable.{Tables, Specification}

/**
*
* @author stormcat24
*/
class BootstrapManagerGroovyTemplatesSpec extends Specification with Tables with SpecSupport {

"BootstrapManager" should {
"delegete" in {
BootstrapManager.delegate.collectFirst {
case (EnabledMode.GROOVY_TEMPLATE, either) => either
} must beSome(beRight())
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package jp.co.cyberagent.aeromock.template.groovytemplate

import jp.co.cyberagent.aeromock.SpecSupport
import jp.co.cyberagent.aeromock.helper._
import org.specs2.mutable.{Tables, Specification}

/**
*
* @author stormcat24
*/
class GroovyTemplateBootstrapSpec extends Specification with Tables with SpecSupport {

"GroovyTemplateBootstrap" should {
"process" in {
trye(new GroovyTemplateBootstrap().process) must beRight()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package jp.co.cyberagent.aeromock.core.bootstrap

import jp.co.cyberagent.aeromock.SpecSupport
import org.specs2.mutable.{Tables, Specification}

/**
*
* @author stormcat24
*/
class BootstrapManagerHandlebarsSpec extends Specification with Tables with SpecSupport {

"BootstrapManager" should {
"delegete" in {
BootstrapManager.delegate.collectFirst {
case (EnabledMode.HANDLEBARS, either) => either
} must beSome(beRight())
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package jp.co.cyberagent.aeromock.template.handlebars

import jp.co.cyberagent.aeromock.SpecSupport
import jp.co.cyberagent.aeromock.helper._
import org.specs2.mutable.{Specification, Tables}

/**
*
* @author stormcat24
*/
class HandlebarsBootstrapSpec extends Specification with Tables with SpecSupport {

"HandlebarsBootstrap" should {
"process" in {
trye(new HandlebarsBootstrap().process) must beRight()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package jp.co.cyberagent.aeromock.core.bootstrap

import jp.co.cyberagent.aeromock.SpecSupport
import org.specs2.mutable.{Tables, Specification}

/**
*
* @author stormcat24
*/
class BootstrapManagerJade4jSpec extends Specification with Tables with SpecSupport {

"BootstrapManager" should {
"delegete" in {
BootstrapManager.delegate.collectFirst {
case (EnabledMode.JADE4j, either) => either
} must beSome(beRight())
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package jp.co.cyberagent.aeromock.template.jade4j

import jp.co.cyberagent.aeromock.SpecSupport
import jp.co.cyberagent.aeromock.helper._
import org.specs2.mutable.{Tables, Specification}

/**
*
* @author stormcat24
*/
class Jade4jBootstrapSpec extends Specification with Tables with SpecSupport {

"Jade4jBootstrap" should {
"process" in {
trye(new Jade4jBootstrap().process) must beRight()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package jp.co.cyberagent.aeromock.core.bootstrap

import org.apache.commons.lang3.ClassUtils
import org.slf4j.LoggerFactory
import jp.co.cyberagent.aeromock.helper._

/**
* manager to control bootstrap.
Expand All @@ -11,18 +12,16 @@ object BootstrapManager {

val LOG = LoggerFactory.getLogger(this.getClass())

def delegate() {
EnabledMode.values.foreach { mode =>
try {
def delegate = {
EnabledMode.values.map { mode =>
(mode, trye {
val bootstrapClass = ClassUtils.getClass(mode.fqdn).asInstanceOf[Class[_ <: Bootstrap]]

if (bootstrapClass != null) {
bootstrapClass.newInstance.process
LOG.info(s"## Prepared ${mode} module.")
}
} catch {
case e: ClassNotFoundException => // TODO handling
}
})
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package jp.co.cyberagent.aeromock.core.bootstrap

import jp.co.cyberagent.aeromock.SpecSupport
import org.specs2.mutable.{Tables, Specification}

/**
*
* @author stormcat24
*/
class BootstrapManagerThymeleafSpec extends Specification with Tables with SpecSupport {

"BootstrapManager" should {
"delegete" in {
BootstrapManager.delegate.collectFirst {
case (EnabledMode.THYMELEAF, either) => either
} must beSome(beRight())
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package jp.co.cyberagent.aeromock.template.thymeleaf

import jp.co.cyberagent.aeromock.SpecSupport
import jp.co.cyberagent.aeromock.helper._
import org.specs2.mutable.{Tables, Specification}

/**
*
* @author stormcat24
*/
class ThymeleafBootstrapSpec extends Specification with Tables with SpecSupport {

"ThymeleafBootstrap" should {
"process" in {
trye(new ThymeleafBootstrap().process) must beRight()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package jp.co.cyberagent.aeromock.core.bootstrap

import jp.co.cyberagent.aeromock.SpecSupport
import org.specs2.mutable.{Tables, Specification}

/**
*
* @author stormcat24
*/
class BootstrapManagerVelocitySpec extends Specification with Tables with SpecSupport {

"BootstrapManager" should {
"delegete" in {
BootstrapManager.delegate.collectFirst {
case (EnabledMode.VELOCITY, either) => either
} must beSome(beRight())
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package jp.co.cyberagent.aeromock.template.velocity

import jp.co.cyberagent.aeromock.SpecSupport
import jp.co.cyberagent.aeromock.helper._
import org.specs2.mutable.{Specification, Tables}

/**
*
* @author stormcat24
*/
class VelocityBootstrapSpec extends Specification with Tables with SpecSupport {

"VelocityBootstrap" should {
"process" in {
// TODO to be right
trye(new VelocityBootstrap().process).isLeft
}
}
}
2 changes: 1 addition & 1 deletion tutorial/static/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Loading Bootstrap -->
<link href="aeromock/components/flatui/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="aeromock/components/flatui/bootstrap/css/jp.co.cyberagent.aeromock.core.bootstrap.bootstrap.bootstrap.css" rel="stylesheet">

<!-- Loading Flat UI -->
<link href="aeromock/components/flatui/css/flat-ui.css" rel="stylesheet">
Expand Down

0 comments on commit 6bfec93

Please sign in to comment.