Package com.jitlogic.zorka.core.spy

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


public class OnlineReconfUnitTest extends ZorkaFixture {

    @Test
    public void testConfigureInstantiateRecofigureRun() throws Exception {
        SpyDefinition sdef1 = spy.instrument("test")
                .include(spy.byMethod(BytecodeInstrumentationFixture.TCLASS1, "trivialMethod"))
                .onSubmit(spy.zorkaStats("test", "test:name=TestClass1", "stats", "xxx"));

        agentInstance.getClassTransformer().add(sdef1);

        Object obj = instantiate(agentInstance.getClassTransformer(), BytecodeInstrumentationFixture.TCLASS1);

        SpyDefinition sdef2 = spy.instrument("test")
                .include(spy.byMethod(BytecodeInstrumentationFixture.TCLASS1, "trivialMethod"))
                .onSubmit(spy.zorkaStats("test", "test:name=TestClass1", "stats", "yyy"));

        agentInstance.getClassTransformer().add(sdef2);
View Full Code Here


        assertEquals("new configuration hasn't been used:", 1, stats.getMethodCallStatistic("yyy").getCalls());
    }

    @Test
    public void testConfigureInstantiateWithIncompatibleFetchConfiguration() throws Exception {
        SpyDefinition sdef1 = spy.instrument("test")
                .include(spy.byMethod(BytecodeInstrumentationFixture.TCLASS1, "trivialMethod"))
                .onSubmit(spy.zorkaStats("test", "test:name=TestClass1", "stats", "xxx"));

        agentInstance.getClassTransformer().add(sdef1);

        Object obj = instantiate(agentInstance.getClassTransformer(), BytecodeInstrumentationFixture.TCLASS1);

        SpyDefinition sdef2 = spy.instrument("test")
                .onEnter(spy.fetchThread("THREAD"))
                .include(spy.byMethod(BytecodeInstrumentationFixture.TCLASS1, "trivialMethod"))
                .onSubmit(spy.zorkaStats("test", "test:name=TestClass1", "stats", "yyy"));

        agentInstance.getClassTransformer().add(sdef2);
View Full Code Here

TOP

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

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.