[arquillian-issues] [JBoss JIRA] Commented: (ARQ-433) Add a Tomcat 7 embedded container

Ian Brandt (JIRA) jira-events at lists.jboss.org
Thu May 5 19:02:18 EDT 2011


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

Ian Brandt commented on ARQ-433:
--------------------------------

The new {{org.apache.catalina.startup.Tomcat}} API is not available in Tomcat 6.x, so no making it work for both.  It was a short ride with Tomcat 7.0.12 and Arquillian 1.0.0-Alpha5:

{noformat}
java.lang.NoSuchMethodError: org.apache.catalina.connector.Connector.setContainer(Lorg/apache/catalina/Container;)V
	at org.jboss.arquillian.container.tomcat.embedded_6.TomcatContainer.startTomcatEmbedded(TomcatContainer.java:323)
{noformat}

As far as I can tell the [{{connector.setContainer(engine)}} call at line 323|https://github.com/arquillian/arquillian-container-tomcat/blob/master/tomcat-embedded-6/src/main/java/org/jboss/arquillian/container/tomcat/embedded_6/TomcatContainer.java#L323] is unnecessary for both Tomcat 6 & 7, and was in fact removed in 7, as the ["...added Connector will use the most recently added Engine to process its received requests|http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/startup/Embedded.html].

Thanks for the repo tip, as the [build instructions|http://www.jboss.org/arquillian/build.html] seem a little out of date in that regard.  I've got {{arquillian-core}} and {{arquillian-container-tomcat}} locally, but am getting a test error on the latter that I need to debug:

{noformat}
-------------------------------------------------------------------------------
Test set: org.jboss.arquillian.container.tomcat.embedded_6.TomcatEmbeddedInContainerTestCase
-------------------------------------------------------------------------------
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 15.926 sec <<< FAILURE!
shouldBeAbleToInjectMembersIntoTestClass(org.jboss.arquillian.container.tomcat.embedded_6.TomcatEmbeddedInContainerTestC
ase)  Time elapsed: 0.026 sec  <<< FAILURE!
java.lang.AssertionError: expected:<Tomcat> but was:<null>
        at org.junit.Assert.fail(Assert.java:91)
        at org.junit.Assert.failNotEquals(Assert.java:645)
        at org.junit.Assert.assertEquals(Assert.java:126)
        at org.junit.Assert.assertEquals(Assert.java:145)
        at org.jboss.arquillian.container.tomcat.embedded_6.TomcatEmbeddedInContainerTestCase.shouldBeAbleToInjectMember
sIntoTestClass(TomcatEmbeddedInContainerTestCase.java:94)
{noformat}

> Add a Tomcat 7 embedded container
> ---------------------------------
>
>                 Key: ARQ-433
>                 URL: https://issues.jboss.org/browse/ARQ-433
>             Project: Arquillian
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: Tomcat Containers
>    Affects Versions: 1.0.0.Alpha5
>            Reporter: Ian Brandt
>
> Tomcat 7 has deprecated the {{[org.apache.catalina.startup.Embedded|http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/startup/Embedded.html]}} API as used by the {{arquillian-tomcat-embedded-6}} container implementation.  The new API is {{[org.apache.catalina.startup.Tomcat|http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/startup/Tomcat.html]}}.  That said I have no idea if the [new {{Tomcat}} API is mature or suitable|http://www.coderanch.com/t/513623/Tomcat/Tomcat-embedded-web-app-jar] for Arquillian at this time.  Either way with Tomcat 7 implementing [Servlet 3.0's web fragments|http://java.sun.com/developer/technicalArticles/JavaEE/JavaEE6Overview_Part2.html], which coincide nicely with Arquillian/ShrinkWrap by allowing one to package isolated parts of their production webapp configuration for select integration tests, I think it would be great if Arquillian declared Tomcat 7 as a supported container.  This could be done by implementing the new API in an {{arquillian-tomcat-embedded-7}} container, forking the deprecated API from {{arquillian-tomcat-embedded-6}} to create the same, or just adding documentation that states the {{arquillian-tomcat-embedded-6}} container can and should be used for Tomcat 7 at this time.
> Thoughts?  I'm going to plow ahead with {{arquillian-tomcat-embedded-6}} for now.  If I run into a reason to fork it or create a container around the new API I'll try my hand at a pull request.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the arquillian-issues mailing list