forked from rkaippully/play-webdrive
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ES: adding support for version numbers and updating the way we constr…
…uct the RemoteDriver to make it nicer
- Loading branch information
extreme
committed
Dec 9, 2011
1 parent
ca981e0
commit f30635d
Showing
3 changed files
with
81 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package play.modules.webdrive; | ||
|
||
import org.openqa.selenium.Platform; | ||
|
||
public class Driver { | ||
|
||
public static String ANY = "ANY"; | ||
public String name; | ||
public String version; | ||
public Platform platform; | ||
|
||
public Driver(String[] driverParts) { | ||
switch (driverParts.length) { | ||
case 0: | ||
System.out.println("wtf?"); | ||
break; | ||
case 1: | ||
this.name = driverParts[0]; | ||
this.version = ANY; | ||
this.platform = Platform.ANY; | ||
break; | ||
case 2: | ||
this.name = driverParts[0]; | ||
this.version = driverParts[1]; | ||
this.platform = Platform.ANY; | ||
break; | ||
case 3: | ||
this.name = driverParts[0]; | ||
this.version = driverParts[1]; | ||
this.platform = Platform.valueOf(driverParts[2]); | ||
break; | ||
default: | ||
this.name = driverParts[0]; | ||
this.version = driverParts[1]; | ||
this.platform = Platform.valueOf(driverParts[2]); | ||
System.out.println("wtf? why haven't you updated this?"); | ||
break; | ||
} | ||
} | ||
|
||
public Driver(String name) { | ||
this(name, ANY); | ||
} | ||
|
||
public Driver(String name, String version) { | ||
this(name, version, Platform.ANY); | ||
} | ||
|
||
public Driver(String name, String version, Platform platform) { | ||
this.name = name; | ||
this.version = version; | ||
this.platform = platform; | ||
} | ||
|
||
} |
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