Permalink
Browse files

Quality: removed unnecessary blank lines and used spaces for indents …

…in stead of tabs
  • Loading branch information...
awulder
awulder committed Feb 26, 2013
1 parent bd91233 commit 0d0446b088d54627302fb5190c8cd2afcc500d4a
Showing with 2,113 additions and 2,142 deletions.
  1. +3 −3 src/main/java/com/xebia/incubator/xebium/AssertionAndStopTestError.java
  2. +3 −3 src/main/java/com/xebia/incubator/xebium/ConfigurableWebDriverSupplier.java
  3. +95 −96 src/main/java/com/xebia/incubator/xebium/DefaultWebDriverSupplier.java
  4. +341 −343 src/main/java/com/xebia/incubator/xebium/ExtendedSeleniumCommand.java
  5. +47 −49 src/main/java/com/xebia/incubator/xebium/FitNesseUtil.java
  6. +66 −81 src/main/java/com/xebia/incubator/xebium/HttpCommandProcessorAdapter.java
  7. +36 −37 src/main/java/com/xebia/incubator/xebium/LocatorCheck.java
  8. +62 −64 src/main/java/com/xebia/incubator/xebium/RemoteWebDriverSupplier.java
  9. +148 −151 src/main/java/com/xebia/incubator/xebium/ScreenCapture.java
  10. +63 −63 src/main/java/com/xebia/incubator/xebium/SeleneseScriptFixture.java
  11. +447 −447 src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java
  12. +50 −50 src/main/java/com/xebia/incubator/xebium/SeleniumServerFixture.java
  13. +3 −6 src/main/java/org/openqa/selenium/firefox/PreferencesWrapper.java
  14. +367 −367 src/test/java/com/xebia/fitnesse/selenium/JavascriptTestCase.java
  15. +198 −198 src/test/java/com/xebia/incubator/xebium/ExtendedSeleniumCommandTest.java
  16. +8 −8 src/test/java/com/xebia/incubator/xebium/FitNesseUtilTest.java
  17. +23 −23 src/test/java/com/xebia/incubator/xebium/RemoteWebDriverBuilderTest.java
  18. +22 −22 src/test/java/com/xebia/incubator/xebium/SeleneseScriptFixtureTest.java
  19. +45 −45 src/test/java/com/xebia/incubator/xebium/SeleniumDriverFixtureIntegrationTest.java
  20. +38 −38 src/test/java/com/xebia/incubator/xebium/SeleniumDriverFixtureTest.java
  21. +48 −48 src/test/java/com/xebia/incubator/xebium/WebDriverTest.java
@@ -19,8 +19,8 @@
public class AssertionAndStopTestError extends AssertionError {
- public AssertionAndStopTestError(Object detailMessage) {
- super(detailMessage);
- }
+ public AssertionAndStopTestError(Object detailMessage) {
+ super(detailMessage);
+ }
}
@@ -25,9 +25,9 @@
*/
public interface ConfigurableWebDriverSupplier {
- public void setBrowser(String browser);
+ public void setBrowser(String browser);
- public void setCustomProfilePreferencesFile(File customProfilePreferencesFile);
+ public void setCustomProfilePreferencesFile(File customProfilePreferencesFile);
- public void setProfileDirectory(File profileDirectory);
+ public void setProfileDirectory(File profileDirectory);
}
@@ -40,59 +40,58 @@
public class DefaultWebDriverSupplier implements ConfigurableWebDriverSupplier {
- private static final Logger LOG = LoggerFactory.getLogger(SeleniumDriverFixture.class);
+ private static final Logger LOG = LoggerFactory.getLogger(SeleniumDriverFixture.class);
- private String browser;
+ private String browser;
private File customProfilePreferencesFile;
- private File profileDirectory;
-
- public DefaultWebDriverSupplier() {
- }
-
- public WebDriver newWebDriver() {
- WebDriver driver;
- if ("firefox".equalsIgnoreCase(browser)) {
- FirefoxProfile profile;
- // Load FireFox-profile if present
- if (profileDirectory != null) {
- profile = new FirefoxProfile(profileDirectory);
- LOG.info("Firefox profile successfully loaded");
- }
- else {
- profile = new FirefoxProfile();
- }
-
- if (customProfilePreferencesFile != null) {
- PreferencesWrapper prefs = loadFirefoxPreferences();
-
- prefs.addTo(profile);
- try {
- StringWriter writer = new StringWriter(512);
- prefs.writeTo(writer);
- LOG.info("Added properties to firefox profile: " + writer.toString());
- } catch (IOException e) {
- LOG.error("Unable to log firefox profile settings", e);
- }
- }
-
- // Ensure we deal with untrusted and unverified hosts.
- profile.setAcceptUntrustedCertificates(true);
- profile.setAssumeUntrustedCertificateIssuer(true);
-
- driver = new FirefoxDriver(profile);
- } else if ("iexplore".equalsIgnoreCase(browser)) {
- driver = new InternetExplorerDriver();
- } else if ("chrome".equalsIgnoreCase(browser)) {
- driver = new ChromeDriver();
- } else if ("safari".equalsIgnoreCase(browser)) {
- driver = new SafariDriver();
- } else if ("htmlUnit".equalsIgnoreCase(browser)) {
- driver = new HtmlUnitDriver();
- } else if ("htmlUnit+js".equalsIgnoreCase(browser)) {
- driver = new HtmlUnitDriver(true);
- } else if ("opera".equalsIgnoreCase(browser)) {
+ private File profileDirectory;
+
+ public DefaultWebDriverSupplier() {
+ }
+
+ public WebDriver newWebDriver() {
+ WebDriver driver;
+ if ("firefox".equalsIgnoreCase(browser)) {
+ FirefoxProfile profile;
+ // Load FireFox-profile if present
+ if (profileDirectory != null) {
+ profile = new FirefoxProfile(profileDirectory);
+ LOG.info("Firefox profile successfully loaded");
+ } else {
+ profile = new FirefoxProfile();
+ }
+
+ if (customProfilePreferencesFile != null) {
+ PreferencesWrapper prefs = loadFirefoxPreferences();
+
+ prefs.addTo(profile);
+ try {
+ StringWriter writer = new StringWriter(512);
+ prefs.writeTo(writer);
+ LOG.info("Added properties to firefox profile: " + writer.toString());
+ } catch (IOException e) {
+ LOG.error("Unable to log firefox profile settings", e);
+ }
+ }
+
+ // Ensure we deal with untrusted and unverified hosts.
+ profile.setAcceptUntrustedCertificates(true);
+ profile.setAssumeUntrustedCertificateIssuer(true);
+
+ driver = new FirefoxDriver(profile);
+ } else if ("iexplore".equalsIgnoreCase(browser)) {
+ driver = new InternetExplorerDriver();
+ } else if ("chrome".equalsIgnoreCase(browser)) {
+ driver = new ChromeDriver();
+ } else if ("safari".equalsIgnoreCase(browser)) {
+ driver = new SafariDriver();
+ } else if ("htmlUnit".equalsIgnoreCase(browser)) {
+ driver = new HtmlUnitDriver();
+ } else if ("htmlUnit+js".equalsIgnoreCase(browser)) {
+ driver = new HtmlUnitDriver(true);
+ } else if ("opera".equalsIgnoreCase(browser)) {
driver = new OperaDriver();
} else if ("opera-mobile-tablet".equalsIgnoreCase(browser)) {
DesiredCapabilities capabilities = DesiredCapabilities.opera();
@@ -112,52 +111,52 @@ public WebDriver newWebDriver() {
driver = new OperaDriver(capabilities);
} else if ("phantomjs".equalsIgnoreCase(browser)) {
driver = new PhantomJSDriver(DesiredCapabilities.phantomjs());
- } else {
- try {
- driver = new RemoteWebDriverSupplier(browser).get();
- } catch (Exception e) {
- throw new RuntimeException("Unknown browser type. Should be one of 'firefox', 'iexplore', 'chrome', " +
+ } else {
+ try {
+ driver = new RemoteWebDriverSupplier(browser).get();
+ } catch (Exception e) {
+ throw new RuntimeException("Unknown browser type. Should be one of 'firefox', 'iexplore', 'chrome', " +
"'opera', 'opera-mobile-tablet', 'opera-mobile-phone', 'htmlUnit' or 'htmlUnit+js'", e);
- }
- }
- return driver;
- }
-
- private PreferencesWrapper loadFirefoxPreferences() {
- PreferencesWrapper prefs;
- FileReader reader;
- try {
- reader = new FileReader(customProfilePreferencesFile);
- } catch (FileNotFoundException e) {
- throw new RuntimeException(e);
- }
- try {
- prefs = new PreferencesWrapper(reader);
- } finally {
- try {
- reader.close();
- } catch (IOException e) {
- LOG.error("Unable to close firefox profile settings file", e);
- }
- }
- return prefs;
- }
-
- public void setBrowser(String browser) {
- this.browser = browser;
- }
-
- public void setCustomProfilePreferencesFile(
- File customProfilePreferencesFile) {
- this.customProfilePreferencesFile = customProfilePreferencesFile;
- }
-
- public void setProfileDirectory(File profileDirectory) {
- this.profileDirectory = profileDirectory;
- }
-
- @Override
- public String toString() {
- return getClass().getName();
- }
+ }
+ }
+ return driver;
+ }
+
+ private PreferencesWrapper loadFirefoxPreferences() {
+ PreferencesWrapper prefs;
+ FileReader reader;
+ try {
+ reader = new FileReader(customProfilePreferencesFile);
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ try {
+ prefs = new PreferencesWrapper(reader);
+ } finally {
+ try {
+ reader.close();
+ } catch (IOException e) {
+ LOG.error("Unable to close firefox profile settings file", e);
+ }
+ }
+ return prefs;
+ }
+
+ public void setBrowser(String browser) {
+ this.browser = browser;
+ }
+
+ public void setCustomProfilePreferencesFile(
+ File customProfilePreferencesFile) {
+ this.customProfilePreferencesFile = customProfilePreferencesFile;
+ }
+
+ public void setProfileDirectory(File profileDirectory) {
+ this.profileDirectory = profileDirectory;
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getName();
+ }
}
Oops, something went wrong.

0 comments on commit 0d0446b

Please sign in to comment.