Hi

In the test, you can check with web:list and http:list if the status is deployed (and not deploying).
Maybe you test the connection before the endpoint is actually started.
You can see how we do it in the karaf examples itests.

Regards
JB

Le 16 nov. 2019 11:01, Massimo Bono <[email protected]> a écrit :
Hi,

I've generated a wab file containing a simple "hello world" index.html. Inside this wab there is the standard manifest with the WebContext-Path manifest entry.

When I manually start a karaf container, everything goes smoothly: I install the war feature (by using "feature:install war") and then I can successfully view the Webapp on a browser (http:/127.0.0.1:8181/hello-example).

However, things go south when I try to test automatically the webapp.
I've created a simple test (by extension KaratTestSupport) where I install the "war" feature using KarafDistributionOption.features and then start the webapp bundle (via CoreOptions.mavenBundle()). I'm using httpcomponents.httpclient (with a OSGi compliant manifest header) to request the HTTP GET connection; however, albeit http:list show the endpoint, I always obtain a "ConnectionRefused" (in the browser I cannot see anything as well).

Surely I'm doing something wrong. Is this the correct way to test a webapp?

Thanks for any kind reply!

--
Ing. Massimo Bono

Reply via email to