diff --git a/tests/js/testActivities1.js b/tests/js/testActivities1.js index ec1fedd8..98abac3f 100644 --- a/tests/js/testActivities1.js +++ b/tests/js/testActivities1.js @@ -13,7 +13,9 @@ // NOTE: this = platform var platformActivityCount = -1; - this.listActivities().count(function(count) { + this.listActivities({ + "limit": -1 + }).count(function(count) { platformActivityCount = count; }); @@ -29,7 +31,9 @@ this.then(function() { // list platform activities - this.listActivities().count(function(count) { + this.listActivities({ + "limit": -1 + }).count(function(count) { ok(count > platformActivityCount, "Platform activity account increased"); platformActivityCount = count; }); @@ -41,7 +45,9 @@ // list domain activities var domainActivityCount = -1; - this.listActivities().count(function(count) { + this.listActivities({ + "limit": -1 + }).count(function(count) { domainActivityCount = count; }); @@ -53,7 +59,9 @@ }); // list domain activities - this.listActivities().count(function(count) { + this.listActivities({ + "limit": -1 + }).count(function(count) { ok(count > domainActivityCount, "Domain activity count increased"); }); }); @@ -62,7 +70,9 @@ }); // list platform activities - this.listActivities().count(function(count) { + this.listActivities({ + "limit": -1 + }).count(function(count) { ok(count > platformActivityCount, "Platform activity account increased (second time)"); success(); }); diff --git a/tests/js/testApplication1.js b/tests/js/testApplication1.js index 22a010b5..4c12e06d 100644 --- a/tests/js/testApplication1.js +++ b/tests/js/testApplication1.js @@ -18,7 +18,9 @@ var key = "key-" + new Date().getTime(); var originalCount = -1; - this.listApplications().count(function(count) { + this.listApplications({ + "limit": -1 + }).count(function(count) { originalCount = count; }); @@ -29,7 +31,9 @@ }).then(function() { application = this; }); - this.listApplications().count(function(count) { + this.listApplications({ + "limit": -1 + }).count(function(count) { equal(count, originalCount + 1, "Application count + 1"); }); @@ -43,7 +47,9 @@ this.readApplication(application.getId()).update().del(); - this.listApplications().count(function(count) { + this.listApplications({ + "limit": -1 + }).count(function(count) { equal(count, originalCount, "Application back to what it was"); }); diff --git a/tests/js/testAuthentication12.js b/tests/js/testAuthentication12.js index 27bee69a..cb1836f0 100644 --- a/tests/js/testAuthentication12.js +++ b/tests/js/testAuthentication12.js @@ -164,7 +164,9 @@ var f3 = function(client, ticket, accessToken, refreshToken, grantTime) { // try to do something with the platform (here we list registrars) - this.listRegistrars().then(function() { + this.listRegistrars({ + "limit": -1 + }).then(function() { Chain(this.getPlatform()).then(function() { diff --git a/tests/js/testAuthentication13.js b/tests/js/testAuthentication13.js index c32acea8..96ddc5c6 100644 --- a/tests/js/testAuthentication13.js +++ b/tests/js/testAuthentication13.js @@ -136,7 +136,9 @@ window.setTimeout(function() { // list registrars - Chain(platform).listRegistrars().then(function() { + Chain(platform).listRegistrars({ + "limit": -1 + }).then(function() { var newTicket1 = this.getDriver().getAuthInfo().getTicket(); ok(newTicket1, "Pass1: Acquired a new ticket"); @@ -159,7 +161,9 @@ window.setTimeout(function() { // list registrars - Chain(platform).listRegistrars().then(function() { + Chain(platform).listRegistrars({ + "limit": -1 + }).then(function() { var newTicket2 = this.getDriver().getAuthInfo().getTicket(); ok(newTicket2, "Pass2: Acquired a new ticket"); diff --git a/tests/js/testAuthentication3.js b/tests/js/testAuthentication3.js index 44664f9b..d4ee7d11 100644 --- a/tests/js/testAuthentication3.js +++ b/tests/js/testAuthentication3.js @@ -26,7 +26,9 @@ // NOTE: this = platform - this.listRepositories().then(function() { + this.listRepositories({ + "limit": -1 + }).then(function() { ok(true, "First authentication worked"); diff --git a/tests/js/testAuthentication5.js b/tests/js/testAuthentication5.js index f2bb456f..fa4f05cd 100644 --- a/tests/js/testAuthentication5.js +++ b/tests/js/testAuthentication5.js @@ -30,7 +30,9 @@ this.createRepository(); - this.listRepositories().count(function(count) { + this.listRepositories({ + "limit": -1 + }).count(function(count) { ok(count > 0, "Count was greater than zero"); }); @@ -40,7 +42,9 @@ // cookie should be gone ok(!Gitana.readCookie("GITANA_TICKET", "Cookie was deleted")); - this.listRepositories().then(function() { + this.listRepositories({ + "limit": -1 + }).then(function() { ok(false, "Should not have made it this far"); }); }); diff --git a/tests/js/testAuthentication8.js b/tests/js/testAuthentication8.js index 9791b671..1c52b0fc 100644 --- a/tests/js/testAuthentication8.js +++ b/tests/js/testAuthentication8.js @@ -23,7 +23,9 @@ ok(true, "Successfully authenticated"); // list domains - this.listDomains().then(function() { + this.listDomains({ + "limit": -1 + }).then(function() { ok(true, "First list worked"); }); @@ -34,7 +36,9 @@ // list domains again // this time the refresh token should be automatically used to re-acquire an access token - this.listDomains().then(function() { + this.listDomains({ + "limit": -1 + }).then(function() { ok(true, "Second list worked"); }); diff --git a/tests/js/testAutoClientMapping1.js b/tests/js/testAutoClientMapping1.js index e6af2516..16cb978f 100644 --- a/tests/js/testAutoClientMapping1.js +++ b/tests/js/testAutoClientMapping1.js @@ -43,7 +43,9 @@ this.then(function() { - this.listAutoClientMappings().count(function(count) { + this.listAutoClientMappings({ + "limit": -1 + }).count(function(count) { equal(count, 3, "Found 3 auto client mappings"); }); @@ -70,7 +72,9 @@ this.readAutoClientMapping(acm3.getId()).update().del(); // list - this.listAutoClientMappings().count(function(count) { + this.listAutoClientMappings({ + "limit": -1 + }).count(function(count) { equal(count, 2, "Auto Client Mapping now 2"); }); diff --git a/tests/js/testDirectory1.js b/tests/js/testDirectory1.js index 5c25f34c..fb031a0f 100644 --- a/tests/js/testDirectory1.js +++ b/tests/js/testDirectory1.js @@ -37,7 +37,9 @@ }); // then test out deletes - this.listDirectories().then(function() { + this.listDirectories({ + "limit": -1 + }).then(function() { var directory2 = this.get(directory.getId()); ok(directory2, "Successfully retrieved from list"); diff --git a/tests/js/testDomain1.js b/tests/js/testDomain1.js index cdffc4eb..ecf8f144 100644 --- a/tests/js/testDomain1.js +++ b/tests/js/testDomain1.js @@ -37,7 +37,9 @@ }); // then test out deletes - this.listDomains().then(function() { + this.listDomains({ + "limit": -1 + }).then(function() { var domain2 = this.get(domain.getId()); ok(domain2, "Successfully retrieved from list"); diff --git a/tests/js/testDomainPrincipal1.js b/tests/js/testDomainPrincipal1.js index 95a0891e..c46ac854 100644 --- a/tests/js/testDomainPrincipal1.js +++ b/tests/js/testDomainPrincipal1.js @@ -21,7 +21,9 @@ var count = 0; // first: list and count all of the users manually - this.listUsers().count(function(c) { + this.listUsers({ + "limit": -1 + }).count(function(c) { count = c; }); @@ -37,7 +39,9 @@ // third: list users again and verify size + 1 // list users var recount = 0; - this.listUsers().count(function(c) { + this.listUsers({ + "limit": -1 + }).count(function(c) { recount = c; equals(recount, count + 1, "Size incremented by 1"); }); diff --git a/tests/js/testDomainPrincipal2.js b/tests/js/testDomainPrincipal2.js index d84968bd..89e68c6e 100644 --- a/tests/js/testDomainPrincipal2.js +++ b/tests/js/testDomainPrincipal2.js @@ -20,7 +20,9 @@ // count the number of groups var count = 0; - this.listGroups().each(function() { + this.listGroups({ + "limit": -1 + }).each(function() { count++; }); @@ -35,7 +37,9 @@ // list groups and verify size + 1 var recount = 0; - this.listGroups().each(function() { + this.listGroups({ + "limit": -1 + }).each(function() { recount++; }).then(function() { equals(recount, count + 1, "Size incremented by 1"); diff --git a/tests/js/testDomainPrincipal3.js b/tests/js/testDomainPrincipal3.js index 0a3c2e53..eb238db1 100644 --- a/tests/js/testDomainPrincipal3.js +++ b/tests/js/testDomainPrincipal3.js @@ -32,13 +32,17 @@ // count the number of users var userCount = 0; - this.listUsers().count(function(count) { + this.listUsers({ + "limit": -1 + }).count(function(count) { userCount = count; }); // counter the number of groups var groupCount = 0; - this.listUsers().count(function(count) { + this.listUsers({ + "limit": -1 + }).count(function(count) { groupCount = count; }); @@ -114,16 +118,24 @@ this.addMember(test.group3, test.user6); // verify memberships - this.listMembers(test.group1, "user").count(function(count) { + this.listMembers(test.group1, "user", { + "limit": -1 + }).count(function(count) { equal(count, 2, "Group 1 has two users"); }); - this.listMembers(test.group2, "group").count(function(count) { + this.listMembers(test.group2, "group", { + "limit": -1 + }).count(function(count) { equal(count, 1, "Group 2 has one child group"); }); - this.listMembers(test.group2, "user").count(function(count) { + this.listMembers(test.group2, "user", { + "limit": -1 + }).count(function(count) { equal(count, 1, "Group 2 has one user"); }); - this.listMembers(test.group3, "user").count(function(count) { + this.listMembers(test.group3, "user", { + "limit": -1 + }).count(function(count) { equal(count, 3, "Group 3 has three users"); }); diff --git a/tests/js/testDomainPrincipal4.js b/tests/js/testDomainPrincipal4.js index dd2ce7f4..b4f46cb7 100644 --- a/tests/js/testDomainPrincipal4.js +++ b/tests/js/testDomainPrincipal4.js @@ -126,7 +126,12 @@ // test sorting of users on query var index = 0; - this.listUsers({"sort":{"title": 1}}).each(function() { + this.listUsers({ + "sort":{ + "title": 1 + }, + "limit": -1 + }).each(function() { if (this.get("tag") == tag) { diff --git a/tests/js/testNodeDictionary1.js b/tests/js/testNodeDictionary1.js index f4bdddcf..65cdaad0 100644 --- a/tests/js/testNodeDictionary1.js +++ b/tests/js/testNodeDictionary1.js @@ -15,22 +15,30 @@ // NOTE: this = branch // list all definitions - this.listDefinitions().count(function(count) { + this.listDefinitions({ + "limit": -1 + }).count(function(count) { ok(count > 0, "Found definitions"); }); // list type definitions - this.listDefinitions("type").count(function(count) { + this.listDefinitions("type", { + "limit": -1 + }).count(function(count) { ok(count > 0, "Found type definitions"); }); // list association type definitions - this.listDefinitions("association").count(function(count) { + this.listDefinitions("association", { + "limit": -1 + }).count(function(count) { ok(count > 0, "Found association type definitions"); }); // list feature definitions - this.listDefinitions("feature").count(function(count) { + this.listDefinitions("feature", { + "limit": -1 + }).count(function(count) { ok(count > 0, "Found feature definitions"); }); diff --git a/tests/js/testNodeMap1.js b/tests/js/testNodeMap1.js index 3cb7c07b..2ec42e59 100644 --- a/tests/js/testNodeMap1.js +++ b/tests/js/testNodeMap1.js @@ -30,7 +30,11 @@ // query for all nodes by this label, check json properties - this.queryNodes({"label": label}).then(function() { + this.queryNodes({ + "label": label + }, { + "limit": -1 + }).then(function() { equal(this.totalRows(), 10, "Total rows was 10"); equal(this.size(), 10, "Size was 10"); equal(this.offset(), 0, "Offset was 0"); @@ -38,7 +42,9 @@ // query for nodes and filter by value > 5 - this.queryNodes().filter(function() { + this.queryNodes({}, { + "limit": -1 + }).filter(function() { return (this.get("value") > 5) }).count(function(count) { equal(count, 4, "Count was 4"); @@ -46,7 +52,9 @@ // query for nodes and filter for even values - this.queryNodes().filter(function() { + this.queryNodes({}, { + "limit": -1 + }).filter(function() { return (this.get("value") % 2 == 0); }).count(function(count) { equal(count, 5, "Count was 5"); @@ -55,7 +63,9 @@ // query for nodes and filter for odd values var counter = 0; - this.queryNodes().filter(function() { + this.queryNodes({}, { + "limit": -1 + }).filter(function() { return (this.get("value") % 2 == 1); }).each(function() { counter++; @@ -67,7 +77,9 @@ // query for nodes, filter for even values and then sum up via each var sum = 0; - this.queryNodes().filter(function() { + this.queryNodes({}, { + "limit": -1 + }).filter(function() { return (this.get("value") % 2 == 0); }).count(function(count) { equal(count, 5, "Count was 5"); @@ -80,7 +92,10 @@ // query for nodes and keep the result set thin (rows only, no values) // ensure we don't get any value back - this.queryNodes({}, {"full":false}).then(function() { + this.queryNodes({}, { + "full":false, + "limit": -1 + }).then(function() { ok(!this.asArray()[0].value); ok(this.asArray()[0]["_doc"]); @@ -97,10 +112,14 @@ // perform a filter over definitions var count1 = 0; var count2 = 0; - this.listDefinitions("type").count(function(count) { + this.listDefinitions("type", { + "limit": -1 + }).count(function(count) { count1 = count; }); - this.listDefinitions("type").filter(function() { + this.listDefinitions("type", { + "limit": -1 + }).filter(function() { return (this.get('_parent') == 'n:node' && this.getQName().substr(0, 2) != 'n:'); }).each(function() { count2++; diff --git a/tests/js/testPlatformAuthorities1.js b/tests/js/testPlatformAuthorities1.js index 759196df..4269e827 100644 --- a/tests/js/testPlatformAuthorities1.js +++ b/tests/js/testPlatformAuthorities1.js @@ -90,7 +90,9 @@ }); // pull back list - this.listRepositories().count(function(count) { + this.listRepositories({ + "limit": -1 + }).count(function(count) { ok(count > 0, "Repository list count > 0"); ok(this.get(repo.getId()), "Found repository"); diff --git a/tests/js/testRepository1.js b/tests/js/testRepository1.js index 862f5f25..b594ad00 100644 --- a/tests/js/testRepository1.js +++ b/tests/js/testRepository1.js @@ -37,7 +37,9 @@ }); // then test out deletes - this.listRepositories().then(function() { + this.listRepositories({ + "limit": -1 + }).then(function() { var repo2 = this.get(repo.getId()); ok(repo2, "Successfully retrieved from list"); diff --git a/tests/js/testRepository2.js b/tests/js/testRepository2.js index 3f1aa341..4fd9f53e 100644 --- a/tests/js/testRepository2.js +++ b/tests/js/testRepository2.js @@ -39,7 +39,9 @@ }); // now test some chaining - this.listRepositories().filter(filter).sort(comparator).limit(2).each(function() { + this.listRepositories({ + "limit": -1 + }).filter(filter).sort(comparator).limit(2).each(function() { count++; }).then(function() { equal(count, 2, "Counted 2"); diff --git a/tests/js/testRepository3.js b/tests/js/testRepository3.js index 4e42f755..fde149f7 100644 --- a/tests/js/testRepository3.js +++ b/tests/js/testRepository3.js @@ -39,7 +39,12 @@ // now list all repositories with pagination var index = 0; - this.listRepositories({"sort": {"title": 1}}).each(function() { + this.listRepositories({ + "sort": { + "title": 1 + }, + "limit": -1 + }).each(function() { if (this.get("pokey") == pokey) { diff --git a/tests/js/testStack1.js b/tests/js/testStack1.js index cebe672c..a9648faa 100644 --- a/tests/js/testStack1.js +++ b/tests/js/testStack1.js @@ -17,7 +17,9 @@ var title = "snap-" + new Date().getTime(); var originalCount = -1; - this.listStacks().count(function(count) { + this.listStacks({ + "limit": -1 + }).count(function(count) { originalCount = count; }); @@ -25,12 +27,18 @@ this.createStack({"title": title}).then(function() { stack = this; }); - this.listStacks().count(function(count) { + this.listStacks({ + "limit": -1 + }).count(function(count) { equal(count, originalCount + 1, "Stack count + 1"); }); // test query - this.queryStacks({"title": title}).count(function(count) { + this.queryStacks({ + "title": title + }, { + "limit": -1 + }).count(function(count) { equal(count, 1, "Found a query result"); }); @@ -39,7 +47,9 @@ this.readStack(stack.getId()).update().del(); - this.listStacks().count(function(count) { + this.listStacks({ + "limit": -1 + }).count(function(count) { equal(count, originalCount, "Stack back to what it was"); }); diff --git a/tests/js/testTenant1.js b/tests/js/testTenant1.js index 08c324f5..853d8da4 100644 --- a/tests/js/testTenant1.js +++ b/tests/js/testTenant1.js @@ -34,7 +34,9 @@ // original count of tenants var originalCount = -1; - this.listTenants().count(function(count) { + this.listTenants({ + "limit": -1 + }).count(function(count) { originalCount = count; }); @@ -45,13 +47,17 @@ }); // list tenants and confirm size change - this.listTenants().count(function(count) { + this.listTenants({ + "limit": -1 + }).count(function(count) { equal(count, originalCount + 1, "Tenant size increased by 1"); }); // query tenants this.queryTenants({ "planKey": "unlimited" + }, { + "limit": -1 }).count(function(count) { ok(count > 0, "Found at least one starter"); }); @@ -85,7 +91,9 @@ }); // count tenants - this.listTenants().count(function(count) { + this.listTenants({ + "limit": -1 + }).count(function(count) { equal(count, originalCount, "Tenant successfully deleted"); }); diff --git a/tests/js/testVault1.js b/tests/js/testVault1.js index fa702e4e..5e4224bb 100644 --- a/tests/js/testVault1.js +++ b/tests/js/testVault1.js @@ -35,7 +35,9 @@ }); // then test out deletes - this.listVaults().then(function() { + this.listVaults({ + "limit": -1 + }).then(function() { var vault2 = this.get(vault.getId()); ok(vault2, "Successfully retrieved from list"); diff --git a/tests/js/testWarehouse1.js b/tests/js/testWarehouse1.js index 02a09180..e1e7b94e 100644 --- a/tests/js/testWarehouse1.js +++ b/tests/js/testWarehouse1.js @@ -18,7 +18,9 @@ var key = "key-" + new Date().getTime(); var originalCount = -1; - this.listWarehouses().count(function(count) { + this.listWarehouses({ + "limit": -1 + }).count(function(count) { originalCount = count; }); @@ -29,7 +31,9 @@ }).then(function() { warehouse = this; }); - this.listWarehouses().count(function(count) { + this.listWarehouses({ + "limit": -1 + }).count(function(count) { equal(count, originalCount + 1, "Warehouse count + 1"); }); @@ -43,7 +47,9 @@ this.readWarehouse(warehouse.getId()).update().del(); - this.listWarehouses().count(function(count) { + this.listWarehouses({ + "limit": -1 + }).count(function(count) { equal(count, originalCount, "Warehouses back to what it was"); }); diff --git a/tests/js/testWebHost1.js b/tests/js/testWebHost1.js index 50c852e4..169ada26 100644 --- a/tests/js/testWebHost1.js +++ b/tests/js/testWebHost1.js @@ -16,7 +16,9 @@ var value = "value" + new Date().getTime(); var originalCount = -1; - this.listWebHosts().count(function(count) { + this.listWebHosts({ + "limit": -1 + }).count(function(count) { originalCount = count; }); @@ -27,7 +29,9 @@ this.then(function() { - this.listWebHosts().count(function(count) { + this.listWebHosts({ + "limit": -1 + }).count(function(count) { equal(count, originalCount + 1, "Web Host count + 1"); }); @@ -41,7 +45,9 @@ this.readWebHost(webhost.getId()).update().del(); - this.listWebHosts().count(function(count) { + this.listWebHosts({ + "limit": -1 + }).count(function(count) { equal(count, originalCount, "Web host back to what it was"); });