diff --git a/etc/scripts/smoketest.sh b/etc/scripts/smoketest.sh index 9a34e91ebe8..d0913618714 100755 --- a/etc/scripts/smoketest.sh +++ b/etc/scripts/smoketest.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2019, 2022 Oracle and/or its affiliates. +# Copyright (c) 2019, 2023 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -194,7 +194,7 @@ full(){ echo "WARNING! GRAALVM_HOME is not set. Skipping native image tests" else echo "GRAALVM_HOME=${GRAALVM_HOME}" - readonly native_image_tests="se-1 mp-1 mp-2 mp-3" + readonly native_image_tests="mp-1 mp-2 mp-3" for native_test in ${native_image_tests}; do cd ${SCRATCH}/helidon/tests/integration/native-image/${native_test} mvn ${MAVEN_ARGS} clean package -Pnative-image ${STAGED_PROFILE} diff --git a/etc/scripts/test-packaging-jar.sh b/etc/scripts/test-packaging-jar.sh index 73e15c9d2de..b4d55d35701 100755 --- a/etc/scripts/test-packaging-jar.sh +++ b/etc/scripts/test-packaging-jar.sh @@ -1,6 +1,6 @@ #!/bin/bash -e # -# Copyright (c) 2021, 2022 Oracle and/or its affiliates. +# Copyright (c) 2021, 2023 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,13 +32,6 @@ mvn ${MAVEN_ARGS} -e clean install # Run tests with classpath and then module path -# -# Run SE-1 (does not contain module-info.java) -# -cd ${WS_DIR}/tests/integration/native-image/se-1 -# Classpath -java -Dexit.on.started=! -jar target/helidon-tests-native-image-se-1.jar - # # Run MP-1 # diff --git a/etc/scripts/test-packaging-jlink.sh b/etc/scripts/test-packaging-jlink.sh index f302b0d6a5c..d4dc6b06339 100755 --- a/etc/scripts/test-packaging-jlink.sh +++ b/etc/scripts/test-packaging-jlink.sh @@ -1,6 +1,6 @@ #!/bin/bash -e # -# Copyright (c) 2021, 2022 Oracle and/or its affiliates. +# Copyright (c) 2021, 2023 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ mvn ${MAVEN_ARGS} -e clean install # Build jlink images # mp-2 fails because of https://github.com/oracle/helidon-build-tools/issues/478 -readonly native_image_tests="se-1 mp-1 mp-3" +readonly native_image_tests="mp-1 mp-3" for native_test in ${native_image_tests}; do cd ${WS_DIR}/tests/integration/native-image/${native_test} mvn ${MAVEN_ARGS} package -e -Pjlink-image,staging -Djlink.image.addClassDataSharingArchive=false -Djlink.image.testImage=false @@ -40,13 +40,6 @@ done # Run tests with classpath and then module path -# Run SE-1 (does not contain module-info.java) -cd ${WS_DIR}/tests/integration/native-image/se-1 -jri_dir=${WS_DIR}/tests/integration/native-image/se-1/target/helidon-tests-native-image-se-1-jri - -# Classpath -${jri_dir}/bin/start --test --jvm --enable-preview - # Run MP-1 cd ${WS_DIR}/tests/integration/native-image/mp-1 jri_dir=${WS_DIR}/tests/integration/native-image/mp-1/target/helidon-tests-native-image-mp-1-jri diff --git a/etc/scripts/test-packaging-native.sh b/etc/scripts/test-packaging-native.sh index d30d9798c9f..d1ebfd720df 100755 --- a/etc/scripts/test-packaging-native.sh +++ b/etc/scripts/test-packaging-native.sh @@ -1,6 +1,6 @@ #!/bin/bash -e # -# Copyright (c) 2021, 2022 Oracle and/or its affiliates. +# Copyright (c) 2021, 2023 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -58,8 +58,7 @@ mvn ${MAVEN_ARGS} -e clean install # Build native images # TODO:java19 -# readonly native_image_tests="se-1 mp-1 mp-3" -readonly native_image_tests="se-1 nima-1" +readonly native_image_tests="nima-1" for native_test in ${native_image_tests}; do cd ${WS_DIR}/tests/integration/native-image/${native_test} mvn ${MAVEN_ARGS} -e clean package -Pnative-image @@ -71,10 +70,6 @@ done # cd ${WS_DIR}/tests/integration/native-image/mp-1 # ${WS_DIR}/tests/integration/native-image/mp-1/target/helidon-tests-native-image-mp-1 || true -# Run SE-1 exiting on started -cd ${WS_DIR}/tests/integration/native-image/se-1 -${WS_DIR}/tests/integration/native-image/se-1/target/helidon-tests-native-image-se-1 -Dexit.on.started=! || true - # Run Nima-1 exiting on started cd ${WS_DIR}/tests/integration/native-image/nima-1 ${WS_DIR}/tests/integration/native-image/nima-1/target/helidon-tests-native-image-nima-1 -Dexit.on.started=! || true diff --git a/tests/integration/native-image/pom.xml b/tests/integration/native-image/pom.xml index f0a991bfcad..e400f724375 100644 --- a/tests/integration/native-image/pom.xml +++ b/tests/integration/native-image/pom.xml @@ -36,7 +36,6 @@ static-content - se-1 mp-1 mp-2 mp-3 diff --git a/tests/integration/native-image/se-1/README.md b/tests/integration/native-image/se-1/README.md deleted file mode 100644 index 6e56db6e251..00000000000 --- a/tests/integration/native-image/se-1/README.md +++ /dev/null @@ -1,63 +0,0 @@ -#GraalVM native image integration test -_____ - -This is a manual (for the time being) test of integration with native-image. - -To run this test: - -```shell script -mvn clean package -Pnative-image -./target/helidon-tests-native-image-se-1 -``` - -Once the native image builds and is started, run the following - curl requests: - -```shell script -# Should return 200 code and "file-resource-text" as entity -curl -i http://localhost:7076/static/path/resource.txt - -# Should return 200 code and "classpath-resource-text" as entity -curl -i http://localhost:7076/static/classpath/resource.txt - -# Should return 200 code and "jar-resource-text" as entity -curl -i http://localhost:7076/static/jar/resource.txt - -# Should return 200 code and "{"message":"SE Hallo World!"}" as entity -curl -i http://localhost:7076/greet - -# Should return 401 code -curl -i http://localhost:7076/greet/john - -# Should return 200 code and "{"message":"SE Hallo jack!"}" as entity -curl -i -u jack:password http://localhost:7076/greet/john - -# Should return 200 code and JSON response with two health checks -curl -i http://localhost:7076/health - -# Should return 200 code and JSON response with metrics -curl -i -H "Accept: application/json" http://localhost:7076/metrics - -# Should return ALL TESTS PASSED! after passing all webclient tests -curl -i http://localhost:7076/wc/test - -# Should return 200 status and plain text RED as the response content - curl -i http://localhost:7076/color - -# Should return: Upgrade: websocket -curl \ - --include \ - --no-buffer \ - --header "Connection: Upgrade" \ - --header "Upgrade: websocket" \ - --header "Host: localhost:7076" \ - --header "Origin: http://localhost:7076" \ - --header "Sec-WebSocket-Key: AQIDBAUGBwgJCgsMDQ4PEC==" \ - --header "Sec-WebSocket-Version: 13" \ - http://localhost:7076/ws/messages - -# Bi-directional test is possible with websocat tool -# should return 'part1 part2' -for msg in "part1" "part2" "SEND"; do echo $msg; done \ -| websocat ws://127.0.0.1:7076/ws/messages -``` diff --git a/tests/integration/native-image/se-1/conf/se.yaml b/tests/integration/native-image/se-1/conf/se.yaml deleted file mode 100644 index 377eff869a2..00000000000 --- a/tests/integration/native-image/se-1/conf/se.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -app: - greeting: "SE Hallo" - -security: - provider-policy: - type: "COMPOSITE" - authentication: - - name: "http-signatures" - flag: "OPTIONAL" - - name: "http-basic-auth" - providers: - # enable the "ABAC" security provider (also handles RBAC) - - abac: - # enabled the HTTP Basic authentication provider - - http-basic-auth: - realm: "helidon" - users: - - login: "jack" - password: "password" - roles: ["admin"] - - login: "jill" - password: "password" - roles: ["user"] - - login: "joe" - password: "password" - - http-signatures: - optional: true - sign-headers: - - method: "get" - always: ["date", "(request-target)", "host"] - if-present: [] - inbound.keys: - - key-id: "helidon-mp" - principal-name: "MP Service" - principal-type: "SERVICE" - hmac.secret: "badIdeaClearTextPassword!" - web-server: - paths: - - path: "/greet/{*}" - authenticate: true - roles-allowed: ["user", "admin"] diff --git a/tests/integration/native-image/se-1/pom.xml b/tests/integration/native-image/se-1/pom.xml deleted file mode 100644 index 2c5e9ad8730..00000000000 --- a/tests/integration/native-image/se-1/pom.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - - 4.0.0 - - io.helidon.applications - helidon-se - 4.0.0-SNAPSHOT - ../../../../applications/se/pom.xml - - io.helidon.tests.integration - helidon-tests-native-image-se-1 - Helidon Integration Tests GraalVM Native image SE1 - - - This test makes sure the following helidon modules can be compiled into native image: WebServer JSON-P Classpath static - content File static content Tyrus(web sockets) Config (with change support) File watch Classpath YAML Tracing Zipkin - Health check Health checks Custom Metrics Vendor Base Custom Security Webserver integration ABAC (verified through roles) - HTTP Basic authentication HTTP Signatures - - - - io.helidon.tests.integration.nativeimage.se1.Se1Main - - - - - io.helidon.reactive.webserver - helidon-reactive-webserver - - - io.helidon.reactive.webserver - helidon-reactive-webserver-static-content - - - io.helidon.reactive.webserver - helidon-reactive-webserver-websocket - - - io.helidon.reactive.media - helidon-reactive-media-jsonp - - - io.helidon.reactive.media - helidon-reactive-media-jsonb - - - io.helidon.config - helidon-config-yaml - - - io.helidon.tracing - helidon-tracing - - - io.helidon.tracing - helidon-tracing-zipkin - - - io.helidon.reactive.health - helidon-reactive-health - - - io.helidon.health - helidon-health-checks - - - io.helidon.reactive.metrics - helidon-reactive-metrics - - - io.helidon.reactive.webclient - helidon-reactive-webclient - - - io.helidon.reactive.webclient - helidon-reactive-webclient-metrics - - - io.helidon.reactive.webclient - helidon-reactive-webclient-tracing - - - io.helidon.security.integration - helidon-security-integration-webserver - - - io.helidon.security.providers - helidon-security-providers-abac - - - io.helidon.security.providers - helidon-security-providers-http-auth - - - io.helidon.security.providers - helidon-security-providers-http-sign - - - io.helidon.tests.integration - helidon-tests-native-image-static-content - ${project.version} - - - org.junit.jupiter - junit-jupiter-api - test - - - org.hamcrest - hamcrest-all - test - - - - - - - org.graalvm.buildtools - native-maven-plugin - - true - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-libs - - - - - - diff --git a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/Animal.java b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/Animal.java deleted file mode 100644 index 3099444816d..00000000000 --- a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/Animal.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2020, 2021 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.helidon.tests.integration.nativeimage.se1; - -import io.helidon.common.Reflected; - -@Reflected -public class Animal { - private TYPE type; - private String name; - - public Animal() { - } - - public Animal(final TYPE type, final String name) { - this.type = type; - this.name = name; - } - - public TYPE getType() { - return type; - } - - public void setType(final TYPE type) { - this.type = type; - } - - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - public enum TYPE { - BIRD, DOG, CAT - } -} diff --git a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/ColorService.java b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/ColorService.java deleted file mode 100644 index 7d42c13490c..00000000000 --- a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/ColorService.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.helidon.tests.integration.nativeimage.se1; - -import io.helidon.config.Config; -import io.helidon.reactive.webserver.Routing; -import io.helidon.reactive.webserver.ServerRequest; -import io.helidon.reactive.webserver.ServerResponse; -import io.helidon.reactive.webserver.Service; - -/** - * Test service to exercise config enum mapping. - */ -public class ColorService implements Service { - - /** - * Enum used in config mapping. - */ - public enum Color {RED, YELLOW, BLUE} - - private final Color configuredColor; - - /** - * Creates a new instance of the service. - * - * @param config config tree - */ - public ColorService(Config config) { - // Attempt the mapping now to force a failure (if any) during server start-up when it's easily and quickly visible. - configuredColor = config.get("color.tint").as(Color.class).get(); - } - - @Override - public void update(Routing.Rules rules) { - rules.get("/", this::reportColor); - } - - private void reportColor(ServerRequest request, ServerResponse response) { - response.send(configuredColor.name()); - } -} diff --git a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/GreetService.java b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/GreetService.java deleted file mode 100644 index 57abd9f7d61..00000000000 --- a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/GreetService.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2019, 2022 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.helidon.tests.integration.nativeimage.se1; - -import java.security.Principal; -import java.util.Collections; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Consumer; - -import io.helidon.common.http.Http; -import io.helidon.config.Config; -import io.helidon.metrics.RegistryFactory; -import io.helidon.reactive.webserver.Routing; -import io.helidon.reactive.webserver.ServerRequest; -import io.helidon.reactive.webserver.ServerResponse; -import io.helidon.reactive.webserver.Service; -import io.helidon.security.SecurityContext; - -import jakarta.json.Json; -import jakarta.json.JsonBuilderFactory; -import jakarta.json.JsonObject; -import org.eclipse.microprofile.metrics.MetricRegistry; -import org.eclipse.microprofile.metrics.Timer; - -/** - * A simple service to greet you. Examples: - * - * Get default greeting message: - * curl -X GET http://localhost:8080/greet - * - * Get greeting message for Joe: - * curl -X GET http://localhost:8080/greet/Joe - * - * Change greeting - * curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Howdy"}' http://localhost:8080/greet/greeting - * - * The message is returned as a JSON object - */ - -public class GreetService implements Service { - - /** - * The config value for the key {@code greeting}. - */ - private final AtomicReference greeting = new AtomicReference<>(); - - private static final JsonBuilderFactory JSON = Json.createBuilderFactory(Collections.emptyMap()); - private final Timer defaultMessageTimer; - - GreetService(Config config) { - Config greetingConfig = config.get("app.greeting"); - - // initial value - greeting.set(greetingConfig.asString().orElse("Ciao")); - - greetingConfig.onChange((Consumer) cfg -> greeting.set(cfg.asString().orElse("Ciao"))); - - RegistryFactory metricsRegistry = RegistryFactory.getInstance(); - MetricRegistry appRegistry = metricsRegistry.getRegistry(MetricRegistry.Type.APPLICATION); - this.defaultMessageTimer = appRegistry.timer("greet.default.timer"); - } - - /** - * A service registers itself by updating the routine rules. - * @param rules the routing rules. - */ - @Override - public void update(Routing.Rules rules) { - rules - .get("/", this::getDefaultMessageHandler) - // Outbound is commented out, as we want native image to work - //.get("/outbound", this::outbound) - .get("/{name}", this::getMessageHandler) - .put("/greeting", this::updateGreetingHandler); - - } - - /** - * Return a worldly greeting message. - * @param request the server request - * @param response the server response - */ - private void getDefaultMessageHandler(ServerRequest request, - ServerResponse response) { - Timer.Context timerContext = defaultMessageTimer.time(); - sendResponse(response, "World"); - response.whenSent() - .thenAccept(res -> timerContext.stop()); - } - - /** - * Return a greeting message using the name that was provided. - * @param request the server request - * @param response the server response - */ - private void getMessageHandler(ServerRequest request, - ServerResponse response) { - String name = request.path().param("name"); - - // if we run with security enabled, we want to return the user from security - name = request.context() - .get(SecurityContext.class) - .flatMap(SecurityContext::userPrincipal) - .map(Principal::getName) - .orElse(name); - - sendResponse(response, name); - } - - private void sendResponse(ServerResponse response, String name) { - String msg = String.format("%s %s!", greeting.get(), name); - - JsonObject returnObject = JSON.createObjectBuilder() - .add("message", msg) - .build(); - response.send(returnObject); - } - - private void updateGreetingFromJson(JsonObject jo, ServerResponse response) { - - if (!jo.containsKey("greeting")) { - JsonObject jsonErrorObject = JSON.createObjectBuilder() - .add("error", "No greeting provided") - .build(); - response.status(Http.Status.BAD_REQUEST_400) - .send(jsonErrorObject); - return; - } - - greeting.set(jo.getString("greeting")); - response.status(Http.Status.NO_CONTENT_204).send(); - } - - /** - * Set the greeting to use in future messages. - * @param request the server request - * @param response the server response - */ - private void updateGreetingHandler(ServerRequest request, - ServerResponse response) { - request.content().as(JsonObject.class).thenAccept(jo -> updateGreetingFromJson(jo, response)); - } - -} diff --git a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/MockZipkinService.java b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/MockZipkinService.java deleted file mode 100644 index 43c3aed753c..00000000000 --- a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/MockZipkinService.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2020, 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.helidon.tests.integration.nativeimage.se1; - -import java.io.ByteArrayInputStream; -import java.io.EOFException; -import java.io.IOException; -import java.io.StringReader; -import java.lang.System.Logger.Level; -import java.nio.ByteBuffer; -import java.util.List; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.Flow; -import java.util.concurrent.atomic.AtomicReference; -import java.util.zip.GZIPInputStream; - -import io.helidon.common.GenericType; -import io.helidon.common.http.DataChunk; -import io.helidon.common.reactive.Multi; -import io.helidon.common.reactive.Single; -import io.helidon.reactive.media.common.MessageBodyReaderContext; -import io.helidon.reactive.media.common.MessageBodyStreamReader; -import io.helidon.reactive.webserver.Routing; -import io.helidon.reactive.webserver.ServerRequest; -import io.helidon.reactive.webserver.ServerResponse; -import io.helidon.reactive.webserver.Service; - -import jakarta.json.Json; -import jakarta.json.JsonPointer; -import jakarta.json.JsonString; -import jakarta.json.JsonValue; - -public class MockZipkinService implements Service { - - private static final System.Logger LOGGER = System.getLogger(MockZipkinService.class.getName()); - - final static JsonPointer TAGS_POINTER = Json.createPointer("/tags"); - final static JsonPointer COMPONENT_POINTER = Json.createPointer("/tags/component"); - - private final Set filteredComponents; - private final AtomicReference> next = new AtomicReference<>(new CompletableFuture<>()); - - /** - * Create mock of the Zipkin listening on /api/v2/spans. - * - * @param filteredComponents listen only for traces with component tag having one of specified values - */ - MockZipkinService(Set filteredComponents) { - this.filteredComponents = filteredComponents; - } - - @Override - public void update(final Routing.Rules rules) { - rules.post("/api/v2/spans", this::mockZipkin); - } - - /** - * Return completion being completed when next trace call arrives. - * - * @return completion being completed when next trace call arrives - */ - CompletionStage next() { - return next.get(); - } - - private void mockZipkin(final ServerRequest request, final ServerResponse response) { - request.queryParams().all("serviceName", List::of).forEach(s -> System.out.println(">>>" + s)); - request.content() - .registerReader(new MessageBodyStreamReader() { - @Override - public PredicateResult accept(final GenericType type, final MessageBodyReaderContext context) { - return PredicateResult.COMPATIBLE; - } - - @Override - @SuppressWarnings("unchecked") - public Flow.Publisher read(final Flow.Publisher publisher, final GenericType type, final MessageBodyReaderContext context) { - return (Flow.Publisher) Multi.create(publisher) - .map(d -> ByteBuffer.wrap(d.bytes())) - .reduce((buf, buf2) -> - ByteBuffer.allocate(buf.capacity() + buf2.capacity()) - .put(buf.array()) - .put(buf2.array())) - .flatMap(b -> { - try (ByteArrayInputStream bais = new ByteArrayInputStream(b.array()); - GZIPInputStream gzipInputStream = new GZIPInputStream(bais)) { - return Single.just(Json.createReader(new StringReader(new String(gzipInputStream.readAllBytes()))) - .readArray()); - } catch (EOFException e) { - //ignore - return Multi.empty(); - } catch (IOException e) { - throw new RuntimeException(e); - } - }) - .flatMap(a -> Multi.create(a.stream())); - } - }) - .asStream(JsonValue.class) - .map(JsonValue::asJsonObject) - .filter(json -> - TAGS_POINTER.containsValue(json) - && COMPONENT_POINTER.containsValue(json) - && filteredComponents.stream() - .anyMatch(s -> s.equals(((JsonString) COMPONENT_POINTER.getValue(json)).getString())) - ) - .onError(Throwable::printStackTrace) - .onError(t -> response.status(500).send(t)) - .onComplete(response::send) - .peek(json -> LOGGER.log(Level.INFO, json.toString())) - .forEach(e -> next.getAndSet(new CompletableFuture<>()).complete(e)); - } -} diff --git a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/Se1Main.java b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/Se1Main.java deleted file mode 100644 index 9060ebb17c7..00000000000 --- a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/Se1Main.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2019, 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.helidon.tests.integration.nativeimage.se1; - -import java.nio.file.Paths; -import java.util.Set; - -import io.helidon.config.Config; -import io.helidon.config.FileSystemWatcher; -import io.helidon.health.checks.HealthChecks; -import io.helidon.logging.common.LogConfig; -import io.helidon.reactive.health.HealthSupport; -import io.helidon.reactive.media.jsonb.JsonbSupport; -import io.helidon.reactive.media.jsonp.JsonpSupport; -import io.helidon.reactive.metrics.MetricsSupport; -import io.helidon.reactive.webserver.Routing; -import io.helidon.reactive.webserver.WebServer; -import io.helidon.reactive.webserver.staticcontent.StaticContentSupport; -import io.helidon.reactive.webserver.websocket.WebSocketRouting; -import io.helidon.security.integration.webserver.WebSecurity; -import io.helidon.tracing.TracerBuilder; - -import jakarta.websocket.server.ServerEndpointConfig; -import org.eclipse.microprofile.health.HealthCheckResponse; - -import static io.helidon.config.ConfigSources.classpath; -import static io.helidon.config.ConfigSources.file; - -/** - * Main class of this integration test. - */ -public final class Se1Main { - /** - * Cannot be instantiated. - */ - private Se1Main() { - } - - /** - * Application main entry point. - * @param args command line arguments. - */ - public static void main(final String[] args) { - startServer(); - } - - /** - * Start the server. - * @return the created {@link io.helidon.reactive.webserver.WebServer} instance - */ - static WebServer startServer() { - // load logging configuration - LogConfig.configureRuntime(); - - // By default this will pick up application.yaml from the classpath - Config config = buildConfig(); - - // Get webserver config from the "server" section of application.yaml - WebServer server = WebServer.builder() - .routing(createRouting(config)) - .routing(WebSocketRouting.builder() - .endpoint("/ws", ServerEndpointConfig.Builder.create( - WebSocketEndpoint.class, "/messages") - .build()) - .build()) - .config(config.get("server")) - .tracer(TracerBuilder.create(config.get("tracing")).build()) - .addMediaSupport(JsonpSupport.create()) - .addMediaSupport(JsonbSupport.create()) - .printFeatureDetails(true) - .build(); - - // Try to start the server. If successful, print some info and arrange to - // print a message at shutdown. If unsuccessful, print the exception. - server.start() - .thenAccept(ws -> { - System.out.println( - "WEB server is up! http://localhost:" + ws.port() + "/greet"); - ws.whenShutdown().thenRun(() - -> System.out.println("WEB server is DOWN. Good bye!")); - }) - .exceptionally(t -> { - System.err.println("Startup failed: " + t.getMessage()); - t.printStackTrace(System.err); - return null; - }); - - // Server threads are not daemon. No need to block. Just react. - - return server; - } - - private static Config buildConfig() { - return Config.builder() - .sources( - classpath("se-test.yaml").optional(), - file("conf/se.yaml") - .changeWatcher(FileSystemWatcher.create()) - .optional(), - classpath("application.yaml")) - .build(); - } - - /** - * Creates new {@link io.helidon.reactive.webserver.Routing}. - * - * @return routing configured with JSON support, a health check, and a service - * @param config configuration of this server - */ - private static Routing createRouting(Config config) { - - MetricsSupport metrics = MetricsSupport.create(); - GreetService greetService = new GreetService(config); - ColorService colorService = new ColorService(config); - MockZipkinService zipkinService = new MockZipkinService(Set.of("helidon-reactive-webclient")); - WebClientService webClientService = new WebClientService(config, zipkinService); - HealthSupport health = HealthSupport.builder() - .add(HealthChecks.healthChecks()) // Adds a convenient set of checks - .addLiveness(() -> HealthCheckResponse.named("custom") // a custom health check - .up() - .withData("timestamp", System.currentTimeMillis()) - .build()) - .build(); - - return Routing.builder() - .register("/static/path", StaticContentSupport.create(Paths.get("web"))) - .register("/static/classpath", StaticContentSupport.create("web")) - .register("/static/jar", StaticContentSupport.create("web-jar")) - .register(WebSecurity.create(config.get("security"))) - .register(health) // Health at "/health" - .register(metrics) // Metrics at "/metrics" - .register("/greet", greetService) - .register("/color", colorService) - .register("/wc", webClientService) - .register("/zipkin", zipkinService) - .build(); - } - -} diff --git a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebClientService.java b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebClientService.java deleted file mode 100644 index ab5e10de086..00000000000 --- a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebClientService.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2020, 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.helidon.tests.integration.nativeimage.se1; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.System.Logger.Level; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.TimeUnit; -import java.util.function.Predicate; - -import io.helidon.common.context.Context; -import io.helidon.common.http.Http; -import io.helidon.common.media.type.MediaTypes; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.reactive.media.jsonb.JsonbSupport; -import io.helidon.reactive.webclient.WebClient; -import io.helidon.reactive.webclient.WebClientException; -import io.helidon.reactive.webclient.WebClientResponse; -import io.helidon.reactive.webserver.Routing; -import io.helidon.reactive.webserver.ServerRequest; -import io.helidon.reactive.webserver.ServerResponse; -import io.helidon.reactive.webserver.Service; - -import jakarta.json.JsonValue; - -public class WebClientService implements Service { - - private static final System.Logger LOGGER = System.getLogger(WebClientService.class.getName()); - private final WebClient client; - private final MockZipkinService zipkinService; - private final String context; - - public WebClientService(Config config, MockZipkinService zipkinService) { - this.zipkinService = zipkinService; - this.context = "http://localhost:" + config.get("port").asInt().orElse(7076); - client = WebClient.builder() - .baseUri(context) - .addReader(JsonbSupport.reader()) - .addHeader(Http.HeaderValues.ACCEPT_JSON) - .config(config.get("client")) - .build(); - } - - @Override - public void update(final Routing.Rules rules) { - rules.get("/test", this::getTest) - .get("/redirect", this::redirect) - .get("/redirect/infinite", this::redirectInfinite) - .get("/endpoint", this::getEndpoint); - } - - private void redirect(ServerRequest request, - ServerResponse response) { - response.headers().add(Http.Header.LOCATION, context + "/wc/endpoint"); - response.status(Http.Status.MOVED_PERMANENTLY_301).send(); - } - - private void redirectInfinite(ServerRequest serverRequest, ServerResponse response) { - response.headers().add(Http.Header.LOCATION, context + "/wc/redirect/infinite"); - response.status(Http.Status.MOVED_PERMANENTLY_301).send(); - } - - private void getEndpoint(final ServerRequest request, final ServerResponse response) { - response.send(new Animal(Animal.TYPE.BIRD, "Frank")); - } - - private void getTest(final ServerRequest request, final ServerResponse response) { - CompletableFuture.runAsync(() -> { - - testTracedGet(request.context()); - testFollowRedirect(request.context()); - testFollowRedirectInfinite(request.context()); - - }).whenComplete((u, t) -> { - if (t == null) { - response.send("ALL TESTS PASSED!\n"); - } else { - response.status(Http.Status.INTERNAL_SERVER_ERROR_500); - StringWriter writer = new StringWriter(); - t.printStackTrace(new PrintWriter(writer)); - response.send("Failed to process request: " + writer); - } - }); - } - - public void testTracedGet(Context ctx) { - final CompletionStage nextTrace = zipkinService.next(); - client.get() - .path("/wc/endpoint") - .context(ctx) - .request(Animal.class) - .thenAccept(animal -> assertTrue(animal, a -> "Frank".equals(a.getName()))) - .await(15, TimeUnit.SECONDS); - //Wait for trace arrival to MockZipkin - Single.create(nextTrace).await(15, TimeUnit.SECONDS); - } - - public void testFollowRedirect(Context ctx) { - client.get() - .path("/wc/redirect") - .followRedirects(true) - .context(ctx) - .request(Animal.class) - .thenAccept(animal -> assertTrue(animal, a -> "Frank".equals(a.getName()))) - .await(15, TimeUnit.SECONDS); - - WebClientResponse response = client.get() - .path("/wc/redirect") - .followRedirects(false) - .context(ctx) - .request() - .await(15, TimeUnit.SECONDS); - assertEquals(response.status(), Http.Status.MOVED_PERMANENTLY_301); - } - - public void testFollowRedirectInfinite(Context ctx) { - try { - client.get() - .path("/wc/redirect/infinite") - .context(ctx) - .request(Animal.class) - .thenAccept(a -> fail("This should have failed!")) - .await(15, TimeUnit.SECONDS); - fail("This should have failed!"); - } catch (Exception e) { - if (e.getCause() instanceof WebClientException) { - WebClientException clientException = (WebClientException) e.getCause(); - assertTrue(clientException.getMessage(), m -> m.startsWith("Max number of redirects extended! (5)")); - } else { - fail(e); - } - } - } - - private void assertTrue(T value, Predicate predicate) { - if (!predicate.test(value)) { - fail("for value: " + value); - } - } - - private void assertEquals(Object a, Object b) { - if (!Objects.equals(a, b)) { - fail("Expected " + a + " equals " + b); - } - } - - private void fail(String msg) { - fail(new RuntimeException("Assertion error " + msg)); - } - - private void fail(Exception e) { - LOGGER.log(Level.ERROR, e.getMessage()); - throw new RuntimeException("Assertion error!", e); - } -} diff --git a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebSocketEndpoint.java b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebSocketEndpoint.java deleted file mode 100644 index 82a6376099c..00000000000 --- a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebSocketEndpoint.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2020, 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.helidon.tests.integration.nativeimage.se1; - -import java.io.IOException; -import java.lang.System.Logger.Level; - -import jakarta.websocket.Endpoint; -import jakarta.websocket.EndpointConfig; -import jakarta.websocket.MessageHandler; -import jakarta.websocket.Session; - - -public class WebSocketEndpoint extends Endpoint { - - private static final System.Logger LOGGER = System.getLogger(WebSocketEndpoint.class.getName()); - - @Override - public void onOpen(Session session, EndpointConfig endpointConfig) { - - StringBuilder sb = new StringBuilder(); - - LOGGER.log(Level.INFO, "Session " + session.getId()); - session.addMessageHandler(new MessageHandler.Whole() { - @Override - public void onMessage(String message) { - LOGGER.log(Level.INFO, "WS Receiving " + message); - if (message.contains("SEND")) { - sendTextMessage(session, sb.toString()); - sb.setLength(0); - } else { - sb.append(message); - } - } - }); - } - - private void sendTextMessage(Session session, String msg) { - try { - session.getBasicRemote().sendText(msg); - } catch (IOException e) { - LOGGER.log(Level.ERROR, "Message sending failed", e); - } - } -} diff --git a/tests/integration/native-image/se-1/src/main/resources/META-INF/native-image/native-image.properties b/tests/integration/native-image/se-1/src/main/resources/META-INF/native-image/native-image.properties deleted file mode 100644 index 0bec3d2415f..00000000000 --- a/tests/integration/native-image/se-1/src/main/resources/META-INF/native-image/native-image.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# We must explicitly include resources from other modules -Args=-H:IncludeResources=web-jar/.* diff --git a/tests/integration/native-image/se-1/src/main/resources/application.yaml b/tests/integration/native-image/se-1/src/main/resources/application.yaml deleted file mode 100644 index 9346a8f9e12..00000000000 --- a/tests/integration/native-image/se-1/src/main/resources/application.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright (c) 2018, 2023 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -app: - greeting: "Hello" - -color: - tint: RED - -server: - port: 7076 - host: 0.0.0.0 - -tracing: - service: "helidon-se" - protocol: "http" - host: "localhost" - port: 7076 - api-version: 2 - # mocked zipkin - path: "/zipkin/api/v2/spans" - -client: - follow-redirects: true - max-redirects: 5 - services: - tracing: \ No newline at end of file diff --git a/tests/integration/native-image/se-1/src/main/resources/logging.properties b/tests/integration/native-image/se-1/src/main/resources/logging.properties deleted file mode 100644 index 36c82ef445e..00000000000 --- a/tests/integration/native-image/se-1/src/main/resources/logging.properties +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright (c) 2018, 2022 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Example Logging Configuration File -# For more information see $JAVA_HOME/jre/lib/logging.properties - -# Send messages to the console -handlers=io.helidon.logging.jul.HelidonConsoleHandler - -# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n - -# Global logging level. Can be overridden by specific loggers -.level=INFO - -# Component specific log levels -#io.helidon.reactive.webserver.level=INFO -#io.helidon.config.level=INFO -#io.helidon.security.level=INFO -#io.helidon.common.level=INFO -#io.netty.level=INFO - -io.helidon.reactive.webserver.ClassPathContentHandler.level=FINEST -io.helidon.reactive.webserver.FileSystemContentHandler.level=FINEST diff --git a/tests/integration/native-image/se-1/src/main/resources/web/resource.txt b/tests/integration/native-image/se-1/src/main/resources/web/resource.txt deleted file mode 100644 index bf0db6fd62a..00000000000 --- a/tests/integration/native-image/se-1/src/main/resources/web/resource.txt +++ /dev/null @@ -1 +0,0 @@ -classpath-resource-text \ No newline at end of file diff --git a/tests/integration/native-image/se-1/src/test/java/io/helidon/tests/integration/nativeimage/se1/Se1MainTest.java b/tests/integration/native-image/se-1/src/test/java/io/helidon/tests/integration/nativeimage/se1/Se1MainTest.java deleted file mode 100644 index 2aee8ae1092..00000000000 --- a/tests/integration/native-image/se-1/src/test/java/io/helidon/tests/integration/nativeimage/se1/Se1MainTest.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2019, 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.helidon.tests.integration.nativeimage.se1; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.Collections; -import java.util.concurrent.TimeUnit; - -import io.helidon.reactive.webserver.WebServer; - -import jakarta.json.Json; -import jakarta.json.JsonObject; -import jakarta.json.JsonReader; -import jakarta.json.JsonReaderFactory; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - - -/** - * Unit test for {@link Se1Main}. - */ -class Se1MainTest { - private static WebServer webServer; - private static final JsonReaderFactory JSON = Json.createReaderFactory(Collections.emptyMap()); - - @BeforeAll - public static void startTheServer() throws Exception { - webServer = Se1Main.startServer(); - - long timeout = 2000; // 2 seconds should be enough to start the server - long now = System.currentTimeMillis(); - - while (!webServer.isRunning()) { - Thread.sleep(100); - if ((System.currentTimeMillis() - now) > timeout) { - Assertions.fail("Failed to start webserver"); - } - } - } - - @AfterAll - public static void stopServer() throws Exception { - if (webServer != null) { - webServer.shutdown() - .toCompletableFuture() - .get(10, TimeUnit.SECONDS); - } - } - - @Test - public void testHelloWorld() throws Exception { - HttpURLConnection conn; - - conn = getURLConnection("GET","/greet"); - assertThat("HTTP response1", conn.getResponseCode(), is(200)); - JsonReader jsonReader = JSON.createReader(conn.getInputStream()); - JsonObject jsonObject = jsonReader.readObject(); - assertThat("default message", jsonObject.getString("message"), - is("Hello World!")); - - conn = getURLConnection("GET", "/greet/Joe"); - assertThat("HTTP response2 - not authenticated", conn.getResponseCode(), is(200)); - jsonReader = JSON.createReader(conn.getInputStream()); - jsonObject = jsonReader.readObject(); - assertThat("hello Joe message", jsonObject.getString("message"), - is("Hello Joe!")); - - conn = getURLConnection("PUT", "/greet/greeting"); - conn.setRequestProperty("Content-Type", "application/json"); - conn.setDoOutput(true); - OutputStream os = conn.getOutputStream(); - os.write("{\"greeting\" : \"Hola\"}".getBytes()); - os.close(); - assertThat("HTTP response3", conn.getResponseCode(), is(204)); - - conn = getURLConnection("GET", "/greet/Jose"); - assertThat("HTTP response4", conn.getResponseCode(), is(200)); - jsonReader = JSON.createReader(conn.getInputStream()); - jsonObject = jsonReader.readObject(); - assertThat("hola Jose message", jsonObject.getString("message"), - is("Hola Jose!")); - - conn = getURLConnection("GET", "/health"); - assertThat("HTTP response2", conn.getResponseCode(), is(200)); - - conn = getURLConnection("GET", "/metrics"); - assertThat("HTTP response2", conn.getResponseCode(), is(200)); - } - - @Test - void testEnumMapping() throws Exception { - HttpURLConnection conn = getURLConnection("GET", "/color"); - int status = conn.getResponseCode(); - ColorService.Color tint; - try (BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()))) { - String colorName = reader.readLine(); // Makes sure the color name was sent. - tint = ColorService.Color.valueOf(colorName); // Makes sure the color name maps to a Color. - } - assertThat("/color GET status", status, is(200)); - assertThat("reported tint", tint, is(ColorService.Color.RED)); // Makes sure the mapped color is RED. - } - - private HttpURLConnection getURLConnection(String method, String path) throws Exception { - URL url = new URL("http://localhost:" + webServer.port() + path); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - conn.setRequestMethod(method); - conn.setRequestProperty("Accept", "application/json"); - System.out.println("Connecting: " + method + " " + url); - return conn; - } -} diff --git a/tests/integration/native-image/se-1/src/test/resources/se-test.yaml b/tests/integration/native-image/se-1/src/test/resources/se-test.yaml deleted file mode 100644 index 22ce20c035f..00000000000 --- a/tests/integration/native-image/se-1/src/test/resources/se-test.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (c) 2018, 2021 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -app.greeting: "Hello" - -server: - port: -1 - host: localhost - -tracing: - service: "se-unit-test" - -security: - providers: - web-server: - paths: - - path: "/greet/{*}" - authenticate: false - roles-allowed: [] - - path: "/outbound" - authenticate: false diff --git a/tests/integration/native-image/se-1/web/resource.txt b/tests/integration/native-image/se-1/web/resource.txt deleted file mode 100644 index 776303ad9af..00000000000 --- a/tests/integration/native-image/se-1/web/resource.txt +++ /dev/null @@ -1 +0,0 @@ -file-resource-text \ No newline at end of file