Example #1
0
 RestAPI.Tenant.getAllTenants(globalAdminRestContext, function(err, tenants) {
     assert.ok(tenants);
     assert.ok(tenants['camtest']);
     assert.equal(tenants['camtest'].host, 'cambridge.oae.com');
     assert.ok(tenants['gttest']);
     assert.equal(tenants['gttest'].host, 'gt.oae.com');
     assert.equal(tenants['camtest'].host, 'cambridge.oae.com');
     assert.ok(tenants['oxfordtest']);
     assert.equal(tenants['oxfordtest'].host, 'oxford.oae.com');
     
     // Delete the previously created tenant
     RestAPI.Tenant.deleteTenant(globalAdminRestContext, 'oxfordtest', function(err) {
         assert.ok(!err);
         RestAPI.Tenant.getAllTenants(globalAdminRestContext, function(err, tenants) {
             assert.ok(!err);
             assert.ok(tenants);
             assert.ok(!tenants['oxfordtest']);
             assert.ok(tenants['camtest']);
             assert.equal(tenants['camtest'].host, 'cambridge.oae.com');
             assert.ok(tenants['gttest']);
             assert.equal(tenants['gttest'].host, 'gt.oae.com');
             callback();
         });
     });
 });
Example #2
0
     it('verify delete tenant', function(callback) {
         // Try deleting a non-existing tenant
          RestAPI.Tenant.deleteTenant(globalAdminRestContext, null, function(err) {
             assert.ok(err);
             
             // Delete the tenant from the previous test
             RestAPI.Tenant.deleteTenant(globalAdminRestContext, 'aartest', function(err) {
                 assert.ok(!err);
                 
                 // Verify that the tenant is no longer running
                 var aarRestContext = TestsUtil.createTenantRestContext('aar.oae.com');
                 RestAPI.Tenant.getTenant(aarRestContext, null, function(err, tenant) {
                     assert.ok(err);
                     assert.ok(!tenant);
 
                     // Verify that it's no longer a part of the all tenants feed
                     RestAPI.Tenant.getAllTenants(globalAdminRestContext, function(err, tenants) {
                         assert.ok(!err);
                         assert.ok(tenants);
                         assert.ok(!tenants['aartest']);
                         callback();
                     });
                 });
             });
         });
    });
Example #3
0
 it('verify delete non-existing tenant', function(callback) {
     // Stop tenant with no alias
     RestAPI.Tenant.deleteTenant(globalAdminRestContext, null, function(err) {
         assert.ok(err);
         callback();
     });
 });
Example #4
0
 it('verify delete tenant as anonymous user fails', function(callback) {
     // Try to stop the tenant as an anonymous user
     RestAPI.Tenant.deleteTenant(anonymousGlobalRestContext, 'aartest', function(err) {
         assert.ok(err);
         assert.equal(err.code, 401);
         callback();
     });
 });