Browse Source

Pull request #11697: REPORT-91327 工程单元测试修复

Merge in DESIGN/design from ~YANN/design:release/11.0 to release/11.0

* commit '1f73a890b95d93758f2e996ca2608d5f43984898':
  REPORT-91327 修复BasicTableDataUtilsTest
  REPORT-91327 修复DesignTableDataManagerTest
release/11.0
Yann-刘之言 2 years ago
parent
commit
e483743562
  1. 14
      designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java
  2. 2
      designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java

14
designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java

@ -50,19 +50,19 @@ public class BasicTableDataUtilsTest extends TestCase {
TableDataSource source = EasyMock.mock(TableDataSource.class);
TableData tableData = EasyMock.mock(TableData.class);
EasyMock.expect(source.getTableData("ds1")).andReturn(tableData).anyTimes();
EasyMock.expect(source.getTableData("test-ds1")).andReturn(tableData).anyTimes();
EasyMock.expect(source.getTableData("test-ds11")).andReturn(null).anyTimes();
EasyMock.expect(source.getTableData("test_ds1")).andReturn(tableData).anyTimes();
EasyMock.expect(source.getTableData("test_ds11")).andReturn(null).anyTimes();
EasyMock.replay(source, tableData);
Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false));
Assert.assertEquals("test-ds11", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false));
Assert.assertEquals("test_ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false));
Assert.assertEquals("test_ds11", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false));
source = EasyMock.mock(TableDataSource.class);
EasyMock.expect(source.getTableData("ds1")).andReturn(null).anyTimes();
EasyMock.expect(source.getTableData("test-ds1")).andReturn(null).anyTimes();
EasyMock.expect(source.getTableData("test_ds1")).andReturn(null).anyTimes();
EasyMock.replay(source);
Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false));
Assert.assertEquals("test_ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false));
Assert.assertEquals("ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false));
Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", true));
Assert.assertEquals("test_ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", true));
}

2
designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java

@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.Map;
@RunWith(PowerMockRunner.class)
@PrepareForTest({TableDataFactory.class, StoreProcedure.class, TableDataConfig.class, ProcedureConfig.class})
@PrepareForTest({TableDataFactory.class, StoreProcedure.class, TableDataConfig.class, ProcedureConfig.class, TemplateTableDataWrapper.class})
@SuppressStaticInitializationFor({"com.fr.design.data.tabledata.wrapper.TableDataFactory"})
public class DesignTableDataManagerTest {

Loading…
Cancel
Save