Skip to content

Commit

Permalink
Launch the native image with -Dtest.url set
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Feb 14, 2019
1 parent 7f0c38d commit 323dc91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

org.jboss.shamrock.example.rest.RestInterface/mp-rest/url=http://localhost:8081/
org.jboss.shamrock.example.rest.RestInterface/mp-rest/url=${test.url}
# Disabled by default as it establishes external connections.
# Uncomment when you want to test SSL support.
#org.jboss.shamrock.example.rest.SslRestInterface/mp-rest/url=https://www.example.com/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Map;

import org.eclipse.microprofile.config.ConfigProvider;
import org.jboss.shamrock.test.common.http.TestHttpResourceManager;

public class NativeImageLauncher implements Closeable {

Expand Down Expand Up @@ -57,6 +58,7 @@ public void start() throws Exception {
List<String> args = new ArrayList<>();
args.add(path);
args.add("-Dshamrock.http.port=" + port);
args.add("-Dtest.url=" + TestHttpResourceManager.getUri());

System.out.println("Executing " + args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class TestHttpResourceManager {
System.setProperty("test.url", uri);
}

public static String getUri() {
return uri;
}

public static void inject(Object testCase) {
Class<?> c = testCase.getClass();
Expand Down

0 comments on commit 323dc91

Please sign in to comment.