Browse Source
Merge in DESIGN/design from ~HARRISON/design:release/10.0 to release/10.0 * commit '955559bb4c71dc7c099c1ded390a2838ab1f3fa3': REPORT-32149【组件加密】@harrison两个组件进行拖入,模板预览很奇怪 回滚代码,没回滚完 REPORT-32149【组件加密】@harrison两个组件进行拖入,模板预览很奇怪 代码回滚 REPORT-32149【组件加密】@harrison两个组件进行拖入,模板预览很奇怪 组件的默认名字不满足要求。 一些组件外面会嵌套 TitileLayout 所以根组件依旧保持之前的逻辑。 子组件使用组件名字递增的方式。feature/big-screen
Harrison
5 years ago
2 changed files with 11 additions and 107 deletions
@ -1,57 +0,0 @@
|
||||
package com.fr.design.designer.beans.models; |
||||
|
||||
import com.fr.design.designer.creator.CRPropertyDescriptor; |
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.mainframe.FormDesigner; |
||||
import com.fr.form.main.Form; |
||||
import com.fr.form.ui.ChartEditor; |
||||
import org.easymock.EasyMock; |
||||
import org.junit.Assert; |
||||
import org.junit.Test; |
||||
|
||||
import javax.swing.JComponent; |
||||
import java.awt.Dimension; |
||||
import java.beans.IntrospectionException; |
||||
|
||||
public class AddingModelTest { |
||||
|
||||
@Test |
||||
public void testInstantiateCreator() throws Exception { |
||||
|
||||
ChartEditor chartEditor = new ChartEditor(); |
||||
chartEditor.setWidgetName("test01"); |
||||
XCreator xCreator = new XCreator(chartEditor, new Dimension(20, 20)) { |
||||
@Override |
||||
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
||||
return new CRPropertyDescriptor[0]; |
||||
} |
||||
|
||||
@Override |
||||
protected JComponent initEditor() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
protected void initXCreatorProperties() { |
||||
} |
||||
|
||||
@Override |
||||
public String createDefaultName() { |
||||
return "test"; |
||||
} |
||||
}; |
||||
AddingModel addingModel = new AddingModel(xCreator, 20, 20); |
||||
|
||||
Form form = EasyMock.mock(Form.class); |
||||
EasyMock.expect(form.isNameExist("test0")).andReturn(true).once(); |
||||
EasyMock.expect(form.isNameExist(EasyMock.anyString())).andReturn(false).anyTimes(); |
||||
EasyMock.replay(form); |
||||
|
||||
FormDesigner mock = EasyMock.mock(FormDesigner.class); |
||||
EasyMock.expect(mock.getTarget()).andReturn(form).anyTimes(); |
||||
EasyMock.replay(mock); |
||||
|
||||
addingModel.instantiateCreator(mock); |
||||
Assert.assertEquals("test1", xCreator.toData().getWidgetName()); |
||||
} |
||||
} |
Loading…
Reference in new issue