playframework 2.0 - Scripting DB changes in Scala Play -
i trying autopopulate bunch of database objects in scala play. i've been able far, disguising script test , running activator test-only.
can give me guidance how convert below test script can run outside of activator test?
my code
import java.awt import java.util.concurrent.timeunit import org.scalatestplus.play._ import org.openqa.selenium._ import com.sun.xml.internal.bind.v2.todo import scala.collection.javaconverters._ import controllers.application import models.item import play.api.test._ import org.scalatest.time._ import org.apache.commons.lang3.randomstringutils import java.util.random class itemgenerator extends playspec oneserverpersuite { implicit override lazy val app: fakeapplication = fakeapplication(additionalconfiguration = testutil.inmemorydatabase("default", map())) "generator" should { "create bunch of items" in { item.deleteall() val rand = new random(system.currenttimemillis()) (x <- 1 100) { item.create() } } } }
thanks,
joe
Comments
Post a Comment