Revision 6797
Added by ben leinfelder about 13 years ago
test/edu/ucsb/nceas/metacat/dataone/CNodeServiceTest.java | ||
---|---|---|
36 | 36 |
|
37 | 37 |
import org.apache.commons.io.IOUtils; |
38 | 38 |
import org.dataone.client.D1Client; |
39 |
import org.dataone.service.exceptions.BaseException; |
|
39 | 40 |
import org.dataone.service.exceptions.InsufficientResources; |
40 | 41 |
import org.dataone.service.exceptions.NotAuthorized; |
41 | 42 |
import org.dataone.service.exceptions.NotFound; |
... | ... | |
465 | 466 |
guid.setValue("testReplicationStatus." + System.currentTimeMillis()); |
466 | 467 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
467 | 468 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object); |
468 |
long serialVersion = 1L; |
|
469 | 469 |
Replica replica = new Replica(); |
470 | 470 |
NodeReference replicaMemberNode = new NodeReference(); |
471 | 471 |
replicaMemberNode.setValue("testNode"); |
... | ... | |
478 | 478 |
assertEquals(guid.getValue(), retGuid.getValue()); |
479 | 479 |
// set it |
480 | 480 |
ReplicationStatus status = ReplicationStatus.COMPLETED; |
481 |
boolean result = CNodeService.getInstance(request).setReplicationStatus(session, guid, replicaMemberNode, status, serialVersion); |
|
481 |
BaseException failure = new NotAuthorized("000", "Mock exception for " + this.getClass().getName()); |
|
482 |
boolean result = CNodeService.getInstance(request).setReplicationStatus(session, guid, replicaMemberNode, status, failure); |
|
482 | 483 |
assertTrue(result); |
483 | 484 |
// get it |
484 | 485 |
sysmeta = CNodeService.getInstance(request).getSystemMetadata(session, guid); |
Also available in: Unified diff
for test to compile, provide BaseException param for setReplicationStatus. I used a NotAuthorized instance.