Browse Source

REPORT-91327 修复BasicTableDataUtilsTest

newui
Yann 2 years ago
parent
commit
1f73a890b9
  1. 14
      designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.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));
}

Loading…
Cancel
Save