Revision 9266
Added by Jing Tao over 9 years ago
test/edu/ucsb/nceas/metacat/dataone/CNodeServiceTest.java | ||
---|---|---|
128 | 128 |
printTestHeader("testRegisterSystemMetadata"); |
129 | 129 |
|
130 | 130 |
try { |
131 |
Session session = getTestSession();
|
|
131 |
Session session = getCNSession();
|
|
132 | 132 |
Identifier guid = new Identifier(); |
133 | 133 |
guid.setValue("testRegisterSystemMetadata." + System.currentTimeMillis()); |
134 | 134 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
149 | 149 |
printTestHeader("testGetSystemMetadata"); |
150 | 150 |
|
151 | 151 |
try { |
152 |
Session session = getTestSession();
|
|
152 |
Session session = getCNSession();
|
|
153 | 153 |
Identifier guid = new Identifier(); |
154 | 154 |
guid.setValue("testGetSystemMetadata." + System.currentTimeMillis()); |
155 | 155 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
169 | 169 |
printTestHeader("testGetLogRecords"); |
170 | 170 |
try { |
171 | 171 |
|
172 |
Session session = getTestSession();
|
|
172 |
Session session = getCNSession();
|
|
173 | 173 |
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
174 | 174 |
Date fromDate = sdf.parse("2010-01-01"); |
175 | 175 |
Date toDate = new Date(); |
... | ... | |
193 | 193 |
printTestHeader("testCreate"); |
194 | 194 |
|
195 | 195 |
try { |
196 |
Session session = getTestSession();
|
|
196 |
Session session = getCNSession();
|
|
197 | 197 |
Identifier guid = new Identifier(); |
198 | 198 |
guid.setValue("testCreate." + System.currentTimeMillis()); |
199 | 199 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
210 | 210 |
printTestHeader("testGet"); |
211 | 211 |
|
212 | 212 |
try { |
213 |
Session session = getTestSession();
|
|
213 |
Session session = getCNSession();
|
|
214 | 214 |
Identifier guid = new Identifier(); |
215 | 215 |
guid.setValue("testGet." + System.currentTimeMillis()); |
216 | 216 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
233 | 233 |
printTestHeader("testChecksum"); |
234 | 234 |
|
235 | 235 |
try { |
236 |
Session session = getTestSession();
|
|
236 |
Session session = getCNSession();
|
|
237 | 237 |
Identifier guid = new Identifier(); |
238 | 238 |
guid.setValue("testChecksum." + System.currentTimeMillis()); |
239 | 239 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
266 | 266 |
printTestHeader("testReserveIdentifier"); |
267 | 267 |
|
268 | 268 |
try { |
269 |
Session session = getTestSession();
|
|
269 |
Session session = getCNSession();
|
|
270 | 270 |
Identifier guid = new Identifier(); |
271 | 271 |
guid.setValue("testReserveIdentifier." + System.currentTimeMillis()); |
272 | 272 |
// reserve it |
... | ... | |
286 | 286 |
printTestHeader("testSearch"); |
287 | 287 |
|
288 | 288 |
try { |
289 |
Session session = getTestSession();
|
|
289 |
Session session = getCNSession();
|
|
290 | 290 |
|
291 | 291 |
// search for objects, but expect a NotImplemented exception |
292 | 292 |
try { |
... | ... | |
306 | 306 |
printTestHeader("testSetOwner"); |
307 | 307 |
|
308 | 308 |
try { |
309 |
Session session = getTestSession();
|
|
309 |
Session session = getCNSession();
|
|
310 | 310 |
Identifier guid = new Identifier(); |
311 | 311 |
guid.setValue("testSetOwner." + System.currentTimeMillis()); |
312 | 312 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
335 | 335 |
printTestHeader("testSetAccessPolicy"); |
336 | 336 |
|
337 | 337 |
try { |
338 |
Session session = getTestSession();
|
|
338 |
Session session = getCNSession();
|
|
339 | 339 |
Identifier guid = new Identifier(); |
340 | 340 |
guid.setValue("testSetAccessPolicy." + System.currentTimeMillis()); |
341 | 341 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
367 | 367 |
printTestHeader("testIsAuthorized"); |
368 | 368 |
|
369 | 369 |
try { |
370 |
Session session = getTestSession();
|
|
370 |
Session session = getCNSession();
|
|
371 | 371 |
Identifier guid = new Identifier(); |
372 | 372 |
guid.setValue("testIsAuthorized." + System.currentTimeMillis()); |
373 | 373 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
400 | 400 |
printTestHeader("testReplicationPolicy"); |
401 | 401 |
|
402 | 402 |
try { |
403 |
Session session = getTestSession();
|
|
403 |
Session session = getCNSession();
|
|
404 | 404 |
Identifier guid = new Identifier(); |
405 | 405 |
guid.setValue("testReplicationPolicy." + System.currentTimeMillis()); |
406 | 406 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
433 | 433 |
printTestHeader("testReplicationStatus"); |
434 | 434 |
|
435 | 435 |
try { |
436 |
Session session = getTestSession();
|
|
436 |
Session session = getCNSession();
|
|
437 | 437 |
Identifier guid = new Identifier(); |
438 | 438 |
guid.setValue("testReplicationStatus." + System.currentTimeMillis()); |
439 | 439 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
479 | 479 |
* @throws ServiceFailure |
480 | 480 |
* @throws Exception |
481 | 481 |
*/ |
482 |
@Override |
|
482 |
/*@Override
|
|
483 | 483 |
public Session getTestSession() throws Exception { |
484 | 484 |
Session session = super.getTestSession(); |
485 | 485 |
|
... | ... | |
498 | 498 |
} |
499 | 499 |
// in case we didn't find it |
500 | 500 |
return session; |
501 |
} |
|
501 |
}*/
|
|
502 | 502 |
|
503 | 503 |
|
504 | 504 |
/** |
... | ... | |
594 | 594 |
printTestHeader("testCreate"); |
595 | 595 |
|
596 | 596 |
try { |
597 |
Session session = getTestSession();
|
|
597 |
Session session = getCNSession();
|
|
598 | 598 |
Identifier guid = new Identifier(); |
599 | 599 |
guid.setValue("testCreate." + System.currentTimeMillis()); |
600 | 600 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
... | ... | |
679 | 679 |
String str3 = "object3"; |
680 | 680 |
try { |
681 | 681 |
//insert test documents with a series id |
682 |
Session session = getTestSession();
|
|
682 |
Session session = getCNSession();
|
|
683 | 683 |
Identifier guid = new Identifier(); |
684 | 684 |
guid.setValue(generateDocumentId()); |
685 | 685 |
InputStream object1 = new ByteArrayInputStream(str1.getBytes("UTF-8")); |
... | ... | |
1160 | 1160 |
String str3 = "object3"; |
1161 | 1161 |
|
1162 | 1162 |
//insert test documents with a series id |
1163 |
Session session = getTestSession();
|
|
1163 |
Session session = getCNSession();
|
|
1164 | 1164 |
Identifier guid = new Identifier(); |
1165 | 1165 |
guid.setValue(generateDocumentId()); |
1166 | 1166 |
InputStream object1 = new ByteArrayInputStream(str1.getBytes("UTF-8")); |
Also available in: Unified diff
Use the getCNSession to replace the getTestSession which was a actual getCNSession.