use of org.ow2.proactive.resourcemanager.common.RMStateNodeUrls in project scheduling by ow2-proactive.
the class SessionSharingTest method sessions_are_shared_rm_login.
@Test
public void sessions_are_shared_rm_login() throws Exception {
String sessionId = rmRest.rmConnect("login", "pw");
assertTrue(studioRest.getWorkflows(sessionId).isEmpty());
when(schedulerMock.freeze()).thenReturn(true);
boolean frozen = schedulerRest.freezeScheduler(sessionId);
assertTrue(frozen);
when(rmMock.getState()).thenReturn(new RMState(new RMStateNodeUrls(new HashSet<String>(), new HashSet<String>(), new HashSet<String>()), Long.valueOf(-1)));
RMState rmState = rmRest.getState(sessionId);
assertNotNull(rmState);
rmRest.rmDisconnect(sessionId);
try {
rmRest.getState(sessionId);
fail();
} catch (NotConnectedException expected) {
// expected
}
try {
schedulerRest.freezeScheduler(sessionId);
fail();
} catch (NotConnectedRestException expected) {
// expected
}
}
use of org.ow2.proactive.resourcemanager.common.RMStateNodeUrls in project scheduling by ow2-proactive.
the class SessionSharingTest method sessions_are_shared_scheduler_login.
@Test
public void sessions_are_shared_scheduler_login() throws Exception {
String sessionId = schedulerRest.login("login", "pw");
when(rmMock.getState()).thenReturn(new RMState(new RMStateNodeUrls(new HashSet<String>(), new HashSet<String>(), new HashSet<String>()), Long.valueOf(-1)));
RMState rmState = rmRest.getState(sessionId);
assertNotNull(rmState);
when(schedulerMock.freeze()).thenReturn(true);
boolean frozen = schedulerRest.freezeScheduler(sessionId);
assertTrue(frozen);
schedulerRest.disconnect(sessionId);
try {
rmRest.getState(sessionId);
fail();
} catch (NotConnectedException expected) {
// expected
}
try {
schedulerRest.freezeScheduler(sessionId);
fail();
} catch (NotConnectedRestException expected) {
// expected
}
}
use of org.ow2.proactive.resourcemanager.common.RMStateNodeUrls in project scheduling by ow2-proactive.
the class RMCore method getState.
/**
* {@inheritDoc}
*/
public RMState getState() {
RMStateNodeUrls rmStateNodeUrls = new RMStateNodeUrls(nodesListToUrlsSet(eligibleNodes), listAliveNodeUrls(), nodesListToUrlsSet(allNodes.values()));
RMState state = new RMState(rmStateNodeUrls, maximumNumberOfNodes);
return state;
}
Aggregations