Revision 8810
Added by ben leinfelder over 9 years ago
MockCNode.java | ||
---|---|---|
19 | 19 |
*/ |
20 | 20 |
package edu.ucsb.nceas.metacat.dataone; |
21 | 21 |
|
22 |
import org.dataone.client.CNode; |
|
22 |
import org.dataone.client.v2.impl.MultipartCNode;
|
|
23 | 23 |
import org.dataone.service.exceptions.IdentifierNotUnique; |
24 |
import org.dataone.service.exceptions.InvalidRequest; |
|
25 | 24 |
import org.dataone.service.exceptions.InvalidToken; |
26 | 25 |
import org.dataone.service.exceptions.NotAuthorized; |
27 | 26 |
import org.dataone.service.exceptions.NotFound; |
... | ... | |
30 | 29 |
import org.dataone.service.types.v1.Identifier; |
31 | 30 |
import org.dataone.service.types.v1.Session; |
32 | 31 |
import org.dataone.service.types.v1.Subject; |
33 |
import org.dataone.service.types.v1.SystemMetadata;
|
|
32 |
import org.dataone.service.types.v2.SystemMetadata;
|
|
34 | 33 |
|
35 | 34 |
/** |
36 | 35 |
* MockCNode mimics a DataONE Coordinating Node, and should be used only for testing |
37 | 36 |
* when there is a dependency on CN services |
38 | 37 |
*/ |
39 |
public class MockCNode extends CNode { |
|
38 |
public class MockCNode extends MultipartCNode {
|
|
40 | 39 |
|
41 | 40 |
/** |
42 | 41 |
* See superclass for documentation |
... | ... | |
65 | 64 |
return true; |
66 | 65 |
} |
67 | 66 |
|
68 |
/** |
|
69 |
* we only want to test against ourselves |
|
70 |
*/ |
|
71 |
@Override |
|
72 |
public String lookupNodeBaseUrl(String nodeId) throws ServiceFailure, NotImplemented { |
|
73 |
|
|
74 |
try { |
|
75 |
return MNodeService.getInstance(null).getCapabilities().getBaseURL(); |
|
76 |
} catch (Exception e) { |
|
77 |
// TODO Auto-generated catch block |
|
78 |
e.printStackTrace(); |
|
79 |
} |
|
80 |
return null; |
|
81 |
} |
|
82 | 67 |
} |
Also available in: Unified diff
add support for v2 DataONE API.