use of org.ow2.proactive_grid_cloud_portal.webapp.StatHistory in project scheduling by ow2-proactive.
the class RMRestTest method callGetStatHistory.
private JSONObject callGetStatHistory() throws Exception {
RMProxyUserInterface rmMock = mock(RMProxyUserInterface.class);
String sessionId = SharedSessionStoreTestUtils.createValidSession(rmMock);
AttributeList value = new AttributeList(Collections.singletonList(new Attribute("test", createRrdDb().getBytes())));
when(rmMock.getMBeanAttributes(Matchers.<ObjectName>any(), Matchers.<String[]>any())).thenReturn(value);
RMRestInterface client = ProxyFactory.create(RMRestInterface.class, "http://localhost:" + port + "/");
String statHistory = client.getStatHistory(sessionId, "hhhhh");
return (JSONObject) new JSONParser().parse(statHistory);
}
use of org.ow2.proactive_grid_cloud_portal.webapp.StatHistory in project scheduling by ow2-proactive.
the class RMRestTest method callGetStatHistory.
private JSONObject callGetStatHistory(byte[] rrdb, ConsolFun function) throws Exception {
RMProxyUserInterface rmMock = mock(RMProxyUserInterface.class);
String sessionId = SharedSessionStoreTestUtils.createValidSession(rmMock);
AttributeList value = new AttributeList(Collections.singletonList(new Attribute("test", rrdb)));
when(rmMock.getMBeanAttributes(Matchers.<ObjectName>any(), Matchers.<String[]>any())).thenReturn(value);
RMRestInterface client = ProxyFactory.create(RMRestInterface.class, "http://localhost:" + port + "/");
String statHistory = client.getStatHistory(sessionId, "hhhhh", function.name());
return (JSONObject) new JSONParser().parse(statHistory);
}
Aggregations