From e0446920705542092e815585d0e76741417cbd81 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 23 Oct 2023 19:45:01 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-102182=20=E3=80=90=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=89=E6=9C=9F=E3=80=91=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E8=AF=A6=E6=83=85=EF=BC=8C=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4?= =?UTF-8?q?=EF=BC=8C=E9=83=A8=E5=88=86=E5=A4=B1=E8=B4=A5=E7=9A=84=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=EF=BC=8C=E9=A1=B5=E9=9D=A2=E4=B8=8D=E4=BC=9A=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/vcs/VcsProcessFailedWrapper.java | 14 ++++++++++++++ .../fr/design/mainframe/vcs/ui/RecyclePane.java | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/VcsProcessFailedWrapper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/VcsProcessFailedWrapper.java index 0a257ce2e4..93d7d93479 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/VcsProcessFailedWrapper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/VcsProcessFailedWrapper.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.vcs; import com.fr.report.entity.VcsEntity; +import com.fr.stable.StringUtils; import java.util.ArrayList; import java.util.List; @@ -51,6 +52,19 @@ public class VcsProcessFailedWrapper { return detailList; } + /** + * 是否失败 + */ + public boolean isFalse(VcsTableEntity entity) { + for (VcsEntity vcsEntity : failedList) { + if (StringUtils.equals(vcsEntity.getFilename(), entity.getFilename()) + && vcsEntity.getVersion() == entity.getEntity().getVersion()) { + return true; + } + } + return false; + } + /** * 处理是否全部成功 */ diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java index 9f19008ee4..1aacaa9d7b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java @@ -232,7 +232,7 @@ public class RecyclePane extends AbstractSupportSelectTablePane } private void updateVcsUI(VcsProcessFailedWrapper wrapper) { - tableEntities = model.getList().stream().filter(tableEntity -> !tableEntity.isSelect() || wrapper.getFailedNameList().contains(tableEntity.getFilename())).collect(Collectors.toList()); + tableEntities = model.getList().stream().filter(tableEntity -> !tableEntity.isSelect() || wrapper.isFalse(tableEntity)).collect(Collectors.toList()); model.setList(new ArrayList<>(tableEntities)); model.fireTableDataChanged(); fireVcsListener(model.getList()); From a53b4e6a4fd9121b38b803d3dbc070ada67519be Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 23 Oct 2023 20:00:31 +0800 Subject: [PATCH 2/5] =?UTF-8?q?REPORT-101549=20=E3=80=90=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BA=8C=E6=9C=9F=E3=80=91=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9B=B4=E6=8E=A5=E8=BF=9B=E5=85=A5=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E7=AE=A1=E7=90=86=E6=B2=A1=E6=9C=89=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=BA=8C=E6=AC=A1=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=B0=B1=E6=9C=89=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java index 28cb3f2447..2c8401c94c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java @@ -371,7 +371,7 @@ public class VcsMovePanel extends BasicPane { private void doAfterMove() { visible = !VcsHelper.getInstance().isLegacyMode(); initVcsLabel(updatePane); - updatePane.setVisible(visible); + updatePane.setVisible(!visible); callBack.doCallBack(visible); parentCard.show(parentPane, SETTING); } From 6176bc666672b4ccb1150dc2c577dd76f7ad8771 Mon Sep 17 00:00:00 2001 From: obo Date: Mon, 30 Oct 2023 16:38:37 +0800 Subject: [PATCH 3/5] =?UTF-8?q?REPORT-107992=20=E3=80=90=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E5=92=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=90=8D=E7=A7=B0=E5=90=8E=E6=93=8D=E4=BD=9C=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E4=BC=9A=E8=AE=B0=E5=BD=95=E5=A4=A7=E7=89=87=E4=B8=8D?= =?UTF-8?q?=E5=A5=BD=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataPaneListPane.java | 100 +++++++++++++++--- 1 file changed, 83 insertions(+), 17 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 264a937999..0694222339 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -5,8 +5,12 @@ import com.fr.base.TableDataBean; import com.fr.config.RemoteConfigEvent; import com.fr.data.MultiResultTableData; import com.fr.data.TableDataSource; +import com.fr.data.impl.*; +import com.fr.data.impl.storeproc.StoreProcedure; +import com.fr.data.metric.utils.DatabaseConnectionMetricHandler; import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.DesignTableDataManager; +import com.fr.design.data.MapCompareUtils; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; @@ -19,6 +23,7 @@ import com.fr.file.TableDataOperator; import com.fr.file.TableDataOperatorImpl; import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; +import com.fr.general.jsqlparser.schema.Table; import com.fr.log.FineLoggerFactory; import com.fr.rpc.ExceptionHandler; import com.fr.rpc.RPCInvokerExceptionInfo; @@ -32,12 +37,8 @@ import com.fr.workspace.WorkContext; import javax.swing.DefaultListModel; import javax.swing.JPanel; import javax.swing.SwingUtilities; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * TableDataList Pane. @@ -46,6 +47,8 @@ public class TableDataPaneListPane extends JListControlPane implements TableData private boolean isNamePermitted = true; private Map dsNameChangedMap = new HashMap<>(); + private final Map populatedTableDataSnapshot = new LinkedHashMap<>(); + public TableDataPaneListPane() { super(); dsNameChangedMap.clear(); @@ -225,10 +228,12 @@ public class TableDataPaneListPane extends JListControlPane implements TableData while (nameIt.hasNext()) { String name = nameIt.next(); nameObjectList.add(new NameObject(name, tableDataConfig.getTableData(name))); + populatedTableDataSnapshot.put(name, tableDataConfig.getTableData(name)); } while (procedurenameIt.hasNext()) { String name = procedurenameIt.next(); nameObjectList.add(new NameObject(name, ProcedureConfig.getInstance().getProcedure(name))); + populatedTableDataSnapshot.put(name, ProcedureConfig.getInstance().getProcedure(name)); } populate(nameObjectList.toArray(new NameObject[0])); @@ -236,17 +241,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData @Override public void update(TableDataConfig tableDataConfig) { - Nameable[] tableDataArray = this.update(); - List tableDataBeans = new ArrayList<>(); - Map map = MapUtils.invertMap(getDsNameChangedMap()); - for (int i = 0; i < tableDataArray.length; i++) { - NameObject nameObject = (NameObject) tableDataArray[i]; - String oldName = map.get(nameObject.getName()); - if (oldName == null) { - oldName = StringUtils.EMPTY; - } - tableDataBeans.add(new TableDataBean(nameObject.getName(), oldName, (TableData) nameObject.getObject())); - } + List tableDataBeans = getUpdateTableDataBeans(); try { WorkContext.getCurrent().get(TableDataOperator.class, new ExceptionHandler() { @Override @@ -255,6 +250,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData return saveByOldWay(tableDataBeans); } }).saveTableData(new ArrayList<>(tableDataConfig.getTableDatas().keySet()), tableDataBeans); + logOperateMessage(populatedTableDataSnapshot, getUpdateTableDataMap(tableDataBeans)); if (!WorkContext.getCurrent().isLocal()) { EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace()); } @@ -263,6 +259,76 @@ public class TableDataPaneListPane extends JListControlPane implements TableData } } + /** + * 获取更新时的数据集快照 + * + * @return 快照 + */ + private List getUpdateTableDataBeans() { + Nameable[] tableDataArray = this.update(); + List tableDataBeans = new ArrayList<>(); + Map map = MapUtils.invertMap(getDsNameChangedMap()); + for (Nameable nameable : tableDataArray) { + NameObject nameObject = (NameObject) nameable; + String oldName = map.get(nameObject.getName()); + if (oldName == null) { + oldName = StringUtils.EMPTY; + } + tableDataBeans.add(new TableDataBean(nameObject.getName(), oldName, (TableData) nameObject.getObject())); + } + return tableDataBeans; + } + + private Map getUpdateTableDataMap(List tableDataBeans) { + Map updateTableDataMap = new HashMap<>(); + for (TableDataBean bean : tableDataBeans) { + updateTableDataMap.put(bean.getName(), bean.getTableData()); + } + return updateTableDataMap; + } + + private void logOperateMessage(Map old, Map newMap) { + List add = new ArrayList<>(); + List update = new ArrayList<>(); + List delete = new ArrayList<>(); + MapCompareUtils.contrastMapEntries(old, newMap, (entryEventKind, s, tableData) -> { + switch (entryEventKind) { + case REMOVED: + delete.add(s); + break; + case ADDED: + add.add(s); + break; + case UPDATED: + update.add(s); + break; + default: + break; + } + }, new MapCompareUtils.UpdateRule() { + @Override + public boolean needUpdate(TableData old, TableData update) { + return !update.equals(old) || !isEmbedConnection(update); + } + + /** + * 是否是主工程里内置的TableData + */ + private boolean isEmbedConnection(TableData tableData) { + return tableData instanceof DBTableData || + tableData instanceof ClassTableData || + tableData instanceof EmbeddedTableData || + tableData instanceof FileTableData || + tableData instanceof RecursionTableData || + tableData instanceof ConditionTableData || + tableData instanceof StoreProcedure; + } + }); + + WorkContext.getCurrent().get(TableDataOperator.class).logOperateMessage(add, update, delete); + } + + private boolean saveByOldWay(List tableDataBean) { try { return TableDataOperatorImpl.getInstance().saveTableData(tableDataBean); From 050439e1dbd7eb200728c23287924b772a6f6596 Mon Sep 17 00:00:00 2001 From: obo Date: Mon, 30 Oct 2023 18:37:27 +0800 Subject: [PATCH 4/5] =?UTF-8?q?REPORT-107992=20=E6=94=B9=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=20&=20=E6=A0=BC=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/MapCompareUtils.java | 93 ------------------- .../data/datapane/TableDataPaneListPane.java | 69 ++------------ .../datapane/connect/ConnectionListPane.java | 2 +- .../fr/design/data/MapCompareUtilsTest.java | 1 + 4 files changed, 8 insertions(+), 157 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/data/MapCompareUtils.java diff --git a/designer-base/src/main/java/com/fr/design/data/MapCompareUtils.java b/designer-base/src/main/java/com/fr/design/data/MapCompareUtils.java deleted file mode 100644 index 331e980834..0000000000 --- a/designer-base/src/main/java/com/fr/design/data/MapCompareUtils.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.fr.design.data; - -import org.jetbrains.annotations.NotNull; - -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * @author rinoux - * @version 10.0 - * Created by rinoux on 2022/3/28 - */ -public final class MapCompareUtils { - - - /** - * 对比两个map 查找出相比orig,other中有哪些是新增的、删除的或者被修改的,并分别进行处理 - * - * 对比时默认用equals方法来判断是否为 EntryEventKind#UPDATED - * - * @param orig 原始map - * @param other 参考的新map - * @param eventHandler 有区别时的事件处理器 - * @param K - * @param V - */ - public static void contrastMapEntries(@NotNull Map orig, @NotNull Map other, @NotNull EventHandler eventHandler) { - - contrastMapEntries(orig, other, eventHandler, UpdateRule.DEFAULT); - } - - /** - * 对比两个map 查找出相比orig,other中有哪些是新增的、删除的或者被修改的,并分别进行处理 - * - * 对比时用自定义的规则来判断是否为 EntryEventKind#UPDATED - * - * @param orig 原始map - * @param other 参考的新map - * @param eventHandler 有区别时的事件处理器 - * @param updateRule 自定义的Update事件判定规则 - * @param - * @param - */ - public static void contrastMapEntries(@NotNull Map orig, @NotNull Map other, @NotNull EventHandler eventHandler, @NotNull UpdateRule updateRule) { - - Map copiedOrig = new LinkedHashMap<>(orig); - - other.forEach((k, v) -> { - V existedV = copiedOrig.remove(k); - if (existedV != null) { - if (updateRule.needUpdate(existedV, v)) { - eventHandler.on(EntryEventKind.UPDATED, k, v); - } - } else { - eventHandler.on(EntryEventKind.ADDED, k, v); - } - }); - - copiedOrig.forEach((k, v) -> eventHandler.on(EntryEventKind.REMOVED, k, v)); - } - - - /** - * 事件处理器,对应比较后的三种结果的事件处理 - * @param - * @param - */ - public interface EventHandler { - void on(EntryEventKind entryEventKind, K k, V v); - } - - /** - * 数据被修改(EntryEventKind.UPDATED) 的判定规则 - * @param - * @param - */ - public interface UpdateRule { - - EntryEventKind eventKind = EntryEventKind.UPDATED; - - UpdateRule DEFAULT = new UpdateRule() {}; - - default boolean needUpdate(V origin, V v) { - return !v.equals(origin); - } - } - - public enum EntryEventKind { - ADDED, - REMOVED, - UPDATED; - } -} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 0694222339..ea368bbfcd 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -5,12 +5,8 @@ import com.fr.base.TableDataBean; import com.fr.config.RemoteConfigEvent; import com.fr.data.MultiResultTableData; import com.fr.data.TableDataSource; -import com.fr.data.impl.*; -import com.fr.data.impl.storeproc.StoreProcedure; -import com.fr.data.metric.utils.DatabaseConnectionMetricHandler; import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.DesignTableDataManager; -import com.fr.design.data.MapCompareUtils; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; @@ -23,7 +19,6 @@ import com.fr.file.TableDataOperator; import com.fr.file.TableDataOperatorImpl; import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; -import com.fr.general.jsqlparser.schema.Table; import com.fr.log.FineLoggerFactory; import com.fr.rpc.ExceptionHandler; import com.fr.rpc.RPCInvokerExceptionInfo; @@ -37,8 +32,12 @@ import com.fr.workspace.WorkContext; import javax.swing.DefaultListModel; import javax.swing.JPanel; import javax.swing.SwingUtilities; -import java.util.*; -import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; /** * TableDataList Pane. @@ -47,8 +46,6 @@ public class TableDataPaneListPane extends JListControlPane implements TableData private boolean isNamePermitted = true; private Map dsNameChangedMap = new HashMap<>(); - private final Map populatedTableDataSnapshot = new LinkedHashMap<>(); - public TableDataPaneListPane() { super(); dsNameChangedMap.clear(); @@ -228,12 +225,10 @@ public class TableDataPaneListPane extends JListControlPane implements TableData while (nameIt.hasNext()) { String name = nameIt.next(); nameObjectList.add(new NameObject(name, tableDataConfig.getTableData(name))); - populatedTableDataSnapshot.put(name, tableDataConfig.getTableData(name)); } while (procedurenameIt.hasNext()) { String name = procedurenameIt.next(); nameObjectList.add(new NameObject(name, ProcedureConfig.getInstance().getProcedure(name))); - populatedTableDataSnapshot.put(name, ProcedureConfig.getInstance().getProcedure(name)); } populate(nameObjectList.toArray(new NameObject[0])); @@ -250,7 +245,6 @@ public class TableDataPaneListPane extends JListControlPane implements TableData return saveByOldWay(tableDataBeans); } }).saveTableData(new ArrayList<>(tableDataConfig.getTableDatas().keySet()), tableDataBeans); - logOperateMessage(populatedTableDataSnapshot, getUpdateTableDataMap(tableDataBeans)); if (!WorkContext.getCurrent().isLocal()) { EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace()); } @@ -278,57 +272,6 @@ public class TableDataPaneListPane extends JListControlPane implements TableData } return tableDataBeans; } - - private Map getUpdateTableDataMap(List tableDataBeans) { - Map updateTableDataMap = new HashMap<>(); - for (TableDataBean bean : tableDataBeans) { - updateTableDataMap.put(bean.getName(), bean.getTableData()); - } - return updateTableDataMap; - } - - private void logOperateMessage(Map old, Map newMap) { - List add = new ArrayList<>(); - List update = new ArrayList<>(); - List delete = new ArrayList<>(); - MapCompareUtils.contrastMapEntries(old, newMap, (entryEventKind, s, tableData) -> { - switch (entryEventKind) { - case REMOVED: - delete.add(s); - break; - case ADDED: - add.add(s); - break; - case UPDATED: - update.add(s); - break; - default: - break; - } - }, new MapCompareUtils.UpdateRule() { - @Override - public boolean needUpdate(TableData old, TableData update) { - return !update.equals(old) || !isEmbedConnection(update); - } - - /** - * 是否是主工程里内置的TableData - */ - private boolean isEmbedConnection(TableData tableData) { - return tableData instanceof DBTableData || - tableData instanceof ClassTableData || - tableData instanceof EmbeddedTableData || - tableData instanceof FileTableData || - tableData instanceof RecursionTableData || - tableData instanceof ConditionTableData || - tableData instanceof StoreProcedure; - } - }); - - WorkContext.getCurrent().get(TableDataOperator.class).logOperateMessage(add, update, delete); - } - - private boolean saveByOldWay(List tableDataBean) { try { return TableDataOperatorImpl.getInstance().saveTableData(tableDataBean); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index 87b1c404f3..6bfd0a37f0 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -9,7 +9,7 @@ import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.metric.utils.DatabaseConnectionMetricHandler; import com.fr.data.operator.DataOperator; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.data.MapCompareUtils; +import com.fr.general.MapCompareUtils; import com.fr.design.dialog.BasicDialog; import com.fr.design.fun.ConnectionProvider; import com.fr.design.gui.controlpane.JListControlPane; diff --git a/designer-base/src/test/java/com/fr/design/data/MapCompareUtilsTest.java b/designer-base/src/test/java/com/fr/design/data/MapCompareUtilsTest.java index 1f1e60e2be..97f3cb7dc4 100644 --- a/designer-base/src/test/java/com/fr/design/data/MapCompareUtilsTest.java +++ b/designer-base/src/test/java/com/fr/design/data/MapCompareUtilsTest.java @@ -1,5 +1,6 @@ package com.fr.design.data; +import com.fr.general.MapCompareUtils; import org.junit.Assert; import org.junit.Test; From d81b21f80f3442d055be45c033898b294330131c Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 31 Oct 2023 10:52:58 +0800 Subject: [PATCH 5/5] =?UTF-8?q?REPORT-107992=20=E7=A7=BB=E5=8A=A8=E4=B8=8B?= =?UTF-8?q?=E5=8D=95=E6=B5=8B=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/MapCompareUtilsTest.java | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 designer-base/src/test/java/com/fr/design/data/MapCompareUtilsTest.java diff --git a/designer-base/src/test/java/com/fr/design/data/MapCompareUtilsTest.java b/designer-base/src/test/java/com/fr/design/data/MapCompareUtilsTest.java deleted file mode 100644 index 97f3cb7dc4..0000000000 --- a/designer-base/src/test/java/com/fr/design/data/MapCompareUtilsTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.fr.design.data; - -import com.fr.general.MapCompareUtils; -import org.junit.Assert; -import org.junit.Test; - -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * @author rinoux - * @version 10.0 - * Created by rinoux on 2022/3/28 - */ -public class MapCompareUtilsTest { - - @Test - public void contrastMapEntries() { - - - Map orig = new LinkedHashMap<>(); - - orig.put("aaa", "aaa"); - orig.put("bbb", "bbb"); - orig.put("ccc", "ccc"); - orig.put("ddd", "ddd"); - - - Map other = new LinkedHashMap<>(); - - other.put("aaa", "111"); - other.put("bbb", "bbb"); - other.put("ccc", "ccc"); - other.put("eee", "eee"); - - - MapCompareUtils.contrastMapEntries(orig, other, new MapCompareUtils.EventHandler() { - @Override - public void on(MapCompareUtils.EntryEventKind entryEventKind, String s, String s2) { - switch (entryEventKind) { - case UPDATED: - Assert.assertEquals(s, "aaa"); - Assert.assertEquals(s2, "111"); - break; - case REMOVED: - Assert.assertEquals(s, "ddd"); - break; - case ADDED: - Assert.assertEquals(s, "eee"); - Assert.assertEquals(s2, "eee"); - break; - default: - Assert.fail(); - } - } - }); - } -} \ No newline at end of file