You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
package com.fr.design.data.datapane; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
import org.easymock.EasyMock; |
|
import org.junit.Before; |
|
import org.junit.Test; |
|
import org.junit.runner.RunWith; |
|
import org.powermock.api.easymock.PowerMock; |
|
import org.powermock.core.classloader.annotations.PowerMockIgnore; |
|
import org.powermock.core.classloader.annotations.PrepareForTest; |
|
import org.powermock.modules.junit4.PowerMockRunner; |
|
|
|
import java.util.Map; |
|
|
|
import static org.junit.Assert.*; |
|
|
|
/** |
|
* @author Yyming |
|
* @version 10.0 |
|
* Created by Yyming on 2020/9/29 |
|
*/ |
|
@RunWith(PowerMockRunner.class) |
|
@PowerMockIgnore({"javax.management.*", "javax.swing.*"}) |
|
@PrepareForTest(Toolkit.class) |
|
public class TableDataPaneListPaneTest { |
|
|
|
@Before |
|
public void setUp() { |
|
PowerMock.mockStatic(Toolkit.class); |
|
EasyMock.expect(Toolkit.i18nText(EasyMock.anyString())).andReturn("test").anyTimes(); |
|
PowerMock.replayAll(); |
|
} |
|
|
|
@Test |
|
public void rename() { |
|
TableDataPaneListPane listPane = new TableDataPaneListPane(); |
|
listPane.rename("111", "222"); |
|
listPane.rename("222", "333"); |
|
Map<String, String> dsNameChangedMap = listPane.getDsNameChangedMap(); |
|
assertEquals(1, dsNameChangedMap.size()); |
|
listPane.rename("333","111"); |
|
assertEquals(0, dsNameChangedMap.size()); |
|
} |
|
}
|
|
|