View Javadoc
1   package com.atlassian.plugin.main;
2   
3   import com.atlassian.plugin.PluginController;
4   import com.mockobjects.dynamic.C;
5   import com.mockobjects.dynamic.Mock;
6   import junit.framework.TestCase;
7   
8   public class TestHotDeployer extends TestCase {
9       public void testRun() throws InterruptedException {
10          Mock mockController = new Mock(PluginController.class);
11          mockController.expectAndReturn("scanForNewPlugins", C.ANY_ARGS, 0);
12  
13          HotDeployer deployer = new HotDeployer((PluginController) mockController.proxy(), 1000);
14          assertFalse(deployer.isRunning());
15          deployer.start();
16          Thread.sleep(500);
17          assertTrue(deployer.isRunning());
18          mockController.verify();
19          deployer.stop();
20          assertFalse(deployer.isRunning());
21  
22  
23      }
24  }