Search in sources :

Example 6 with OrMatcherOperator

use of com.navercorp.pinpoint.bootstrap.instrument.matcher.operator.OrMatcherOperator in project pinpoint by naver.

the class DefaultMultiClassBasedMatcherTest method getMatcherOperandWithMultiClassName.

@Test
public void getMatcherOperandWithMultiClassName() {
    // (class OR class)
    DefaultMultiClassBasedMatcher matcher = new DefaultMultiClassBasedMatcher(Arrays.asList("java.lang.String", "java.lang.Thread"));
    assertTrue(matcher.getBaseClassNames().contains("java.lang.String"));
    assertTrue(matcher.getBaseClassNames().contains("java.lang.Thread"));
    MatcherOperand operand = matcher.getMatcherOperand();
    assertTrue(operand instanceof OrMatcherOperator);
    OrMatcherOperator operator = (OrMatcherOperator) operand;
    assertTrue(operator.getLeftOperand() instanceof ClassInternalNameMatcherOperand);
    ClassInternalNameMatcherOperand leftOperand = (ClassInternalNameMatcherOperand) operator.getLeftOperand();
    assertEquals("java/lang/String", leftOperand.getClassInternalName());
    assertTrue(operator.getRightOperand() instanceof ClassInternalNameMatcherOperand);
    ClassInternalNameMatcherOperand rightOperand = (ClassInternalNameMatcherOperand) operator.getRightOperand();
    assertEquals("java/lang/Thread", rightOperand.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) OrMatcherOperator(com.navercorp.pinpoint.bootstrap.instrument.matcher.operator.OrMatcherOperator) ClassInternalNameMatcherOperand(com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand) Test(org.junit.Test)

Aggregations

OrMatcherOperator (com.navercorp.pinpoint.bootstrap.instrument.matcher.operator.OrMatcherOperator)6 MatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.MatcherOperand)5 Test (org.junit.Test)4 ClassInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.ClassInternalNameMatcherOperand)3 InterfaceInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.InterfaceInternalNameMatcherOperand)3 AndMatcherOperator (com.navercorp.pinpoint.bootstrap.instrument.matcher.operator.AndMatcherOperator)3 PackageInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.PackageInternalNameMatcherOperand)2 MatcherOperator (com.navercorp.pinpoint.bootstrap.instrument.matcher.operator.MatcherOperator)2 NotMatcherOperator (com.navercorp.pinpoint.bootstrap.instrument.matcher.operator.NotMatcherOperator)2 AnnotationInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.AnnotationInternalNameMatcherOperand)1 SuperClassInternalNameMatcherOperand (com.navercorp.pinpoint.bootstrap.instrument.matcher.operand.SuperClassInternalNameMatcherOperand)1