congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SensorInstrumentationPoint.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
rocks.inspectit.shared.all.instrumentation.config.impl.SensorInstrumentationPoint

Best Java code snippets using rocks.inspectit.shared.all.instrumentation.config.impl.SensorInstrumentationPoint.getId (Showing top 20 results out of 315)

origin: inspectIT/inspectIT

  @Override
  public MethodVisitor answer(InvocationOnMock invocation) throws Throwable {
    Object[] arguments = invocation.getArguments();
    SensorInstrumentationPoint sip = (SensorInstrumentationPoint) arguments[0];
    return getMethodInstrumenter((MethodVisitor) arguments[1], (Integer) arguments[2], (String) arguments[3], (String) arguments[4], sip.getId(), (Boolean) arguments[5]);
  }
};
origin: inspectIT/inspectIT

  @Override
  public MethodVisitor answer(InvocationOnMock invocation) throws Throwable {
    Object[] arguments = invocation.getArguments();
    SensorInstrumentationPoint sip = (SensorInstrumentationPoint) arguments[0];
    return getConstructorInstrumenter((MethodVisitor) arguments[1], (Integer) arguments[2], (String) arguments[3], (String) arguments[4], sip.getId(), (Boolean) arguments[5]);
  }
};
origin: inspectIT/inspectIT

@Test
public void constructorEnchancedExceptionSensor() {
  long id = 7L;
  String name = "method";
  String desc = "()V";
  boolean enhancedExceptionSensor = true;
  when(sensorInstrumentationPoint.isConstructor()).thenReturn(true);
  when(sensorInstrumentationPoint.getId()).thenReturn(id);
  MethodVisitor methodVisitor = factory.getMethodVisitor(sensorInstrumentationPoint, superMethodVisitor, 0, name, desc, enhancedExceptionSensor);
  assertThat(methodVisitor, is(instanceOf(ConstructorInstrumenter.class)));
  ConstructorInstrumenter methodInstrumenter = (ConstructorInstrumenter) methodVisitor;
  assertThat(methodInstrumenter.getMethodId(), is(id));
  assertThat(methodInstrumenter.isEnhancedExceptionSensor(), is(enhancedExceptionSensor));
}
origin: inspectIT/inspectIT

@Test
public void method() {
  long id = 7L;
  String name = "method";
  String desc = "()V";
  boolean enhancedExceptionSensor = false;
  when(sensorInstrumentationPoint.isConstructor()).thenReturn(false);
  when(sensorInstrumentationPoint.getId()).thenReturn(id);
  MethodVisitor methodVisitor = factory.getMethodVisitor(sensorInstrumentationPoint, superMethodVisitor, 0, name, desc, enhancedExceptionSensor);
  assertThat(methodVisitor, is(instanceOf(MethodInstrumenter.class)));
  MethodInstrumenter methodInstrumenter = (MethodInstrumenter) methodVisitor;
  assertThat(methodInstrumenter.getMethodId(), is(id));
  assertThat(methodInstrumenter.isEnhancedExceptionSensor(), is(enhancedExceptionSensor));
}
origin: inspectIT/inspectIT

@Test
public void methodEnchancedExceptionSensor() {
  long id = 7L;
  String name = "method";
  String desc = "()V";
  boolean enhancedExceptionSensor = true;
  when(sensorInstrumentationPoint.isConstructor()).thenReturn(false);
  when(sensorInstrumentationPoint.getId()).thenReturn(id);
  MethodVisitor methodVisitor = factory.getMethodVisitor(sensorInstrumentationPoint, superMethodVisitor, 0, name, desc, enhancedExceptionSensor);
  assertThat(methodVisitor, is(instanceOf(MethodInstrumenter.class)));
  MethodInstrumenter methodInstrumenter = (MethodInstrumenter) methodVisitor;
  assertThat(methodInstrumenter.getMethodId(), is(id));
  assertThat(methodInstrumenter.isEnhancedExceptionSensor(), is(enhancedExceptionSensor));
}
origin: inspectIT/inspectIT

@Test
public void constructor() {
  long id = 7L;
  String name = "method";
  String desc = "()V";
  boolean enhancedExceptionSensor = false;
  when(sensorInstrumentationPoint.isConstructor()).thenReturn(true);
  when(sensorInstrumentationPoint.getId()).thenReturn(id);
  MethodVisitor methodVisitor = factory.getMethodVisitor(sensorInstrumentationPoint, superMethodVisitor, 0, name, desc, enhancedExceptionSensor);
  assertThat(methodVisitor, is(instanceOf(ConstructorInstrumenter.class)));
  ConstructorInstrumenter methodInstrumenter = (ConstructorInstrumenter) methodVisitor;
  assertThat(methodInstrumenter.getMethodId(), is(id));
  assertThat(methodInstrumenter.isEnhancedExceptionSensor(), is(enhancedExceptionSensor));
}
origin: inspectIT/inspectIT

@Test
public void exceptionThrowerIsInstrumentedWhenConstructor() throws Exception {
  Object[] params = { "test" };
  long constructorId = 11L;
  when(sip.getId()).thenReturn(constructorId);
  prepareConfigurationMockConstructor(config, InstrumentationExceptionTestClass.class, false, String.class);
  doAnswer(CONSTRUCTOR_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(EXCEPTION_TEST_CLASS_FQN);
  prepareWriter(cr, null, true, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  Class<?> clazz = createClass(EXCEPTION_TEST_CLASS_FQN, b);
  Constructor<?> constructor = clazz.getConstructor(new Class[] { String.class });
  Object instance = constructor.newInstance(params);
  verify(hookDispatcher).dispatchConstructorBeforeBody(constructorId, params);
  verify(hookDispatcher).dispatchConstructorAfterBody(constructorId, instance, params);
  ArgumentCaptor<Object> captor = ArgumentCaptor.forClass(Object.class);
  verify(hookDispatcher).dispatchConstructorBeforeCatch(eq(constructorId), captor.capture());
  assertThat(captor.getValue().getClass().getName(), is(equalTo(MyTestException.class.getName())));
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void constructorNullParameter() throws Exception {
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockConstructor(config, InstrumentationTestClass.class, false);
  doAnswer(CONSTRUCTOR_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // create instance
  Object instance = this.createInstance(TEST_CLASS_FQN, b);
  verify(hookDispatcher).dispatchConstructorBeforeBody(methodId, new Object[0]);
  verify(hookDispatcher).dispatchConstructorAfterBody(methodId, instance, new Object[0]);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void staticConstructor() throws Exception {
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockConstructor(config, InstrumentationTestClass.class, true);
  doAnswer(CONSTRUCTOR_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // create instance
  this.createInstance(TEST_CLASS_FQN, b);
  verify(hookDispatcher).dispatchConstructorBeforeBody(methodId, new Object[0]);
  verify(hookDispatcher).dispatchConstructorAfterBody(methodId, null, new Object[0]);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void stringNullParameterStatic() throws Exception {
  String methodName = "stringNullParameterStatic";
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, null);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, null, new Object[0]);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, null, new Object[0], "stringNullParameterStatic", false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, null, new Object[0], "stringNullParameterStatic", false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void exceptionHandledResultReturned() throws Exception {
  String methodName = "exceptionHandledResultReturned";
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, null);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, testClass, new Object[0]);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, testClass, new Object[0], 3, false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, testClass, new Object[0], 3, false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void floatNullParameter() throws Exception {
  String methodName = "floatNullParameter";
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, null);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, testClass, new Object[0]);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, testClass, new Object[0], Float.MAX_VALUE, false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, testClass, new Object[0], Float.MAX_VALUE, false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void booleanNullParameter() throws Exception {
  String methodName = "booleanNullParameter";
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, null);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, testClass, new Object[0]);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, testClass, new Object[0], false, false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, testClass, new Object[0], false, false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void charNullParameter() throws Exception {
  String methodName = "charNullParameter";
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, null);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, testClass, new Object[0]);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, testClass, new Object[0], '\u1234', false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, testClass, new Object[0], '\u1234', false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void voidOneParameter() throws Exception {
  String methodName = "voidOneParameter";
  Object[] parameters = { "java.lang.String" };
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName, String.class);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, parameters);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, testClass, parameters);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, testClass, parameters, null, false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, testClass, parameters, null, false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void doubleNullParameter() throws Exception {
  String methodName = "doubleNullParameter";
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, null);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, testClass, new Object[0]);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, testClass, new Object[0], 5.3D, false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, testClass, new Object[0], 5.3D, false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void shortNullParameter() throws Exception {
  String methodName = "shortNullParameter";
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, null);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, testClass, new Object[0]);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, testClass, new Object[0], (short) 16345, false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, testClass, new Object[0], (short) 16345, false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void intArrayNullParameter() throws Exception {
  String methodName = "intArrayNullParameter";
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, null);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, testClass, new Object[0]);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, testClass, new Object[0], new int[] { 1, 2, 3 }, false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, testClass, new Object[0], new int[] { 1, 2, 3 }, false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void stringArrayNullParameter() throws Exception {
  String methodName = "stringArrayNullParameter";
  long methodId = 9L;
  when(sip.getId()).thenReturn(methodId);
  prepareConfigurationMockMethod(config, InstrumentationTestClass.class, methodName);
  doAnswer(METHOD_INSTRUMENTER_ANSWER).when(instrumenterFactory).getMethodVisitor(eq(sip), Matchers.<MethodVisitor> any(), anyInt(), anyString(), anyString(), anyBoolean());
  when(config.getAllInstrumentationPoints()).thenReturn(Collections.<IMethodInstrumentationPoint> singleton(sip));
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(true));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  this.callMethod(testClass, methodName, null);
  verify(hookDispatcher).dispatchMethodBeforeBody(methodId, testClass, new Object[0]);
  verify(hookDispatcher).dispatchFirstMethodAfterBody(methodId, testClass, new Object[0], new String[] { "test123", "bla" }, false);
  verify(hookDispatcher).dispatchSecondMethodAfterBody(methodId, testClass, new Object[0], new String[] { "test123", "bla" }, false);
  verifyNoMoreInteractions(hookDispatcher);
}
origin: inspectIT/inspectIT

@Test
public void noInstrumenatation() throws Exception {
  String methodName = "stringNullParameter";
  long methodId = 3L;
  when(sip.getId()).thenReturn(methodId);
  when(config.getTargetMethodName()).thenReturn("nonExistingMethod");
  ClassReader cr = new ClassReader(TEST_CLASS_FQN);
  prepareWriter(cr, null, false, config);
  cr.accept(classInstrumenter, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG);
  assertThat(classInstrumenter.isByteCodeAdded(), is(false));
  byte b[] = classWriter.toByteArray();
  // now call this method
  Object testClass = this.createInstance(TEST_CLASS_FQN, b);
  // call this method via reflection as we would get a class cast
  // exception by casting to the concrete class.
  this.callMethod(testClass, methodName, null);
  verifyZeroInteractions(hookDispatcher);
}
rocks.inspectit.shared.all.instrumentation.config.implSensorInstrumentationPointgetId

Popular methods of SensorInstrumentationPoint

  • getSensorIds
  • getPropertyAccessorList
  • getSettings
  • isConstructor
    Gets #constructor.
  • isStartsInvocation
  • addSensorId
    Adds sensor Id if one does not exists already and properly sorts the id in the #sensorIds array base
  • containsSensorId
    If sensor if is contained in this SensorInstrumentationPoint.
  • <init>
  • addPropertyAccessor
    Adds one PropertyPathStart to the list of the property acc list.
  • addSettings
    Adds all given settings to the settings map.
  • isPropertyAccess
  • setConstructor
    Sets #constructor.
  • isPropertyAccess,
  • setConstructor,
  • setId,
  • setStartsInvocation

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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