usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [11/38] incubator-usergrid git commit: Added testProperties RTF files.
Date Wed, 04 Mar 2015 22:39:06 GMT
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-432
Commit: 635b183618899efcb246093afc4ac1698739e264
Parents: 06d1560
Author: grey <greyes@apigee.com>
Authored: Thu Feb 26 14:19:45 2015 -0800
Committer: grey <greyes@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 );
+    }
+}


Mime
View raw message