B-1_14-DEV merge back to main
This commit is contained in:
@@ -5,24 +5,30 @@ import com.jacob.activeX.ActiveXComponent;
|
||||
import com.jacob.com.ComException;
|
||||
|
||||
/**
|
||||
* This test verifies patch SF 1794811 .
|
||||
* It shows how unicode filenames throw exceptions in 1.13M4 and earlier.
|
||||
* This test verifies patch SF 1794811 . It shows how unicode filenames throw
|
||||
* exceptions in 1.13M4 and earlier.
|
||||
*
|
||||
* @author justme84
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class UnicodeErrorTest extends BaseTestCase {
|
||||
|
||||
/**
|
||||
* verifies that messages can now have unicode in them like when the file
|
||||
* names have unicode characters
|
||||
*/
|
||||
public void testUnicodeCharactersInErrorMessage() {
|
||||
ActiveXComponent application = new ActiveXComponent("Word.Application");
|
||||
ActiveXComponent documents = application.getPropertyAsComponent("Documents");
|
||||
ActiveXComponent documents = application
|
||||
.getPropertyAsComponent("Documents");
|
||||
String fileName = "abc\u0411\u0412\u0413\u0414def";
|
||||
try {
|
||||
documents.invoke("Open", fileName);
|
||||
fail("Should have thrown an exception");
|
||||
} catch (ComException e) {
|
||||
assertTrue("Error message should contain file name with unicode " +
|
||||
"characters in it. "+e.getMessage(),
|
||||
e.getMessage().indexOf(fileName) > 0);
|
||||
assertTrue("Error message should contain file name with unicode "
|
||||
+ "characters in it. " + e.getMessage(), e.getMessage()
|
||||
.indexOf(fileName) > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user