Revision 5798
Added by berkley over 13 years ago
CrudServiceTest.java | ||
---|---|---|
94 | 94 |
public static Test suite() |
95 | 95 |
{ |
96 | 96 |
TestSuite suite = new TestSuite(); |
97 |
suite.addTest(new CrudServiceTest("initialize")); |
|
97 |
/*suite.addTest(new CrudServiceTest("initialize"));
|
|
98 | 98 |
suite.addTest(new CrudServiceTest("testSingletonAccessor")); |
99 | 99 |
suite.addTest(new CrudServiceTest("testCreateAndGet")); |
100 | 100 |
suite.addTest(new CrudServiceTest("testGetSystemMetadata")); |
101 | 101 |
suite.addTest(new CrudServiceTest("testUpdate")); |
102 | 102 |
suite.addTest(new CrudServiceTest("testListObjects")); |
103 |
suite.addTest(new CrudServiceTest("testAccessControl")); |
|
103 |
suite.addTest(new CrudServiceTest("testAccessControl"));*/
|
|
104 | 104 |
suite.addTest(new CrudServiceTest("testGenerateMissingSystemMetadata")); |
105 |
suite.addTest(new CrudServiceTest("testGetLogRecords")); |
|
105 |
/*suite.addTest(new CrudServiceTest("testGetLogRecords"));
|
|
106 | 106 |
suite.addTest(new CrudServiceTest("testChecksumError")); |
107 | 107 |
suite.addTest(new CrudServiceTest("testPublicAccess")); |
108 | 108 |
suite.addTest(new CrudServiceTest("testFailedCreate")); |
109 | 109 |
suite.addTest(new CrudServiceTest("testChecksum")); |
110 | 110 |
suite.addTest(new CrudServiceTest("testDescribe")); |
111 | 111 |
suite.addTest(new CrudServiceTest("testDelete")); |
112 |
suite.addTest(new CrudServiceTest("testSemiColonsInIdentifiers")); |
|
112 |
suite.addTest(new CrudServiceTest("testSemiColonsInIdentifiers"));*/
|
|
113 | 113 |
return suite; |
114 | 114 |
} |
115 | 115 |
|
... | ... | |
432 | 432 |
try |
433 | 433 |
{ |
434 | 434 |
CrudService cs = CrudService.getInstance(); |
435 |
AuthToken token = getToken(); |
|
435 |
AuthToken token = getToken("uid=dataone_cn_metacat,o=DATAONE,dc=ecoinformatics,dc=org", "umtmm4tcn");
|
|
436 | 436 |
//create a document with no system metadata |
437 | 437 |
String testDoc = getTestDoc(); |
438 | 438 |
Identifier id = new Identifier(); |
... | ... | |
810 | 810 |
|
811 | 811 |
/** |
812 | 812 |
* authenticate and return a token |
813 |
* use the test.mcUser and test.mcPassword username/password combo |
|
813 | 814 |
*/ |
814 | 815 |
private AuthToken getToken() |
815 | 816 |
throws Exception |
816 | 817 |
{ |
818 |
String username = PropertyService.getProperty("test.mcUser"); |
|
819 |
String password = PropertyService.getProperty("test.mcPassword"); |
|
820 |
return getToken(username, password); |
|
821 |
} |
|
822 |
|
|
823 |
/** |
|
824 |
* authenticate and return a token using the given credentials |
|
825 |
*/ |
|
826 |
private AuthToken getToken(String username, String password) |
|
827 |
throws Exception |
|
828 |
{ |
|
817 | 829 |
CrudService cs = CrudService.getInstance(); |
818 | 830 |
//login and get a sessionid |
819 | 831 |
MetacatRestClient restClient = new MetacatRestClient(cs.getContextUrl()); |
820 |
String username = PropertyService.getProperty("test.mcUser"); |
|
821 |
String password = PropertyService.getProperty("test.mcPassword"); |
|
822 | 832 |
String response = restClient.login(username, password); |
823 | 833 |
String sessionid = restClient.getSessionId(); |
824 | 834 |
SessionService sessionService = SessionService.getInstance(); |
Also available in: Unified diff
fixes for creating SM for legacy docs