[arquillian-issues] [JBoss JIRA] (ARQ-1862) Scalatest TestRunner

Giovanni Silva (JIRA) issues at jboss.org
Tue Oct 7 08:22:11 EDT 2014


    [ https://issues.jboss.org/browse/ARQ-1862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009253#comment-13009253 ] 

Giovanni Silva commented on ARQ-1862:
-------------------------------------

I Will investigate. The basically idea is startup aquillian before the test suite and shutdown after. But I don't understand how the test run in the context of the container,with injection and other services.

> Scalatest TestRunner
> --------------------
>
>                 Key: ARQ-1862
>                 URL: https://issues.jboss.org/browse/ARQ-1862
>             Project: Arquillian
>          Issue Type: Feature Request
>            Reporter: Giovanni Silva
>
> Hi,
> Would be great to have a Arquillian runner in the same way of JUnitRunner (to run with Junit but with startup of Arquillian) or as native scalatest integration, not using Junit.
> Arquillian is great to test Context and Dependency Injections and Java EE components.
> Current is possible to run arquillian using the JUnitRunner but it only start in Junit test cases.
> This run the FlatSpec test with JUnit, but do not bootstrap arquillian:
> {code}
> @RunWith(classOf[JUnitRunner])
> class MySimpleBeamTestScala extends FlatSpec with Matchers {
>   @Inject
>   private var mysimplebeam: MySimpleBeam = _
>   "A simple bean" should "return hello world" in {
>       mysimplebeam.helloWorld() should be("Hello World")
>   }
>   @Test def testIsDeployed {
>       mysimplebeam.helloWorld() should be("Hell World")
>   }
> }
> object MySimpleBeamTestScala {
>   @Deployment
>   def createDeployment() = {
>     println("working")
>     ShrinkWrap.create(classOf[JavaArchive], "test.jar").addClass(classOf[MySimpleBeam]).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
>   }
> }
> {code}
> This run the test with TestNG and bootstrap arquillian, but can't use other format spec
> {code}
> import javax.inject.Inject
> import org.jboss.arquillian.container.test.api.Deployment
> import org.jboss.arquillian.testng.Arquillian
> import org.jboss.shrinkwrap.api.ShrinkWrap
> import org.jboss.shrinkwrap.api.asset.EmptyAsset
> import org.jboss.shrinkwrap.api.spec.JavaArchive
> import org.scalatest._
> import org.testng.annotations.Test
> /**
>  * @author Giovanni Silva
>  */
> class MySimpleBeamTestScala extends Arquillian with FlatSpecLike with Matchers {
>   @Inject
>   private var mysimplebeam: MySimpleBeam = _
>   "A simple bean" should "return hello world" in {
>       mysimplebeam.helloWorld() should be("Hello World")
>   }
>   @Test def testIsDeployed {
>       mysimplebeam.helloWorld() should be("Hell World")
>   }
> }
> object MySimpleBeamTestScala {
>   @Deployment
>   def createDeployment() = {
>     println("working")
>     ShrinkWrap.create(classOf[JavaArchive], "test.jar").addClass(classOf[MySimpleBeam]).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the arquillian-issues mailing list