forked from fanruan/design
Bryant
5 years ago
2 changed files with 20 additions and 23 deletions
@ -1,23 +1,26 @@ |
|||||||
package com.fr.design.update.ui.dialog; |
package com.fr.design.update.ui.dialog; |
||||||
|
|
||||||
|
import com.fr.design.RestartHelper; |
||||||
import org.easymock.EasyMock; |
import com.fr.log.FineLoggerFactory; |
||||||
import org.easymock.IMocksControl; |
import com.fr.stable.StableUtils; |
||||||
import org.junit.Assert; |
import org.junit.Assert; |
||||||
import org.junit.Test; |
import org.junit.Test; |
||||||
|
|
||||||
import java.io.File; |
import java.io.File; |
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
public class RestoreResultDialogTest { |
public class RestoreResultDialogTest { |
||||||
|
|
||||||
@Test |
@Test |
||||||
public void testDeletePreviousPropertyFile() { |
public void testDeletePreviousPropertyFile() { |
||||||
IMocksControl control = EasyMock.createControl(); |
File moveFile = new File(RestartHelper.MOVE_FILE); |
||||||
File testRecordFile = control.createMock(File.class); |
File recordFile = new File(RestartHelper.RECORD_FILE); |
||||||
File testMoveFile = control.createMock(File.class); |
try { |
||||||
EasyMock.expect(testRecordFile.getPath()).andReturn("move").anyTimes(); |
StableUtils.makesureFileExist(moveFile); |
||||||
EasyMock.expect(testMoveFile.getPath()).andReturn("record").anyTimes(); |
StableUtils.makesureFileExist(recordFile); |
||||||
control.replay(); |
Assert.assertTrue(RestoreResultDialog.deletePreviousPropertyFile()); |
||||||
Assert.assertTrue(RestoreResultDialog.deletePreviousPropertyFile("move","record")); |
} catch (IOException e) { |
||||||
|
FineLoggerFactory.getLogger().error(e.getMessage(),e); |
||||||
|
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue