Пример #1
0
 @Test
 public void multiPostRequests() {
   Map<String, Object> req1Map =
       createMap(
           "type", "read",
           "mbean", "java.lang:type=Memory",
           "attribute", "HeapMemoryUsage");
   Map<String, Object> req2Map = createMap("type", "list");
   List<JmxRequest> req =
       JmxRequestFactory.createPostRequests(Arrays.asList(req1Map, req2Map), procParams);
   assertEquals(req.get(0).getType(), RequestType.READ);
   assertEquals(req.get(1).getType(), RequestType.LIST);
 }
Пример #2
0
 @Test(expectedExceptions = {IllegalArgumentException.class})
 public void multiPostRequestsWithWrongArg() {
   Map<String, Object> reqMap = createMap("type", "list");
   JmxRequestFactory.createPostRequests(Arrays.asList(reqMap, "Wrong"), procParams);
 }