Browse Source

REPORT-46892 【冒烟】切换到本地目录有插件版本不匹配时,远程配置页面会消失的比较慢

feature/big-screen
lucian 4 years ago
parent
commit
d0f99ed990
  1. 6
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 15
      designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java

6
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -310,8 +310,10 @@ public class EnvChangeEntrance {
String content = PluginErrorRemindHandler.pluginErrorContent(); String content = PluginErrorRemindHandler.pluginErrorContent();
if (StringUtils.isNotEmpty(content)) { if (StringUtils.isNotEmpty(content)) {
PluginErrorRemindDialog dialog = new PluginErrorRemindDialog(DesignerContext.getDesignerFrame(), content); SwingUtilities.invokeLater(() -> {
dialog.setVisible(true); PluginErrorRemindDialog dialog = new PluginErrorRemindDialog(DesignerContext.getDesignerFrame(), content);
dialog.setVisible(true);
});
} }
} }

15
designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java

@ -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();

Loading…
Cancel
Save