summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2012-11-08 05:36:24 (EST)
committerDani Megert2012-11-12 04:21:40 (EST)
commit157d86b3c2b072256343af0016e9d363e1fd522a (patch)
tree49453ac1e049599c402f681260500f580f18d90d
parenteecb63aa56f01db143aea5ff5d3c2c3300e57403 (diff)
downloadeclipse.platform.text-157d86b3c2b072256343af0016e9d363e1fd522a.zip
eclipse.platform.text-157d86b3c2b072256343af0016e9d363e1fd522a.tar.gz
eclipse.platform.text-157d86b3c2b072256343af0016e9d363e1fd522a.tar.bz2
Bug 393353: Test failure in EncodingChangeTests on the Hudson Mac
-rw-r--r--org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/EncodingChangeTests.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/EncodingChangeTests.java b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/EncodingChangeTests.java
index 94f7b39..7478d5f 100644
--- a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/EncodingChangeTests.java
+++ b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/EncodingChangeTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.filebuffers.ITextFileBuffer;
@@ -53,6 +54,7 @@ import org.eclipse.ui.editors.text.TextEditor;
*/
public class EncodingChangeTests extends TestCase {
+ private static final String NON_DEFAULT_ENCODING= "US-ASCII".equals(ResourcesPlugin.getEncoding()) ? "ISO-8859-1" : "US-ASCII";
private static final String ORIGINAL_CONTENT= "line1\nline2\nline3";
public static Test suite() {
@@ -99,7 +101,7 @@ public class EncodingChangeTests extends TestCase {
IWorkbench workbench= PlatformUI.getWorkbench();
IWorkbenchPage page= workbench.getActiveWorkbenchWindow().getActivePage();
try {
- fFile.setCharset("US-ASCII", null);
+ fFile.setCharset(NON_DEFAULT_ENCODING, null);
} catch (CoreException ex) {
fail();
}
@@ -113,7 +115,7 @@ public class EncodingChangeTests extends TestCase {
ScrolledComposite composite= (ScrolledComposite)accessor.get("fStatusControl");
assertNull(composite);
DefaultEncodingSupport encodingSupport= (DefaultEncodingSupport)editor.getAdapter(IEncodingSupport.class);
- assertEquals("US-ASCII", encodingSupport.getEncoding());
+ assertEquals(NON_DEFAULT_ENCODING, encodingSupport.getEncoding());
} else
fail();
@@ -132,7 +134,7 @@ public class EncodingChangeTests extends TestCase {
while (editor.getSite().getShell().getDisplay().readAndDispatch()) {
}
DefaultEncodingSupport encodingSupport= (DefaultEncodingSupport)editor.getAdapter(IEncodingSupport.class);
- encodingSupport.setEncoding("US-ASCII");
+ encodingSupport.setEncoding(NON_DEFAULT_ENCODING);
Accessor accessor= new Accessor(editor, StatusTextEditor.class);
while (editor.getSite().getShell().getDisplay().readAndDispatch()) {
}
@@ -144,7 +146,7 @@ public class EncodingChangeTests extends TestCase {
} catch (CoreException e1) {
fail();
}
- assertEquals("US-ASCII", actual);
+ assertEquals(NON_DEFAULT_ENCODING, actual);
} else
fail();
} catch (PartInitException e) {