test_class.declarator: JOLOKIA_URL = "http://localhost:8080/jolokia"
test_class.modifier: public static final
test_class.original_string: public static final String JOLOKIA_URL = "http://localhost:8080/jolokia";
test_class.type: String
test_class.var_name: JOLOKIA_URL
test_class.declarator: MULTICAST_GROUP = ConfigKey.MULTICAST_GROUP.getDefaultValue()
test_class.modifier: public static final
test_class.original_string: public static final String MULTICAST_GROUP = ConfigKey.MULTICAST_GROUP.getDefaultValue();
test_class.type: String
test_class.var_name: MULTICAST_GROUP
test_class.declarator: MULTICAST_PORT = Integer.valueOf(ConfigKey.MULTICAST_PORT.getDefaultValue())
test_class.modifier: public static final
test_class.original_string: public static final int MULTICAST_PORT = Integer.valueOf(ConfigKey.MULTICAST_PORT.getDefaultValue());
test_class.type: int
test_class.var_name: MULTICAST_PORT
test_class.declarator: url
test_class.modifier: private
test_class.original_string: private URL url;
test_class.type: URL
test_class.var_name: url
test_class.declarator: id
test_class.modifier: private
test_class.original_string: private String id;
test_class.type: String
test_class.var_name: id
test_class.file: agent/core/src/test/java/org/jolokia/discovery/MulticastSocketListenerThreadTest.java
test_class.identifier: MulticastSocketListenerThreadTest
test_case.body: @Test
      public void simple() throws IOException, InterruptedException {
          checkForMulticastSupport();
  
          MulticastSocketListenerThread listenerThread = startSocketListener();
  
          try {
              DiscoveryOutgoingMessage out =
                      new DiscoveryOutgoingMessage.Builder(QUERY)
                              .agentId(UUID.randomUUID().toString())
                              .build();
              List<DiscoveryIncomingMessage> discovered = sendQueryAndCollectAnswers(out, 500, MULTICAST_GROUP, MULTICAST_PORT, new LogHandler.StdoutLogHandler(true));
              int idCount = 0;
              int urlCount = 0;
              for (DiscoveryIncomingMessage in : discovered) {
                  AgentDetails agentDetails = in.getAgentDetails();
                  if (agentDetails.getAgentId().equals(id)) {
                      idCount++;
                  }
                  if (JOLOKIA_URL.equals(in.getAgentDetails().toJSONObject().get("url"))) {
                      urlCount++;
                  }
                  assertFalse(in.isQuery());
                  JSONObject details = agentDetails.toJSONObject();
                  if (details.get("server_vendor") != null && details.get("server_vendor").equals("jolokia")) {
                      assertEquals(details.get("url"), JOLOKIA_URL);
                      assertEquals(details.get("agent_version"), Version.getAgentVersion());
                      return;
                  }
              }
              assertEquals(idCount,1,"Exactly one in message with the send id should have been received");
              assertEquals(urlCount,1,"Only one message with the url should be included");
              fail("No message found");
          } finally {
              listenerThread.shutdown();
          }
      }
test_case.class_method_signature: MulticastSocketListenerThreadTest.simple()
test_case.full_signature: @Test public void simple()
test_case.identifier: simple
test_case.invocations: checkForMulticastSupport startSocketListener build agentId toString randomUUID sendQueryAndCollectAnswers getAgentDetails equals getAgentId equals get toJSONObject getAgentDetails assertFalse isQuery toJSONObject get equals get assertEquals get assertEquals get getAgentVersion assertEquals assertEquals fail shutdown
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void simple()
focal_class.declarator: agentDetailsHolder
focal_class.modifier: private final
focal_class.original_string: private final AgentDetailsHolder agentDetailsHolder;
focal_class.type: AgentDetailsHolder
focal_class.var_name: agentDetailsHolder
focal_class.declarator: restrictor
focal_class.modifier: private final
focal_class.original_string: private final Restrictor restrictor;
focal_class.type: Restrictor
focal_class.var_name: restrictor
focal_class.declarator: multicastGroup
focal_class.modifier: private final
focal_class.original_string: private final String multicastGroup;
focal_class.type: String
focal_class.var_name: multicastGroup
focal_class.declarator: multicastPort
focal_class.modifier: private final
focal_class.original_string: private final int multicastPort;
focal_class.type: int
focal_class.var_name: multicastPort
focal_class.declarator: logHandler
focal_class.modifier: private final
focal_class.original_string: private final LogHandler logHandler;
focal_class.type: LogHandler
focal_class.var_name: logHandler
focal_class.declarator: address
focal_class.modifier: private final
focal_class.original_string: private final InetAddress address;
focal_class.type: InetAddress
focal_class.var_name: address
focal_class.declarator: running
focal_class.modifier: private
focal_class.original_string: private boolean running;
focal_class.type: boolean
focal_class.var_name: running
focal_class.declarator: socket
focal_class.modifier: private
focal_class.original_string: private MulticastSocket socket;
focal_class.type: MulticastSocket
focal_class.var_name: socket
focal_class.file: agent/core/src/main/java/org/jolokia/discovery/MulticastSocketListenerThread.java
focal_class.identifier: MulticastSocketListenerThread
focal_class.class_method_signature: MulticastSocketListenerThread.MulticastSocketListenerThread(String name, InetAddress pHostAddress, AgentDetailsHolder pAgentDetailsHolder, Restrictor pRestrictor, String pMulticastGroup, int pMulticastPort, LogHandler pLogHandler)
focal_class.full_signature:   MulticastSocketListenerThread(String name, InetAddress pHostAddress, AgentDetailsHolder pAgentDetailsHolder, Restrictor pRestrictor, String pMulticastGroup, int pMulticastPort, LogHandler pLogHandler)
focal_class.identifier: MulticastSocketListenerThread
focal_class.parameters: (String name, InetAddress pHostAddress, AgentDetailsHolder pAgentDetailsHolder, Restrictor pRestrictor, String pMulticastGroup, int pMulticastPort, LogHandler pLogHandler)
focal_class.signature:  MulticastSocketListenerThread(String name, InetAddress pHostAddress, AgentDetailsHolder pAgentDetailsHolder, Restrictor pRestrictor, String pMulticastGroup, int pMulticastPort, LogHandler pLogHandler)
focal_class.class_method_signature: MulticastSocketListenerThread.run()
focal_class.full_signature: public void run()
focal_class.identifier: run
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void run()
focal_class.class_method_signature: MulticastSocketListenerThread.setRunning(boolean pRunning)
focal_class.full_signature: private synchronized void setRunning(boolean pRunning)
focal_class.identifier: setRunning
focal_class.modifiers: private synchronized
focal_class.parameters: (boolean pRunning)
focal_class.return: void
focal_class.signature: void setRunning(boolean pRunning)
focal_class.class_method_signature: MulticastSocketListenerThread.isRunning()
focal_class.full_signature: public synchronized boolean isRunning()
focal_class.identifier: isRunning
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isRunning()
focal_class.class_method_signature: MulticastSocketListenerThread.shutdown()
focal_class.full_signature: public synchronized void shutdown()
focal_class.identifier: shutdown
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void shutdown()
focal_class.class_method_signature: MulticastSocketListenerThread.shouldMessageBeProcessed(DiscoveryIncomingMessage pMsg)
focal_class.full_signature: private boolean shouldMessageBeProcessed(DiscoveryIncomingMessage pMsg)
focal_class.identifier: shouldMessageBeProcessed
focal_class.modifiers: private
focal_class.parameters: (DiscoveryIncomingMessage pMsg)
focal_class.return: boolean
focal_class.signature: boolean shouldMessageBeProcessed(DiscoveryIncomingMessage pMsg)
focal_class.class_method_signature: MulticastSocketListenerThread.receiveMessage()
focal_class.full_signature: private DiscoveryIncomingMessage receiveMessage()
focal_class.identifier: receiveMessage
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: DiscoveryIncomingMessage
focal_class.signature: DiscoveryIncomingMessage receiveMessage()
focal_class.class_method_signature: MulticastSocketListenerThread.refreshSocket()
focal_class.full_signature: private void refreshSocket()
focal_class.identifier: refreshSocket
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void refreshSocket()
focal_class.class_method_signature: MulticastSocketListenerThread.handleQuery(DiscoveryIncomingMessage pMsg)
focal_class.full_signature: private void handleQuery(DiscoveryIncomingMessage pMsg)
focal_class.identifier: handleQuery
focal_class.modifiers: private
focal_class.parameters: (DiscoveryIncomingMessage pMsg)
focal_class.return: void
focal_class.signature: void handleQuery(DiscoveryIncomingMessage pMsg)
focal_class.class_method_signature: MulticastSocketListenerThread.send(DiscoveryOutgoingMessage pAnswer)
focal_class.full_signature: private void send(DiscoveryOutgoingMessage pAnswer)
focal_class.identifier: send
focal_class.modifiers: private
focal_class.parameters: (DiscoveryOutgoingMessage pAnswer)
focal_class.return: void
focal_class.signature: void send(DiscoveryOutgoingMessage pAnswer)
focal_class.superclass: extends Thread
focal_method.body: public synchronized void shutdown() {
          setRunning(false);
          interrupt();
          socket.close();
      }
focal_method.class_method_signature: MulticastSocketListenerThread.shutdown()
focal_method.full_signature: public synchronized void shutdown()
focal_method.identifier: shutdown
focal_method.invocations: setRunning interrupt close
focal_method.modifiers: public synchronized
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void shutdown()