View Javadoc

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