usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject usergrid git commit: Separates system database setup from data bootstrapping
Date Wed, 02 Sep 2015 23:10:47 GMT
Repository: usergrid
Updated Branches:
  refs/heads/USERGRID-993 [created] 4450504cb


Separates system database setup from data bootstrapping


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

Branch: refs/heads/USERGRID-993
Commit: 4450504cbe21bb8704695c041db425dd91f0c3e2
Parents: cd479dc
Author: Todd Nine <tnine@apigee.com>
Authored: Wed Sep 2 17:10:42 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Wed Sep 2 17:10:42 2015 -0600

----------------------------------------------------------------------
 .../corepersistence/CpEntityManagerFactory.java | 20 +++-
 .../usergrid/corepersistence/CpSetup.java       |  3 +-
 .../persistence/EntityManagerFactory.java       | 10 ++
 .../usergrid/persistence/cassandra/Setup.java   | 14 +--
 .../usergrid/persistence/CoreSchemaManager.java |  2 +-
 .../apache/usergrid/rest/DatabaseResource.java  | 98 ++++++++++++++++++++
 .../apache/usergrid/rest/SystemResource.java    | 57 +++---------
 .../apache/usergrid/rest/SystemResourceIT.java  | 32 ++++---
 .../resource/endpoints/BoostrapResource.java    | 52 +++++++++++
 .../resource/endpoints/DatabaseResource.java    |  4 +
 .../test/resource/endpoints/SetupResource.java  |  4 +-
 .../test/resource/endpoints/SystemResource.java | 14 ---
 12 files changed, 224 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index b91a758..4bdade5 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -33,7 +33,6 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.usergrid.corepersistence.asyncevents.AsyncEventService;
 import org.apache.usergrid.corepersistence.index.ReIndexRequestBuilder;
 import org.apache.usergrid.corepersistence.index.ReIndexService;
-import org.apache.usergrid.corepersistence.pipeline.builder.PipelineBuilderFactory;
 import org.apache.usergrid.corepersistence.service.CollectionService;
 import org.apache.usergrid.corepersistence.service.ConnectionService;
 import org.apache.usergrid.corepersistence.util.CpNamingUtils;
@@ -207,7 +206,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
     @Override
     public Entity createApplicationV2(String organizationName, String name) throws Exception
{
-        return createApplicationV2(organizationName, name, null, null);
+        return createApplicationV2( organizationName, name, null, null );
     }
 
 
@@ -229,7 +228,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
         logger.debug( "New application orgName {} orgAppName {} id {} ",
             new Object[] { orgName, name, applicationId.toString() } );
 
-        return initializeApplicationV2(orgName, applicationId, appName, properties);
+        return initializeApplicationV2( orgName, applicationId, appName, properties );
     }
 
 
@@ -449,7 +448,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
     @Override
     public Map<String, UUID> getApplications() throws Exception {
-        return getApplications(CpNamingUtils.getEdgeTypeFromCollectionName( CpNamingUtils.APPLICATION_INFOS
));
+        return getApplications( CpNamingUtils.getEdgeTypeFromCollectionName( CpNamingUtils.APPLICATION_INFOS
) );
     }
 
 
@@ -511,7 +510,18 @@ public class CpEntityManagerFactory implements EntityManagerFactory,
Application
 
     @Override
     public void setup() throws Exception {
-        getSetup().init();
+        getSetup().initSubsystems();
+    }
+
+
+    @Override
+    public void boostrap() throws Exception {
+
+        //we want to make sure our keyspaces exist
+        setup();
+        //create the defautl applications
+        getSetup().createDefaultApplications();
+        //init any other data we need
         init();
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
index aace825..71db120 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
@@ -90,13 +90,12 @@ public class CpSetup implements Setup {
 
 
     @Override
-    public void init() throws Exception {
+    public void initSubsystems() throws Exception {
         //a no op, creating the injector creates the connections
         //init our index if required
         this.emf.initializeManagementIndex();
         setupStaticKeyspace();
         setupSystemKeyspace();
-        createDefaultApplications();
 
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
index be6ff1d..bde1bd2 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
@@ -136,8 +136,18 @@ public interface EntityManagerFactory {
 
     public Map<String, UUID> getDeletedApplications() throws Exception;
 
+    /**
+     * Sets up core system resources
+     * @throws Exception
+     */
     void setup() throws Exception;
 
+    /**
+     * Boostraps system data so that we can operate usergrid
+     * @throws Exception
+     */
+    void boostrap() throws Exception;
+
     Map<String, String> getServiceProperties();
 
     boolean updateServiceProperties( Map<String, String> properties );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java
index 2c060ff..ad60b1c 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java
@@ -25,34 +25,34 @@ import java.util.UUID;
 public interface Setup {
 
     /**
-     * Initialize all configuration for the system setup.  DO NOT actually create any keyspaces.
+     * Initialize all configuration for the system setup. Creates keyspaces, and elasticsearch
indexes
      * @throws Exception
      */
-    void init() throws Exception;
+    void initSubsystems() throws Exception;
 
     /**
      * Setup the management keyspaces
      * @throws Exception
      */
-    public void setupSystemKeyspace() throws Exception;
+    void setupSystemKeyspace() throws Exception;
 
     /**
      * Setup the application keyspaces
      * @throws Exception
      */
-    public void setupStaticKeyspace() throws Exception;
+    void setupStaticKeyspace() throws Exception;
 
     /**
      * Returns true if both keyspaces exist
      * @return
      */
-    public boolean keyspacesExist();
+    boolean keyspacesExist();
 
     /**
      * Bootstrap the root application to allow the system to function.
      * @throws Exception
      */
-    public void createDefaultApplications() throws Exception;
+    void createDefaultApplications() throws Exception;
 
-    public void setupApplicationKeyspace(UUID applicationId, String appName) throws Exception;
+    void setupApplicationKeyspace( UUID applicationId, String appName ) throws Exception;
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
b/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
index 723e971..adecc40 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
@@ -50,7 +50,7 @@ public class CoreSchemaManager implements SchemaManager {
     @Override
     public void create() {
         try {
-            setup.init();
+            setup.initSubsystems();
         }
         catch ( Exception ex ) {
             LOG.error( "Could not setup usergrid core schema", ex );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/rest/src/main/java/org/apache/usergrid/rest/DatabaseResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/DatabaseResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/DatabaseResource.java
new file mode 100644
index 0000000..a8c5fee
--- /dev/null
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/DatabaseResource.java
@@ -0,0 +1,98 @@
+/*
+ * 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.
+ */
+package org.apache.usergrid.rest;
+
+
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriInfo;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import org.apache.usergrid.rest.security.annotations.RequireSystemAccess;
+
+import com.sun.jersey.api.json.JSONWithPadding;
+
+
+@Component
+@Scope( "singleton" )
+@Produces( {
+    MediaType.APPLICATION_JSON, "application/javascript", "application/x-javascript", "text/ecmascript",
+    "application/ecmascript", "text/jscript"
+} )
+public class DatabaseResource extends AbstractContextResource {
+
+    private static final Logger logger = LoggerFactory.getLogger( DatabaseResource.class
);
+
+
+    public DatabaseResource() {
+        logger.info( "DatabaseResource initialized" );
+    }
+
+
+    @RequireSystemAccess
+    @PUT
+    @Path( "setup" )
+    public JSONWithPadding runDatabaseSetup( @Context UriInfo ui,
+                                             @QueryParam( "callback" ) @DefaultValue( "callback"
) String callback )
+        throws Exception {
+
+        ApiResponse response = createApiResponse();
+        response.setAction( "cassandra setup" );
+
+        logger.info( "Setting up Cassandra" );
+
+
+        emf.setup();
+
+
+        response.setSuccess();
+
+        return new JSONWithPadding( response, callback );
+    }
+
+
+    @RequireSystemAccess
+    @PUT
+    @Path( "bootstrap" )
+    public JSONWithPadding runSystemSetup( @Context UriInfo ui,
+                                           @QueryParam( "callback" ) @DefaultValue( "callback"
) String callback )
+        throws Exception {
+
+        ApiResponse response = createApiResponse();
+        response.setAction( "cassandra setup" );
+
+        logger.info( "Setting up Cassandra" );
+
+
+        emf.boostrap();
+        management.setup();
+
+        response.setSuccess();
+
+        return new JSONWithPadding( response, callback );
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/rest/src/main/java/org/apache/usergrid/rest/SystemResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/SystemResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/SystemResource.java
index fca3333..26f1149 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/SystemResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/SystemResource.java
@@ -17,15 +17,9 @@
 package org.apache.usergrid.rest;
 
 
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
 import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
@@ -37,17 +31,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
-import org.apache.usergrid.persistence.EntityManager;
-import org.apache.usergrid.persistence.EntityManagerFactory;
-import org.apache.usergrid.persistence.EntityManagerFactory.ProgressObserver;
-import org.apache.usergrid.persistence.EntityRef;
-import org.apache.usergrid.persistence.index.utils.UUIDUtils;
-import org.apache.usergrid.rest.management.organizations.OrganizationsResource;
 import org.apache.usergrid.rest.security.annotations.RequireSystemAccess;
 
-import com.clearspring.analytics.util.Preconditions;
-import com.fasterxml.jackson.databind.node.JsonNodeFactory;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.sun.jersey.api.json.JSONWithPadding;
 
 
@@ -55,8 +40,8 @@ import com.sun.jersey.api.json.JSONWithPadding;
 @Component
 @Scope( "singleton" )
 @Produces( {
-        MediaType.APPLICATION_JSON, "application/javascript", "application/x-javascript",
"text/ecmascript",
-        "application/ecmascript", "text/jscript"
+    MediaType.APPLICATION_JSON, "application/javascript", "application/x-javascript", "text/ecmascript",
+    "application/ecmascript", "text/jscript"
 } )
 public class SystemResource extends AbstractContextResource {
 
@@ -70,34 +55,10 @@ public class SystemResource extends AbstractContextResource {
 
     @RequireSystemAccess
     @GET
-    @Path( "database/setup" )
-    public JSONWithPadding getSetup( @Context UriInfo ui,
-                                     @QueryParam( "callback" ) @DefaultValue( "callback"
) String callback )
-            throws Exception {
-
-        ApiResponse response = createApiResponse();
-        response.setAction( "cassandra setup" );
-
-        logger.info( "Setting up Cassandra" );
-
-
-        emf.setup();
-
-
-        management.setup();
-
-        response.setSuccess();
-
-        return new JSONWithPadding( response, callback );
-    }
-
-
-    @RequireSystemAccess
-    @GET
     @Path( "superuser/setup" )
     public JSONWithPadding getSetupSuperuser( @Context UriInfo ui,
                                               @QueryParam( "callback" ) @DefaultValue( "callback"
) String callback )
-            throws Exception {
+        throws Exception {
 
         ApiResponse response = createApiResponse();
         response.setAction( "superuser setup" );
@@ -116,11 +77,19 @@ public class SystemResource extends AbstractContextResource {
         return new JSONWithPadding( response, callback );
     }
 
+
     @Path( "migrate" )
-    public MigrateResource migrate(){
+    public MigrateResource migrate() {
         return getSubResource( MigrateResource.class );
     }
 
+
     @Path( "index" )
-    public IndexResource index() { return getSubResource(IndexResource.class); }
+    public IndexResource index() { return getSubResource( IndexResource.class ); }
+
+
+    @Path( "database" )
+    public DatabaseResource database() {
+        return getSubResource( DatabaseResource.class );
+    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
index 7f09fa5..bb53e83 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
@@ -22,10 +22,6 @@ import org.junit.Test;
 import org.apache.usergrid.rest.test.resource.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource.model.Entity;
 import org.apache.usergrid.rest.test.resource.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource.model.Token;
-
-import com.sun.jersey.api.client.UniformInterfaceException;
-import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
 
 import static org.junit.Assert.assertNotNull;
 
@@ -38,19 +34,33 @@ public class SystemResourceIT extends AbstractRestIT {
     @Test
     public void testSystemDatabaseAlreadyRun() {
         QueryParameters queryParameters = new QueryParameters();
-        queryParameters.addParam( "access_token",clientSetup.getSuperuserToken().getAccessToken()
);
+        queryParameters.addParam( "access_token", clientSetup.getSuperuserToken().getAccessToken()
);
 
-        Entity result = clientSetup.getRestClient().system().database().setup().get(queryParameters);
+        Entity result = clientSetup.getRestClient().system().database().setup().put( queryParameters
);
 
-        assertNotNull(result);
-        assertNotNull( "ok" ,(String)result.get( "status" ) );
+        assertNotNull( result );
+        assertNotNull( "ok", ( String ) result.get( "status" ) );
 
-        result = clientSetup.getRestClient().system().database().setup().get(queryParameters);
+        result = clientSetup.getRestClient().system().database().setup().put( queryParameters
);
 
         assertNotNull( result );
-        assertNotNull( "ok" ,(String)result.get( "status" ) );
+        assertNotNull( "ok", ( String ) result.get( "status" ) );
+    }
 
 
-    }
+    @Test
+    public void testBoostrapAlreadyRun() {
+        QueryParameters queryParameters = new QueryParameters();
+        queryParameters.addParam( "access_token", clientSetup.getSuperuserToken().getAccessToken()
);
 
+        Entity result = clientSetup.getRestClient().system().database().bootstrap().put(
queryParameters );
+
+        assertNotNull( result );
+        assertNotNull( "ok", ( String ) result.get( "status" ) );
+
+        result = clientSetup.getRestClient().system().database().bootstrap().put( queryParameters
);
+
+        assertNotNull( result );
+        assertNotNull( "ok", ( String ) result.get( "status" ) );
+    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/BoostrapResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/BoostrapResource.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/BoostrapResource.java
new file mode 100644
index 0000000..89450fa
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/BoostrapResource.java
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+package org.apache.usergrid.rest.test.resource.endpoints;
+
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.usergrid.rest.test.resource.model.Entity;
+import org.apache.usergrid.rest.test.resource.model.QueryParameters;
+import org.apache.usergrid.rest.test.resource.state.ClientContext;
+
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
+
+
+/**
+ * Functions as the endpoint for all resources that hit /system/ * /setup
+ */
+public class BoostrapResource extends NamedResource {
+
+    public BoostrapResource( final ClientContext context, final UrlResource parent ) {
+        super("bootstrap",context,parent);
+    }
+
+    public Entity put(QueryParameters queryParameters){
+
+        WebResource resource = getResource();
+        resource = addParametersToResource( resource, queryParameters );
+
+        //added httpBasicauth filter to all setup calls because they all do verification
this way.
+        HTTPBasicAuthFilter httpBasicAuthFilter = new HTTPBasicAuthFilter( "superuser","superpassword"
);
+        resource.addFilter( httpBasicAuthFilter );
+
+        return resource.type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON
)
+                                .put( Entity.class );
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/DatabaseResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/DatabaseResource.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/DatabaseResource.java
index e1dcd9c..2873513 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/DatabaseResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/DatabaseResource.java
@@ -36,4 +36,8 @@ public class DatabaseResource extends NamedResource {
     public SetupResource setup(){
         return new SetupResource (context, this);
     }
+
+    public BoostrapResource bootstrap(){
+          return new BoostrapResource (context, this);
+      }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java
index b374cdc..ba2534f 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java
@@ -37,7 +37,7 @@ public class SetupResource extends NamedResource {
         super("setup",context,parent);
     }
 
-    public Entity get(QueryParameters queryParameters){
+    public Entity put(QueryParameters queryParameters){
 
         WebResource resource = getResource();
         resource = addParametersToResource( resource, queryParameters );
@@ -47,6 +47,6 @@ public class SetupResource extends NamedResource {
         resource.addFilter( httpBasicAuthFilter );
 
         return resource.type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON
)
-                                .get( Entity.class);
+                                .put( Entity.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4450504c/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java
index 6a97dad..cb8a369 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java
@@ -34,24 +34,10 @@ public class SystemResource extends NamedResource {
         super( "system",context, parent );
     }
 
-    //Dirty hack for path resource in new branch of two-dot-o
-    public SystemResource(final String name,final ClientContext context, final UrlResource
parent ) {
-        super( name,context, parent );
-    }
-
 
     public DatabaseResource database() {
         return new DatabaseResource(context, this);
     }
 
-    public SystemResource addToPath( String pathPart ) {
-        return new SystemResource( pathPart, context, this );
-    }
 
-    public ApiResponse put(){
-        ApiResponse
-            response = getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
-                                        .put(ApiResponse.class);
-        return response;
-    }
 }


Mime
View raw message