Package com.jitlogic.zorka.core.spy

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


        Assert.assertTrue(sms.methodMatch("some.Class$1", null, null, 1, "run", "()V", null));
    }

    @Test
    public void testMatchFilterWithPriorities() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byClass("**").priority(1000),
                spy.byClass("com.jitlogic.**").exclude(),
                spy.byClass("com.jitlogic.TestClazz").priority(10)
        );

        assertTrue(sms.classMatch("java.lang.Integer"));
        assertFalse(sms.classMatch("com.jitlogic.zorka.core.spy.SpyProcessor"));
        assertTrue(sms.classMatch("com.jitlogic.TestClazz"));
    }
View Full Code Here


        assertTrue(sms.classMatch("com.jitlogic.TestClazz"));
    }

    @Test
    public void testClassExclusionWithOnlySomeMethod() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byMethod("com.jitlogic.zorka.core.**", "mapRow").exclude(),
                spy.byClass("**"));
        assertTrue(sms.classMatch("com.jitlogic.zorka.core.AgentConfig"));
        assertTrue(sms.classMatch(AgentConfig.class, false));
    }
View Full Code Here

        assertTrue(sms.classMatch(AgentConfig.class, false));
    }

    @Test
    public void testClassExclusionWithAllMethodsInClassExcluded() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byClass("com.jitlogic.zorka.core.**").exclude(),
                spy.byClass("**"));
        assertFalse(sms.classMatch("com.jitlogic.zorka.core.AgentConfig"));
        assertFalse(sms.classMatch(AgentConfig.class, false));
    }
View Full Code Here

    }


    @Test
    public void testSpyMatchClazzByName() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byClass("com.jitlogic.zorka.core.test.spy.support.Test*"));
        assertTrue(sms.classMatch(TestClass1.class, true));
        assertFalse(sms.classMatch(Integer.class, true));
    }
View Full Code Here

    }


    @Test
    public void testSpyMatchClazzByInterface() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byInterfaceAndMethod("com.jitlogic.zorka.core.test.spy.support.TestInterface1", "*"));
        assertFalse(sms.classMatch(TestClass1.class, true));
        assertTrue(sms.classMatch(TestClass2.class, true));
        assertFalse(sms.classMatch(TestClass3.class, true));
        assertTrue(sms.classMatch(TestClass4.class, true));
    }
View Full Code Here

    }


    @Test
    public void testSpyMatchClazzBySuperInterface() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byInterface("com.jitlogic.zorka.core.test.spy.support.TestInterface2"));
        assertFalse(sms.classMatch(TestClass1.class, true));
        assertTrue(sms.classMatch(TestClass2.class, true));
        assertFalse(sms.classMatch(TestClass3.class, true));
        assertTrue(sms.classMatch(TestClass4.class, true));
        assertTrue(sms.classMatch(TestClass5.class, true));
    }
View Full Code Here

    }


    @Test
    public void testSpyMatchClazzByClassAnnotation() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byClassAnnotation("com.jitlogic.zorka.core.test.spy.support.ClassAnnotation"));
        assertTrue(sms.classMatch(TestClass1.class, true));
        assertFalse(sms.classMatch(TestClass2.class, true));
    }
View Full Code Here

    }


    @Test
    public void testSpyMatchClazzByMethodAnnotation() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byMethodAnnotation("**", "com.jitlogic.zorka.core.test.spy.support.TestAnnotation"));
        assertFalse(sms.classMatch(TestClass1.class, true));
        assertTrue(sms.classMatch(TestClass2.class, true));
    }
View Full Code Here

        assertTrue(sms.classMatch(TestClass2.class, true));
    }

    @Test
    public void testSpyMatchClazzByMethodSignatureWithBasicTypes() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byMethod(0, "**", "paramMethod*", "void", "boolean"));
        assertTrue(sms.classMatch(TestClass1.class, true));
        assertFalse(sms.classMatch(TestClass2.class, true));
    }
View Full Code Here

        assertFalse(sms.classMatch(TestClass2.class, true));
    }

    @Test
    public void testSpyMatchClassByMethodSignatureWithClassTypes() {
        SpyMatcherSet sms = new SpyMatcherSet(
                spy.byMethod(0, "**", "*", "String", "String", SpyLib.SM_NOARGS));
        assertFalse(sms.classMatch(TestClass1.class, true));
        assertTrue(sms.classMatch(TestClass2.class, true));
    }
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.