Skip to content

Commit

Permalink
Merge pull request #1374 from phillip-kruger/jakarta
Browse files Browse the repository at this point in the history
Javax -> Jakarta
  • Loading branch information
phillip-kruger authored May 2, 2022
2 parents a1270c3 + 4696df6 commit d274e03
Show file tree
Hide file tree
Showing 202 changed files with 857 additions and 757 deletions.
14 changes: 11 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
:microprofile-graphql: https://github.com/eclipse/microprofile-graphql/
:graphql-over-http: https://github.com/graphql/graphql-over-http
:subscriptions-transport-ws: https://github.com/apollographql/subscriptions-transport-ws
:graphql-ws: https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md

image:https://github.com/smallrye/smallrye-graphql/workflows/SmallRye%20Build/badge.svg?branch=main[link=https://github.com/smallrye/smallrye-graphql/actions?query=workflow%3A%22SmallRye+Build%22]
image:https://sonarcloud.io/api/project_badges/measure?project=smallrye_smallrye-graphql&metric=alert_status["Quality Gate Status", link="https://sonarcloud.io/dashboard?id=smallrye_smallrye-graphql"]
Expand All @@ -12,23 +14,25 @@ SmallRye GraphQL is an implementation of

- {microprofile-graphql}[Eclipse MicroProfile GraphQL].
- {graphql-over-http}[GraphQL over HTTP].
- {graphql-ws}[GraphQL over WebSocket].
- {subscriptions-transport-ws}[Subscriptions transport ws] (old).

== Instructions

=== Testing against the released v 1.1.0 of MicroProfile GraphQL
=== Testing against the released v 2.0 of MicroProfile GraphQL

[source,bash]
----
mvn clean install
----

=== Testing against the unreleased v 2.0-SNAPSHOT of MicroProfile GraphQL
=== Testing against the unreleased v 2.1-SNAPSHOT of MicroProfile GraphQL

(You need to build that version of MicroProfile GraphQL locally first to make the snapshot versions available in your repository)

[source,bash]
----
mvn clean install -Dversion.eclipse.microprofile.graphql=2.0-SNAPSHOT
mvn clean install -Dversion.eclipse.microprofile.graphql=2.1-SNAPSHOT
----

=== Documentation
Expand All @@ -37,6 +41,10 @@ The live documentation is available at link:https://smallrye.io/smallrye-graphql

Info about how to build and manage the documentation is in `docs/README.adoc`.

=== Javax/Jakarta

The 1.5.x branch will be maintained for the `javax` namespace, and the main (2.x) branch for `jakarta`.

=== Project structure

==== Common
Expand Down
2 changes: 1 addition & 1 deletion client/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-parent</artifactId>
<version>1.5.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>smallrye-graphql-client-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Map;

import javax.json.JsonObject;
import jakarta.json.JsonObject;

public interface Request {
String getDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.List;
import java.util.Map;

import javax.json.JsonObject;
import jakarta.json.JsonObject;

public interface Response {

Expand Down
4 changes: 1 addition & 3 deletions client/generator-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-parent</artifactId>
<version>1.5.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>smallrye-graphql-client-generator-test</artifactId>
Expand Down Expand Up @@ -39,12 +39,10 @@
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-api</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion client/generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-parent</artifactId>
<version>1.5.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>smallrye-graphql-client-generator</artifactId>
Expand Down
10 changes: 1 addition & 9 deletions client/implementation-vertx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-parent</artifactId>
<version>1.5.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>smallrye-graphql-client-implementation-vertx</artifactId>
Expand Down Expand Up @@ -39,19 +39,11 @@
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-tck</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${version.mockito}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.11</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

import javax.json.JsonObject;
import jakarta.json.JsonObject;

import org.jboss.logging.Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Stream;

import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonArrayBuilder;
import javax.json.JsonBuilderFactory;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import javax.json.JsonValue;
import jakarta.json.Json;
import jakarta.json.JsonArray;
import jakarta.json.JsonArrayBuilder;
import jakarta.json.JsonBuilderFactory;
import jakarta.json.JsonObject;
import jakarta.json.JsonObjectBuilder;
import jakarta.json.JsonValue;

import org.jboss.logging.Logger;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.smallrye.graphql.client.vertx.websocket;

import javax.json.JsonObject;
import jakarta.json.JsonObject;

import io.smallrye.mutiny.Uni;
import io.smallrye.mutiny.subscription.MultiEmitter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import javax.json.JsonString;
import javax.json.JsonValue;
import javax.json.stream.JsonParsingException;
import jakarta.json.Json;
import jakarta.json.JsonArray;
import jakarta.json.JsonObject;
import jakarta.json.JsonObjectBuilder;
import jakarta.json.JsonString;
import jakarta.json.JsonValue;
import jakarta.json.stream.JsonParsingException;

import org.jboss.logging.Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;

import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import javax.json.JsonString;
import javax.json.JsonValue;
import javax.json.stream.JsonParsingException;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.json.JsonObjectBuilder;
import jakarta.json.JsonString;
import jakarta.json.JsonValue;
import jakarta.json.stream.JsonParsingException;

import org.jboss.logging.Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class IncrementingNumberOperationIDGenerator implements OperationIDGenerator {

private AtomicLong generator = new AtomicLong(1);
private final AtomicLong generator = new AtomicLong(1);

@Override
public String generate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import java.lang.reflect.Method;
import java.net.URI;

import javax.json.Json;
import javax.json.JsonObject;
import jakarta.json.Json;
import jakarta.json.JsonObject;

import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
Expand Down
17 changes: 3 additions & 14 deletions client/implementation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-parent</artifactId>
<version>1.5.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>smallrye-graphql-client</artifactId>
Expand All @@ -17,8 +17,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
<source>11</source>
<target>11</target>
<parameters>true</parameters>
</configuration>
</plugin>
Expand Down Expand Up @@ -56,11 +56,6 @@
<artifactId>jakarta.json-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config</artifactId>
Expand Down Expand Up @@ -121,12 +116,6 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${version.mockito}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.slf4j</groupId>
<artifactId>slf4j-jboss-logging</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
import java.util.Map;
import java.util.Objects;

import javax.json.*;
import javax.json.bind.Jsonb;
import javax.json.bind.JsonbBuilder;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.json.JsonObjectBuilder;
import jakarta.json.JsonStructure;
import jakarta.json.JsonValue;
import jakarta.json.bind.Jsonb;
import jakarta.json.bind.JsonbBuilder;

import org.eclipse.yasson.internal.JsonBinding;

Expand All @@ -23,6 +27,7 @@ public RequestImpl(String document) {
this.variables = new HashMap<>();
}

@Override
public String toJson() {
JsonObjectBuilder queryBuilder = Json.createObjectBuilder().add("query", document);
if (!variables.isEmpty()) {
Expand All @@ -34,6 +39,7 @@ public String toJson() {
return queryBuilder.build().toString();
}

@Override
public JsonObject toJsonObject() {
JsonObjectBuilder queryBuilder = Json.createObjectBuilder().add("query", document);
if (!variables.isEmpty()) {
Expand Down Expand Up @@ -68,22 +74,27 @@ private JsonObject _formatJsonVariables() {
return varBuilder.build();
}

@Override
public String getDocument() {
return document;
}

@Override
public Map<String, Object> getVariables() {
return variables;
}

@Override
public void setVariables(Map<String, Object> variables) {
this.variables = variables;
}

@Override
public Object getVariable(String key) {
return variables.get(key);
}

@Override
public Request setVariable(String key, Object value) {
variables.put(key, value);
return this;
Expand All @@ -97,15 +108,18 @@ public void setOperationName(String operationName) {
this.operationName = operationName;
}

@Override
public Request resetVariables() {
variables.clear();
return this;
}

@Override
public String toString() {
return "GraphQLRequest{" + "document=" + document + ", variables=" + variables + '}';
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
Expand All @@ -121,10 +135,6 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.document, other.document)) {
return false;
}
if (!Objects.equals(this.variables, other.variables)) {
return false;
}

return true;
return Objects.equals(this.variables, other.variables);
}
}
Loading

0 comments on commit d274e03

Please sign in to comment.