From 10e88ac516e292fdaaf5465dd8d53b4744d04e38 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Thu, 27 Dec 2018 09:40:12 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-13902=20=E9=94=99=E8=AF=AF=E7=9A=84test?= =?UTF-8?q?=E4=BE=9D=E8=B5=96,=20=E5=85=88=E7=A7=BB=E5=87=BA=E6=9D=A5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/form/ui/WidgetNameCopyTest.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 designer-form/src/test/java/com/fr/form/ui/WidgetNameCopyTest.java diff --git a/designer-form/src/test/java/com/fr/form/ui/WidgetNameCopyTest.java b/designer-form/src/test/java/com/fr/form/ui/WidgetNameCopyTest.java new file mode 100644 index 000000000..8a2f498de --- /dev/null +++ b/designer-form/src/test/java/com/fr/form/ui/WidgetNameCopyTest.java @@ -0,0 +1,29 @@ +package com.fr.form.ui; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.mainframe.FormSelectionUtils; +import com.fr.form.main.Form; +import com.fr.general.ComparatorUtils; +import junit.framework.TestCase; + +import java.awt.Dimension; + +/** + * @author kerry + * @date 2018/7/27 + */ +public class WidgetNameCopyTest extends TestCase { + + public void testWidgetNameCopy() throws Exception { + Widget button = new FreeButton(); + Form form = new Form(); + button.setWidgetName("button0"); + XCreator xCreator = XCreatorUtils.createXCreator(button, new Dimension(100, 100)); + XCreator copyXcreator1 = FormSelectionUtils.copyXcreator(form, xCreator); + XCreator copyXcreator2 = FormSelectionUtils.copyXcreator(form, xCreator); + copyXcreator1.toData().setWidgetName("button_test"); + assertTrue(!ComparatorUtils.equals(copyXcreator2.toData().getWidgetName(), copyXcreator1.toData().getWidgetName())); + } + +}