Browse Source
* commit 'd157a12f21d6a81f63e525617f958f1ac6cfb06c': REPORT-28459 JWorkBook 未释放 同步到final REPORT-28459 场景补充 REPORT-28459 JWorkBook未释放问题 同步到final REPORT-27434 1.15jar假保存问题 更换下位置。 重构后改动了代码的位置。 没再测试 REPORT-27434 1.15jar假保存问题 监听装置需要同步刷新persist/10.0
Kara
5 years ago
9 changed files with 128 additions and 28 deletions
@ -0,0 +1,11 @@ |
|||||||
|
package com.fr.design.event; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2020/3/19 |
||||||
|
*/ |
||||||
|
public interface RemoveListener { |
||||||
|
|
||||||
|
void doRemoveAction(); |
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
package com.fr.design.file; |
||||||
|
|
||||||
|
import com.fr.design.mainframe.JTemplate; |
||||||
|
import com.fr.file.FILE; |
||||||
|
import com.fr.invoke.Reflect; |
||||||
|
import junit.framework.TestCase; |
||||||
|
import org.easymock.EasyMock; |
||||||
|
import org.junit.Assert; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.Arrays; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2020/3/23 |
||||||
|
*/ |
||||||
|
public class HistoryTemplateListCacheTest extends TestCase { |
||||||
|
|
||||||
|
public void testContains() { |
||||||
|
JTemplate jTemplate = EasyMock.mock(JTemplate.class); |
||||||
|
FILE file = EasyMock.mock(FILE.class); |
||||||
|
EasyMock.expect(jTemplate.getEditingFILE()).andReturn(file).anyTimes(); |
||||||
|
EasyMock.replay(file); |
||||||
|
EasyMock.replay(jTemplate); |
||||||
|
Assert.assertEquals(-1, HistoryTemplateListCache.getInstance().contains(file)); |
||||||
|
Assert.assertEquals(-1, HistoryTemplateListCache.getInstance().contains(jTemplate)); |
||||||
|
Reflect.on(HistoryTemplateListCache.getInstance()).set("historyList", new ArrayList<>(Arrays.asList(jTemplate))); |
||||||
|
Assert.assertEquals(0, HistoryTemplateListCache.getInstance().contains(file)); |
||||||
|
Assert.assertEquals(0, HistoryTemplateListCache.getInstance().contains(jTemplate)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue