Tabnine Logo
IllegalArgumentException.getSuppressed
Code IndexAdd Tabnine to your IDE (free)

How to use
getSuppressed
method
in
java.lang.IllegalArgumentException

Best Java code snippets using java.lang.IllegalArgumentException.getSuppressed (Showing top 9 results out of 315)

origin: reactor/reactor-core

@Test
public void afterTerminateCallbackErrorAndErrorCallbackError() {
  IllegalStateException err = new IllegalStateException("expected afterTerminate");
  IllegalArgumentException err2 = new IllegalArgumentException("error");
  FluxPeekFuseable<String> flux = new FluxPeekFuseable<>(
      Flux.empty(), null, null, e -> { throw err2; },
      null,
      () -> { throw err; }, null, null);
  AssertSubscriber<String> ts = AssertSubscriber.create();
  try {
    flux.subscribe(ts);
    fail("expected thrown exception");
  }
  catch (Exception e) {
    e.printStackTrace();
    assertSame(e.toString(), err, e.getCause());
    assertEquals(0, err2.getSuppressed().length);
    //err2 is never thrown
  }
  ts.assertNoValues();
  ts.assertComplete();
}
origin: reactor/reactor-core

@Test
public void afterTerminateCallbackErrorAndErrorCallbackError() {
  IllegalStateException err = new IllegalStateException("afterTerminate");
  IllegalArgumentException err2 = new IllegalArgumentException("error");
  FluxPeek<String> flux = new FluxPeek<>(Flux.empty(), null, null, e -> {
    throw err2;
  }, null, () -> {
    throw err;
  }, null, null);
  AssertSubscriber<String> ts = AssertSubscriber.create();
  try {
    flux.subscribe(ts);
    fail("expected thrown exception");
  }
  catch (Exception e) {
    assertSame(err, e.getCause());
    assertEquals(0, err2.getSuppressed().length);
    //err2 is never thrown
  }
  ts.assertNoValues();
  ts.assertComplete();
}
origin: reactor/reactor-core

@Test
public void afterTerminateCallbackErrorAndErrorCallbackError2() {
  IllegalStateException afterTerminate = new IllegalStateException("afterTerminate");
  IllegalArgumentException error = new IllegalArgumentException("error");
  NullPointerException err = new NullPointerException();
  FluxPeekFuseable<String> flux = new FluxPeekFuseable<>(
      Flux.error(err),
      null, null,
      e -> { throw error; }, null, () -> { throw afterTerminate; },
      null, null);
  AssertSubscriber<String> ts = AssertSubscriber.create();
  try {
    flux.subscribe(ts);
    fail("expected thrown exception");
  }
  catch (Exception e) {
    assertSame(afterTerminate, e.getCause());
    //afterTerminate suppressed error which itself suppressed original err
    assertEquals(1, afterTerminate.getSuppressed().length);
    assertEquals(error, afterTerminate.getSuppressed()[0]);
    assertEquals(1, error.getSuppressed().length);
    assertEquals(err, error.getSuppressed()[0]);
  }
  ts.assertNoValues();
  //the subscriber still sees the 'error' message since actual.onError is called before the afterTerminate callback
  ts.assertErrorMessage("error");
}
origin: reactor/reactor-core

@Test
public void afterTerminateCallbackErrorAndErrorCallbackError2() {
  IllegalStateException afterTerminate =
      new IllegalStateException("afterTerminate");
  IllegalArgumentException error = new IllegalArgumentException("error");
  NullPointerException err = new NullPointerException();
  FluxPeek<String> flux = new FluxPeek<>(Flux.error(err), null, null, e -> {
    throw error;
  }, null, () -> {
    throw afterTerminate;
  }, null, null);
  AssertSubscriber<String> ts = AssertSubscriber.create();
  try {
    flux.subscribe(ts);
    fail("expected thrown exception");
  }
  catch (Exception e) {
    assertSame(afterTerminate, e.getCause());
    //afterTerminate suppressed error which itself suppressed original err
    assertEquals(1, afterTerminate.getSuppressed().length);
    assertEquals(error, afterTerminate.getSuppressed()[0]);
    assertEquals(1, error.getSuppressed().length);
    assertEquals(err, error.getSuppressed()[0]);
  }
  ts.assertNoValues();
  //the subscriber still sees the 'error' message since actual.onError is called before the afterTerminate callback
  ts.assertErrorMessage("error");
}
origin: org.elasticsearch/elasticsearch

} catch (IllegalArgumentException iae) {
  validationErrors.add(iae.getMessage());
  for (Throwable t : iae.getSuppressed()) {
    validationErrors.add(t.getMessage());
origin: palatable/lambda

@Test
public void exceptionThrownInEnsuringBlockIsCaught() {
  IllegalStateException expected = new IllegalStateException();
  assertEquals(Try.failure(expected), Try.success(1).ensuring(() -> {throw expected;}));
  Either<IllegalArgumentException, Object> actual = Try.failure(new IllegalArgumentException())
      .ensuring(() -> { throw expected;})
      .toEither();
  assertThat(actual, isLeftThat(instanceOf(IllegalArgumentException.class)));
  assertEquals(left(expected), actual.biMapL(t -> t.getSuppressed()[0]));
}
origin: com.strapdata.elasticsearch/elasticsearch

} catch (IllegalArgumentException iae) {
  validationErrors.add(iae.getMessage());
  for (Throwable t : iae.getSuppressed()) {
    validationErrors.add(t.getMessage());
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

} catch (IllegalArgumentException iae) {
  validationErrors.add(iae.getMessage());
  for (Throwable t : iae.getSuppressed()) {
    validationErrors.add(t.getMessage());
origin: apache/servicemix-bundles

} catch (IllegalArgumentException iae) {
  validationErrors.add(iae.getMessage());
  for (Throwable t : iae.getSuppressed()) {
    validationErrors.add(t.getMessage());
java.langIllegalArgumentExceptiongetSuppressed

Popular methods of IllegalArgumentException

  • <init>
    Constructs a new exception with the specified cause and a detail message of (cause==null ? null : c
  • getMessage
  • printStackTrace
  • initCause
  • toString
  • getLocalizedMessage
  • getStackTrace
  • setStackTrace
  • getCause
  • addSuppressed
  • fillInStackTrace
  • fillInStackTrace

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Path (java.nio.file)
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Collectors (java.util.stream)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top PhpStorm 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