Project

General

Profile

« Previous | Next » 

Revision 6325

include MNAuthorization tests

View differences:

test/edu/ucsb/nceas/metacat/dataone/MNodeServiceTest.java
114 114
    // suite.addTest(new MNodeServiceTest("testGetOperationStatistics"));
115 115
    // suite.addTest(new MNodeServiceTest("testGetCapabilities"));
116 116
    // MNAuthorization tests
117
    // suite.addTest(new MNodeServiceTest("testIsAuthorized"));
118
    //suite.addTest(new MNodeServiceTest("testSetAccessPolicy"));
117
    suite.addTest(new MNodeServiceTest("testIsAuthorized"));
118
    suite.addTest(new MNodeServiceTest("testSetAccessPolicy"));
119 119
    // MNreplication tests
120 120
    // suite.addTest(new MNodeServiceTest("testReplicate"));
121 121
    // suite.addTest(new MNodeServiceTest("testSynchronizationFailed"));
......
751 751
	    accessWasSet = 
752 752
	    	MNodeService.getInstance().setAccessPolicy(session, pid, accessPolicy);
753 753
	    assertTrue(accessWasSet);
754
	    
754
	    // test that it is enforced
755
	    session.setSubject(publicSubject);
756
	    boolean isAuthorized = MNodeService.getInstance().isAuthorized(session, pid, Permission.WRITE);
757
	    assertTrue(isAuthorized);
758

  
755 759
    } catch (UnsupportedEncodingException e) {
756 760
	    e.printStackTrace();
757 761
	    

Also available in: Unified diff