You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/02/03 22:40:29 UTC

[2/2] incubator-usergrid git commit: First pass at using arquillian

First pass at using arquillian


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

Branch: refs/heads/USERGRID-273-arquillian-prototype
Commit: cb2787ee4b3e1889e52d1d74e2b61cd69d3ce6e6
Parents: b3951ee
Author: Todd Nine <tn...@apigee.com>
Authored: Tue Feb 3 10:52:19 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Tue Feb 3 10:52:19 2015 -0700

----------------------------------------------------------------------
 stack/corepersistence/common/pom.xml            |   9 ++
 stack/corepersistence/pom.xml                   |   1 +
 stack/corepersistence/test/pom.xml              | 104 +++++++++++++++++++
 .../test/src/main/resources/arquillian.xml      |  68 ++++++++++++
 .../test/src/test/java/StartupTest.java         |  38 +++++++
 5 files changed, 220 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb2787ee/stack/corepersistence/common/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/pom.xml b/stack/corepersistence/common/pom.xml
index 42b2996..6949e2f 100644
--- a/stack/corepersistence/common/pom.xml
+++ b/stack/corepersistence/common/pom.xml
@@ -151,6 +151,15 @@
       <scope>test</scope>
     </dependency>
 
+<!-- Testing dependencies -->
+      <dependency>
+          <groupId>${project.parent.groupId}</groupId>
+          <artifactId>test</artifactId>
+          <version>${project.version}</version>
+        <scope>test</scope>
+        </dependency>
+
+
   </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb2787ee/stack/corepersistence/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/pom.xml b/stack/corepersistence/pom.xml
index 9bd53fa..b47fb78 100644
--- a/stack/corepersistence/pom.xml
+++ b/stack/corepersistence/pom.xml
@@ -86,6 +86,7 @@ limitations under the License.
         <module>common</module>
         <module>map</module>
         <module>queue</module>
+        <module>test</module>
     </modules>
 
     <build>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb2787ee/stack/corepersistence/test/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/test/pom.xml b/stack/corepersistence/test/pom.xml
new file mode 100644
index 0000000..b928c73
--- /dev/null
+++ b/stack/corepersistence/test/pom.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>persistence</artifactId>
+    <groupId>org.apache.usergrid</groupId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>test</artifactId>
+
+  <name>Usergrid Testing Tools</name>
+
+  <properties>
+    <!-- override these settings in your profile if you're running a different version -->
+    <docker.api.version>1.16</docker.api.version>
+
+    <!-- We use the TCP socket of the docker java client.  Change this in your settings if your machine is different -->
+    <docker.url>https://192.168.59.105:2376</docker.url>
+
+    <arquillian.version>1.1.6.Final</arquillian.version>
+
+  </properties>
+
+  <build>
+
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+        <includes>
+          <include>**/*.xml</include>
+        </includes>
+      </resource>
+    </resources>
+  </build>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.jboss.arquillian</groupId>
+        <artifactId>arquillian-bom</artifactId>
+        <version>${arquillian.version}</version>
+        <scope>import</scope>
+        <type>pom</type>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+
+    <!-- Required to start docker -->
+    <dependency>
+      <groupId>org.arquillian.cube</groupId>
+      <artifactId>arquillian-cube-docker</artifactId>
+      <version>1.0.0.Alpha3</version>
+    </dependency>
+
+    <!--<dependency>-->
+    <!--<groupId>org.jboss.arquillian</groupId>-->
+    <!--<artifactId>arquillian-bom</artifactId>-->
+    <!--<version>${arquillian.version}</version>-->
+    <!--<type>pom</type>-->
+    <!--</dependency>-->
+
+    <!--<dependency>-->
+    <!--<groupId>org.jboss.arquillian.container</groupId>-->
+    <!--<artifactId>arquillian-container-spi</artifactId>-->
+    <!--</dependency>-->
+
+    <dependency>
+      <groupId>org.jboss.arquillian.junit</groupId>
+      <artifactId>arquillian-junit-container</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+    </dependency>
+  </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb2787ee/stack/corepersistence/test/src/main/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/test/src/main/resources/arquillian.xml b/stack/corepersistence/test/src/main/resources/arquillian.xml
new file mode 100644
index 0000000..b6582e1
--- /dev/null
+++ b/stack/corepersistence/test/src/main/resources/arquillian.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!--
+  ~ /*
+  ~  *
+  ~  * Licensed to the Apache Software Foundation (ASF) under one
+  ~  * or more contributor license agreements.  See the NOTICE file
+  ~  * distributed with this work for additional information
+  ~  * regarding copyright ownership.  The ASF licenses this file
+  ~  * to you under the Apache License, Version 2.0 (the
+  ~  * "License"); you may not use this file except in compliance
+  ~  * with the License.  You may obtain a copy of the License at
+  ~  *
+  ~  *    http://www.apache.org/licenses/LICENSE-2.0
+  ~  *
+  ~  * Unless required by applicable law or agreed to in writing,
+  ~  * software distributed under the License is distributed on an
+  ~  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  * KIND, either express or implied.  See the License for the
+  ~  * specific language governing permissions and limitations
+  ~  * under the License.
+  ~  *
+  ~  */
+  -->
+
+<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns="http://jboss.org/schema/arquillian"
+  xsi:schemaLocation="http://jboss.org/schema/arquillian
+  http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+  <extension qualifier="docker">
+      <!--<property name="serverVersion">${docker.api.version}</property>-->
+      <!--<property name="serverUri">${docker.url}</property>-->
+    <!--&lt;!&ndash;Default container&ndash;&gt;-->
+     <!-- <property name="dockerContainers">
+          tomcat:
+            image: tutum/tomcat:7.0
+            exposedPorts: [8089/tcp]
+            await:
+              strategy: polling
+            env: [TOMCAT_PASS=mypass, JAVA_OPTS=-Dcom.sun.management.jmxremote.port=8089 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false]
+            portBindings: [8089/tcp, 8080/tcp]
+      </property>  -->
+
+     <property name="dockerContainers">
+        cassandra:
+          image: spotify/cassandra
+          exposedPorts: [9160/tcp]
+          await:
+            strategy: polling
+          env: []
+          portBindings: [9160/tcp]
+     </property>
+    <property name="autoStartContainers">cassandra</property>
+    <property name="shouldAllowToConnectToRunningContainers">true</property>
+  </extension>
+
+  <!--Default container-->
+  <!--<container qualifier="tomcat" default="true">-->
+      <!--<configuration>-->
+          <!--<property name="host">localhost</property>-->
+          <!--<property name="httpPort">8080</property>-->
+          <!--<property name="user">admin</property>-->
+          <!--<property name="pass">mypass</property>-->
+      <!--</configuration>-->
+  <!--</container>-->
+
+
+</arquillian>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb2787ee/stack/corepersistence/test/src/test/java/StartupTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/test/src/test/java/StartupTest.java b/stack/corepersistence/test/src/test/java/StartupTest.java
new file mode 100644
index 0000000..8a65cbe
--- /dev/null
+++ b/stack/corepersistence/test/src/test/java/StartupTest.java
@@ -0,0 +1,38 @@
+/*
+ *
+ *  *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  *    http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *  *
+ *
+ */
+
+import org.jboss.arquillian.junit.Arquillian;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertTrue;
+
+
+@RunWith( Arquillian.class)
+public class StartupTest {
+
+    @Test
+    public void iStartCassandra(){
+        assertTrue( "stuff done", true);
+    }
+}