Browse Source

Merge pull request #971 in DESIGN/design from ~YAOH.WU/design:REPORT-19058 to release/10.0

* commit '4020cf334a2942ee5de4c694b6bbdf6908d272aa':
  REPORT-19058 环境切换暂存文件为保存提示
bugfix/10.0
yaoh.wu 5 years ago
parent
commit
77fa198592
  1. 5
      designer-base/src/main/java/com/fr/file/StashedFILE.java
  2. 23
      designer-base/src/test/java/com/fr/file/StashedFILETest.java

5
designer-base/src/main/java/com/fr/file/StashedFILE.java

@ -71,4 +71,9 @@ public class StashedFILE extends AbstractFILE {
public boolean isEnvFile() { public boolean isEnvFile() {
return false; return false;
} }
@Override
public String toString() {
return FILEFactory.MEM_PREFIX + getName();
}
} }

23
designer-base/src/test/java/com/fr/file/StashedFILETest.java

@ -0,0 +1,23 @@
package com.fr.file;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
public class StashedFILETest {
/**
* 用于测试暂存文件未保存时的提示
*/
@Test
public void testToString() {
FILE file = EasyMock.mock(FILE.class);
String name = "getA.cpt";
EasyMock.expect(file.getName()).andReturn(name).once();
EasyMock.replay(file);
FILE stashedFILE = new StashedFILE(file, new byte[0]);
String expectString = FILEFactory.MEM_PREFIX + name;
Assert.assertEquals(expectString, stashedFILE + "");
EasyMock.verify(file);
}
}
Loading…
Cancel
Save