Skip to content

Commit

Permalink
Review test following permission discussion. (see #8712)
Browse files Browse the repository at this point in the history
  • Loading branch information
jburel committed May 11, 2012
1 parent 949112c commit bcbef5b
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions components/tools/OmeroJava/test/integration/chmod/RolesTest.java
Expand Up @@ -61,9 +61,6 @@ public class RolesTest
extends AbstractServerTest extends AbstractServerTest
{ {


/** Flag to turn on/off the deletion of a dataset.*/
private boolean delete = false;

/** /**
* Since we are creating a new client on each invocation, we should also * Since we are creating a new client on each invocation, we should also
* clean it up. Note: {@link #newUserAndGroup(String)} also closes, but * clean it up. Note: {@link #newUserAndGroup(String)} also closes, but
Expand Down Expand Up @@ -233,30 +230,16 @@ public void testInteractionByGroupOwnerRW()
assertFalse(perms.canLink()); assertFalse(perms.canLink());


//Create a link canLink //Create a link canLink
//Try to delete the link i.e. canLink //Try to delete the link i.e. canDelete
try { iUpdate.deleteObject(l);
iUpdate.deleteObject(l);
fail("Group owner should not be allowed to delete " +
"an image/dataset link.");
} catch (Exception e) {
}




//Try to delete the annotation link i.e. canDelete //Try to delete the annotation link i.e. canDelete
try { iUpdate.deleteObject(dl);
iUpdate.deleteObject(dl);
fail("Group owner should not be allowed to delete " +
"an annoation link.");
} catch (Exception e) {
}




//Try to delete the annotation i.e. canDelete //Try to delete the annotation i.e. canDelete
try { iUpdate.deleteObject(ann);
iUpdate.deleteObject(ann);
fail("Group owner should not be allowed to delete " +
"an annoation.");
} catch (Exception e) {}


//Try to link an image i.e. canLink //Try to link an image i.e. canLink
try { try {
Expand Down Expand Up @@ -284,8 +267,14 @@ public void testInteractionByGroupOwnerRW()




//Try to edit i.e. canEdit //Try to edit i.e. canEdit
d.setName(rstring("newNAme")); try {
iUpdate.saveAndReturnObject(d);
d.setName(rstring("newNAme"));
iUpdate.saveAndReturnObject(d);
fail("Group owner should not be allowed to edit a dataset.");
} catch (Exception e) {
// TODO: handle exception
}
} }


/** /**
Expand Down Expand Up @@ -1020,7 +1009,6 @@ public void testInteractionByMemberRWRW()
iUpdate.deleteObject(ann); iUpdate.deleteObject(ann);


//Try to delete the dataset i.e. canDelete //Try to delete the dataset i.e. canDelete
if (delete)
delete(client, new DeleteCommand( delete(client, new DeleteCommand(
DeleteServiceTest.REF_DATASET, id, null)); DeleteServiceTest.REF_DATASET, id, null));


Expand Down

0 comments on commit bcbef5b

Please sign in to comment.