Hello Hansueli,
just override getPort(int) method in your JerseyTest successor:
public class ActivitiJerseyStubTest extends JerseyTest {
@Override
protected int getPort(int defaultPort) {
return ...
}
...
}
or you can override it by setting system property "jersey.test.port"
mvn test -DargLine="-Djersey.test.port=7895"
Regards,
Pavel
On 6/19/11 4:17 PM, h.hitz_at_gmx.ch wrote:
> Hello everybody
> I'm using jersey testframework to stub services that will be used in my
> project under test. I need to change the port number of the grizzly web
> container because our REST-Services are listening on different port
> number as grizzli webtest default port
> (9998).
> How can I do that? Can somebody provide me a code snipplet?
>
> Many thanks in advance
> Hansueli Hitz
>
> My code for starting grizzli web container:
>
> public class ActivitiJerseyStubTest extends JerseyTest{
>
> public ActivitiJerseyStubTest() throws Exception {
>
> super(new
> WebAppDescriptor.Builder("ch.triemli.proc.hflow.srvcstub")
> .contextPath("hFlow")
> .servletPath("/rs")
> .build());
>
> }
>
> @Rule
> public ActivitiRule activitiRule = new ActivitiRule();
> ......
>