Skip to content

Commit

Permalink
Partial backport of graphql from v4 trunk (036ee7f)
Browse files Browse the repository at this point in the history
  • Loading branch information
pczerkas committed Jul 31, 2022
1 parent e82be7d commit d62f2a9
Show file tree
Hide file tree
Showing 41 changed files with 2,615 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ third_party/py/googlestorage/client_secrets.json
venv
venv3
py/.idea
.vscode

# Bazel stuff
bazel-bin
bazel-genfiles
bazel-out
bazel-selenium
bazel-testlogs

4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ end
verbose($DEBUG)

def release_version
"3.141"
"3.200"
end

def version
"#{release_version}.59"
"#{release_version}.11"
end

# The build system used by webdriver is layered on top of rake, and we call it
Expand Down
11 changes: 11 additions & 0 deletions common/.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1659277340837</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
9 changes: 9 additions & 0 deletions java/client/.project
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,14 @@
<arguments>1.0-name-matches-false-false-build.desc</arguments>
</matcher>
</filter>
<filter>
<id>1659277340828</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
2 changes: 2 additions & 0 deletions java/client/src/org/openqa/selenium/json/Json.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import java.util.Map;

public class Json {
public static final String JSON_UTF_8 = "application/json; charset=utf-8";

public static final Type LIST_OF_MAPS_TYPE = new TypeToken<List<Map<String, Object>>>() {}.getType();
public static final Type MAP_TYPE = new TypeToken<Map<String, Object>>() {}.getType();
public static final Type OBJECT_TYPE = new TypeToken<Object>() {}.getType();
Expand Down
10 changes: 10 additions & 0 deletions java/client/src/org/openqa/selenium/json/JsonOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public class JsonOutput implements Closeable {
private String indent = "";
private String lineSeparator = "\n";
private String indentBy = " ";
private boolean writeClassName = true;

JsonOutput(Appendable appendable) {
this.appendable = Objects.requireNonNull(appendable);
Expand Down Expand Up @@ -197,6 +198,11 @@ public JsonOutput setPrettyPrint(boolean enablePrettyPrinting) {
return this;
}

public JsonOutput writeClassName(boolean writeClassName) {
this.writeClassName = writeClassName;
return this;
}

public JsonOutput beginObject() {
stack.getFirst().write("{" + lineSeparator);
indent += indentBy;
Expand Down Expand Up @@ -355,6 +361,10 @@ private void mapObject(Object toConvert, int maxDepth) {
continue;
}

if (!writeClassName && "class".equals(pd.getName())) {
continue;
}

name(pd.getName());
write(pd.getReadMethod().apply(toConvert), maxDepth - 1);
}
Expand Down
9 changes: 9 additions & 0 deletions java/server/.project
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,14 @@
<arguments>1.0-name-matches-false-false-build.desc</arguments>
</matcher>
</filter>
<filter>
<id>1659277340839</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
8 changes: 8 additions & 0 deletions java/server/src/org/openqa/grid/BUCK
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
java_library(name = 'grid',
srcs = glob([
'common/**/*.java',
'graphql/**/*.java',
'internal/**/*.java',
'remote/**/*.java',
'server/**/*.java',
'shared/**/*.java',
'web/**/*.java',
]),
resources = glob([
'graphql/selenium-grid-schema.graphqls',
'images/*.css',
'images/*.gif',
'images/*.html',
Expand All @@ -26,11 +30,15 @@ java_library(name = 'grid',
'//java/server/src/org/openqa/selenium/remote/server:webdriver-servlet',
'//java/server/src/org/openqa/selenium/remote/server/log:log',
'//java/server/src/org/openqa/selenium/remote/server/jmx:jmx',
'//third_party/java/antlr:antlr',
'//third_party/java/beust:jcommander',
'//third_party/java/guava:guava',
'//third_party/java/graphql:graphql-java',
'//third_party/java/graphql:java-dataloader',
'//third_party/java/jcip:jcip-annotations',
'//third_party/java/jetty:jetty',
'//third_party/java/servlet:javax.servlet-api',
'//third_party/java/slf4j:slf4j-api',
'//third_party/java/yaml:snakeyaml',
],
visibility = [
Expand Down
Loading

0 comments on commit d62f2a9

Please sign in to comment.