@@ -0,0 +1,2414 @@
+package org.slc.sli.api.aspect;%0A%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.util.StopWatch;%0A%0A/**%0A * Tests that logging can be done via inter-type declared methods%0A * %0A * @author dkornishev%0A * %0A */%0A@Ignore%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(locations = %7B %22/spring/applicationContext-test.xml%22 %7D)%0Apublic class LoggingAspectTest %7B%0A    %0A    private static final Logger LOG = LoggerFactory.getLogger(LoggingAspectTest.class);%0A    %0A    @Test%0A    public void testDebug() %7B%0A        debug(%22Debug msg%22);%0A        debug(%22Debug msg %7B%7D %7B%7D %7B%7D%22, %22param1%22, 13, true);%0A    %7D%0A    %0A    @Test%0A    public void testInfo() %7B%0A        info(%22Info msg%22);%0A        info(%22Info msg %7B%7D %7B%7D %7B%7D%22, %22param1%22, 13, true);%0A    %7D%0A    %0A    @Test%0A    public void testWarn() %7B%0A        warn(%22Warn msg%22);%0A        warn(%22Warn msg %7B%7D %7B%7D %7B%7D%22, %22param1%22, 13, true);%0A    %7D%0A    %0A    @Test%0A    public void testError() %7B%0A        error(%22Error msg%22, new Exception(%22I am an error msg.  FEAR ME.%22));%0A    %7D%0A    %0A    @Ignore%0A    @Test%0A    public void benchCompare() %7B%0A        StopWatch aop = new StopWatch();%0A        StopWatch plain = new StopWatch();%0A        StopWatch plainNoField = new StopWatch();%0A        %0A        int numIters = 500000;%0A        for (int i = 0; i %3C numIters; i++) %7B%0A            plain.start();%0A            LOG.debug(%22DEBUG MSG%3C OMGFG PLAIN %7B%7D/%7B%7D/%7B%7D%7B%7D%22, new Object%5B%5D %7B true, Math.random(), %22hello world%22, i %7D);%0A            plain.stop();%0A%0A            plainNoField.start();%0A            LoggerFactory.getLogger(this.getClass()).debug(%22DEBUG MSG%3C OMGFG PLAIN %7B%7D/%7B%7D/%7B%7D%7B%7D%22, new Object%5B%5D %7B true, Math.random(), %22hello world%22, i %7D);%0A            plainNoField.stop();%0A%0A            aop.start();%0A            debug(%22DEBUG MSG%3C OMGFG AOP %7B%7D/%7B%7D/%7B%7D%7B%7D%22, true, Math.random(), %22hello world%22, i);%0A            aop.stop();%0A        %7D%0A        %0A        info(%22Plain: %7B%7D AVG: %7B%7D%22, plain.getTotalTimeMillis(), plain.getTotalTimeMillis() / (float) numIters);%0A        info(%22Plain No Field: %7B%7D AVG: %7B%7D%22, plainNoField.getTotalTimeMillis(), plainNoField.getTotalTimeMillis() / (float) numIters);%0A        info(%22AOP: %7B%7D AVG: %7B%7D%22, aop.getTotalTimeMillis(), aop.getTotalTimeMillis() / (float) numIters);%0A    %7D%0A%7D%0A

test for aspect logging