You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2015/07/15 19:28:20 UTC
[3/8] incubator-usergrid git commit: remove old test framework
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/NamedResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/NamedResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/NamedResource.java
deleted file mode 100644
index 3eeddf8..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/NamedResource.java
+++ /dev/null
@@ -1,356 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints;
-
-
-import com.sun.jersey.api.client.GenericType;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
-import com.sun.jersey.api.representation.Form;
-import com.sun.jersey.multipart.FormDataMultiPart;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import javax.ws.rs.core.MediaType;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * Base class that is extended by named endpoints.
- * The NamedResource stores the parent of the class, the context in which the class operates and then Name of this resource
- */
-public class NamedResource implements UrlResource {
-
- protected final String name;
- protected final ClientContext context;
- /* Stores the path of the parent that called it.
- i.e If we had a ApplicationResource ( an instance of a namedResource ) this would contain the OrganizationResource.
- */
- protected final UrlResource parent;
-
-
- public NamedResource( final String name, final ClientContext context, final UrlResource parent ) {
- this.name = name;
- this.context = context;
- this.parent = parent;
- }
-
-
- @Override
- public String getPath() {
- return name + getMatrix();
- }
-
- @Override
- public WebResource getResource() {
- return getResource(false);
- }
- public WebResource getResource(boolean useToken) {
- return getResource(useToken,null);
- }
- public WebResource getResource(boolean useToken,Token token) {
- WebResource resource = parent.getResource().path( getPath() );
- token = token !=null ? token : this.context.getToken();
- //error checking
- if (token == null) {
- return resource;
- }
- return useToken ? resource.queryParam("access_token",token.getAccessToken()) : resource;
- }
-
- protected WebResource addParametersToResource(WebResource resource, final QueryParameters parameters){
-
- if(parameters == null){
- return resource;
- }
- if ( parameters.getQuery() != null ) {
- resource = resource.queryParam( "ql", parameters.getQuery() );
- }
-
- if ( parameters.getCursor() != null ) {
- resource = resource.queryParam( "cursor", parameters.getCursor() );
- }
-
- if ( parameters.getStart() != null ) {
- resource = resource.queryParam("start", parameters.getStart().toString());
- }
-
- if ( parameters.getLimit() != null ) {
- resource = resource.queryParam("limit", parameters.getLimit().toString());
- }
- //We can also post the params as queries
- if ( parameters.getFormPostData().size() > 0){
- Map<String,String> formData = parameters.getFormPostData();
- Set<String> keySet = formData.keySet();
- Iterator<String> keyIterator = keySet.iterator();
-
-
- while(keyIterator.hasNext()){
- String key = keyIterator.next();
- String value = formData.get( key );
- resource = resource.queryParam( key, value );
- }
- }
- return resource;
- }
-
- protected String getMatrixValue(final QueryParameters parameters) {
-
- StringBuilder sb = new StringBuilder();
- if (parameters == null) {
- return null;
- }
- if (parameters.getQuery() != null) {
- sb.append(";");
- sb.append("ql").append("=").append(parameters.getQuery());
- }
-
- if (parameters.getCursor() != null) {
- sb.append(";");
- sb.append("cursor").append("=").append(parameters.getCursor());
- }
- if (parameters.getStart() != null) {
- sb.append(";");
- sb.append("start").append("=").append(parameters.getStart());
- }
- if (parameters.getLimit() != null) {
- sb.append(";");
- sb.append("limit").append("=").append(parameters.getLimit());
- }
- //We can also post the params as queries
- if (parameters.getFormPostData().size() > 0) {
- Map<String, String> formData = parameters.getFormPostData();
- Set<String> keySet = formData.keySet();
- Iterator<String> keyIterator = keySet.iterator();
-
-
- while (keyIterator.hasNext()) {
- if (sb.length() > 0)
- sb.append(";");
- String key = keyIterator.next();
- String value = formData.get(key);
- sb.append(key).append("=").append(value);
- }
- }
- return sb.toString();
- }
-
- /**
- * Need to refactor all instances of tokens to either be passed in or manually set during the test.
- * There isn't any reason we would want a rest forwarding framework to set something on behave of the user.
- * @param map
- * @return
- */
- //For edge cases like Organizations and Tokens
- public ApiResponse post(Map map) {
- return post( true, ApiResponse.class, map, null, false );
-
- }
-
- //For edge cases like Organizations and Tokens
- public ApiResponse post(boolean useToken, Map map, QueryParameters queryParameters) {
- return post( useToken, ApiResponse.class, map, queryParameters, false );
-
- }
-
- /**
- * Need to refactor all instances of tokens to either be passed in or manually set during the test.
- * There isn't any reason we would want a rest forwarding framework to set something on behave of the user.
- * @param type
- * @param <T>
- * @return
- */
- //For edge cases like Organizations and Tokens
- public <T> T post(Class<T> type) {
- return post(true,type,null,null,false);
-
- }
-
- /**
- * Need to refactor all instances of tokens to either be passed in or manually set during the test.
- * There isn't any reason we would want a rest forwarding framework to set something on behave of the user.
- * @param type
- * @param requestEntity
- * @param <T>
- * @return
- */
- //For edge cases like Organizations and Tokens
- public <T> T post(Class<T> type, Entity requestEntity) {
- return post(true,type,requestEntity,null,false);
-
- }
-
- /**
- * Need to refactor all instances of tokens to either be passed in or manually set during the test.
- * There isn't any reason we would want a rest forwarding framework to set something on behave of the user.
- * @param type
- * @param requestEntity
- * @param <T>
- * @return
- */
- //For edge cases like Organizations and Tokens
- public <T> T post(Class<T> type, Map requestEntity) {
- return post(true,type,requestEntity,null,false);
-
- }
-
- public <T> T post( boolean useToken, Class<T> type, Map requestEntity) {
- return post(useToken, type, requestEntity, null, false);
-
- }
-
- /**
- * Used to test POST using form payloads.
- * @param type
- * @param requestEntity
- * @param <T>
- * @return
- */
- public <T> T post(Class<T> type, Form requestEntity) {
- GenericType<T> gt = new GenericType<>((Class) type);
- return getResource()
- .accept(MediaType.APPLICATION_JSON)
- .type(MediaType.APPLICATION_FORM_URLENCODED_TYPE)
- .entity(requestEntity, MediaType.APPLICATION_FORM_URLENCODED_TYPE)
- .post(gt.getRawClass());
-
- }
-
-
- //Used for empty posts
- public <T> T post( boolean useToken, Class<T> type, Map entity, final QueryParameters queryParameters) {
- WebResource resource = getResource(useToken);
- resource = addParametersToResource(resource, queryParameters);
- WebResource.Builder builder = resource
- .type(MediaType.APPLICATION_JSON_TYPE)
- .accept( MediaType.APPLICATION_JSON );
-
- if(entity!=null){
- builder.entity(entity);
- }
- GenericType<T> gt = new GenericType<>((Class) type);
- return builder
- .post(gt.getRawClass());
-
- }
-
- //Used for empty posts
- public <T> T post( boolean useToken, Class<T> type, Map entity, final QueryParameters queryParameters, boolean useBasicAuthentication ) {
- WebResource resource = getResource(useToken);
- resource = addParametersToResource(resource, queryParameters);
- WebResource.Builder builder = resource
- .type(MediaType.APPLICATION_JSON_TYPE)
- .accept( MediaType.APPLICATION_JSON );
-
- if(entity!=null){
- builder.entity(entity);
- }
-
- if(useBasicAuthentication){
- //added httpBasicauth filter to all setup calls because they all do verification this way.
- HTTPBasicAuthFilter httpBasicAuthFilter = new HTTPBasicAuthFilter( "superuser","superpassword" );
- resource.addFilter( httpBasicAuthFilter );
- }
-
- GenericType<T> gt = new GenericType<>((Class) type);
- return builder.post( gt.getRawClass() );
-
- }
-
- //For edge cases like Organizations and Tokens without any payload
- public <T> T get(Class<T> type) {
- return get(type,null,true);
-
- }
-
- //For edge cases like Organizations and Tokens without any payload
- public <T> T get(Class<T> type, boolean useToken) {
- return get( type, null, useToken );
- }
-
-
-
- public <T> T get(Class<T> type,QueryParameters queryParameters) {
- return get( type, queryParameters, true );
- }
-
- public <T> T get(Class<T> type,QueryParameters queryParameters, boolean useToken) {
- WebResource resource = getResource(useToken);
- if(queryParameters!=null) {
- resource = addParametersToResource(resource, queryParameters);
- }
- GenericType<T> gt = new GenericType<>((Class) type);
- return resource.type(MediaType.APPLICATION_JSON_TYPE)
- .accept( MediaType.APPLICATION_JSON )
- .get( gt.getRawClass() );
-
- }
-
- public String getMatrix() {
- return "";
- }
-
- public ApiResponse post( boolean useToken, FormDataMultiPart multiPartForm ) {
- WebResource resource = getResource( useToken );
- return resource.type( MediaType.MULTIPART_FORM_DATA_TYPE ).post( ApiResponse.class, multiPartForm );
- }
-
- public ApiResponse post( FormDataMultiPart multiPartForm ) {
- return post( true, multiPartForm );
- }
-
- public ApiResponse put( boolean useToken, byte[] data, MediaType type ) {
- WebResource resource = getResource(useToken);
- return resource.type( type ).put( ApiResponse.class, data );
- }
-
- public ApiResponse put( byte[] data, MediaType type ) {
- return put( true, data, type );
- }
-
- public ApiResponse put( boolean useToken, FormDataMultiPart multiPartForm ) {
- WebResource resource = getResource(useToken);
- return resource.type( MediaType.MULTIPART_FORM_DATA_TYPE ).put( ApiResponse.class, multiPartForm );
- }
-
- public ApiResponse put( FormDataMultiPart multiPartForm ) {
- return put( true, multiPartForm );
- }
-
- public InputStream getAssetAsStream( boolean useToken ) {
- WebResource resource = getResource(useToken);
- return resource.accept( MediaType.APPLICATION_OCTET_STREAM_TYPE ).get( InputStream.class );
- }
-
- public InputStream getAssetAsStream() {
- return getAssetAsStream( true );
- }
-
- public ApiResponse delete( ) {
- return delete(true);
- }
-
- public ApiResponse delete( boolean useToken ) {
- return getResource(useToken).delete( ApiResponse.class );
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/OrganizationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/OrganizationResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/OrganizationResource.java
deleted file mode 100644
index c1032b6..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/OrganizationResource.java
+++ /dev/null
@@ -1,49 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints;
-
-
-import java.util.Map;
-import java.util.UUID;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Organization;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-
-/**
- * Holds the information required for building and chaining organization objects to applications.
- * Should also contain the GET,PUT,POST,DELETE methods of functioning in here.
- */
-public class OrganizationResource extends NamedResource {
-
-
- public OrganizationResource( final String name, final ClientContext context, final UrlResource parent ) {
- super( name, context, parent );
- }
-
- public ApplicationsResource app(final String name){
- return new ApplicationsResource( name, context ,this );
- }
-
- public Organization get(){
- throw new UnsupportedOperationException("service doesn't exist");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RootResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RootResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RootResource.java
deleted file mode 100644
index 4570bac..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RootResource.java
+++ /dev/null
@@ -1,86 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints;
-
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.ManagementResource;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
-
-/**
- * Contains the root element for classes. Contains the client context that holds a token for the management calls,
- * and also contains the serverUrl so we know what endpoint we need to hit.
- * Contains the two top level functions that can be called from the "root" ( actual root is the serverUrl )
- * 1.) Is the management resource i.e /management/org/blah/...
- * 2.) Is the organization resource i.e /<orgname>/<appname>...
- * This is where top level elements are contained and managemend
- */
-//TODO: check to see if this actually ever gets called. It doesn't seem like so remove once verified.
-public class RootResource implements UrlResource {
-
-
- private final String serverUrl;
- private final ClientContext context;
-
-
- /**
- *
- * @param serverUrl The serverurl that has stood up the UG instance i.e localhost:8080
- * @param context Contains the token that will be used for the following resources.
- */
- public RootResource( final String serverUrl, final ClientContext context ) {
- this.serverUrl = serverUrl;
- this.context = context;
- }
-
-
- /**
- * Returns the serverUrl that the root resource is pointing to.
- * @return serverUrl
- */
- @Override
- public String getPath() {
- return serverUrl;
- }
-
- @Override
- public WebResource getResource() {
- //TODO: fix this to return the proper resource in the scope we expect it, might not be needed here.
- return null;
- }
-
- /**
- * Get the management resource
- * @return
- */
- public ManagementResource management(){
- return new ManagementResource( context, this);
- }
-
-
- /**
- * Get the organization resource
- * @param orgName
- * @return OrganizationResource Returns an instance of the OrganizationResource to continue builder pattern
- */
- public OrganizationResource org(final String orgName){
- return new OrganizationResource( orgName,context, this );
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
deleted file mode 100644
index 4b88cf8..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
+++ /dev/null
@@ -1,52 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints;
-
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.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 SetupResource extends NamedResource {
-
- public SetupResource( final ClientContext context, final UrlResource parent ) {
- super("setup",context,parent);
- }
-
- public Entity get(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 )
- .get( Entity.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SystemResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SystemResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SystemResource.java
deleted file mode 100644
index ee70942..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SystemResource.java
+++ /dev/null
@@ -1,57 +0,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.
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints;
-
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-
-/**
- * Handles making rest calls to system resources.
- */
-public class SystemResource extends NamedResource {
-
- public SystemResource(final ClientContext context, final UrlResource parent ) {
- 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;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/TokenResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/TokenResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/TokenResource.java
deleted file mode 100644
index 9ecbadc..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/TokenResource.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *
- * * Licensed to the Apache Software Foundation (ASF) under one or more
- * * contributor license agreements. 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. For additional information regarding
- * * copyright in this work, please see the NOTICE file in the top level
- * * directory of this distribution.
- *
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints;
-
-
-import com.sun.jersey.api.client.WebResource;
-import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import javax.ws.rs.core.MediaType;
-
-/**
- * Classy class class.
- */
-public class TokenResource extends NamedResource {
- public TokenResource(final ClientContext context, final UrlResource parent) {
- super("token", context, parent);
- }
-
-
- /**
- * Obtains an access token and sets the token for the context to use in later calls
- *
- * @return
- */
- public Token post(QueryParameters params) {
- WebResource resource = getResource(false);
- resource = addParametersToResource(resource, params);
- Token token = resource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON)
- .get(Token.class);
-
- this.context.setToken(token);
- return token;
- }
-
- /**
- * Obtains an access token and sets the token for the context to use in later calls
- *
- * @return
- */
- public Token post() {
- Token token = getResource().accept(MediaType.APPLICATION_JSON).post(Token.class);
- this.context.setToken(token);
- return token;
- }
-
- /**
- * Obtains an access token and sets the token for the context to use in later calls
- *
- * @param token
- * @return
- */
- public Token post(Token token) {
- token = getResource(false).type(MediaType.APPLICATION_JSON_TYPE)
- .accept(MediaType.APPLICATION_JSON).post(Token.class, token);
- this.context.setToken(token);
- return token;
- }
-
- public TokenResource setToken(Token token) {
- this.context.setToken(token);
- return this;
- }
-
- public TokenResource clearToken() {
- this.context.setToken(null);
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UrlResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UrlResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UrlResource.java
deleted file mode 100644
index fc3b31f..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UrlResource.java
+++ /dev/null
@@ -1,44 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints;
-
-
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
-
-/**
- * Interface that returns the path that is currently being pointed to.
- */
-public interface UrlResource {
-
- /**
- * Get the url path to this resource
- * example: http://localhost:8080/management/orgs/<org_name>
- * @return
- */
- public String getPath();
-
- /**
- * Get the resource
- * @return
- */
- public WebResource getResource();
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ApplicationResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ApplicationResource.java
deleted file mode 100644
index 1e8f1f1..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ApplicationResource.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *
- * * Licensed to the Apache Software Foundation (ASF) under one or more
- * * contributor license agreements. 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. For additional information regarding
- * * copyright in this work, please see the NOTICE file in the top level
- * * directory of this distribution.
- *
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-import javax.ws.rs.core.MediaType;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.CollectionEndpoint;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.Application;
-import org.apache.usergrid.rest.test.resource2point0.model.*;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-
-/**
- * Classy class class.
- */
-public class ApplicationResource extends NamedResource {
-
- private static final Logger logger = LoggerFactory.getLogger(ApplicationResource.class);
-
- ObjectMapper mapper = new ObjectMapper();
-
- public ApplicationResource(ClientContext context, UrlResource parent) {
- super("applications", context, parent);
- }
-
- public ApplicationResource( final String name, final ClientContext context, final UrlResource parent ) {
- super( name, context, parent );
- }
-
- public ApplicationResource addToPath( String pathPart ) {
- return new ApplicationResource( pathPart, context, this );
- }
-
-
- public ApiResponse post(Application application) {
- ApiResponse apiResponse =getResource(true).type(MediaType.APPLICATION_JSON_TYPE)
- .accept(MediaType.APPLICATION_JSON).post(ApiResponse.class, application);
- return apiResponse;
- }
-
- public Entity post(Entity payload) {
-
- String responseString = getResource(true)
- .type( MediaType.APPLICATION_JSON_TYPE )
- .accept(MediaType.APPLICATION_JSON)
- .post(String.class, payload);
-
- logger.debug("Response from post: " + responseString);
-
- ApiResponse response;
- try {
- response = mapper.readValue(new StringReader(responseString), ApiResponse.class);
- } catch (IOException e) {
- throw new RuntimeException("Error parsing response", e);
- }
-
- return new Entity(response);
- }
-
-
- public Entity get() {
-
- String responseString = getResource(true)
- .type( MediaType.APPLICATION_JSON_TYPE )
- .accept(MediaType.APPLICATION_JSON)
- .get(String.class);
-
- logger.debug("Response from post: " + responseString);
-
- ApiResponse response;
- try {
- response = mapper.readValue(new StringReader(responseString), ApiResponse.class);
- } catch (IOException e) {
- throw new RuntimeException("Error parsing response", e);
- }
-
- return new Entity(response);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ApplicationsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ApplicationsResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ApplicationsResource.java
deleted file mode 100644
index f789272..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ApplicationsResource.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * * Licensed to the Apache Software Foundation (ASF) under one or more
- * * contributor license agreements. 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. For additional information regarding
- * * copyright in this work, please see the NOTICE file in the top level
- * * directory of this distribution.
- *
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.MediaType;
-import java.io.IOException;
-import java.io.StringReader;
-
-
-/**
- * Management end-point for getting list of applications in organization.
- */
-public class ApplicationsResource extends NamedResource {
- private static final Logger logger = LoggerFactory.getLogger(ApplicationsResource.class);
- ObjectMapper mapper = new ObjectMapper();
-
- public ApplicationsResource( final ClientContext context, final UrlResource parent ) {
- super( "apps", context, parent );
- }
-
- public ManagementResponse getOrganizationApplications() throws IOException {
-
- String responseString = this.getResource()
- .queryParam( "access_token", context.getToken().getAccessToken() )
- .type(MediaType.APPLICATION_JSON)
- .get(String.class);
-
- logger.info("Response: " + responseString);
-
- return mapper.readValue(
- new StringReader(responseString), ManagementResponse.class);
- }
-
-
-
- public ApplicationResource app( final String appName ){
- return new ApplicationResource( appName,context,this );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/AuthorizeResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/AuthorizeResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/AuthorizeResource.java
deleted file mode 100644
index 7dd820b..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/AuthorizeResource.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * * Licensed to the Apache Software Foundation (ASF) under one or more
- * * contributor license agreements. 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. For additional information regarding
- * * copyright in this work, please see the NOTICE file in the top level
- * * directory of this distribution.
- *
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-import com.sun.jersey.api.client.GenericType;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-/**
- * OAuth authorization resource
- */
-public class AuthorizeResource extends NamedResource {
- public AuthorizeResource(final ClientContext context, final UrlResource parent) {
- super("authorize", context, parent);
- }
-
- /**
- * Obtains an OAuth authorization
- *
- * @param requestEntity
- * @return
- */
- public Object post(Object requestEntity) {
- return getResource().post(Object.class, requestEntity);
-
- }
-
- /**
- * Obtains an OAuth authorization
- *
- * @param type
- * @param requestEntity
- * @return
- */
- public <T> T post(Class<T> type, Object requestEntity) {
- GenericType<T> gt = new GenericType<>((Class) type);
- return getResource().post(gt.getRawClass(), requestEntity);
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ConfirmResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ConfirmResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ConfirmResource.java
deleted file mode 100644
index 5692dfe..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ConfirmResource.java
+++ /dev/null
@@ -1,46 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
-
-/**
- * For confirming users
- */
-public class ConfirmResource extends NamedResource {
- public ConfirmResource( final ClientContext context, final UrlResource parent ) {
- super( "confirm", context, parent );
- }
-
- public void get(QueryParameters queryParameters){
- WebResource resource = getResource();
- resource = addParametersToResource( resource, queryParameters );
- String obj = resource.type( MediaType.TEXT_HTML_TYPE )
- .accept( MediaType.TEXT_HTML).get( String.class );
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/CredentialsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/CredentialsResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/CredentialsResource.java
deleted file mode 100644
index ee83b2e..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/CredentialsResource.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * * Licensed to the Apache Software Foundation (ASF) under one or more
- * * contributor license agreements. 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. For additional information regarding
- * * copyright in this work, please see the NOTICE file in the top level
- * * directory of this distribution.
- *
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-import com.sun.jersey.api.client.WebResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Credentials;
-import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import javax.ws.rs.core.MediaType;
-
-/**
- */
-public class CredentialsResource extends NamedResource {
-
- public CredentialsResource(final ClientContext context, final UrlResource parent) {
- super("credentials", context, parent);
- }
-
- public Credentials get(final QueryParameters parameters, final boolean useToken) {
- WebResource resource = getResource(useToken);
- resource = addParametersToResource(resource, parameters);
- ApiResponse response = resource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON)
- .get(ApiResponse.class);
- return new Credentials(response);
- }
-
- public Credentials get(final QueryParameters parameters) {
- return get(parameters, true);
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
deleted file mode 100644
index 3435afe..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * * Licensed to the Apache Software Foundation (ASF) under one or more
- * * contributor license agreements. 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. For additional information regarding
- * * copyright in this work, please see the NOTICE file in the top level
- * * directory of this distribution.
- *
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Collection;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-
-/**
- * Contains the REST methods to interacting with the ManagementEndpoints
- * and the user feeds
- */
-public class FeedResource extends NamedResource {
- public FeedResource(final ClientContext context, final UrlResource parent) {
- super ( "feed",context, parent);
- }
-
- public ApiResponse get() {
- return getResource( true ).type( MediaType.APPLICATION_JSON_TYPE )
- .accept( MediaType.APPLICATION_JSON ).get( ApiResponse.class);
-
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ManagementResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ManagementResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ManagementResource.java
deleted file mode 100644
index 6b27473..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ManagementResource.java
+++ /dev/null
@@ -1,60 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.*;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-
-/**
- * Contains the REST methods to interacting with the ManagementEndpoints
- */
-public class ManagementResource extends NamedResource {
- public ManagementResource( final ClientContext context, final UrlResource parent ) {
- super( "management", context, parent );
- }
-
- public TokenResource token(){
- return new TokenResource( context, this );
- }
-
- public MeResource me(){
- return new MeResource( context, this );
- }
-
- public AuthorizeResource authorize(){
- return new AuthorizeResource( context, this );
- }
-
- public OrgResource orgs() {
- return new OrgResource( context, this );
- }
-
- public UsersResource users() {
- return new UsersResource( context, this );
- }
-
- public EntityEndpoint externaltoken(){
- return new EntityEndpoint("externaltoken",context,this);
- }
-
- public EntityEndpoint get(final String identifier){
- return new EntityEndpoint(identifier, context, this);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ManagementResponse.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ManagementResponse.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ManagementResponse.java
deleted file mode 100644
index b5cd751..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ManagementResponse.java
+++ /dev/null
@@ -1,72 +0,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.
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-import java.util.Map;
-
-
-/**
- * Represents response from management end-points.
- */
-public class ManagementResponse {
- private String action;
- private Map<String, Object> data;
- private long timestamp;
- private long duration;
- private String uri;
-
- public long getDuration() {
- return duration;
- }
-
- public void setDuration(long duration) {
- this.duration = duration;
- }
-
- public long getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(long timestamp) {
- this.timestamp = timestamp;
- }
-
- public Map<String, Object> getData() {
- return data;
- }
-
- public void setData(Map<String, Object> data) {
- this.data = data;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getUri() {
- return uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/MeResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/MeResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/MeResource.java
deleted file mode 100644
index 4b3c042..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/MeResource.java
+++ /dev/null
@@ -1,36 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-
-/**
- * Calls the management/me endpoints
- */
-public class MeResource extends NamedResource {
- public MeResource( final ClientContext context, final UrlResource parent ) {
- super( "me", context, parent );
- }
-
- public TokenResource token(){
- return new TokenResource(context,this);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
deleted file mode 100644
index 9f99e25..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
+++ /dev/null
@@ -1,167 +0,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.
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-import javax.ws.rs.core.MediaType;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Organization;
-import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.model.User;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
-import com.sun.jersey.api.representation.Form;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-
-//TODO: add error checking to each of the REST calls.
-/**
- * Manages the Management/ORG endpoint.
- */
-public class OrgResource extends NamedResource {
- private static final Logger logger = LoggerFactory.getLogger(OrgResource.class);
-
- public OrgResource( final ClientContext context, final UrlResource parent ) {
- super( "organizations", context, parent );
- }
-
-
- public OrganizationResource org( final String orgname ){
- return new OrganizationResource( orgname,context,this );
- }
-
- /**
- * This post is for the POST params case, where the entire call is made using queryParameters.
- */
- public Organization post(Form form){
-
- // Seems like an apiresponse can't handle what gets returned from the from urlended media type
-
- ApiResponse response = getResource().type( MediaType.APPLICATION_FORM_URLENCODED )
- .accept(MediaType.APPLICATION_JSON)
- .post(ApiResponse.class, form);
-
- Organization organization = new Organization(response);
- organization.setOwner( response );
- return organization;
- }
-
- /**
- * This post is for the POST params case, where the entire call is made using queryParameters.
- */
- public Organization post(QueryParameters parameters){
-
- // Seems like an ApiResponse can't handle what gets returned from the from URL encoded media type
- WebResource resource = addParametersToResource( getResource(), parameters);
-
- // use string type so we can log actual response from server
- String responseString = resource.type(MediaType.APPLICATION_JSON_TYPE)
- .accept(MediaType.APPLICATION_JSON)
- .post(String.class);
-
- logger.debug("Response from post: " + responseString);
-
- ObjectMapper mapper = new ObjectMapper();
- ApiResponse response;
- try {
- response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
- } catch (IOException e) {
- throw new RuntimeException("Error parsing response", e);
- }
-
- Organization org = new Organization(response);
- org.setOwner( response );
-
- return org;
- }
-
- public Organization post(Organization organization){
-
- // use string type so we can log actual response from server
- String responseString = getResource(false).type( MediaType.APPLICATION_JSON_TYPE )
- .accept(MediaType.APPLICATION_JSON)
- .post(String.class, organization);
-
- logger.debug("Response from post: " + responseString);
-
- ObjectMapper mapper = new ObjectMapper();
- ApiResponse response;
- try {
- response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
- } catch (IOException e) {
- throw new RuntimeException("Error parsing response", e);
- }
-
- Organization org = new Organization(response);
- org.setOwner( response );
-
- return org;
- }
- public Organization post(Organization organization, Token token){
- ApiResponse response = getResource(true,token).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
- .post( ApiResponse.class,organization );
-
- Organization org = new Organization(response);
- org.setOwner( response );
-
- return org;
- }
-
- public Organization put(Organization organization){
-
- // use string type so we can log actual response from server
- String responseString = getResource().type( MediaType.APPLICATION_JSON_TYPE )
- .accept(MediaType.APPLICATION_JSON)
- .put(String.class, organization);
-
- logger.debug("Response from put: " + responseString);
-
- ObjectMapper mapper = new ObjectMapper();
- ApiResponse response;
- try {
- response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
- } catch (IOException e) {
- throw new RuntimeException("Error parsing response", e);
- }
-
- Organization org = new Organization(response);
- org.setOwner( response );
-
- return org;
-
- }
-
- public Organization get(){
- throw new UnsupportedOperationException("service doesn't exist");
- }
-
- public CredentialsResource credentials(){
- return new CredentialsResource( context ,this );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrganizationApplicationResponse.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrganizationApplicationResponse.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrganizationApplicationResponse.java
deleted file mode 100644
index 8af9d79..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrganizationApplicationResponse.java
+++ /dev/null
@@ -1,60 +0,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.
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import java.util.Map;
-
-public class OrganizationApplicationResponse {
- private String action;
- private Map<String, Object> data;
- private long timestamp;
- private long duration;
-
- public long getDuration() {
- return duration;
- }
-
- public void setDuration(long duration) {
- this.duration = duration;
- }
-
- public long getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(long timestamp) {
- this.timestamp = timestamp;
- }
-
- public Map<String, Object> getData() {
- return data;
- }
-
- public void setData(Map<String, Object> data) {
- this.data = data;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrganizationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrganizationResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrganizationResource.java
deleted file mode 100644
index 128c3ff..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrganizationResource.java
+++ /dev/null
@@ -1,80 +0,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.
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Organization;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import javax.ws.rs.core.MediaType;
-import java.util.Map;
-
-
-/**
- * This is for the Management endpoint.
- * Holds the information required for building and chaining organization objects to applications.
- * Should also contain the GET,PUT,POST,DELETE methods of functioning in here.
- */
-public class OrganizationResource extends NamedResource {
-
- public OrganizationResource(final String name, final ClientContext context, final UrlResource parent) {
- super(name, context, parent);
- }
-
- public UsersResource users() {
- return new UsersResource(context, this);
- }
-
- public Organization get() {
- ApiResponse rep = getResource(true).type(MediaType.APPLICATION_JSON_TYPE)
- .accept(MediaType.APPLICATION_JSON).get(ApiResponse.class);
-
- //TODO: not sure if this will work for multiple users.
- Organization org = new Organization(rep);
- org.setUserOwner(rep);
- return org;
- }
-
- // Doesn't return anything useful server side so this was made as a void. .
- public void put(Organization organization) {
- Map<String, Object> response = getResource(true).type(MediaType.APPLICATION_JSON_TYPE)
- .accept(MediaType.APPLICATION_JSON).put(Organization.class,
- organization);
-
- }
-
- public ApplicationResource app(){
- return new ApplicationResource( context ,this );
- }
-
- public CredentialsResource credentials() {
- return new CredentialsResource(context, this);
- }
-
- public ApplicationsResource apps() {
- return new ApplicationsResource( context, this );
- }
-
-
- public ApplicationResource addToPath( String pathPart ) {
- return new ApplicationResource( pathPart, context, this );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/PasswordResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/PasswordResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/PasswordResource.java
deleted file mode 100644
index c9e17ee..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/PasswordResource.java
+++ /dev/null
@@ -1,45 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import java.util.Map;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
-
-/**
- * Relations to the following endpoint
- * /management/users/"username"/password
- * Allows admin users to change their passwords
- */
-public class PasswordResource extends NamedResource {
-
- public PasswordResource( final ClientContext context, final UrlResource parent ) {
- super( "password", context, parent );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ReactivateResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ReactivateResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ReactivateResource.java
deleted file mode 100644
index 25dc95e..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ReactivateResource.java
+++ /dev/null
@@ -1,46 +0,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.
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
-
-/**
- * handles the * /reactivate endpoints
- */
-public class ReactivateResource extends NamedResource {
- public ReactivateResource(final ClientContext context, final UrlResource parent) {
- super("reactivate",context, parent);
- }
-
- public Entity get(){
- WebResource resource = getResource(true);
- ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )
- .accept( MediaType.APPLICATION_JSON ).get( ApiResponse.class);
- return new Entity(response);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ResetResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ResetResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ResetResource.java
deleted file mode 100644
index 17a3a39..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ResetResource.java
+++ /dev/null
@@ -1,42 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.representation.Form;
-
-
-/**
- * Handles /resetpw endpoints for the user resource.
- */
-public class ResetResource extends NamedResource {
-
- public ResetResource( final ClientContext context, final UrlResource parent ) {
- super( "resetpw", context, parent );
- }
-
- public String post(Form formPayload) {
- return getResource().type( MediaType.APPLICATION_FORM_URLENCODED_TYPE )
- .accept( MediaType.TEXT_HTML ).post( String.class, formPayload);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/RevokeTokenResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/RevokeTokenResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/RevokeTokenResource.java
deleted file mode 100644
index dcdd432..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/RevokeTokenResource.java
+++ /dev/null
@@ -1,32 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-
-/**
- * Handles /revokeToken endpoint ( as opposed to revokeTokens
- */
-public class RevokeTokenResource extends NamedResource {
- public RevokeTokenResource( final ClientContext context, final UrlResource parent ) {
- super( "revoketoken", context, parent );
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/RevokeTokensResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/RevokeTokensResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/RevokeTokensResource.java
deleted file mode 100644
index 20796ae..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/RevokeTokensResource.java
+++ /dev/null
@@ -1,33 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-
-/**
- * Handles endpoints against /revoketokens
- */
-public class RevokeTokensResource extends NamedResource {
- public RevokeTokensResource( final ClientContext context, final UrlResource parent ) {
- super( "revoketokens", context, parent );
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/TokenResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/TokenResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/TokenResource.java
deleted file mode 100644
index d22665d..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/TokenResource.java
+++ /dev/null
@@ -1,71 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import com.sun.jersey.api.client.WebResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import javax.ws.rs.core.MediaType;
-
-
-/**
- * Called by the ManagementResource. This contains anything token related that comes back to the ManagementResource.
- */
-public class TokenResource extends NamedResource {
- public TokenResource(final ClientContext context, final UrlResource parent) {
- super("token", context, parent);
- }
-
- public Token get(String username, String password){
- QueryParameters queryParameters = new QueryParameters();
- queryParameters.addParam( "grant_type", "password" );
- queryParameters.addParam( "username", username );
- queryParameters.addParam( "password", password );
- return get(queryParameters);
-
- }
- /**
- * Obtains an access token and sets the token for the context to use in later calls
- *
- * @return
- */
- public Token get(QueryParameters params) {
- WebResource resource = getResource(false);
- resource = addParametersToResource(resource, params);
- Token token = resource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON)
- .get(Token.class);
-
- this.context.setToken(token);
- return token;
- }
-
-
- /**
- * Convinece method to set the token needed for each call.
- * @param token
- * @return
- */
- public TokenResource setToken(Token token) {
- this.context.setToken(token);
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/876dc8d3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
deleted file mode 100644
index a52d884..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
+++ /dev/null
@@ -1,88 +0,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.
- */
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
-
-/**
- * Relations to the following endpoint
- * /management/users/"username"
- * Store endpoints relating to specific users
- */
-public class UserResource extends NamedResource {
-
- public UserResource( final String name, final ClientContext context, final UrlResource parent ) {
- super( name, context, parent );
- }
-
- public ReactivateResource reactivate() {
- return new ReactivateResource( context, this );
- }
-
- public ConfirmResource confirm() {
- return new ConfirmResource(context,this);
- }
-
- public PasswordResource password() {
- return new PasswordResource( context, this );
- }
-
- public FeedResource feed() {
- return new FeedResource( context, this );
- }
-
- public ResetResource resetpw() {
- return new ResetResource(context,this);
- }
-
- public OrgResource organizations() {
- return new OrgResource( context, this );
- }
-
- public RevokeTokensResource revokeTokens() {
- return new RevokeTokensResource( context, this );
- }
-
- public RevokeTokenResource revokeToken() {
- return new RevokeTokenResource( context, this );
- }
-
- public Entity get() {
- WebResource resource = getResource( true );
- ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )
- .accept( MediaType.APPLICATION_JSON ).get( ApiResponse.class );
- return new Entity(response);
- }
-
- public Entity put(Entity userPayload){
- WebResource resource = getResource(true);
-
- ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )
- .accept( MediaType.APPLICATION_JSON ).put( ApiResponse.class, userPayload);
- return new Entity(response);
- }
-
-}