Esempio n. 1
0
  @Test
  public void testWriteExecutionData() throws Exception {
    data.getExecutionData(Long.valueOf(0x12345678), "Foo", 42);
    data.setSessionId("stubid");

    final Socket socket = serverSocket.connect();
    final RemoteControlWriter remoteWriter = new RemoteControlWriter(socket.getOutputStream());
    final RemoteControlReader remoteReader = new RemoteControlReader(socket.getInputStream());

    // First process a NOP command to ensure the connection is initialized:
    remoteWriter.visitDumpCommand(false, false);
    remoteReader.read();

    // Now the actual test starts:
    controller.writeExecutionData(false);

    final ExecutionDataStore execStore = new ExecutionDataStore();
    remoteReader.setExecutionDataVisitor(execStore);
    final SessionInfoStore infoStore = new SessionInfoStore();
    remoteReader.setSessionInfoVisitor(infoStore);
    remoteReader.read();

    assertEquals("Foo", execStore.get(0x12345678).getName());

    final List<SessionInfo> infos = infoStore.getInfos();
    assertEquals(1, infos.size());
    assertEquals("stubid", infos.get(0).getId());

    logger.assertNoException();
    controller.shutdown();
  }
 public void visitClassExecution(ExecutionData data) {
   executionDataStore.put(data);
   merged.put(defensiveCopy(data));
 }
Esempio n. 3
0
 /**
  * Subtracts all probes in the given execution data store from this store.
  *
  * @param store execution data store to subtract
  * @see #subtract(ExecutionData)
  */
 public void subtract(final ExecutionDataStore store) {
   for (final ExecutionData data : store.getContents()) {
     subtract(data);
   }
 }