package hudson.plugins.groovy;

import org.jvnet.hudson.test.HudsonTestCase;

import com.gargoylesoftware.htmlunit.ElementNotFoundException;
import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

public class PluginTest extends HudsonTestCase {

    public void testAllowTokenMacro() throws ElementNotFoundException, Exception {
        HtmlPage page = createWebClient().goTo("configure");
        HtmlCheckBoxInput allowMacroCheckBox = page.getElementByName("allowMacro");
        allowMacroCheckBox.setChecked(true);
        submit(page.getFormByName("config"));
        assertTrue(Groovy.DESCRIPTOR.getAllowMacro());
    }
}

@@ -36,43 +36,130 @@
 ort 
-org.jvnet.hudson.test.H
+static org.junit.Assert.assertTrue;%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.jvnet.h
 udson
-TestCas
+.test.JenkinsRul
 e;%0A%0A
@@ -363,33 +363,81 @@
 est 
-extends HudsonTestCase %7B%0A
+%7B%0A%0A    @Rule%0A    public JenkinsRule j = new JenkinsRule();%0A    %0A    @Test
 %0A   
@@ -540,16 +540,18 @@
  page = 
+j.
 createWe
@@ -716,16 +716,18 @@
         
+j.
 submit(p

Update tests to JenkinsRule