File tree Expand file tree Collapse file tree 3 files changed +67
-11
lines changed
java/src/org/openqa/selenium/manager Expand file tree Collapse file tree 3 files changed +67
-11
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ java_export(
18
18
],
19
19
deps = [
20
20
"//java/src/org/openqa/selenium:core" ,
21
+ "//java/src/org/openqa/selenium/json" ,
21
22
artifact ("com.google.guava:guava" ),
22
- artifact ("com.google.code.gson:gson" ),
23
23
],
24
24
)
25
25
Original file line number Diff line number Diff line change 18
18
19
19
import com .google .common .collect .ImmutableList ;
20
20
import com .google .common .io .CharStreams ;
21
- import com .google .gson .GsonBuilder ;
22
21
import org .openqa .selenium .Beta ;
23
22
import org .openqa .selenium .Capabilities ;
24
23
import org .openqa .selenium .Platform ;
25
24
import org .openqa .selenium .WebDriverException ;
25
+ import org .openqa .selenium .json .Json ;
26
26
27
27
import java .io .File ;
28
28
import java .io .IOException ;
@@ -113,7 +113,7 @@ private static String runCommand(String... command) {
113
113
throw new WebDriverException ("Unsuccessful command executed: " + Arrays .toString (command ) +
114
114
"\n " + output );
115
115
}
116
- SeleniumManagerJsonOutput jsonOutput = new GsonBuilder ().create (). fromJson (output ,
116
+ SeleniumManagerJsonOutput jsonOutput = new Json ().toType (output ,
117
117
SeleniumManagerJsonOutput .class );
118
118
jsonOutput .logs .stream ().filter (log -> log .level .equalsIgnoreCase (WARN ))
119
119
.forEach (log -> LOG .warning (log .message ));
Original file line number Diff line number Diff line change 20
20
21
21
public class SeleniumManagerJsonOutput {
22
22
23
- List <Log > logs ;
24
- Result result ;
23
+ public List <Log > logs ;
24
+ public Result result ;
25
25
26
- class Log {
27
- String level ;
26
+ public List <Log > getLogs () {
27
+ return logs ;
28
+ }
29
+
30
+ public void setLogs (List <Log > logs ) {
31
+ this .logs = logs ;
32
+ }
33
+
34
+ public Result getResult () {
35
+ return result ;
36
+ }
37
+
38
+ public void setResult (Result result ) {
39
+ this .result = result ;
40
+ }
41
+
42
+ public static class Log {
43
+ public String level ;
28
44
long timestamp ;
29
- String message ;
45
+ public String message ;
46
+
47
+ public String getLevel () {
48
+ return level ;
49
+ }
50
+
51
+ public void setLevel (String level ) {
52
+ this .level = level ;
53
+ }
54
+
55
+ public long getTimestamp () {
56
+ return timestamp ;
57
+ }
58
+
59
+ public void setTimestamp (long timestamp ) {
60
+ this .timestamp = timestamp ;
61
+ }
62
+
63
+ public String getMessage () {
64
+ return message ;
65
+ }
66
+
67
+ public void setMessage (String message ) {
68
+ this .message = message ;
69
+ }
30
70
}
31
71
32
- class Result {
33
- int code ;
34
- String message ;
72
+ public static class Result {
73
+ public int code ;
74
+ public String message ;
75
+
76
+ public int getCode () {
77
+ return code ;
78
+ }
79
+
80
+ public void setCode (int code ) {
81
+ this .code = code ;
82
+ }
83
+
84
+ public String getMessage () {
85
+ return message ;
86
+ }
87
+
88
+ public void setMessage (String message ) {
89
+ this .message = message ;
90
+ }
35
91
}
36
92
37
93
}
You can’t perform that action at this time.
0 commit comments