Author: konstantin.mishin
Date: 2008-12-08 10:29:18 -0500 (Mon, 08 Dec 2008)
New Revision: 11640
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08
15:26:58 UTC (rev 11639)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08
15:29:18 UTC (rev 11640)
@@ -23,8 +23,8 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.FileFilter;
import java.io.FileInputStream;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -141,25 +141,33 @@
@BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
- String[] paths = {"/usr/lib/firefox-1.0.4/firefox-bin",
- "/usr/lib/firefox-1.5.0.10/firefox-bin",
- "/usr/lib/firefox-1.5.0.12/firefox-bin",
- "/usr/lib64/firefox-1.5.0.12/firefox-bin",
- "/usr/lib/firefox-3.0b5/firefox-bin",
- "/usr/lib64/firefox-3.0b5/firefox-bin",
- "/usr/lib/firefox-3.0.1/firefox-bin",
- "/usr/lib64/firefox-3.0.1/firefox-bin",
- "/usr/lib/firefox/firefox-bin",
- "/usr/lib/firefox-1.5.0.9/firefox-bin"
- };
if ("*firefox".equals(browser)) {
- for (int i = 0; i < paths.length &&
"*firefox".equals(browser); i++) {
- String path = paths[i];
- File file = new File(path);
- if (file.isFile()) {
- browser += " " + path;
- }
- }
+ File[] libs = {new File("/usr/lib"), new File("/usr/lib64")};
+ for (int i = 0; i < libs.length && "*firefox".equals(browser);
i++) {
+ File lib = libs[i];
+ if (lib.isDirectory()) {
+ System.out.println("---->lib#" + i + ": " + lib.getPath());
+ File[] firefoxDirs = lib.listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname != null&&
pathname.getName().startsWith("firefox")
+ && pathname.isDirectory();
+ }
+ });
+ for (int j = firefoxDirs.length - 1; j >= 0 &&
"*firefox".equals(browser); j--) {
+ System.out.println("------>firefoxDir#" + j + ": " +
firefoxDirs[j].getPath());
+ File[] firefoxes = firefoxDirs[j].listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname != null&&
pathname.getName().startsWith("firefox")
+ && pathname.isFile();
+ }
+ });
+ for (int k = firefoxes.length - 1; k >= 0 &&
"*firefox".equals(browser); k--) {
+ System.out.println("-------->firefoxes#" + k + ": " +
firefoxes[k].getPath());
+ browser += " " + firefoxes[k].getPath();
+ }
+ }
+ }
+ }
}
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
Show replies by date