You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2015/02/24 21:17:31 UTC

[3/4] incubator-usergrid git commit: Effort to use arquillian-suite-extension

Effort to use arquillian-suite-extension


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/ec8e6664
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ec8e6664
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ec8e6664

Branch: refs/heads/USERGRID-273
Commit: ec8e66642a4b45d17c0c4ddca96823b642d6f462
Parents: 35bff54
Author: Dave Johnson <dm...@apigee.com>
Authored: Tue Feb 24 15:16:23 2015 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Tue Feb 24 15:16:23 2015 -0500

----------------------------------------------------------------------
 stack/rest/pom.xml                              | 58 +++++---------------
 .../apache/usergrid/rest/AbstractRestIT.java    |  7 ++-
 .../java/org/apache/usergrid/rest/BasicIT.java  |  5 +-
 stack/rest/src/test/resources/arquillian.xml    | 14 +----
 4 files changed, 21 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ec8e6664/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index 2959d6c..c1c8ea2 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -50,48 +50,6 @@
 
             <dependencies>
 
-                <!--embedded mode-->
-                <!--<dependency>-->
-                   <!--<groupId>org.apache.tomcat.embed</groupId>-->
-                   <!--<artifactId>tomcat-embed-core</artifactId>-->
-                   <!--<version>7.0.59</version>-->
-                   <!--<scope>provided</scope>-->
-                <!--</dependency>-->
-                <!--<dependency>-->
-                   <!--<groupId>org.apache.tomcat.embed</groupId>-->
-                   <!--<artifactId>tomcat-embed-jasper</artifactId>-->
-                   <!--<version>7.0.59</version>-->
-                   <!--<scope>provided</scope>-->
-                <!--</dependency>-->
-                <!--<dependency>-->
-                   <!--<groupId>org.apache.tomcat.embed</groupId>-->
-                   <!--<artifactId>tomcat-embed-logging-juli</artifactId>-->
-                   <!--<version>7.0.59</version>-->
-                   <!--<scope>provided</scope>-->
-                <!--</dependency>-->
-                <!--<dependency>-->
-                   <!--<groupId>org.eclipse.jdt.core.compiler</groupId>-->
-                   <!--<artifactId>ecj</artifactId>-->
-                   <!--<version>3.7</version>-->
-                   <!--<scope>test</scope>-->
-                <!--</dependency>-->
-
-                <!--&lt;!&ndash; Weld servlet for testing CDI injections &ndash;&gt;-->
-           <!--<dependency>-->
-               <!--<groupId>org.jboss.weld.servlet</groupId>-->
-               <!--<artifactId>weld-servlet</artifactId>-->
-               <!--<version>2.2.9.Final</version>-->
-           <!--</dependency>-->
-
-                <!-- managed -->
-                <!--<dependency>-->
-                      <!--<groupId>org.jboss.arquillian.container</groupId>-->
-                      <!--<artifactId>arquillian-tomcat-managed-7</artifactId>-->
-                      <!--<version>1.0.0.CR7</version>-->
-                      <!--<scope>test</scope>-->
-                    <!--</dependency>-->
-
-                <!-- remote -->
                 <dependency>
                     <groupId>org.jboss.arquillian.container</groupId>
                     <artifactId>arquillian-tomcat-remote-7</artifactId>
@@ -99,6 +57,14 @@
                     <scope>test</scope>
                 </dependency>
 
+                <!-- only deploy once during tests -->
+                <dependency>
+                    <groupId>org.eu.ingwar.tools</groupId>
+                    <artifactId>arquillian-suite-extension</artifactId>
+                    <version>1.1.2</version>
+                    <scope>test</scope>
+                </dependency>
+
             </dependencies>
 
 
@@ -152,12 +118,14 @@
                     </argLine>
                     <includes>
 
-                        <!--<include>**/*IT.java</include>-->
-                        <!--<include>**/*Test.java</include>-->
+                        <include>**/*IT.java</include>
+                        <include>**/*Test.java</include>
 
                         <!-- how many tests can we run before Tomcat JVM throws OOM / PermGen exceptions -->
 
-                        <include>**/org/apache/usergrid/rest/BasicIT.java</include>
+                        <!--<include>**/org/apache/usergrid/rest/BasicIT.java</include>-->
+                        <!--<include>**/org/apache/usergrid/rest/PartialUpdateTest.java</include>-->
+                        <!--<include>**/org/apache/usergrid/rest/applications/collection/**/CollectionsResourceIT.java</include>-->
 
                         <!--<include>**/org/apache/usergrid/rest/*IT.java</include>-->
                         <!--<include>**/org/apache/usergrid/rest/*Test.java</include>-->

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ec8e6664/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java
index 9ce381d..fab1e55 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java
@@ -40,6 +40,7 @@ import org.apache.usergrid.java.client.Client;
 import static org.apache.usergrid.utils.JsonUtils.mapToFormattedJsonString;
 import static org.apache.usergrid.utils.MapUtils.hashMap;
 
+import org.eu.ingwar.tools.arquillian.extension.suite.annotations.ArquillianSuiteDeployment;
 import org.jboss.arquillian.container.test.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.Archive;
@@ -64,7 +65,8 @@ import org.slf4j.LoggerFactory;
  * following naming convention: test_[HTTP verb]_[action mapping]_[ok|fail][_[specific
  * failure condition if multiple]
  */
-@RunWith( Arquillian.class )
+@ArquillianSuiteDeployment
+@RunWith(Arquillian.class)
 public abstract class AbstractRestIT extends JerseyTest {
     private static final Logger LOG = LoggerFactory.getLogger( AbstractRestIT.class );
     private static boolean usersSetup = false;
@@ -111,14 +113,13 @@ public abstract class AbstractRestIT extends JerseyTest {
         // set maven to be in offline mode
 
         System.setProperty( "org.apache.maven.offline", "true" );
-        return ShrinkWrap.create( MavenImporter.class )
+        return ShrinkWrap.create(MavenImporter.class)
             .loadPomFromFile( "pom.xml", "arquillian-tomcat" )
             .importBuildOutput()
             .as( WebArchive.class );
     }
 
 
-
     @AfterClass
     public static void teardown() {
         access_token = null;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ec8e6664/stack/rest/src/test/java/org/apache/usergrid/rest/BasicIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/BasicIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/BasicIT.java
index f63df78..53b30a4 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/BasicIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/BasicIT.java
@@ -24,6 +24,7 @@ import javax.ws.rs.core.MultivaluedMap;
 
 import com.fasterxml.jackson.databind.JsonNode;
 
+import org.eu.ingwar.tools.arquillian.extension.suite.annotations.ArquillianSuiteDeployment;
 import org.junit.Rule;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -258,7 +259,7 @@ public class BasicIT extends AbstractRestIT {
             err_thrown = true;
         }
         assertTrue( "Error should have been thrown", err_thrown );
-        
+
         // test set app user pin
 
         MultivaluedMap<String, String> formData = new MultivaluedMapImpl();
@@ -270,7 +271,7 @@ public class BasicIT extends AbstractRestIT {
                 .post( String.class, formData ));
 
         refreshIndex(orgName, appName);
-        
+
         node = mapper.readTree( resource()
                 .path( "/"+orgName+"/"+appName+"/token" )
                 .queryParam( "grant_type", "pin" )

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ec8e6664/stack/rest/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/arquillian.xml b/stack/rest/src/test/resources/arquillian.xml
index 1e6177e..5e5fb6c 100644
--- a/stack/rest/src/test/resources/arquillian.xml
+++ b/stack/rest/src/test/resources/arquillian.xml
@@ -23,19 +23,7 @@
     xmlns="http://jboss.org/schema/arquillian"
     xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
 
-    <!--<container qualifier="tomcat" default="true">-->
-        <!--<configuration>-->
-            <!--<property name="bindHttpPort">8080</property>-->
-            <!--<property name="bindAddress">localhost</property>-->
-            <!--<property name="javaVmArguments">-Xmx512m -XX:MaxPermSize=128m</property>-->
-            <!--<property name="catalinaHome">${catalina.home}</property>-->
-            <!--<property name="user">usergrid</property>-->
-            <!--<property name="pass">testpassword</property>-->
-            <!--&lt;!&ndash;This is a workaround for this issue https://issues.jboss.org/browse/ARQ-1814&ndash;&gt;-->
-            <!--<property name="catalinaBase">${catalina.home}</property>-->
-            <!--<property name="allowConnectingToRunningServer">true</property>-->
-        <!--</configuration>-->
-    <!--</container>-->
+    <defaultProtocol type="Servlet 3.0"/>
 
     <container qualifier="tomcat" default="true">
         <configuration>