Package org.apache.sirona.javaagent

Examples of org.apache.sirona.javaagent.AgentContext


    }

    @Test
    public void start() {
        final String key = "start";
        final AgentContext context = AgentContext.startOn(null, key);
        context.stop(null);
        assertEquals("org.apache.sirona.javaagent.AgentContext", context.getClass().getName());
        assertEquals(1, Repository.INSTANCE.getCounter(AgentContext.key(key)).getHits());
    }
View Full Code Here


    @Test
    public void attributes() {
        final String key = "ref";
        final Object instance = new Object();
        final AgentContext context = AgentContext.startOn(instance, key);
        context.stop(null);
        assertEquals(instance, context.getReference());
        assertEquals(key, context.getKey());
        assertEquals(1, Repository.INSTANCE.getCounter(AgentContext.key(key)).getHits());
    }
View Full Code Here

import static org.junit.Assert.assertEquals;

public class AgentContextTest {
    @Test
    public void keyClass() {
        final Class<?> clazz = new AgentContext("org.apache.test.sirona.javaagent.AgentContextTest.keyClass", this, new InvocationListener[0]).keyAsClass();
        assertEquals(AgentContextTest.class, clazz);
    }
View Full Code Here

        assertEquals(AgentContextTest.class, clazz);
    }

    @Test
    public void keyMethod() throws NoSuchMethodException {
        final Method mtd = new AgentContext("org.apache.test.sirona.javaagent.AgentContextTest.keyMethod", this, new InvocationListener[0]).keyAsMethod();
        assertEquals(AgentContextTest.class.getMethod("keyMethod"), mtd);
    }
View Full Code Here

    }

    @Test
    public void start() {
        final Counter.Key key = AgentContext.key("start");
        final AgentContext context = AgentContext.startOn(key, null);
        context.stop();
        assertEquals("org.apache.sirona.javaagent.AgentContext", context.getClass().getName());
        assertEquals(1, Repository.INSTANCE.getCounter(key).getHits());
    }
View Full Code Here

    @Test
    public void attributes() {
        final Counter.Key key = AgentContext.key("ref");
        final Object instance = new Object();
        final AgentContext context = AgentContext.startOn(key, instance);
        context.stop();
        assertEquals(instance, context.getReference());
        assertEquals(key, context.getKey());
        assertEquals(1, Repository.INSTANCE.getCounter(key).getHits());
    }
View Full Code Here

TOP

Related Classes of org.apache.sirona.javaagent.AgentContext

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.