usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [47/51] [abbrv] git commit: Extending TomcatResource
Date Thu, 16 Jan 2014 17:30:43 GMT
Extending TomcatResource


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

Branch: refs/heads/two-dot-o
Commit: 447ede6d2d85c70baa1dd37e8f2e0f291a68aac8
Parents: 3f762ec
Author: Sungju Jin <sungju@softwaregeeks.org>
Authored: Thu Jan 16 22:52:54 2014 +0900
Committer: Sungju Jin <sungju@softwaregeeks.org>
Committed: Thu Jan 16 22:52:54 2014 +0900

----------------------------------------------------------------------
 .../test/java/org/usergrid/rest/ITSetup.java    |  9 ++++++--
 .../java/org/usergrid/rest/TomcatResource.java  | 23 ++++++++------------
 2 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/447ede6d/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java b/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java
index 2701202..0b335a9 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java
@@ -50,11 +50,16 @@ public class ITSetup extends ExternalResource {
     private Properties properties;
 
 
-    public ITSetup( CassandraResource cassandraResource ) {
+    public ITSetup( CassandraResource cassandraResource) {
         this.cassandraResource = cassandraResource;
         tomcatResource = TomcatResource.instance;
+        tomcatResource.setWebAppsPath("src/main/webapp");
+    }
 
-
+    public ITSetup( CassandraResource cassandraResource, String webAppsPath ) {
+        this.cassandraResource = cassandraResource;
+        tomcatResource = TomcatResource.instance;
+        tomcatResource.setWebAppsPath(webAppsPath);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/447ede6d/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java b/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java
index 8ba697f..4b223aa 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java
@@ -15,20 +15,14 @@ import com.google.common.io.Files;
 /** @author tnine */
 public class TomcatResource extends ExternalResource {
 
+    public static final TomcatResource instance = new TomcatResource();
     private static Object mutex = new Object();
-
     private static final String CONTEXT = "/";
-
+    private String webAppsPath;
     private int port;
-
-
-
-
     private Tomcat tomcat;
 
     protected TomcatResource(){
-
-
     }
 
     @Override
@@ -51,9 +45,7 @@ public class TomcatResource extends ExternalResource {
             tomcat = new Tomcat();
             tomcat.setBaseDir( dataDir.getAbsolutePath() );
             tomcat.setPort( port );
-            tomcat.addWebapp( CONTEXT, new File( "src/main/webapp" ).getAbsolutePath() );
-
-
+            tomcat.addWebapp( CONTEXT, new File( getWebAppsPath() ).getAbsolutePath() );
             tomcat.start();
         }
     }
@@ -67,8 +59,11 @@ public class TomcatResource extends ExternalResource {
         return port;
     }
 
+    public String getWebAppsPath() {
+        return webAppsPath;
+    }
 
-    public static final TomcatResource instance = new TomcatResource();
-
-
+    public void setWebAppsPath(String webAppsPath) {
+        this.webAppsPath = webAppsPath;
+    }
 }


Mime
View raw message