You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/03/03 22:03:30 UTC
[02/21] incubator-usergrid git commit: Added testProperties RTF files.
Added testProperties RTF files.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/635b1836
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/635b1836
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/635b1836
Branch: refs/heads/USERGRID-422
Commit: 635b183618899efcb246093afc4ac1698739e264
Parents: 06d1560
Author: grey <gr...@apigee.com>
Authored: Thu Feb 26 14:19:45 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Thu Feb 26 14:19:45 2015 -0800
----------------------------------------------------------------------
.../rest/test/resource2point0/RestClient.java | 4 +-
.../resource2point0/TestPropertiesResource.java | 47 ++++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/635b1836/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
index 9349ae6..f697509 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
@@ -74,7 +74,9 @@ public class RestClient implements UrlResource {
return context;
}
-
+ public TestPropertiesResource testPropertiesResource() {
+ return new TestPropertiesResource( context, this );
+ }
/**
* Get the management resource
*/
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/635b1836/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/TestPropertiesResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/TestPropertiesResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/TestPropertiesResource.java
new file mode 100644
index 0000000..2650c29
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/TestPropertiesResource.java
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+
+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;
+
+
+/**
+ *Adds support for changing the management properties in the rest testing framework.
+ */
+public class TestPropertiesResource extends NamedResource {
+ public TestPropertiesResource( final ClientContext context, final UrlResource parent ) {
+ super( "testproperties", context, parent );
+ }
+
+ public ApiResponse post(Entity testProperties){
+
+ return getResource(true).type( MediaType.APPLICATION_JSON_TYPE )
+ .accept( MediaType.APPLICATION_JSON ).post( ApiResponse.class, testProperties );
+ }
+
+ public ApiResponse get(){
+ return getResource(true).type( MediaType.APPLICATION_JSON_TYPE )
+ .accept( MediaType.APPLICATION_JSON ).get(ApiResponse.class );
+ }
+}