public class MockCloudContext extends AbstractCloudContext
UnsupportedOperationExceptions and other kind of errors. For several simple tests it is however useful already.
The object model must be manually set up using the several addNodeManager
methods. The 'core' model is created with addCore(). Current implementation will basicly allow all 'related' and 'posrel' relations, but this
part has still to be elaborated on. This may change in future versions of this.| Modifier and Type | Class and Description |
|---|---|
static class |
MockCloudContext.MockResolver |
static class |
MockCloudContext.NodeDescription
Simple structure to contain the data of an MMBase node in memory.
|
| Modifier and Type | Field and Description |
|---|---|
Map<String,NodeManagerDescription> |
nodeManagers |
(package private) Map<Integer,MockCloudContext.NodeDescription> |
nodes |
clouds| Constructor and Description |
|---|
MockCloudContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCore()
Adds the 'core' builders to the object model.
|
int |
addNode(String type,
Map<String,Object> map) |
void |
addNodeManager(InputSource source) |
protected void |
addNodeManager(MockBuilderReader reader) |
void |
addNodeManager(String name,
Map<String,DataType<?>> map) |
void |
addNodeManagers(ResourceLoader directory) |
void |
clear() |
Cloud |
getCloud(String name,
UserContext user)
Returns the cloud with the specified name, based on an existing User object.
|
static MockCloudContext |
getInstance()
Returns 'the' MockCloudContext.
|
Map<Integer,MockCloudContext.NodeDescription> |
getNodes() |
protected int |
getTypeDefNode(String name) |
String |
getUri()
The String which was usesd, and could be used again to acquire this cloud context using
ContextProvider.getCloudContext(String). |
(package private) void |
setNodeType(int node,
String type) |
String |
toString() |
assertUp, createFieldList, createModuleList, createNodeList, createNodeManagerList, createRelationList, createRelationManagerList, createStringList, getActionRepository, getAuthentication, getCloud, getCloud, getCloudNames, getDefaultCharacterEncoding, getDefaultCloudName, getDefaultLocale, getDefaultTimeZone, getModule, getModules, hasModule, isUpfinal Map<Integer,MockCloudContext.NodeDescription> nodes
public final Map<String,NodeManagerDescription> nodeManagers
public static MockCloudContext getInstance()
public Map<Integer,MockCloudContext.NodeDescription> getNodes()
public void clear()
public void addCore()
throws IOException
IOExceptionprotected int getTypeDefNode(String name)
public void addNodeManager(InputSource source)
protected void addNodeManager(MockBuilderReader reader)
public void addNodeManagers(ResourceLoader directory) throws IOException
IOExceptionvoid setNodeType(int node,
String type)
public Cloud getCloud(String name, UserContext user) throws NotFoundException
CloudContextCloud.getUser() or directly from Authentication.login(java.lang.String, java.util.Map<java.lang.String, ?>, java.lang.Object[])).
The security implementation may depend on implementation details of this
UserContext.name - The name of the cloud to be returned. See CloudContext.getCloudNames().user - The user object for which this cloud object must be created. Many
security implementation require this object to be created by
themselves.NotFoundException - thrown when cloud not foundpublic String getUri()
CloudContextContextProvider.getCloudContext(String).MMBase 1.9-SNAPSHOT - ${javadoctimestamp}