@@ -0,0 +1,1908 @@
+package org.aspectj.aspect;%0A%0Aimport com.google.gson.GsonBuilder;%0Aimport org.aspectj.configuration.model.Artifact;%0Aimport org.aspectj.configuration.model.ClassRef;%0Aimport org.aspectj.configuration.model.ResourceRef;%0Aimport org.aspectj.util.MavenLoader;%0Aimport org.aspectj.util.task.MvelTimerTask;%0Aimport org.mvel2.integration.impl.MapVariableResolverFactory;%0Aimport static junit.framework.Assert.assertNotNull;%0Aimport static junit.framework.Assert.assertTrue;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Timer;%0A%0Apublic class ExecuteTimerTaskTest %7B%0A%0A    public static final int TIMER_DELAY = 500;%0A%0A    private static String jsonResult = null;%0A%0A    public static void setJsonResult(String jsonResult) %7B%0A        ExecuteTimerTaskTest.jsonResult = jsonResult;%0A    %7D%0A%0A    @org.junit.Test%0A    public void mvelScheduler() throws Exception%7B%0A        Timer timer = new Timer();%0A        MapVariableResolverFactory variableResolverFactory = new MapVariableResolverFactory();%0A        ClassRef%5B%5D classRefs = %7Bnew ClassRef(%22org.github.suhorukov.SigarCollect%22, %22SigarCollect%22)%7D;%0A        ResourceRef%5B%5D resourceRefs = new ResourceRef%5B0%5D;%0A        Artifact%5B%5D artifacts = %7Bnew Artifact(%22com.github.igor-suhorukov:jvm-metrics:1.1%22, classRefs, resourceRefs)%7D;%0A        MavenLoader.loadArtifact(artifacts, variableResolverFactory);%0A        String mvelScript = %22java.lang.String metrics = new SigarCollect().getJsonFullInfo();%22 +%0A                            %22org.aspectj.aspect.ExecuteTimerTaskTest.setJsonResult(metrics);%22;%0A        timer.schedule(new MvelTimerTask(mvelScript, variableResolverFactory), TIMER_DELAY);%0A        Thread.sleep(TIMER_DELAY*5);%0A        HashMap metrics = new GsonBuilder().create().fromJson(jsonResult, HashMap.class);%0A        assertNotNull(jsonResult);%0A        assertTrue(metrics.containsKey(%22ProcCpu%22));%0A        assertTrue(metrics.containsKey(%22Pid%22));%0A        assertTrue(metrics.containsKey(%22Mem%22));%0A    %7D%0A%7D%0A

Test TimerTask with Mvel expression