Project

General

Profile

« Previous | Next » 

Revision 8834

use mock CN for testing metacat implementations

View differences:

MockCNode.java
27 27
import org.dataone.service.exceptions.NotImplemented;
28 28
import org.dataone.service.exceptions.ServiceFailure;
29 29
import org.dataone.service.types.v1.Identifier;
30
import org.dataone.service.types.v1.NodeReference;
31
import org.dataone.service.types.v1.NodeType;
30 32
import org.dataone.service.types.v1.Session;
31 33
import org.dataone.service.types.v1.Subject;
34
import org.dataone.service.types.v2.Node;
35
import org.dataone.service.types.v2.NodeList;
32 36
import org.dataone.service.types.v2.SystemMetadata;
33 37

  
34 38
/**
......
44 48
    	super(null);
45 49
    }
46 50
    
51
    @Override
52
	public NodeList listNodes() throws NotImplemented, ServiceFailure {
53
		NodeList list = new NodeList();
54
		list.addNode(getCapabilities());
55
		return list;
56
	}
57
    
58
    @Override
59
	public Node getCapabilities() throws NotImplemented, ServiceFailure {
60
		Node node = new Node();
61
		node.setIdentifier(getNodeId());
62
		Subject subject = new Subject();
63
		subject.setValue("cn=" + getNodeId() + ",dc=dataone,dc=org");
64
		node.addSubject(subject );
65
		node.setType(getNodeType());
66
		return node;
67
	}
68
    
69
    @Override
70
	public NodeReference getNodeId() {
71
		NodeReference nodeRef = new NodeReference();
72
		nodeRef.setValue("urn:node:MockCNode");
73
		return nodeRef ;
74
	}
75
    
76
    @Override
77
	public NodeType getNodeType() {
78
		return NodeType.CN;
79
	}
80
    
81
    @Override
82
	public String getNodeBaseServiceUrl() {
83
		return "https//:foo.dataone.org";
84
	}
85
    
47 86
    /**
48 87
     * No records exist in the Mock CNode - indicates such
49 88
     */

Also available in: Unified diff