use of org.ow2.proactive.resourcemanager.db.NodeSourceData in project scheduling by ow2-proactive.
the class RMDBManagerBufferTest method addNodeSourceData.
private void addNodeSourceData() {
nodeSourceData = new NodeSourceData();
nodeSourceData.setName(NODE_SOURCE_NAME_BASE);
nodeSourceData.setPolicyType(NODE_SOURCE_POLICY);
dbManager.addNodeSource(nodeSourceData);
}
use of org.ow2.proactive.resourcemanager.db.NodeSourceData in project scheduling by ow2-proactive.
the class RMDBManagerBufferTest method addRMNodeData.
private RMNodeData addRMNodeData(String nodeName, NodeState state) {
RMNodeData rmNodeData = new RMNodeData(nodeName, NODE_URL, owner, provider, permission, state, STATE_CHANGE_TIME_BASE, HOSTNAME, JMX_URLS, JVM_NAME);
rmNodeData.setNodeSource(nodeSourceData);
dbManager.addNode(rmNodeData, NODE_SOURCE_NAME_BASE);
return rmNodeData;
}
use of org.ow2.proactive.resourcemanager.db.NodeSourceData in project scheduling by ow2-proactive.
the class NodeSourceTest method createNodeSource.
private NodeSource createNodeSource(InfrastructureManager infrastructureManager, NodeSourcePolicy nodeSourcePolicy, Client client) {
NodeSourceData nodeSourceData = new NodeSourceData();
nodeSourceData.setProvider(client);
nodeSourceData.setNodesRecoverable(NODES_NOT_RECOVERABLE);
return new NodeSource("registrationURL", "name", infrastructureManager, nodeSourcePolicy, mock(RMCore.class), mock(RMMonitoringImpl.class), nodeSourceData.toNodeSourceDescriptor());
}
use of org.ow2.proactive.resourcemanager.db.NodeSourceData in project scheduling by ow2-proactive.
the class NodeSourcesTest method emptyNodeSource.
@Test
public void emptyNodeSource() throws Exception {
NodeSourceData nodeSourceData = new NodeSourceData();
try {
dbManager.addNodeSource(nodeSourceData);
Assert.fail("Empty node source successfully added");
} catch (RuntimeException e) {
}
}
use of org.ow2.proactive.resourcemanager.db.NodeSourceData in project scheduling by ow2-proactive.
the class NodeSourcesTest method addNodeSource.
@Test
public void addNodeSource() throws Exception {
NodeSourceData nodeSourceData = createNodeSource();
nodeSourceData.setInfrastructureVariables(infrastructureVariables);
assertThat(dbManager.getNodeSources()).isEmpty();
dbManager.addNodeSource(nodeSourceData);
Collection<NodeSourceData> nodeSources = dbManager.getNodeSources();
assertThat(nodeSources).hasSize(1);
NodeSourceData nodeSource = nodeSources.iterator().next();
Assert.assertEquals("ns1", nodeSource.getName());
Assert.assertEquals(DefaultInfrastructureManager.class.getName(), nodeSource.getInfrastructureType());
Assert.assertEquals("infrastructure", nodeSource.getInfrastructureParameters().toArray()[0]);
Assert.assertEquals(StaticPolicy.class.getName(), nodeSource.getPolicyType());
Assert.assertEquals("policy", nodeSource.getPolicyParameters().toArray()[0]);
assertThat(nodeSource.getInfrastructureVariables()).hasSize(1);
Assert.assertEquals(INFRASTRUCTURE_VARIABLE_VALUE, nodeSource.getInfrastructureVariables().get(INFRASTRUCTURE_VARIABLE_KEY));
}
Aggregations