package hudson.node_monitors;

import org.jvnet.hudson.test.HudsonTestCase;
import hudson.slaves.DumbSlave;
import hudson.slaves.SlaveComputer;
import hudson.util.ClockDifference;
import hudson.util.TimeUnit2;

/**
 * @author Richard Mortimer
 */
public class ClockMonitorDescriptorTest extends HudsonTestCase {
    /**
     * Makes sure that it returns sensible values.
     */
    public void testClockMonitor() throws Exception {
        DumbSlave s = createSlave();
        SlaveComputer c = s.getComputer();
        c.connect(false).get(); // wait until it's connected
        if(c.isOffline())
            fail("Slave failed to go online: "+c.getLog());

        ClockDifference cd = ClockMonitor.DESCRIPTOR.monitor(c);
        long diff = cd.diff;
        assertTrue(diff < TimeUnit2.SECONDS.toMillis(5));
        assertTrue(diff > TimeUnit2.SECONDS.toMillis(-5));
        assertTrue(cd.abs() >= 0);
        assertTrue(cd.abs() < TimeUnit2.SECONDS.toMillis(5));
        assertFalse(cd.isDangerous());
        assertTrue("html output too short", cd.toHtml().length() > 0);
    }
}

@@ -35,44 +35,123 @@
 ort 
-org.jvnet.hudson.test.HudsonTestCase
+static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assert.fail
 ;%0Aim
@@ -283,16 +283,105 @@
 Unit2;%0A%0A
+import org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.jvnet.hudson.test.JenkinsRule;%0A%0A
 /**%0A * @
@@ -452,32 +452,82 @@
 est 
-extends HudsonTestCase %7B
+%7B%0A    %0A    @Rule%0A    public JenkinsRule jenkins = new  JenkinsRule();%0A    
 %0A   
@@ -590,16 +590,26 @@
      */%0A
+    @Test%0A
     publ
@@ -680,13 +680,27 @@
 s = 
-creat
+jenkins.createOnlin
 eSla
@@ -752,69 +752,8 @@
 ();%0A
-        c.connect(false).get(); // wait until it's connected%0A
     

Use JenkinsRule instead of deprecated HudsonTestCase