Search in sources :

Example 6 with ClassInternalNameMatcherOperand

use of com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand in project pinpoint by naver.

the class DefaultClassBasedMatcherTest method getMatcherOperandWithClassName.

@Test
public void getMatcherOperandWithClassName() {
    DefaultClassBasedMatcher matcher = new DefaultClassBasedMatcher("java.lang.String");
    assertEquals("java.lang.String", matcher.getBaseClassName());
    MatcherOperand operand = matcher.getMatcherOperand();
    assertTrue(operand instanceof ClassInternalNameMatcherOperand);
    ClassInternalNameMatcherOperand classInternalNameMatcherOperand = (ClassInternalNameMatcherOperand) operand;
    assertEquals("java/lang/String", classInternalNameMatcherOperand.getClassInternalName());
}
Also used : MatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.MatcherOperand) ClassInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand) InterfaceInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.InterfaceInternalNameMatcherOperand) ClassInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand) Test(org.junit.Test)

Example 7 with ClassInternalNameMatcherOperand

use of com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand in project pinpoint by naver.

the class DefaultClassBasedMatcherTest method getMatcherOperandWithClassNameAndAdditional.

@Test
public void getMatcherOperandWithClassNameAndAdditional() {
    InterfaceInternalNameMatcherOperand additional = new InterfaceInternalNameMatcherOperand("java/lang/Runnable", false);
    DefaultClassBasedMatcher matcher = new DefaultClassBasedMatcher("java.lang.String", additional);
    assertEquals("java.lang.String", matcher.getBaseClassName());
    MatcherOperand operand = matcher.getMatcherOperand();
    assertTrue(operand instanceof AndMatcherOperator);
    AndMatcherOperator operator = (AndMatcherOperator) operand;
    assertTrue(operator.getLeftOperand() instanceof ClassInternalNameMatcherOperand);
    assertTrue(operator.getRightOperand() instanceof InterfaceInternalNameMatcherOperand);
}
Also used : InterfaceInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.InterfaceInternalNameMatcherOperand) MatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.MatcherOperand) ClassInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand) InterfaceInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.InterfaceInternalNameMatcherOperand) AndMatcherOperator(com.navercorp.pinpoint.bootstrap.instrument.matcher.operator.AndMatcherOperator) ClassInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand) Test(org.junit.Test)

Example 8 with ClassInternalNameMatcherOperand

use of com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand in project pinpoint by naver.

the class AndMatcherOperatorTest method base.

@Test
public void base() throws Exception {
    AndMatcherOperator operator = new AndMatcherOperator(new ClassInternalNameMatcherOperand("java/lang/String"), new InterfaceInternalNameMatcherOperand("java/lang/Serializable", false));
    assertEquals(2, operator.getPrecedence());
    assertTrue(operator.isOperator());
    assertFalse(operator.isIndex());
    assertTrue(operator.getLeftOperand() instanceof ClassInternalNameMatcherOperand);
    assertTrue(operator.getRightOperand() instanceof InterfaceInternalNameMatcherOperand);
    assertEquals(3, operator.getExecutionCost());
}
Also used : InterfaceInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.InterfaceInternalNameMatcherOperand) ClassInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand) Test(org.junit.Test)

Example 9 with ClassInternalNameMatcherOperand

use of com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand in project pinpoint by naver.

the class OrMatcherOperatorTest method base.

@Test
public void base() throws Exception {
    OrMatcherOperator operator = new OrMatcherOperator(new ClassInternalNameMatcherOperand("java/lang/String"), new InterfaceInternalNameMatcherOperand("java/lang/Serializable", false));
    assertEquals(1, operator.getPrecedence());
    assertNotNull(operator.getLeftOperand());
    assertNotNull(operator.getRightOperand());
    assertFalse(operator.isIndex());
    assertTrue(operator.isOperator());
    assertEquals(3, operator.getExecutionCost());
}
Also used : InterfaceInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.InterfaceInternalNameMatcherOperand) ClassInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand) Test(org.junit.Test)

Aggregations

ClassInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand)9 InterfaceInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.InterfaceInternalNameMatcherOperand)7 MatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.MatcherOperand)7 Test (org.junit.Test)7 PackageInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.PackageInternalNameMatcherOperand)3 AnnotationInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.AnnotationInternalNameMatcherOperand)2 SuperClassInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.SuperClassInternalNameMatcherOperand)2 AndMatcherOperator (com.navercorp.pinpoint.bootstrap.instrument.matcher.operator.AndMatcherOperator)1 OrMatcherOperator (com.navercorp.pinpoint.bootstrap.instrument.matcher.operator.OrMatcherOperator)1 InternalClassMetadata (com.navercorp.pinpoint.profiler.instrument.classreading.InternalClassMetadata)1 DefaultInstrumentMatcherCacheConfig (com.navercorp.pinpoint.profiler.instrument.config.DefaultInstrumentMatcherCacheConfig)1 InstrumentMatcherCacheConfig (com.navercorp.pinpoint.profiler.instrument.config.InstrumentMatcherCacheConfig)1 InputStream (java.io.InputStream)1