Tabnine Logo
ReactiveAuditException
Code IndexAdd Tabnine to your IDE (free)

How to use
ReactiveAuditException
in
com.octo.reactive.audit.lib

Best Java code snippets using com.octo.reactive.audit.lib.ReactiveAuditException (Showing top 12 results out of 315)

origin: octo-online/reactive-audit

final StackTraceElement[] stack = getStackTrace();
int pos = 0;
for (final StackTraceElement traceElement : stack)
setStackTrace(newStack);
final StackTraceElement[] stack = getStackTrace();
final int newSize = Math.min(stack.length, LIMIT_STACK_SIZE_IF_DEBUG);
final StackTraceElement[] newStack = new StackTraceElement[newSize];
System.arraycopy(stack, 0, newStack, 0, newSize);
setStackTrace(newStack);
origin: octo-online/reactive-audit

/**
 * Create an {@link AssertionError} with {@link Latency}, thread name and message.
 *
 * @param latency The latency for this exception.
 * @param message The message associated with this exception.
 */
protected ReactiveAuditException(Latency latency, String message)
{
  super(message);
  this.threadName = Thread.currentThread().getName();
  this.latency = latency;
  updateStackTraceElements();
}
origin: octo-online/reactive-audit

  baseLatency = latencyCPU;
if (baseLatency == null) return;
if (e.getLatency().ordinal() < baseLatency.ordinal())
  return;
if (!history.isAlreadyLogged(e.getStackTrace()))
  logger.log(level, e.getMessage(), e);
origin: octo-online/reactive-audit

  @SuppressWarnings("PointlessBooleanExpression")
  @Test
  public void testPurgeStackTrace()
      throws NoSuchFieldException, IllegalAccessException
  {
    // If debug mode, test nothing
    Field field = ReactiveAuditException.class.getDeclaredField("debug");
    field.setAccessible(true);
    if (((Boolean) field.get(null)) == true) return;
    TestTools.strict.commit();

    try
    {
      latencyCall1();
      fail();
    }
    catch (ReactiveAuditException e)
    {
      StackTraceElement[] stack = e.getStackTrace();
      for (StackTraceElement traceElement : stack)
      {
        assertFalse((traceElement.getClassName().startsWith(auditPackageName)
                   && !traceElement.getClassName().endsWith("Test"))); // For inner unit test
      }
    }
  }
}
origin: octo-online/reactive-audit

@Test(expected = ReactiveAuditException.class)
public void invokeWithLatencyMedium()
{
  TestTools.strict.commit();
  class Test
  {
    @WithLatency(Latency.MEDIUM)
    public void directCall()
    {
      fail();
    }
  }
  try
  {
    new Test().directCall();
  }
  catch (ReactiveAuditException e)
  {
    assertEquals(MEDIUM, e.getLatency());
    throw e;
  }
}
origin: octo-online/reactive-audit

@Test(expected = ReactiveAuditException.class)
public void invokeWithLatencyLow()
{
  TestTools.strict.commit();
  class Test
  {
    @WithLatency(LOW)
    public void directCall()
    {
      fail();
    }
  }
  try
  {
    new Test().directCall();
  }
  catch (ReactiveAuditException e)
  {
    assertEquals(LOW, e.getLatency());
    throw e;
  }
}
origin: com.octo.reactive.audit/reactive-audit-lib

final StackTraceElement[] stack = getStackTrace();
int pos = 0;
for (final StackTraceElement traceElement : stack)
setStackTrace(newStack);
final StackTraceElement[] stack = getStackTrace();
final int newSize = Math.min(stack.length, LIMIT_STACK_SIZE_IF_DEBUG);
final StackTraceElement[] newStack = new StackTraceElement[newSize];
System.arraycopy(stack, 0, newStack, 0, newSize);
setStackTrace(newStack);
origin: com.octo.reactive.audit/reactive-audit-lib

/**
 * Create an {@link AssertionError} with {@link Latency}, thread name and message.
 *
 * @param latency The latency for this exception.
 * @param message The message associated with this exception.
 */
protected ReactiveAuditException(Latency latency, String message)
{
  super(message);
  this.threadName = Thread.currentThread().getName();
  this.latency = latency;
  updateStackTraceElements();
}
origin: octo-online/reactive-audit

  @Test(expected = ReactiveAuditException.class)
  public void invokeWithLatencyHigh()
  {
    TestTools.strict.commit();
    class Test
    {
      @WithLatency(Latency.HIGH)
      public void directCall()
      {
        fail();
      }
    }
    try
    {
      new Test().directCall();
    }
    catch (ReactiveAuditException e)
    {
      assertEquals(HIGH, e.getLatency());
      throw e;
    }
  }
}
origin: octo-online/reactive-audit

/**
 * Create an {@link AssertionError} with {@link Latency}, thread name and formatted message.
 *
 * @param latency The latency for this exception.
 * @param format  The format message associated with this exception.
 * @param args    The arguments to generate the message with the format.
 */
protected ReactiveAuditException(Latency latency, String format, Object... args)
{
  super(String.format(format, args));
  this.threadName = Thread.currentThread().getName();
  updateStackTraceElements();
}
origin: octo-online/reactive-audit

  @Test(expected = ReactiveAuditException.class)
  public void invokeWithLatencyHigh()
  {
    TestTools.strict.commit();
    class Test
    {
      @WithLatency(Latency.HIGH)
      public void directCall()
      {
        fail();
      }
    }
    try
    {
      new Test().directCall();
    }
    catch (ReactiveAuditException e)
    {
      assertEquals(HIGH, e.getLatency());
      throw e;
    }
  }
}
origin: com.octo.reactive.audit/reactive-audit-lib

/**
 * Create an {@link AssertionError} with {@link Latency}, thread name and formatted message.
 *
 * @param latency The latency for this exception.
 * @param format  The format message associated with this exception.
 * @param args    The arguments to generate the message with the format.
 */
protected ReactiveAuditException(Latency latency, String format, Object... args)
{
  super(String.format(format, args));
  this.threadName = Thread.currentThread().getName();
  updateStackTraceElements();
}
com.octo.reactive.audit.libReactiveAuditException

Javadoc

Exception thrown by the JVM agent if a blocking API is used. This exception is thrown only if the reactiveAudit_throwExceptions parameter is set to true.

Most used methods

  • getStackTrace
  • getLatency
  • setStackTrace
  • updateStackTraceElements
    If not debug, remove all the audit layout in the stack trace.
  • getMessage

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • setScale (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JPanel (javax.swing)
  • Top Sublime Text 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