-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1331 from phillip-kruger/main
Mulitple cleanups in prep for non blocking
- Loading branch information
Showing
35 changed files
with
694 additions
and
1,018 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-349 Bytes
(68%)
client/implementation-vertx/src/test/resources/ssl/client.cert
Binary file not shown.
Binary file modified
BIN
+272 Bytes
(110%)
client/implementation-vertx/src/test/resources/ssl/client.pkcs12.keystore
Binary file not shown.
Binary file modified
BIN
-352 Bytes
(76%)
client/implementation-vertx/src/test/resources/ssl/client.pkcs12.truststore
Binary file not shown.
Binary file modified
BIN
+256 Bytes
(110%)
client/implementation-vertx/src/test/resources/ssl/client.pkcs12.wrong.keystore
Binary file not shown.
Empty file modified
0
client/implementation-vertx/src/test/resources/ssl/generate.sh
100644 → 100755
Empty file.
Binary file modified
BIN
-350 Bytes
(68%)
client/implementation-vertx/src/test/resources/ssl/server.cert
Binary file not shown.
Binary file modified
BIN
+256 Bytes
(110%)
client/implementation-vertx/src/test/resources/ssl/server.pkcs12.keystore
Binary file not shown.
Binary file modified
BIN
-352 Bytes
(76%)
client/implementation-vertx/src/test/resources/ssl/server.pkcs12.truststore
Binary file not shown.
Binary file modified
BIN
+256 Bytes
(110%)
client/implementation-vertx/src/test/resources/ssl/server.pkcs12.wrong.keystore
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ | |
import org.jboss.jandex.Index; | ||
import org.jboss.jandex.IndexView; | ||
import org.jboss.jandex.Indexer; | ||
import org.jboss.logging.Logger; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
|
@@ -48,15 +47,13 @@ | |
* @author Phillip Kruger ([email protected]) | ||
*/ | ||
public class SchemaBuilderTest { | ||
private static final Logger LOG = Logger.getLogger(SchemaBuilderTest.class.getName()); | ||
private static final Jsonb JSONB = JsonbBuilder.create(new JsonbConfig().withFormatting(true)); | ||
|
||
@Test | ||
public void testSchemaModelCreation() { | ||
|
||
IndexView index = getTCKIndex(); | ||
Schema schema = SchemaBuilder.build(index); | ||
LOG.info(JSONB.toJson(schema)); | ||
assertNotNull(schema); | ||
} | ||
|
||
|
@@ -90,7 +87,6 @@ public void testConcurrentSchemaBuilding() throws Exception { | |
assertNotNull(movieSchema); | ||
|
||
String basicSchemaString = JSONB.toJson(basicSchema); | ||
LOG.info(basicSchemaString); | ||
assertTrue(basicSchemaString.contains("org.eclipse.microprofile.graphql.tck.apps.basic.api.BasicType")); | ||
assertTrue(basicSchemaString.contains("org.eclipse.microprofile.graphql.tck.apps.basic.api.BasicInput")); | ||
assertTrue(basicSchemaString.contains("org.eclipse.microprofile.graphql.tck.apps.basic.api.BasicInterface")); | ||
|
@@ -99,7 +95,6 @@ public void testConcurrentSchemaBuilding() throws Exception { | |
assertFalse(basicSchemaString.contains("io.smallrye.graphql")); | ||
|
||
String heroSchemaString = JSONB.toJson(heroSchema); | ||
LOG.info(heroSchemaString); | ||
assertTrue(heroSchemaString.contains("org.eclipse.microprofile.graphql.tck.apps.superhero.model.SuperHero")); | ||
assertTrue(heroSchemaString.contains("org.eclipse.microprofile.graphql.tck.apps.superhero.model.Sidekick")); | ||
assertTrue(heroSchemaString.contains("org.eclipse.microprofile.graphql.tck.apps.superhero.model.Team")); | ||
|
@@ -108,7 +103,6 @@ public void testConcurrentSchemaBuilding() throws Exception { | |
assertFalse(heroSchemaString.contains("io.smallrye.graphql")); | ||
|
||
String movieSchemaString = JSONB.toJson(movieSchema); | ||
LOG.info(movieSchemaString); | ||
assertTrue(movieSchemaString.contains("io.smallrye.graphql.index.app.Movie")); | ||
assertTrue(movieSchemaString.contains("io.smallrye.graphql.index.app.Person")); | ||
assertFalse(movieSchemaString.contains("org.eclipse.microprofile.graphql.tck.apps.basic")); | ||
|
@@ -146,14 +140,12 @@ public void testSchemaWithDirectives() throws IOException { | |
Index index = indexer.complete(); | ||
|
||
Schema schema = SchemaBuilder.build(index); | ||
LOG.info(JSONB.toJson(schema)); | ||
|
||
// check directive types | ||
assertTrue(schema.hasDirectiveTypes()); | ||
DirectiveType someDirective = schema.getDirectiveTypes().stream() | ||
.filter(d -> d.getName().equals("someDirective")) | ||
.findFirst().orElseThrow(NoSuchElementException::new); | ||
LOG.info(JSONB.toJson(someDirective)); | ||
assertNotNull(someDirective); | ||
assertEquals("someDirective", someDirective.getName()); | ||
assertEquals(SomeDirective.class.getName(), someDirective.getClassName()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,53 +6,44 @@ | |
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.enterprise.context.RequestScoped; | ||
import javax.inject.Inject; | ||
import javax.json.Json; | ||
import javax.json.JsonArray; | ||
import javax.json.JsonObject; | ||
import javax.json.JsonObjectBuilder; | ||
import javax.json.stream.JsonGenerator; | ||
|
||
import org.jboss.jandex.IndexView; | ||
import org.jboss.logging.Logger; | ||
import org.jboss.weld.junit5.WeldInitiator; | ||
import org.jboss.weld.junit5.WeldJunit5Extension; | ||
import org.jboss.weld.junit5.WeldSetup; | ||
import org.jboss.weld.junit5.auto.ActivateScopes; | ||
import org.jboss.weld.junit5.auto.EnableAutoWeld; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
|
||
import graphql.schema.GraphQLSchema; | ||
import io.smallrye.graphql.bootstrap.Bootstrap; | ||
import io.smallrye.graphql.cdi.CdiLookupService; | ||
import io.smallrye.graphql.cdi.event.EventsService; | ||
import io.smallrye.graphql.cdi.producer.GraphQLProducer; | ||
import io.smallrye.graphql.schema.SchemaBuilder; | ||
import io.smallrye.graphql.schema.model.Schema; | ||
import io.smallrye.graphql.spi.LookupService; | ||
|
||
/** | ||
* Test a basic query | ||
* | ||
* @author Phillip Kruger ([email protected]) | ||
*/ | ||
@ExtendWith(WeldJunit5Extension.class) | ||
@EnableAutoWeld | ||
@ActivateScopes({ RequestScoped.class, ApplicationScoped.class }) | ||
public class CdiExecutionTest { | ||
private static final Logger LOG = Logger.getLogger(CdiExecutionTest.class.getName()); | ||
|
||
private ExecutionService executionService; | ||
|
||
@WeldSetup | ||
public WeldInitiator weld = WeldInitiator.of(heroFinder, heroDatabase, sidekickDatabase, heroLocator, scalarTestApi, | ||
EventsService.class, CdiLookupService.class); | ||
@Inject | ||
GraphQLProducer graphQLProducer; | ||
|
||
@BeforeEach | ||
public void init() { | ||
IndexView index = Indexer.getTCKIndex(); | ||
Schema schema = SchemaBuilder.build(index); | ||
GraphQLSchema graphQLSchema = Bootstrap.bootstrap(schema); | ||
this.executionService = new ExecutionService(graphQLSchema, schema.getBatchOperations(), | ||
schema.hasSubscriptions()); | ||
graphQLProducer.initialize(schema); | ||
} | ||
|
||
@Test | ||
|
@@ -330,6 +321,7 @@ public void testInputWithDifferentNameOnInputAndType() { | |
|
||
private JsonObject executeAndGetData(String graphQL) { | ||
JsonObjectResponseWriter jor = new JsonObjectResponseWriter(graphQL); | ||
ExecutionService executionService = LookupService.get().getInstance(ExecutionService.class).get(); | ||
executionService.executeSync(toJsonObject(graphQL), jor); | ||
|
||
ExecutionResponse result = jor.getExecutionResponse(); | ||
|
@@ -342,6 +334,7 @@ private JsonObject executeAndGetData(String graphQL) { | |
|
||
private JsonArray executeAndGetError(String graphQL) { | ||
JsonObjectResponseWriter jor = new JsonObjectResponseWriter(graphQL); | ||
ExecutionService executionService = LookupService.get().getInstance(ExecutionService.class).get(); | ||
executionService.executeSync(toJsonObject(graphQL), jor); | ||
ExecutionResponse result = jor.getExecutionResponse(); | ||
|
||
|
@@ -581,27 +574,4 @@ private JsonObject toJsonObject(String graphQL) { | |
" }\n" + | ||
"}"; | ||
|
||
// Create the CDI Beans in the TCK Tests app | ||
private static final Class<?> heroFinder; | ||
private static final Class<?> heroDatabase; | ||
private static final Class<?> sidekickDatabase; | ||
private static final Class<?> heroLocator; | ||
private static final Class<?> scalarTestApi; | ||
|
||
private static final Map<String, Object> JSON_PROPERTIES = new HashMap<>(1); | ||
|
||
static { | ||
try { | ||
heroFinder = Class.forName("org.eclipse.microprofile.graphql.tck.apps.superhero.api.HeroFinder"); | ||
heroDatabase = Class.forName("org.eclipse.microprofile.graphql.tck.apps.superhero.db.HeroDatabase"); | ||
sidekickDatabase = Class.forName("org.eclipse.microprofile.graphql.tck.apps.superhero.db.SidekickDatabase"); | ||
heroLocator = Class.forName("org.eclipse.microprofile.graphql.tck.apps.superhero.db.HeroLocator"); | ||
scalarTestApi = Class.forName("org.eclipse.microprofile.graphql.tck.apps.basic.api.ScalarTestApi"); | ||
} catch (ClassNotFoundException ex) { | ||
throw new RuntimeException(ex); | ||
} | ||
|
||
JSON_PROPERTIES.put(JsonGenerator.PRETTY_PRINTING, true); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.