usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [61/63] [abbrv] usergrid git commit: fix rest tests
Date Fri, 09 Oct 2015 21:37:41 GMT
fix rest tests


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

Branch: refs/heads/remove-inmemory-event-service
Commit: a56c8dddfcde2d17ec03f0b5c6cb8fc6e0b34700
Parents: bce1359
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Thu Oct 1 10:27:22 2015 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Thu Oct 1 10:27:22 2015 -0600

----------------------------------------------------------------------
 .../collection/users/ConnectionResourceTest.java        | 12 ++++++------
 stack/rest_integration_tests/config/default.js          |  1 +
 stack/rest_integration_tests/test/entities/create.js    |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/a56c8ddd/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
index 777b04e..893703e 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.usergrid.services.exceptions.ServiceResourceNotFoundException;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -34,6 +35,8 @@ import org.apache.usergrid.rest.test.resource.model.QueryParameters;
 
 import com.sun.jersey.api.client.UniformInterfaceException;
 
+import javax.ws.rs.NotFoundException;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
@@ -82,9 +85,8 @@ public class ConnectionResourceTest extends AbstractRestIT {
                 .get();
             fail( "This should throw an exception" );
         }
-        catch ( UniformInterfaceException uie ) {
+        catch ( NotFoundException uie ) {
             // Should return a 404 Not Found
-            assertEquals( 404, uie.getResponse().getStatus() );
         }
     }
 
@@ -172,9 +174,8 @@ public class ConnectionResourceTest extends AbstractRestIT {
             thing2 = this.app().collection( "things" ).entity( thing2 ).get();
             fail( "This should throw an exception" );
         }
-        catch ( UniformInterfaceException uie ) {
+        catch ( NotFoundException uie ) {
             // Should return a 404 Not Found
-            assertEquals( 404, uie.getResponse().getStatus() );
         }
     }
 
@@ -208,9 +209,8 @@ public class ConnectionResourceTest extends AbstractRestIT {
             thing1 = this.app().collection( "things" ).entity( thing1 ).get();
             fail( "This should throw an exception" );
         }
-        catch ( UniformInterfaceException uie ) {
+        catch ( NotFoundException uie ) {
             // Should return a 404 Not Found
-            assertEquals( 404, uie.getResponse().getStatus() );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a56c8ddd/stack/rest_integration_tests/config/default.js
----------------------------------------------------------------------
diff --git a/stack/rest_integration_tests/config/default.js b/stack/rest_integration_tests/config/default.js
index 5140638..666f3ea 100644
--- a/stack/rest_integration_tests/config/default.js
+++ b/stack/rest_integration_tests/config/default.js
@@ -20,6 +20,7 @@ module.exports = {
     appName: "test-app", //must pre create app
     numberOfUsers: 5,
     numberOfEntities: 20,
+    numberOfEntitiesConsistency: 100,
     org: {
         clientId: "",
         clientSecret: ""

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a56c8ddd/stack/rest_integration_tests/test/entities/create.js
----------------------------------------------------------------------
diff --git a/stack/rest_integration_tests/test/entities/create.js b/stack/rest_integration_tests/test/entities/create.js
index c7e6f42..3fa6831 100644
--- a/stack/rest_integration_tests/test/entities/create.js
+++ b/stack/rest_integration_tests/test/entities/create.js
@@ -20,7 +20,7 @@ var config = require('../../config');
 
 module.exports = {
     test: function() {
-        var numberOfRecords = 30;
+        var numberOfRecords = config.numberOfEntitiesConsistency;
         var uuid = require("uuid");
         var id = "resttest_"+ uuid.v1().toString().replace("-", "");
 


Mime
View raw message