RequestManager { public RequestManager() { requestProcessors = new ArrayList<RequestProcessor>(); } RequestManager(); long getRequestTimeout(); void setRequestTimeout(long requestTimeout); RequestManager withRequestTimeout(long timeout); long getTimeoutCheckInterval(); void setTimeoutCheckInterval(long timeoutCheckInterval); void start(); void requestStarting(Request request); void requestFinished(Request request); RequestManager withRequestProcessor(RequestProcessor processor); RequestManager withResultsProcessor(ResultsProcessor processor); void shutdown(); Status awaitTermination(long timeout); List<RequestProcessor> getRequestProcessors();  }
@Test public void testRequestManager() { RequestManager requestManager=initRequestManager(0,5000); TestProcessingThread testThread=new TestProcessingThread(5); Request testRequest=new Request(); testRequest.setThreadId(testThread.getId()); testThread.start(); requestManager.requestStarting(testRequest); try { testThread.join(); } catch (InterruptedException ex) { ex.printStackTrace(); } requestManager.requestFinished(testRequest); requestManager.shutdown(); requestManager.awaitTermination(30000); File resultsFile=new File("target/test-output/"+testRequest.getId()+"/request-sampling.nps"); assertTrue(resultsFile.exists()); }