|
|
|
@ -1,7 +1,5 @@
|
|
|
|
|
package com.fr.design.mainframe.alphafine.search.manager.impl; |
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
import com.fr.base.extension.FileExtension; |
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; |
|
|
|
|
import com.fr.design.mainframe.alphafine.AlphaFineHelper; |
|
|
|
@ -9,9 +7,6 @@ import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
|
|
|
|
|
import com.fr.design.mainframe.alphafine.model.SearchResult; |
|
|
|
|
import com.fr.file.filetree.FileNode; |
|
|
|
|
import com.fr.invoke.Reflect; |
|
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
|
import com.fr.web.core.SessionPoolManager; |
|
|
|
|
import com.fr.web.utils.WebUtils; |
|
|
|
|
import org.easymock.EasyMock; |
|
|
|
|
import org.junit.Test; |
|
|
|
|
import org.junit.runner.RunWith; |
|
|
|
@ -23,7 +18,7 @@ import org.powermock.modules.junit4.PowerMockRunner;
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.*; |
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author Yyming |
|
|
|
@ -43,8 +38,8 @@ public class FileSearchManagerTest {
|
|
|
|
|
FileNode fileNode2 = EasyMock.createMock(FileNode.class); |
|
|
|
|
EasyMock.expect(fileNode1.getName()).andReturn("workbook").anyTimes(); |
|
|
|
|
EasyMock.expect(fileNode2.getName()).andReturn("work book").anyTimes(); |
|
|
|
|
EasyMock.expect(fileNode1.getEnvPath()).andReturn("").anyTimes(); |
|
|
|
|
EasyMock.expect(fileNode2.getEnvPath()).andReturn("").anyTimes(); |
|
|
|
|
EasyMock.expect(fileNode1.getEnvPath()).andReturn("t1").anyTimes(); |
|
|
|
|
EasyMock.expect(fileNode2.getEnvPath()).andReturn("t2").anyTimes(); |
|
|
|
|
EasyMock.replay(fileNode1,fileNode2); |
|
|
|
|
FileNode[] fileNodes = { fileNode1, fileNode2 }; |
|
|
|
|
Reflect.on(instance).set("fileNodes",fileNodes); |
|
|
|
@ -65,8 +60,10 @@ public class FileSearchManagerTest {
|
|
|
|
|
PowerMock.mockStatic(AlphaFineHelper.class); |
|
|
|
|
AlphaFineHelper.getFilterResult(); |
|
|
|
|
PowerMock.expectLastCall().andReturn(list).anyTimes(); |
|
|
|
|
AlphaFineHelper.findFolderName(""); |
|
|
|
|
PowerMock.expectLastCall().andReturn("").anyTimes(); |
|
|
|
|
AlphaFineHelper.findFolderName("t1"); |
|
|
|
|
PowerMock.expectLastCall().andReturn("t1").anyTimes(); |
|
|
|
|
AlphaFineHelper.findFolderName("t2"); |
|
|
|
|
PowerMock.expectLastCall().andReturn("t2").anyTimes(); |
|
|
|
|
AlphaFineHelper.checkCancel(); |
|
|
|
|
PowerMock.expectLastCall().andVoid().anyTimes(); |
|
|
|
|
PowerMock.replay(AlphaFineHelper.class); |
|
|
|
|