|
|
@ -116,31 +116,22 @@ public class EnvChangeEntranceTest { |
|
|
|
|
|
|
|
|
|
|
|
Workspace workspace = EasyMock.mock(Workspace.class); |
|
|
|
Workspace workspace = EasyMock.mock(Workspace.class); |
|
|
|
EasyMock.expect(workspace.isLocal()).andReturn(false).once(); |
|
|
|
EasyMock.expect(workspace.isLocal()).andReturn(false).once(); |
|
|
|
EasyMock.expect(workspace.isLocal()).andReturn(true).times(2); |
|
|
|
EasyMock.expect(workspace.isLocal()).andReturn(true).once(); |
|
|
|
PowerMock.mockStatic(WorkContext.class); |
|
|
|
PowerMock.mockStatic(WorkContext.class); |
|
|
|
EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes(); |
|
|
|
EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes(); |
|
|
|
|
|
|
|
|
|
|
|
PowerMock.mockStatic(PluginErrorRemindHandler.class); |
|
|
|
PowerMock.mockStatic(PluginErrorRemindHandler.class); |
|
|
|
EasyMock.expect(PluginErrorRemindHandler.pluginErrorContent()).andReturn("").once(); |
|
|
|
EasyMock.expect(PluginErrorRemindHandler.pluginErrorContent()).andReturn("").once(); |
|
|
|
EasyMock.expect(PluginErrorRemindHandler.pluginErrorContent()).andReturn("111").once(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PluginErrorRemindDialog dialog = EasyMock.mock(PluginErrorRemindDialog.class); |
|
|
|
EasyMock.replay(workspace); |
|
|
|
PowerMock.expectNew(PluginErrorRemindDialog.class, EasyMock.anyObject(Frame.class), EasyMock.anyString()).andReturn(dialog).once(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialog.setVisible(true); |
|
|
|
|
|
|
|
EasyMock.expectLastCall(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EasyMock.replay(workspace, dialog); |
|
|
|
|
|
|
|
PowerMock.replayAll(); |
|
|
|
PowerMock.replayAll(); |
|
|
|
|
|
|
|
|
|
|
|
EnvChangeEntrance entrance = EnvChangeEntrance.getInstance(); |
|
|
|
EnvChangeEntrance entrance = EnvChangeEntrance.getInstance(); |
|
|
|
|
|
|
|
|
|
|
|
entrance.pluginErrorRemind(); |
|
|
|
entrance.pluginErrorRemind(); |
|
|
|
entrance.pluginErrorRemind(); |
|
|
|
entrance.pluginErrorRemind(); |
|
|
|
entrance.pluginErrorRemind(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EasyMock.verify(workspace, dialog); |
|
|
|
EasyMock.verify(workspace); |
|
|
|
PowerMock.verifyAll(); |
|
|
|
PowerMock.verifyAll(); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Assert.fail(); |
|
|
|
Assert.fail(); |
|
|
|