1 package org
.argeo
.slc
.server
.unit
;
3 import org
.argeo
.slc
.SlcException
;
4 import org
.argeo
.slc
.msg
.ExecutionAnswer
;
5 import org
.argeo
.slc
.server
.client
.SlcServerHttpClient
;
6 import org
.argeo
.slc
.unit
.AbstractSpringTestCase
;
8 public abstract class AbstractHttpClientTestCase
extends AbstractSpringTestCase
{
9 private SlcServerHttpClient httpClient
= null;
11 private String isServerReadyService
= "isServerReady.service";
13 protected void setUp() throws Exception
{
15 httpClient
= createHttpClient();
18 protected void waitForServerToBeReady() {
19 ExecutionAnswer answer
= httpClient
.callServiceSafe(
20 isServerReadyService
, null, getServerReadyTimeout());
22 throw new SlcException("Server is not ready: " + answer
);
25 protected SlcServerHttpClient
createHttpClient() {
26 SlcServerHttpClient httpClient
= getBean(SlcServerHttpClient
.class);
30 protected SlcServerHttpClient
getHttpClient() {
34 /** Default is 120s */
35 protected Long
getServerReadyTimeout() {