static void sleep(int millis) { try { Thread.sleep(millis); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } }
protected void captureMaxThreads() { int concurrentThreads = threadsRunning.get(); int maxThreads = maxConcurrentThreads.get(); if (concurrentThreads > maxThreads) { maxConcurrentThreads.compareAndSet(maxThreads, concurrentThreads); if (concurrentThreads > 1) { new RuntimeException("should not be greater than 1").printStackTrace(); } } }
@Override public void run() { try (Socket socket = new Socket(InetAddress.getLocalHost(), serverPort)) { OutputStream outputStream = socket.getOutputStream(); PrintWriter writer = new PrintWriter(outputStream); sendLogRequests(writer, socket.getInputStream()); } catch (IOException e) { LOGGER.error("error sending requests", e); throw new RuntimeException(e); } }
protected void captureMaxThreads() { int concurrentThreads = threadsRunning.get(); int maxThreads = maxConcurrentThreads.get(); if (concurrentThreads > maxThreads) { maxConcurrentThreads.compareAndSet(maxThreads, concurrentThreads); if (concurrentThreads > 1) { new RuntimeException("should not be greater than 1").printStackTrace(); } } }
@Override public SingleSource<Integer> apply(final Integer integer) throws Exception { throw new RuntimeException("something went terribly wrong!"); } })
@Override public Flowable<Integer> apply(Integer t1) { throw new RuntimeException("Forced failure"); } };
@Override public Integer apply(Integer t1, Integer t2) { throw new RuntimeException("Forced failure"); } };
@Override public Observable<Integer> apply(Integer t1) { throw new RuntimeException("Forced failure"); } };
@Override public Flowable<Integer> apply(Integer t1) { throw new RuntimeException("Forced failure"); } };
@Override public T apply(Integer t1) { throw new RuntimeException("Forced failure"); } };
@Override public Long apply(Long value) { if (value == 1L) { throw new RuntimeException("error!"); } return value; } });
@Override public Throwable call() { return new RuntimeException(); } });
@Override public R apply(T t1) { throw new RuntimeException("Forced failure"); } };
@Override public void run() { throw new RuntimeException("failed on second one too"); } }));
@Override public Map<Integer, String> call() { throw new RuntimeException("Forced failure"); } };
@Override public void accept(Long n) { throw new RuntimeException(); } };
@Override public void onError(Throwable e) { throw new RuntimeException(e); } };
@Override public void accept(Throwable e) { if (++calls == 3) { throw new RuntimeException(); } } });
@Override public String apply(String v1, String v2) { throw new RuntimeException("I don't work."); } });
@Override public void onNext(Long args) { throw new RuntimeException("forced failure"); } };