Skip to content

Commit 57f5969

Browse files
committed
fix maven warnings
Signed-off-by: Varun Garg <[email protected]>
1 parent 6a47b27 commit 57f5969

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@
5050

5151
<build>
5252
<plugins>
53-
<plugin>
54-
<groupId>org.apache.maven.plugins</groupId>
55-
<artifactId>maven-surefire-plugin</artifactId>
56-
<version>2.12.4</version>
57-
</plugin>
5853
<plugin>
5954
<groupId>org.apache.maven.plugins</groupId>
6055
<artifactId>maven-surefire-plugin</artifactId>

src/test/java/com/browserstack/BrowserStackTestNGTest.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
import org.testng.annotations.AfterMethod;
1717
import org.testng.annotations.BeforeMethod;
1818

19-
2019
public class BrowserStackTestNGTest {
2120
public WebDriver driver;
2221
private Local l;
2322

24-
@BeforeMethod(alwaysRun=true)
25-
@org.testng.annotations.Parameters(value={"config", "environment"})
23+
@BeforeMethod(alwaysRun = true)
24+
@org.testng.annotations.Parameters(value = { "config", "environment" })
25+
@SuppressWarnings("unchecked")
2626
public void setUp(String config_file, String environment) throws Exception {
2727
JSONParser parser = new JSONParser();
2828
JSONObject config = (JSONObject) parser.parse(new FileReader("src/test/resources/conf/" + config_file));
@@ -33,42 +33,45 @@ public void setUp(String config_file, String environment) throws Exception {
3333
Map<String, String> envCapabilities = (Map<String, String>) envs.get(environment);
3434
Iterator it = envCapabilities.entrySet().iterator();
3535
while (it.hasNext()) {
36-
Map.Entry pair = (Map.Entry)it.next();
36+
Map.Entry pair = (Map.Entry) it.next();
3737
capabilities.setCapability(pair.getKey().toString(), pair.getValue().toString());
3838
}
39-
39+
4040
Map<String, String> commonCapabilities = (Map<String, String>) config.get("capabilities");
4141
it = commonCapabilities.entrySet().iterator();
4242
while (it.hasNext()) {
43-
Map.Entry pair = (Map.Entry)it.next();
44-
if(capabilities.getCapability(pair.getKey().toString()) == null){
43+
Map.Entry pair = (Map.Entry) it.next();
44+
if (capabilities.getCapability(pair.getKey().toString()) == null) {
4545
capabilities.setCapability(pair.getKey().toString(), pair.getValue().toString());
4646
}
4747
}
4848

4949
String username = System.getenv("BROWSERSTACK_USERNAME");
50-
if(username == null) {
50+
if (username == null) {
5151
username = (String) config.get("user");
5252
}
5353

5454
String accessKey = System.getenv("BROWSERSTACK_ACCESS_KEY");
55-
if(accessKey == null) {
55+
if (accessKey == null) {
5656
accessKey = (String) config.get("key");
5757
}
5858

59-
if(capabilities.getCapability("browserstack.local") != null && capabilities.getCapability("browserstack.local") == "true"){
59+
if (capabilities.getCapability("browserstack.local") != null
60+
&& capabilities.getCapability("browserstack.local") == "true") {
6061
l = new Local();
6162
Map<String, String> options = new HashMap<String, String>();
6263
options.put("key", accessKey);
6364
l.start(options);
6465
}
6566

66-
driver = new RemoteWebDriver(new URL("http://"+username+":"+accessKey+"@"+config.get("server")+"/wd/hub"), capabilities);
67+
driver = new RemoteWebDriver(
68+
new URL("http://" + username + ":" + accessKey + "@" + config.get("server") + "/wd/hub"), capabilities);
6769
}
6870

69-
@AfterMethod(alwaysRun=true)
71+
@AfterMethod(alwaysRun = true)
7072
public void tearDown() throws Exception {
7173
driver.quit();
72-
if(l != null) l.stop();
74+
if (l != null)
75+
l.stop();
7376
}
7477
}

0 commit comments

Comments
 (0)