コード例 #1
0
 @Test
 @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 0, concurrency = 1)
 public void startWithException() throws Exception {
   // 多次,會中斷
   testRunner.start();
   ThreadHelper.sleep(3000L);
   //
   testRunner.start();
   ThreadHelper.sleep(3000L);
 }
コード例 #2
0
 @Test
 @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 0, concurrency = 1)
 public void start() throws Exception {
   ExecutorService executorService = Executors.newFixedThreadPool(2);
   //
   TestRunner runner = new TestRunner(executorService);
   runner.start();
   //
   runner = new TestRunner(executorService);
   runner.start();
   ThreadHelper.sleep(10 * 1000L);
 }
コード例 #3
0
 @Test
 @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 0, concurrency = 1)
 public void restart() throws Exception {
   testRunner.start();
   ThreadHelper.sleep(3000L);
   //
   testRunner.shutdown();
   ThreadHelper.sleep(3000L);
   //
   testRunner.start();
   ThreadHelper.sleep(3000L);
 }