92 |
92 |
suite.addTest(new AccessAPITest("initialize"));
|
93 |
93 |
// Test basic functions
|
94 |
94 |
suite.addTest(new AccessAPITest("testSetSingleAccess"));
|
95 |
|
suite.addTest(new AccessAPITest("testSetBlockAccess"));
|
|
95 |
//suite.addTest(new AccessAPITest("testSetBlockAccess"));
|
96 |
96 |
|
97 |
97 |
return suite;
|
98 |
98 |
}
|
... | ... | |
131 |
131 |
debug("AccessAPITest.testSetSingleAccess - Test 1, add user allowFirst allow read access");
|
132 |
132 |
principal = "uid=test30,o=NCEAS,dc=ecoinformatics,dc=org";
|
133 |
133 |
setSingleAccess(docId, principal,
|
134 |
|
Integer.toString(AccessControlInterface.READ),
|
|
134 |
"READ",
|
135 |
135 |
AccessControlInterface.ALLOW,
|
136 |
136 |
AccessControlInterface.ALLOWFIRST,
|
137 |
137 |
true);
|
... | ... | |
147 |
147 |
// get the access control for this doc id from metacat and make sure this
|
148 |
148 |
// access record is in that list.
|
149 |
149 |
accessXML = m.getAccessControl(docId);
|
150 |
|
realAccessDAOList = getAccessDAOList(docId, accessXML);
|
|
150 |
realAccessDAOList = getAccessDAOList(docId, accessXML);
|
151 |
151 |
compareAccessDAOs(realAccessDAOList, accessDAOList, false);
|
152 |
152 |
|
153 |
153 |
// test inserting a single access record with denyFirst permission order and allow read
|
... | ... | |
451 |
451 |
}
|
452 |
452 |
}
|
453 |
453 |
|
|
454 |
|
454 |
455 |
// iterate through the sub list and make sure all its elements are in the master list
|
455 |
456 |
for (XMLAccessDAO subAccessDAO : subAccessDAOList) {
|
456 |
457 |
boolean matchFound = false;
|
457 |
|
for (XMLAccessDAO mainAccessDAO : mainAccessDAOList) {
|
|
458 |
for (XMLAccessDAO mainAccessDAO : mainAccessDAOList) {
|
|
459 |
/*System.out.println("subAccessDAO.docid: '" + subAccessDAO.getDocId() + "'");
|
|
460 |
System.out.println("mainAccessDAO.docid: '" + mainAccessDAO.getDocId() + "'");
|
|
461 |
|
|
462 |
System.out.println("subAccessDAO.permOrder: '" + subAccessDAO.getPermOrder() + "'");
|
|
463 |
System.out.println("mainAccessDAO.permOrder: '" + mainAccessDAO.getPermOrder() + "'");
|
|
464 |
|
|
465 |
System.out.println("subAccessDAO.permtype: '" + subAccessDAO.getPermType() + "'");
|
|
466 |
System.out.println("mainAccessDAO.docid: '" + mainAccessDAO.getPermType() + "'");
|
|
467 |
|
|
468 |
System.out.println("subAccessDAO.princname: '" + subAccessDAO.getPrincipalName() + "'");
|
|
469 |
System.out.println("mainAccessDAO.princname: '" + mainAccessDAO.getPrincipalName() + "'");
|
|
470 |
|
|
471 |
System.out.println("subAccessDAO.perm: '" + subAccessDAO.getPermission() + "'");
|
|
472 |
System.out.println("mainAccessDAO.perm: '" + mainAccessDAO.getPermission() + "'");*/
|
458 |
473 |
if (subAccessDAO.getDocId().equals(mainAccessDAO.getDocId()) &&
|
459 |
474 |
subAccessDAO.getPermOrder().equals(mainAccessDAO.getPermOrder()) &&
|
460 |
475 |
subAccessDAO.getPermType().equals(mainAccessDAO.getPermType()) &&
|
merging test changes into the trunk