test_class.file: core/src/test/java/dk/alexandra/fresco/framework/network/socket/TestSocketNetwork.java
test_class.identifier: TestSocketNetwork
test_class.superclass: extends AbstractCloseableNetworkTest
test_case.body: @Test(expected = RuntimeException.class)
    public void testStoppedSender()
        throws NoSuchFieldException, SecurityException, IllegalArgumentException,
        IllegalAccessException {
      networks = createNetworks(2);
      Field f1 = networks.get(1).getClass().getDeclaredField("senders");
      f1.setAccessible(true);
      @SuppressWarnings("unchecked")
      Sender sender = ((HashMap<Integer, Sender>) f1.get(networks.get(1))).get(2);
      sender.stop();
      networks.get(1).send(2, new byte[] { 0x01 });
      f1.setAccessible(false);
    }
test_case.class_method_signature: TestSocketNetwork.testStoppedSender()
test_case.full_signature: @Test(expected = RuntimeException.class) public void testStoppedSender()
test_case.identifier: testStoppedSender
test_case.invocations: createNetworks getDeclaredField getClass get setAccessible get get get stop send get setAccessible
test_case.modifiers: @Test(expected = RuntimeException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testStoppedSender()
focal_class.declarator: RECEIVE_TIMEOUT = Duration.ofMillis(100)
focal_class.modifier: private static final
focal_class.original_string: private static final Duration RECEIVE_TIMEOUT = Duration.ofMillis(100);
focal_class.type: Duration
focal_class.var_name: RECEIVE_TIMEOUT
focal_class.declarator: logger = LoggerFactory.getLogger(SocketNetwork.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(SocketNetwork.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: selfQueue
focal_class.modifier: private final
focal_class.original_string: private final BlockingQueue<byte[]> selfQueue;
focal_class.type: BlockingQueue<byte[]>
focal_class.var_name: selfQueue
focal_class.declarator: conf
focal_class.modifier: private final
focal_class.original_string: private final NetworkConfiguration conf;
focal_class.type: NetworkConfiguration
focal_class.var_name: conf
focal_class.declarator: alive
focal_class.modifier: private
focal_class.original_string: private boolean alive;
focal_class.type: boolean
focal_class.var_name: alive
focal_class.declarator: sockets
focal_class.modifier: private final
focal_class.original_string: private final Collection<Socket> sockets;
focal_class.type: Collection<Socket>
focal_class.var_name: sockets
focal_class.declarator: senders
focal_class.modifier: private final
focal_class.original_string: private final Map<Integer, Sender> senders;
focal_class.type: Map<Integer, Sender>
focal_class.var_name: senders
focal_class.declarator: receivers
focal_class.modifier: private final
focal_class.original_string: private final Map<Integer, Receiver> receivers;
focal_class.type: Map<Integer, Receiver>
focal_class.var_name: receivers
focal_class.file: core/src/main/java/dk/alexandra/fresco/framework/network/socket/SocketNetwork.java
focal_class.identifier: SocketNetwork
focal_class.interfaces: implements CloseableNetwork
focal_class.class_method_signature: SocketNetwork.SocketNetwork(NetworkConfiguration conf, Map<Integer, Socket> socketMap)
focal_class.full_signature: public  SocketNetwork(NetworkConfiguration conf, Map<Integer, Socket> socketMap)
focal_class.identifier: SocketNetwork
focal_class.modifiers: public
focal_class.parameters: (NetworkConfiguration conf, Map<Integer, Socket> socketMap)
focal_class.signature:  SocketNetwork(NetworkConfiguration conf, Map<Integer, Socket> socketMap)
focal_class.class_method_signature: SocketNetwork.SocketNetwork(NetworkConfiguration conf)
focal_class.full_signature: public  SocketNetwork(NetworkConfiguration conf)
focal_class.identifier: SocketNetwork
focal_class.modifiers: public
focal_class.parameters: (NetworkConfiguration conf)
focal_class.signature:  SocketNetwork(NetworkConfiguration conf)
focal_class.class_method_signature: SocketNetwork.startCommunication(Map<Integer, Socket> sockets)
focal_class.full_signature: private void startCommunication(Map<Integer, Socket> sockets)
focal_class.identifier: startCommunication
focal_class.modifiers: private
focal_class.parameters: (Map<Integer, Socket> sockets)
focal_class.return: void
focal_class.signature: void startCommunication(Map<Integer, Socket> sockets)
focal_class.class_method_signature: SocketNetwork.send(int partyId, byte[] data)
focal_class.full_signature: @Override public void send(int partyId, byte[] data)
focal_class.identifier: send
focal_class.modifiers: @Override public
focal_class.parameters: (int partyId, byte[] data)
focal_class.return: void
focal_class.signature: void send(int partyId, byte[] data)
focal_class.class_method_signature: SocketNetwork.receive(final int partyId)
focal_class.full_signature: @Override public byte[] receive(final int partyId)
focal_class.identifier: receive
focal_class.modifiers: @Override public
focal_class.parameters: (final int partyId)
focal_class.return: byte[]
focal_class.signature: byte[] receive(final int partyId)
focal_class.class_method_signature: SocketNetwork.inRange(final int partyId)
focal_class.full_signature: private void inRange(final int partyId)
focal_class.identifier: inRange
focal_class.modifiers: private
focal_class.parameters: (final int partyId)
focal_class.return: void
focal_class.signature: void inRange(final int partyId)
focal_class.class_method_signature: SocketNetwork.closeCommunication()
focal_class.full_signature: private void closeCommunication()
focal_class.identifier: closeCommunication
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void closeCommunication()
focal_class.class_method_signature: SocketNetwork.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: SocketNetwork.getNoOfParties()
focal_class.full_signature: @Override public int getNoOfParties()
focal_class.identifier: getNoOfParties
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNoOfParties()
focal_method.body: @Override
    public void send(int partyId, byte[] data) {
      if (partyId == conf.getMyId()) {
        this.selfQueue.add(data);
      } else {
        inRange(partyId);
        if (!senders.get(partyId).isRunning()) {
          throw new RuntimeException(
              "P" + conf.getMyId() + ": Unable to send to P" + partyId + ". Sender not running");
        }
        this.senders.get(partyId).queueMessage(data);
      }
    }
focal_method.class_method_signature: SocketNetwork.send(int partyId, byte[] data)
focal_method.full_signature: @Override public void send(int partyId, byte[] data)
focal_method.identifier: send
focal_method.invocations: getMyId add inRange isRunning get getMyId queueMessage get
focal_method.modifiers: @Override public
focal_method.parameters: (int partyId, byte[] data)
focal_method.return: void
focal_method.signature: void send(int partyId, byte[] data)