Skip to content

Commit eeff8a0

Browse files
committed
Merge pull request #9 from browserstack/args
args
2 parents 8be79c8 + 9ca955e commit eeff8a0

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

src/main/java/com/browserstack/local/Local.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ public class Local {
2121

2222
public Local() {
2323
parameters = new HashMap<String, String>();
24-
parameters.put("v", "-vvv");
25-
parameters.put("f", "-f");
26-
parameters.put("force", "-force");
27-
parameters.put("only", "-only");
28-
parameters.put("forcelocal", "-forcelocal");
29-
parameters.put("localIdentifier", "-localIdentifier");
30-
parameters.put("onlyAutomate", "-onlyAutomate");
31-
parameters.put("proxyHost", "-proxyHost");
32-
parameters.put("proxyPort", "-proxyPort");
33-
parameters.put("proxyUser", "-proxyUser");
34-
parameters.put("proxyPass", "-proxyPass");
35-
parameters.put("forceproxy", "-forceproxy");
36-
parameters.put("hosts", "-hosts");
24+
parameters.put("-v", "-vvv");
25+
parameters.put("-f", "-f");
26+
parameters.put("-force", "-force");
27+
parameters.put("-only", "-only");
28+
parameters.put("-forcelocal", "-forcelocal");
29+
parameters.put("-localIdentifier", "-localIdentifier");
30+
parameters.put("-onlyAutomate", "-onlyAutomate");
31+
parameters.put("-proxyHost", "-proxyHost");
32+
parameters.put("-proxyPort", "-proxyPort");
33+
parameters.put("-proxyUser", "-proxyUser");
34+
parameters.put("-proxyPass", "-proxyPass");
35+
parameters.put("-forceproxy", "-forceproxy");
36+
parameters.put("-hosts", "-hosts");
3737
}
3838

3939
/**
@@ -57,7 +57,7 @@ public void start(Map<String, String> options) throws Exception {
5757
command.add("-logFile");
5858
command.add(logFilePath);
5959

60-
command.add(options.get("key"));
60+
command.add(options.get("-key"));
6161
makeCommand(options);
6262

6363
if (options.get("onlyCommand") != null) return;

src/test/java/com/browserstack/local/BrowserStackLocalTest.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class BrowserStackLocalTest {
1818
public void setUp() throws Exception {
1919
l = new Local();
2020
options = new HashMap<String, String>();
21-
options.put("key", System.getenv("BROWSERSTACK_ACCESS_KEY"));
21+
options.put("-key", System.getenv("BROWSERSTACK_ACCESS_KEY"));
2222
}
2323

2424
@Test
@@ -42,15 +42,15 @@ public void testMultipleBinary() throws Exception {
4242

4343
@Test
4444
public void testEnableVerbose() throws Exception {
45-
options.put("v", "");
45+
options.put("-v", "");
4646
options.put("onlyCommand", "true");
4747
l.start(options);
4848
assertTrue(l.command.contains("-vvv"));
4949
}
5050

5151
@Test
5252
public void testSetFolder() throws Exception {
53-
options.put("f", "/var/html");
53+
options.put("-f", "/var/html");
5454
options.put("onlyCommand", "true");
5555
l.start(options);
5656
assertTrue(l.command.contains("-f"));
@@ -59,47 +59,47 @@ public void testSetFolder() throws Exception {
5959

6060
@Test
6161
public void testEnableForce() throws Exception {
62-
options.put("force", "");
62+
options.put("-force", "");
6363
options.put("onlyCommand", "true");
6464
l.start(options);
6565
assertTrue(l.command.contains("-force"));
6666
}
6767

6868
@Test
6969
public void testEnableOnly() throws Exception {
70-
options.put("only", "");
70+
options.put("-only", "");
7171
options.put("onlyCommand", "true");
7272
l.start(options);
7373
assertTrue(l.command.contains("-only"));
7474
}
7575

7676
@Test
7777
public void testEnableOnlyAutomate() throws Exception {
78-
options.put("onlyAutomate", "");
78+
options.put("-onlyAutomate", "");
7979
options.put("onlyCommand", "true");
8080
l.start(options);
8181
assertTrue(l.command.contains("-onlyAutomate"));
8282
}
8383

8484
@Test
8585
public void testEnableForceLocal() throws Exception {
86-
options.put("forcelocal", "");
86+
options.put("-forcelocal", "");
8787
options.put("onlyCommand", "true");
8888
l.start(options);
8989
assertTrue(l.command.contains("-forcelocal"));
9090
}
9191

9292
@Test
9393
public void testEnableForceProxy() throws Exception {
94-
options.put("forceproxy", "");
94+
options.put("-forceproxy", "");
9595
options.put("onlyCommand", "true");
9696
l.start(options);
9797
assertTrue(l.command.contains("-forceproxy"));
9898
}
9999

100100
@Test
101101
public void testSetLocalIdentifier() throws Exception {
102-
options.put("localIdentifier", "abcdef");
102+
options.put("-localIdentifier", "abcdef");
103103
options.put("onlyCommand", "true");
104104
l.start(options);
105105
assertTrue(l.command.contains("-localIdentifier"));
@@ -108,10 +108,10 @@ public void testSetLocalIdentifier() throws Exception {
108108

109109
@Test
110110
public void testSetProxy() throws Exception {
111-
options.put("proxyHost", "localhost");
112-
options.put("proxyPort", "8080");
113-
options.put("proxyUser", "user");
114-
options.put("proxyPass", "pass");
111+
options.put("-proxyHost", "localhost");
112+
options.put("-proxyPort", "8080");
113+
options.put("-proxyUser", "user");
114+
options.put("-proxyPass", "pass");
115115
options.put("onlyCommand", "true");
116116
l.start(options);
117117
assertTrue(l.command.contains("-proxyHost"));
@@ -126,7 +126,7 @@ public void testSetProxy() throws Exception {
126126

127127
@Test
128128
public void testSetHosts() throws Exception {
129-
options.put("hosts", "localhost,8000,0");
129+
options.put("-hosts", "localhost,8000,0");
130130
options.put("onlyCommand", "true");
131131
l.start(options);
132132
assertTrue(l.command.contains("localhost,8000,0"));

0 commit comments

Comments
 (0)