You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2012/10/02 14:51:40 UTC

svn commit: r1392895 - in /openejb/trunk/openejb/arquillian: arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/exception/ arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/or...

Author: rmannibucau
Date: Tue Oct  2 12:51:39 2012
New Revision: 1392895

URL: http://svn.apache.org/viewvc?rev=1392895&view=rev
Log:
TOMEE-440 fixing some arquillian tests + new arquillian enricher for webapp adapter 

Modified:
    openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/exception/DeploymentExceptionErrorTest.java
    openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesServletExporter.java
    openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesTest.java
    openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/ejb/JSFInjectionTest.java
    openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java
    openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/servlet/SimpleServletTest.java
    openejb/trunk/openejb/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappExtension.java

Modified: openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/exception/DeploymentExceptionErrorTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/exception/DeploymentExceptionErrorTest.java?rev=1392895&r1=1392894&r2=1392895&view=diff
==============================================================================
--- openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/exception/DeploymentExceptionErrorTest.java (original)
+++ openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/exception/DeploymentExceptionErrorTest.java Tue Oct  2 12:51:39 2012
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.openejb.arquillian.tests.deployment.exception;
+package org.apache.openejb.arquillian.tests.exception;
 
 import org.apache.openejb.OpenEJBException;
 import org.apache.webbeans.exception.WebBeansConfigurationException;

Modified: openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesServletExporter.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesServletExporter.java?rev=1392895&r1=1392894&r2=1392895&view=diff
==============================================================================
--- openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesServletExporter.java (original)
+++ openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesServletExporter.java Tue Oct  2 12:51:39 2012
@@ -26,8 +26,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
 
-import static junit.framework.Assert.assertTrue;
-
 @WebServlet(name = "get-resources", urlPatterns = "/get-resources")
 public class GetResourcesServletExporter extends HttpServlet {
     @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
@@ -37,10 +35,12 @@ public class GetResourcesServletExporter
 
         try {
             // all this tests will throw an exception if it fails
-            getServletContext().getResource("/config/test.getresources").openStream().close();
-            getServletContext().getResourceAsStream("/config/test.getresources").close();
-            getServletContext().getResourcePaths("/config/").iterator().next();
-            assertTrue(new File(getServletContext().getRealPath("/config/test.getresources")).exists());
+            getServletContext().getResource("/WEB-INF/classes/config/test.getresources").openStream().close();
+            getServletContext().getResourceAsStream("/WEB-INF/classes/config/test.getresources").close();
+            getServletContext().getResourcePaths("/WEB-INF/classes/config/").iterator().next();
+            if (!new File(getServletContext().getRealPath("/WEB-INF/classes/config/test.getresources")).exists()) {
+                throw new RuntimeException(); // fail
+            }
 
             writer.write("servletContextGetResource=ok");
         } catch (Exception e) {

Modified: openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesTest.java?rev=1392895&r1=1392894&r2=1392895&view=diff
==============================================================================
--- openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesTest.java (original)
+++ openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/getresources/GetResourcesTest.java Tue Oct  2 12:51:39 2012
@@ -44,14 +44,12 @@ public class GetResourcesTest {
     @ArquillianResource
     private URL url;
 
-    @Deployment(testable = false) public static WebArchive createDeployment() {
+    @Deployment(testable = false)
+    public static WebArchive createDeployment() {
         return ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war")
-                .addClass(GetResourcesServletExporter.class)
-                .addClass(GetResourcesListener.class)
-                .addClass(GetResourcesHolder.class)
-                .addAsWebResource(Thread.currentThread().getContextClassLoader().getResource("test.getresources"), "/config/test.getresources")
-                .addAsWebResource(Thread.currentThread().getContextClassLoader().getResource("test.getresources"), "/config/test.getresources2")
-                .addAsLibraries(JarLocation.jarLocation(Test.class))
+                .addClasses(GetResourcesServletExporter.class, GetResourcesListener.class, GetResourcesHolder.class)
+                .addAsResource(Thread.currentThread().getContextClassLoader().getResource("test.getresources"), "/config/test.getresources")
+                .addAsResource(Thread.currentThread().getContextClassLoader().getResource("test.getresources"), "/config/test.getresources2")
                 .setWebXML(new StringAsset(
                       Descriptors.create(WebAppDescriptor.class)
                         .version("3.0").exportAsString()));

Modified: openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/ejb/JSFInjectionTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/ejb/JSFInjectionTest.java?rev=1392895&r1=1392894&r2=1392895&view=diff
==============================================================================
--- openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/ejb/JSFInjectionTest.java (original)
+++ openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/ejb/JSFInjectionTest.java Tue Oct  2 12:51:39 2012
@@ -40,7 +40,7 @@ public class JSFInjectionTest extends JS
     @Deployment(testable = false)
     public static WebArchive getArchive() {
         return base("jsf-injection-test.war")
-                .addPackage(JSFInjectionTest.class.getPackage())
+                .addClasses(DummyEJB.class, DummyManagedBean.class)
                 .addAsWebResource(new ClassLoaderAsset(
                         JSFInjectionTest.class.getPackage().getName().replace('.', '/').concat("/").concat("dummy.xhtml")), "dummy.xhtml");
     }

Modified: openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java?rev=1392895&r1=1392894&r2=1392895&view=diff
==============================================================================
--- openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java (original)
+++ openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java Tue Oct  2 12:51:39 2012
@@ -55,7 +55,7 @@ public class JPAInjectionTest extends JS
 
         Asset persistenceAsset = new StringAsset(persistenceDescriptor.exportAsString());
         return base("jsf-jpa-test.war").addAsWebInfResource(persistenceAsset, "persistence.xml")
-                .addPackage(JPAInjectionTest.class.getPackage())
+                .addClasses(DummyManagedBean.class)
                 .addAsWebResource(new ClassLoaderAsset(
                         JPAInjectionTest.class.getPackage().getName().replace('.', '/').concat("/").concat("dummy.xhtml")), "dummy.xhtml");
 

Modified: openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/servlet/SimpleServletTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/servlet/SimpleServletTest.java?rev=1392895&r1=1392894&r2=1392895&view=diff
==============================================================================
--- openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/servlet/SimpleServletTest.java (original)
+++ openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/servlet/SimpleServletTest.java Tue Oct  2 12:51:39 2012
@@ -51,7 +51,7 @@ public class SimpleServletTest {
 
     @Deployment(testable = false)
     public static WebArchive getArchive() {
-        return new WebModule(SimpleServletTest.class).getArchive();
+        return new WebModule(SimpleServletTest.class, SimpleServletTest.class).getArchive();
     }
 
     protected void validateTest(String expectedOutput) throws IOException {

Modified: openejb/trunk/openejb/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappExtension.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappExtension.java?rev=1392895&r1=1392894&r2=1392895&view=diff
==============================================================================
--- openejb/trunk/openejb/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappExtension.java (original)
+++ openejb/trunk/openejb/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappExtension.java Tue Oct  2 12:51:39 2012
@@ -18,13 +18,11 @@
 package org.apache.tomee.arquillian.webapp;
 
 import org.apache.openejb.arquillian.common.ArquillianUtil;
-import org.apache.openejb.arquillian.common.TomEEInjectionEnricher;
 import org.apache.openejb.arquillian.common.deployment.DeploymentExceptionObserver;
 import org.apache.openejb.arquillian.common.deployment.DeploymentExceptionProvider;
 import org.jboss.arquillian.container.spi.client.container.DeployableContainer;
 import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
 import org.jboss.arquillian.core.spi.LoadableExtension;
-import org.jboss.arquillian.test.spi.TestEnricher;
 import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider;
 
 public class TomEEWebappExtension implements LoadableExtension {
@@ -36,7 +34,6 @@ public class TomEEWebappExtension implem
             builder.service(DeployableContainer.class, TomEEWebappContainer.class)
                 .service(AuxiliaryArchiveAppender.class, TomEEWebappEJBEnricherArchiveAppender.class)
                 .observer(DeploymentExceptionObserver.class)
-                .service(TestEnricher.class, TomEEInjectionEnricher.class)
                 .service(ResourceProvider.class, DeploymentExceptionProvider.class);
         }
     }