56 String java_home = System.getProperty("java.home"); 57 StringBuilder buf = new StringBuilder(); 58 for (int i = 0; i < bounds.length; i++) { 59 buf.append(" " + bounds[i].x); 60 buf.append(" " + bounds[i].y); 61 buf.append(" " + bounds[i].width); 62 buf.append(" " + bounds[i].height); 63 } 64 Map envs = System.getenv(); 65 String enva[] = new String[envs.size()]; 66 int ind = 0; 67 Iterator iter = envs.entrySet().iterator(); 68 while (iter.hasNext()) { 69 Map.Entry entry = (Map.Entry)iter.next(); 70 if (!"AWT_TOOLKIT".equals(entry.getKey())) { 71 enva[ind++] = entry.getKey() + "=" + entry.getValue(); 72 } else { 73 enva[ind++] = "AWT_TOOLKIT=sun.awt.X11.XToolkit"; 74 } 75 } 76 Process proc = Runtime.getRuntime().exec(java_home + 77 "/bin/java -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED -Dawt.toolkit=sun.awt.X11.XToolkit TesterClient " 78 + test.getName() + " " + window + buf, 79 enva); 80 System.err.println("Test for " + test.getName() + " has started."); 81 log.fine("Test for " + test.getName() + " has started."); 82 new InputReader(proc.getInputStream()); 83 new InputReader(proc.getErrorStream()); 84 try { 85 passed = (proc.waitFor() == 0); 86 } catch (InterruptedException ie) { 87 } 88 log.fine("Test for " + test.getName() + " has finished."); 89 File logFile = new File("java3.txt"); 90 if (logFile.exists()) { 91 logFile.renameTo(new File(test.getName() + ".txt")); 92 } 93 return proc; 94 } catch (IOException ex1) { 95 ex1.printStackTrace(); 96 } 97 return null; | 56 String java_home = System.getProperty("java.home"); 57 StringBuilder buf = new StringBuilder(); 58 for (int i = 0; i < bounds.length; i++) { 59 buf.append(" " + bounds[i].x); 60 buf.append(" " + bounds[i].y); 61 buf.append(" " + bounds[i].width); 62 buf.append(" " + bounds[i].height); 63 } 64 Map envs = System.getenv(); 65 String enva[] = new String[envs.size()]; 66 int ind = 0; 67 Iterator iter = envs.entrySet().iterator(); 68 while (iter.hasNext()) { 69 Map.Entry entry = (Map.Entry)iter.next(); 70 if (!"AWT_TOOLKIT".equals(entry.getKey())) { 71 enva[ind++] = entry.getKey() + "=" + entry.getValue(); 72 } else { 73 enva[ind++] = "AWT_TOOLKIT=sun.awt.X11.XToolkit"; 74 } 75 } 76 Process proc = Runtime.getRuntime(). 77 exec(java_home + 78 "/bin/java --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED -Dawt.toolkit=sun.awt.X11.XToolkit TesterClient " 79 + test.getName() + " " + window + buf, 80 enva); 81 System.err.println("Test for " + test.getName() + " has started."); 82 log.fine("Test for " + test.getName() + " has started."); 83 new InputReader(proc.getInputStream()); 84 new InputReader(proc.getErrorStream()); 85 try { 86 passed = (proc.waitFor() == 0); 87 } catch (InterruptedException ie) { 88 } 89 log.fine("Test for " + test.getName() + " has finished."); 90 File logFile = new File("java3.txt"); 91 if (logFile.exists()) { 92 logFile.renameTo(new File(test.getName() + ".txt")); 93 } 94 return proc; 95 } catch (IOException ex1) { 96 ex1.printStackTrace(); 97 } 98 return null; |