usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject incubator-usergrid git commit: Working with managed tomcat. Need to changed to remote tomcat.
Date Mon, 16 Feb 2015 18:29:36 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-273 75a8361cd -> 84b048e6d


Working with managed tomcat.  Need to changed to remote tomcat.


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

Branch: refs/heads/USERGRID-273
Commit: 84b048e6da0842f478f1cd42a2feaf7892665739
Parents: 75a8361
Author: Todd Nine <tnine@apigee.com>
Authored: Fri Feb 13 16:06:26 2015 -0700
Committer: Todd Nine <tnine@apigee.com>
Committed: Mon Feb 16 10:29:28 2015 -0800

----------------------------------------------------------------------
 stack/rest/README.md                            | 90 +++++++++++++++++++
 stack/rest/README.txt                           | 60 -------------
 stack/rest/pom.xml                              | 91 +++++++++++---------
 .../apache/usergrid/rest/AbstractRestIT.java    |  2 +
 stack/rest/src/test/resources/arquillian.xml    | 32 ++++---
 .../resources/usergrid-properties-context.xml   | 40 ---------
 .../resources/usergrid-rest-deploy-context.xml  | 31 -------
 7 files changed, 158 insertions(+), 188 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84b048e6/stack/rest/README.md
----------------------------------------------------------------------
diff --git a/stack/rest/README.md b/stack/rest/README.md
new file mode 100644
index 0000000..e6016fb
--- /dev/null
+++ b/stack/rest/README.md
@@ -0,0 +1,90 @@
+
+Usergrid REST API Web App
+=========================
+
+
+Installs as a webapp in Tomcat. Has not been extensively tested in other web containers.
+See usergrid-standalone for an example of running inside Grizzly.
+
+To verify installation, go here:
+
+http://localhost:8080/test/hello
+
+Eclipse insists on deploying with the ROOT servlet prefix:
+
+http://localhost:8080/ROOT/test/hello
+
+Before you can use, you need to make sure that the database is setup. You can
+do that at the following URLs:
+
+http://localhost:8080/system/database/setup
+http://localhost:8080/ROOT/system/database/setup
+
+You'll need to enter the superuser credentials (superuser/superuser), assuming
+they haven't been changed from the defaults in the runtime properties file:
+
+config/src/main/resources/properties.txt
+
+usergrid.sysadmin.login.name=superuser
+usergrid.sysadmin.login.password=superuser
+usergrid.sysadmin.login.allowed=true
+
+
+Implementation Notes
+--------------------
+
+The REST API is built using Jersey:
+
+http://jersey.java.net/
+
+Jersey is the reference implementation of JAX-RS, Java API for RESTful Web
+Services, which was defined by JSR 311, which is detailed here:
+
+http://jcp.org/en/jsr/detail?id=311
+
+The Spring context in the Usergrid webapp also launches the Mongo and
+WebSocket API servers.
+
+The Usergrid webapp is meant to install as a root servlet. This means that on
+the production server, it can be found at:
+
+http://api.usergrid.com
+
+However, on a local Tomcat server when running within Eclipse, it's
+going to be found at:
+
+http://localhost:8080/ROOT
+
+The usergrid-standalone project is set up to run in Grizzly and will be at:
+
+http://localhost:8080
+
+
+Running Tests
+-------------
+
+To test, add the following configuration to the TOMCAT_HOME/conf/tomcat-users.xml
+
+```xml
+<tomcat-users>
+    <role rolename="manager-gui"/>
+    <tomcat-users>
+        <role rolename="manager-gui"/>
+        <role rolename="manager-jmx"/>
+        <role rolename="manager-script"/>
+        <role rolename="manager-status"/>
+       <!-- this username and password is set into src/test/resources/arquillian.xml -->
+        <user username="usergrid" password="testpassword" roles="manager-script, manager-jmx,
manager-gui, manager-status"/>
+    </tomcat-users>
+</tomcat-users>
+```
+
+
+See the [documentation here](https://docs.jboss.org/author/display/ARQ/Tomcat+7.0+-+Managed)
for more setup information.
+
+
+Add the following properties to you maven settings.xml
+
+```xml
+ <catalina.home>[path to your tomcat directory]</catalina.home>
+ ```

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84b048e6/stack/rest/README.txt
----------------------------------------------------------------------
diff --git a/stack/rest/README.txt b/stack/rest/README.txt
deleted file mode 100644
index 80cff7f..0000000
--- a/stack/rest/README.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-
-Usergrid REST API Web App
-
-Installs as a webapp in Tomcat. Has not been extensively tested in other web containers.
-See usergrid-standalone for an example of running inside Grizzly.
-
-To verify installation, go here:
-
-http://localhost:8080/test/hello
-
-Eclipse insists on deploying with the ROOT servlet prefix:
-
-http://localhost:8080/ROOT/test/hello
-
-Before you can use, you need to make sure that the database is setup. You can
-do that at the following URLs:
-
-http://localhost:8080/system/database/setup
-http://localhost:8080/ROOT/system/database/setup
-
-You'll need to enter the superuser credentials (superuser/superuser), assuming
-they haven't been changed from the defaults in the runtime properties file:
-
-config/src/main/resources/properties.txt
-
-usergrid.sysadmin.login.name=superuser
-usergrid.sysadmin.login.password=superuser
-usergrid.sysadmin.login.allowed=true
-
---------------------
-Implementation Notes
---------------------
-
-The REST API is built using Jersey:
-
-http://jersey.java.net/
-
-Jersey is the reference implementation of JAX-RS, Java API for RESTful Web
-Services, which was defined by JSR 311, which is detailed here:
-
-http://jcp.org/en/jsr/detail?id=311
-
-The Spring context in the Usergrid webapp also launches the Mongo and
-WebSocket API servers.
-
-The Usergrid webapp is meant to install as a root servlet. This means that on
-the production server, it can be found at:
-
-http://api.usergrid.com
-
-However, on a local Tomcat server when running within Eclipse, it's
-going to be found at:
-
-http://localhost:8080/ROOT
-
-The usergrid-standalone project is set up to run in Grizzly and will be at:
-
-http://localhost:8080
-
-

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84b048e6/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index 1c2e3ba..d94c9e2 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -31,49 +31,65 @@
 
     <!-- Override these properties in an active profile within your settings.xml -->
     <properties>
-       <cargo.servlet.port>8081</cargo.servlet.port>
         <usergrid.rest.threads>8</usergrid.rest.threads>
         <guice.version>4.0-beta5</guice.version>
+        <catalina.home>OVERRIDE_ME_IN_SETTINGS>XML</catalina.home>
     </properties>
 
+
     <!-- profile that arquillian uses when it builds/starts tomcat -->
     <profiles>
+
         <profile>
             <id>arquillian-tomcat</id>
+
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+
             <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.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>
-
-                <!-- Weld servlet for testing CDI injections -->
-           <dependency>
-               <groupId>org.jboss.weld.servlet</groupId>
-               <artifactId>weld-servlet</artifactId>
-               <version>2.2.9.Final</version>
-           </dependency>
+                      <groupId>org.jboss.arquillian.container</groupId>
+                      <artifactId>arquillian-tomcat-managed-7</artifactId>
+                      <version>1.0.0.CR7</version>
+                      <scope>test</scope>
+                    </dependency>
 
             </dependencies>
 
@@ -439,20 +455,9 @@
               <type>pom</type>
             </dependency>
 
-        <!--<dependency>-->
-            <!--<groupId>org.jboss.shrinkwrap.resolver</groupId>-->
-            <!--<artifactId>shrinkwrap-resolver-impl-maven</artifactId>-->
-            <!--<scope>test</scope>-->
-            <!--<version>2.1.1</version>-->
-        <!--</dependency>-->
 
 
-        <dependency>
-            <groupId>org.jboss.arquillian.container</groupId>
-            <artifactId>arquillian-tomcat-embedded-7</artifactId>
-            <version>1.0.0.CR7</version>
-            <scope>test</scope>
-        </dependency>
+
 
         <!--  use the external test client.  Just depend on the maven jetty plugin to
launch jetty -->
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84b048e6/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 41b3be5..f1536b5 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
@@ -101,12 +101,14 @@ public abstract class AbstractRestIT extends JerseyTest {
     }
 
 
+    //We set testable = false so we deploy the archive to the server and test it locally
     @Deployment(testable = false)
     public static WebArchive createTestArchive() {
 
         //we use the MavenImporter from shrinkwrap to just produce whatever maven would build
then test with it
 
         //set maven to be in offline mode
+
         System.setProperty( "org.apache.maven.offline", "true" );
 
       return  ShrinkWrap.create(MavenImporter.class)

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84b048e6/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 a208aeb..49b43f4 100644
--- a/stack/rest/src/test/resources/arquillian.xml
+++ b/stack/rest/src/test/resources/arquillian.xml
@@ -23,21 +23,25 @@
     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="unpackArchive">true</property>-->
-           <!--</configuration>-->
-       <!--</container>-->
+    <!--<container qualifier="tomcat" default="true">-->
+    <!--<configuration>-->
+    <!--<property name="unpackArchive">true</property>-->
+    <!--</configuration>-->
+    <!--</container>-->
 
+    <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>
+            <!--This is a workaround for this issue https://issues.jboss.org/browse/ARQ-1814-->
+            <property name="catalinaBase">${catalina.home}</property>
+            <property name="allowConnectingToRunningServer">true</property>
+        </configuration>
+    </container>
 
-        <container qualifier="tomcat" default="true">
-            <configuration>
-                <property name="tomcatHome">target/tomcat-embedded-7</property>
-                <property name="workDir">work</property>
-                <property name="bindHttpPort">8888</property>
-                <property name="unpackArchive">true</property>
-                <property name="serverName">arquillian-tomcat-embedded-7</property>
-            </configuration>
-        </container>
 </arquillian>
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84b048e6/stack/rest/src/test/resources/usergrid-properties-context.xml
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/usergrid-properties-context.xml b/stack/rest/src/test/resources/usergrid-properties-context.xml
deleted file mode 100644
index 541ae53..0000000
--- a/stack/rest/src/test/resources/usergrid-properties-context.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="
-	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
-	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
-	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
-
-    <bean id="properties"
-          class="org.springframework.beans.factory.config.PropertiesFactoryBean">
-        <property name="singleton" value="true" />
-        <property name="ignoreResourceNotFound" value="true" />
-        <property name="locations">
-            <list>
-                <value>classpath:/usergrid-default.properties</value>
-                <value>classpath:/usergrid-test.properties</value>
-                <value>classpath:/usergrid-custom-test.properties</value>
-            </list>
-        </property>
-    </bean>
-
-</beans>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84b048e6/stack/rest/src/test/resources/usergrid-rest-deploy-context.xml
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/usergrid-rest-deploy-context.xml b/stack/rest/src/test/resources/usergrid-rest-deploy-context.xml
deleted file mode 100644
index 424f480..0000000
--- a/stack/rest/src/test/resources/usergrid-rest-deploy-context.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
-	xsi:schemaLocation="
-	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
-	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
-	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
-
-	<import resource="classpath:/usergrid-test-context.xml" />
-	
-	
-
-
-</beans>


Mime
View raw message