@@ -26,31 +26,8 @@ public class BrowserStackRemoteTest {
26
26
@ SuppressWarnings ("unchecked" )
27
27
public void setUp (String config_file , String platform ) throws Exception {
28
28
JSONParser parser = new JSONParser ();
29
- JSONObject config ;
30
- JSONArray platforms ;
31
- if (!config_file .isEmpty ()) {
32
- config = (JSONObject ) parser .parse (new FileReader ("src/test/resources/conf/" + config_file ));
33
- platforms = (JSONArray ) config .get ("platforms" );
34
- } else {
35
- config = (JSONObject ) parser .parse ("{}" );
36
- String cliHub = System .getProperty ("hub" );
37
- if (cliHub .isEmpty ()) {
38
- cliHub = "hub.browserstack.com" ;
39
- }
40
- config .put ("server" , cliHub );
41
- String cliUser = System .getProperty ("userName" );
42
- if (!cliUser .isEmpty ()) {
43
- config .put ("user" , cliUser );
44
- }
45
- String cliKey = System .getProperty ("accessKey" );
46
- if (!cliKey .isEmpty ()) {
47
- config .put ("key" , cliKey );
48
- }
49
- JSONObject cliCaps = (JSONObject ) parser .parse (System .getProperty ("caps" ).replaceAll ("'" , "\" " ));
50
- config .put ("capabilities" , cliCaps );
51
- JSONArray cliplatforms = (JSONArray ) parser .parse (System .getProperty ("platforms" ).replaceAll ("'" , "\" " ));
52
- platforms = cliplatforms ;
53
- }
29
+ JSONObject config = (JSONObject ) parser .parse (new FileReader ("src/test/resources/conf/" + config_file ));
30
+ JSONArray platforms = (JSONArray ) config .get ("platforms" );;
54
31
55
32
DesiredCapabilities capabilities = new DesiredCapabilities ();
56
33
Map <String , String > envCapabilities = (Map <String , String >) platforms .get (Integer .parseInt (platform ));
0 commit comments