Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce classindex dependency and auto-discover WebDriverFactory im…
…plementations.
- Loading branch information
Showing
11 changed files
with
138 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
fluentlenium-core/src/main/java/org/fluentlenium/configuration/AlternativeNames.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
package org.fluentlenium.configuration; | |||
|
|||
/** | |||
* Add alternative names to an object. | |||
* | |||
* {@link WebDriverFactory} implementations can also implement this interface to be registered in {@link WebDrivers} | |||
* registry with those alternative names. | |||
*/ | |||
public interface AlternativeNames { | |||
/** | |||
* Get the alternative names. | |||
* | |||
* @return | |||
*/ | |||
String[] getAlternativeNames(); | |||
} |
28 changes: 28 additions & 0 deletions
28
...ntlenium-core/src/main/java/org/fluentlenium/configuration/DefaultWebDriverFactories.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
package org.fluentlenium.configuration; | |||
|
|||
public class DefaultWebDriverFactories { | |||
public static class FirefoxWebDriverFactory extends ReflectiveWebDriverFactory { | |||
public FirefoxWebDriverFactory() { | |||
super("firefox", "org.openqa.selenium.firefox.FirefoxDriver"); | |||
} | |||
} | |||
|
|||
public static class ChromeWebDriverFactory extends ReflectiveWebDriverFactory { | |||
public ChromeWebDriverFactory() { | |||
super("chrome", "org.openqa.selenium.chrome.ChromeDriver"); | |||
} | |||
} | |||
|
|||
public static class InternetExplorerWebDriverFactory extends ReflectiveWebDriverFactory { | |||
public InternetExplorerWebDriverFactory() { | |||
super("ie", "org.openqa.selenium.ie.InternetExplorerDriver"); | |||
} | |||
} | |||
|
|||
public static class HtmlUnitWebDriverFactory extends ReflectiveWebDriverFactory { | |||
public HtmlUnitWebDriverFactory() { | |||
super("htmlunit", "org.openqa.selenium.htmlunit.HtmlUnitDriver"); | |||
} | |||
} | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ntlenium-core/src/main/java/org/fluentlenium/configuration/WebDriverFactoryProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
package org.fluentlenium.configuration; | |||
|
|||
import org.atteo.classindex.processor.ClassIndexProcessor; | |||
|
|||
public class WebDriverFactoryProcessor extends ClassIndexProcessor { | |||
public WebDriverFactoryProcessor() { | |||
indexSubclasses(WebDriverFactory.class); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters