Browse Source

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

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

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

@ -310,8 +310,10 @@ public class EnvChangeEntrance {
String content = PluginErrorRemindHandler.pluginErrorContent();
if (StringUtils.isNotEmpty(content)) {
SwingUtilities.invokeLater(() -> {
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);
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);
EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes();
PowerMock.mockStatic(PluginErrorRemindHandler.class);
EasyMock.expect(PluginErrorRemindHandler.pluginErrorContent()).andReturn("").once();
EasyMock.expect(PluginErrorRemindHandler.pluginErrorContent()).andReturn("111").once();
PluginErrorRemindDialog dialog = EasyMock.mock(PluginErrorRemindDialog.class);
PowerMock.expectNew(PluginErrorRemindDialog.class, EasyMock.anyObject(Frame.class), EasyMock.anyString()).andReturn(dialog).once();
dialog.setVisible(true);
EasyMock.expectLastCall();
EasyMock.replay(workspace, dialog);
EasyMock.replay(workspace);
PowerMock.replayAll();
EnvChangeEntrance entrance = EnvChangeEntrance.getInstance();
entrance.pluginErrorRemind();
entrance.pluginErrorRemind();
entrance.pluginErrorRemind();
EasyMock.verify(workspace, dialog);
EasyMock.verify(workspace);
PowerMock.verifyAll();
} catch (Exception e) {
Assert.fail();

Loading…
Cancel
Save