Commits

Michael Heemskerk  committed f1a6009

CRUC-4793: Updated the unit tests so they also run on MacOs

  • Participants
  • Parent commits d2b42b8

Comments (0)

Files changed (4)

File processutils/src/main/java/com/atlassian/utils/process/ExternalProcess.java

         String[] i18n = new String[cmdArray.length + extraArgs];
         i18n[0] = "cmd";
         i18n[1] = "/C";
-//        i18n[2] = "chcp 65001";
-//        i18n[3] = "&&";
         i18n[extraArgs] = cmdArray[0];
         for (int counter = 1; counter < cmdArray.length; counter++) {
             String envName = "JENV_" + counter;

File processutils/src/test/java/com/atlassian/utils/process/Echo.java

 	 */
 	public static void main(String[] args) {
 		System.err.println("Encoding " + System.getProperty("file.encoding"));
+		System.err.println("Platform " + System.getProperty("os.name").toLowerCase());
 		String sep = "";
 		for (String str : args) {
 			System.out.println(sep + str);

File processutils/src/test/java/com/atlassian/utils/process/ExternalProcessTest.java

     }
     
     protected boolean isWindows() {
-    	return System.getProperty("os.name").toLowerCase().contains("windows");
+        return System.getProperty("os.name").toLowerCase().contains("windows");
     }
     
     @Test
 
     @Test
     public void testCommandLineArgumentsWin1252Iso88591Incompatibilities() throws Exception {
-        if (Charset.isSupported("windows-1252")) {
+        if (Charset.isSupported("windows-1252") && isWindows()) {
+            // other platforms claim to support windows-1252, but it looks like only iso-8859-1 is supported.
             EchoResult result = spawnEcho("windows-1252", "win-1252-not-in-iso-8859-1");
             assertEquals("Windows cp 1252 -  incompatibility detected:", result.input, result.output);
         }

File processutils/src/test/java/com/atlassian/utils/process/echostrings.properties

 # see http://www.iana.org/assignments/character-sets for canonical charsets
 
-# collection of iso-8859-1 unicode chars, see http://en.wikipedia.org/wiki/ISO/IEC_8859-1
-iso-8859-1=\u00A0\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A8\u00A9\u00AA\u00AB\u00AC\u00AD\u00AE\u00AF\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6
+# collection of iso-8859-1 unicode chars, see http://en.wikipedia.org/wiki/ISO/IEC_8859-1: �����������������������
+iso-8859-1=\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6
 
 # latin-extended-A
 latin-ext-A=\u0153\u0144\u0133