Tabnine Logo
RuntimeException.toString
Code IndexAdd Tabnine to your IDE (free)

How to use
toString
method
in
java.lang.RuntimeException

Best Java code snippets using java.lang.RuntimeException.toString (Showing top 20 results out of 3,213)

origin: jenkinsci/jenkins

  @Override
  public String toString() {
    return super.toString()+" "+errors;
  }
}
origin: facebook/stetho

 @Override
 public Object evaluate(String expression) throws Exception {
  if (mRhinoJsUnexpectedError != null) {
   return "stetho-js-rhino threw: " + mRhinoJsUnexpectedError.toString();
  } else {
   return "Not supported without stetho-js-rhino dependency";
  }
 }
};
origin: ReactiveX/RxJava

@Test
public void interrupted() {
  Iterator<Object> it = Flowable.never().blockingLatest().iterator();
  Thread.currentThread().interrupt();
  try {
    it.hasNext();
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
  Thread.interrupted();
}
origin: ReactiveX/RxJava

@Test
public void interrupted() {
  Iterator<Object> it = Observable.never().blockingLatest().iterator();
  Thread.currentThread().interrupt();
  try {
    it.hasNext();
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
  Thread.interrupted();
}
origin: ReactiveX/RxJava

@Test
public void interruptTestWaitStrategy() {
  try {
    Thread.currentThread().interrupt();
    TestWaitStrategy.SLEEP_1000MS.run();
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
}
origin: ReactiveX/RxJava

@Test
public void interrupt() {
  Iterator<Object> it = Observable.never().blockingNext().iterator();
  try {
    Thread.currentThread().interrupt();
    it.next();
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
}
origin: ReactiveX/RxJava

@Test
public void interrupt() {
  Iterator<Object> it = Flowable.never().blockingNext().iterator();
  try {
    Thread.currentThread().interrupt();
    it.next();
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
}
origin: ReactiveX/RxJava

@Test
public void interruptWait() {
  BlockingFlowableIterator<Integer> it = new BlockingFlowableIterator<Integer>(128);
  try {
    Thread.currentThread().interrupt();
    it.hasNext();
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
}
origin: ReactiveX/RxJava

@Test
public void awaitDoneTimed() {
  TestObserver<Integer> to = new TestObserver<Integer>();
  Thread.currentThread().interrupt();
  try {
    to.awaitDone(5, TimeUnit.SECONDS);
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
}
origin: ReactiveX/RxJava

@Test
public void interruptWait() {
  BlockingObservableIterator<Integer> it = new BlockingObservableIterator<Integer>(128);
  try {
    Thread.currentThread().interrupt();
    it.hasNext();
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
}
origin: ReactiveX/RxJava

@Test
public void awaitDoneTimed() {
  TestSubscriber<Integer> ts = new TestSubscriber<Integer>();
  Thread.currentThread().interrupt();
  try {
    ts.awaitDone(5, TimeUnit.SECONDS);
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
}
origin: apache/zookeeper

public static List<HostPort> parseHostPortList(String hplist) {
  ArrayList<HostPort> alist = new ArrayList<HostPort>();
  for (String hp: hplist.split(",")) {
    int idx = hp.lastIndexOf(':');
    String host = hp.substring(0, idx);
    int port;
    try {
      port = Integer.parseInt(hp.substring(idx + 1));
    } catch(RuntimeException e) {
      throw new RuntimeException("Problem parsing " + hp + e.toString());
    }
    alist.add(new HostPort(host,port));
  }
  return alist;
}
origin: ReactiveX/RxJava

@Test(timeout = 5000)
public void blockingFirstTimeout() {
  BlockingFirstSubscriber<Integer> bf = new BlockingFirstSubscriber<Integer>();
  Thread.currentThread().interrupt();
  try {
    bf.blockingGet();
    fail("Should have thrown!");
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
}
origin: checkstyle/checkstyle

void method2(int i) {
  i++;
  this.i = i;
  method1();
  try {
    this.method1();
  }
  catch (RuntimeException e) {
    e.toString();
  }
  this.i--;
  Integer.toString(10);
}
origin: ReactiveX/RxJava

@Test(timeout = 5000)
public void blockingFirstTimeout2() {
  BlockingFirstSubscriber<Integer> bf = new BlockingFirstSubscriber<Integer>();
  bf.onSubscribe(new BooleanSubscription());
  Thread.currentThread().interrupt();
  try {
    bf.blockingGet();
    fail("Should have thrown!");
  } catch (RuntimeException ex) {
    assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
  }
}
origin: ReactiveX/RxJava

@Test
public void manualPropagate() {
  try {
    Exceptions.propagate(new InternalError());
    fail("Didn't throw exception");
  } catch (InternalError ex) {
    // expected
  }
  try {
    throw Exceptions.propagate(new IllegalArgumentException());
  } catch (IllegalArgumentException ex) {
    // expected
  }
  try {
    throw ExceptionHelper.wrapOrThrow(new IOException());
  } catch (RuntimeException ex) {
    if (!(ex.getCause() instanceof IOException)) {
      fail(ex.toString() + ": should have thrown RuntimeException(IOException)");
    }
  }
}
origin: ReactiveX/RxJava

} catch (RuntimeException ex) {
  if (!(ex.getCause() instanceof IOException)) {
    fail(ex.toString() + ": Should have cause of IOException");
origin: ReactiveX/RxJava

@Test
public void disposeThrowsCheckedException() {
  CompositeDisposable cd = new CompositeDisposable();
  cd.add(Disposables.fromAction(new Action() {
    @Override
    public void run() throws Exception {
      throw new IOException();
    }
  }));
  Disposable d1 = Disposables.empty();
  cd.add(d1);
  try {
    cd.dispose();
    fail("Failed to throw");
  } catch (RuntimeException ex) {
    // expected
    if (!(ex.getCause() instanceof IOException)) {
      fail(ex.toString() + " should have thrown RuntimeException(IOException)");
    }
  }
  assertTrue(d1.isDisposed());
}
origin: ReactiveX/RxJava

  fail("Should have thrown");
} catch (RuntimeException ex) {
  assertTrue(ex.toString(), ex.getCause() instanceof InterruptedException);
origin: ReactiveX/RxJava

fail(ex.toString() + " should have thrown RuntimeException(IOException)");
java.langRuntimeExceptiontoString

Popular methods of RuntimeException

  • <init>
  • getMessage
  • printStackTrace
  • getCause
  • getStackTrace
  • initCause
  • setStackTrace
  • getLocalizedMessage
  • fillInStackTrace
  • addSuppressed
  • getSuppressed
  • getSuppressed

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • putExtra (Intent)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now