Package com.jitlogic.zorka.core.spy

Examples of com.jitlogic.zorka.core.spy.SpyMatcherSet


    }


    @Test
    public void testClassMatchSignatureWithStringType() {
        SpyMatcherSet sms = new SpyMatcherSet(spy.byMethod(0xff, "test.*", "frobnicate", "String", "String"));
        Assert.assertTrue(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(Ljava/lang/String;)Ljava/lang/String;", null));
        Assert.assertFalse(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(J)I", null));
    }
View Full Code Here


        Assert.assertFalse(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(J)I", null));
    }

    @Test
    public void testClassMatchWithVariousArgs() {
        SpyMatcherSet sms = new SpyMatcherSet(spy.byMethod(0xff, "test.*", "frobnicate", "String", "int", "com.jitlogic.zorka.spy.CallInfo"));
        Assert.assertTrue(sms.methodMatch("test.SomeClass", null, null, 1, "frobnicate", "(ILcom/jitlogic/zorka/spy/CallInfo;)Ljava/lang/String;", null));
    }
View Full Code Here

        Assert.assertTrue(sms.methodMatch("test.SomeClass", null, null, 1, "frobnicate", "(ILcom/jitlogic/zorka/spy/CallInfo;)Ljava/lang/String;", null));
    }

    @Test
    public void testClassMatchWithNoArgsMarker() {
        SpyMatcherSet sms = new SpyMatcherSet(spy.byMethod(0xFF, "test.*", "frobnicate", null, SM_NOARGS));
        Assert.assertTrue(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "()V", null));
        Assert.assertFalse(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(I)V", null));
    }
View Full Code Here

        Assert.assertFalse(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(I)V", null));
    }

    @Test
    public void testMatchWithMoreAttributesAndNoArgsFlag() {
        SpyMatcherSet sms = new SpyMatcherSet(spy.byMethod(0xff, "test.*", "frobnicate", null, "int", SM_NOARGS));
        Assert.assertTrue(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(I)V", null));
        Assert.assertFalse(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(II)V", null));
    }
View Full Code Here

        Assert.assertFalse(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(II)V", null));
    }

    @Test
    public void testMatchWithJustSomeAttributes() {
        SpyMatcherSet sms = new SpyMatcherSet(spy.byMethod(0xFF, "test.*", "frobnicate", null, "int"));
        Assert.assertTrue(sms.methodMatch("test.SomeClass", null, null, 1, "frobnicate", "(I)V", null));
        Assert.assertTrue(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(II)V", null));
    }
View Full Code Here

        Assert.assertTrue(sms.methodMatch("test.someClass", null, null, 1, "frobnicate", "(II)V", null));
    }

    @Test
    public void testMatchOnlyNames() {
        SpyMatcherSet sms = new SpyMatcherSet(spy.byMethod("test.someClass", "trivialMethod"));
        Assert.assertTrue(sms.methodMatch("test.someClass", null, null, 1, "trivialMethod", "()V", null));
        Assert.assertTrue(sms.methodMatch("test.someClass", null, null, 1, "trivialMethod", "(II)V", null));
    }
View Full Code Here

        Assert.assertTrue(sms.methodMatch("test.someClass", null, null, 1, "trivialMethod", "(II)V", null));
    }

    @Test
    public void testMatchAnnotationBits() {
        SpyMatcherSet sms = new SpyMatcherSet(spy.byClassAnnotation("some.Annotation"));
        Assert.assertTrue(sms.methodMatch(null, Arrays.asList("Lsome.Annotation;"), null, 1, "trivialMethod", "()V", null));
    }
View Full Code Here

        Assert.assertTrue(sms.methodMatch(null, Arrays.asList("Lsome.Annotation;"), null, 1, "trivialMethod", "()V", null));
    }

    @Test
    public void testMatchWithFilterExclusion() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byMethod("java**", "*").exclude(),
                spy.byMethod("com.sun.**", "*").exclude(),
                spy.byMethod("**", "*").forTrace());

        Assert.assertTrue(sms.classMatch("org.apache.catalina.Valve"));
        Assert.assertFalse(sms.classMatch("java.util.Properties"));
    }
View Full Code Here

        Assert.assertFalse(sms.classMatch("java.util.Properties"));
    }

    @Test
    public void testMatchMethodsWithFilterExclusion() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byMethod("com.jitlogic.foo.SomeClass", "some*"),
                spy.byClass("com.jitlogic.**").exclude(),
                spy.byClass("**")
        );

        Assert.assertTrue(sms.methodMatch("com.jitlogic.foo.SomeClass", null, null, 1, "someMethod", "()V", null));
        Assert.assertFalse(sms.methodMatch("com.jitlogic.foo.SomeClass", null, null, 1, "otherMethod", "()V", null));
    }
View Full Code Here

        Assert.assertFalse(sms.methodMatch("com.jitlogic.foo.SomeClass", null, null, 1, "otherMethod", "()V", null));
    }

    @Test
    public void testMatchInnerClass() {
        SpyMatcherSet sms = new SpyMatcherSet(spy.byMethod("some.Class$1", "run"));
        Assert.assertTrue(sms.methodMatch("some.Class$1", null, null, 1, "run", "()V", null));
    }
View Full Code Here

TOP

Related Classes of com.jitlogic.zorka.core.spy.SpyMatcherSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.