Package org.glassfish.tests.utils
Class ServerUtils
java.lang.Object
org.glassfish.tests.utils.ServerUtils
- Author:
- David Matejcek
-
Constructor Details
-
ServerUtils
public ServerUtils()
-
-
Method Details
-
getFreePort
Tries to alocate a free local port.- Returns:
- a free local port number.
- Throws:
IllegalStateException- if it fails for 20 times
-
getLocalIP4Address
- Returns:
- the IP address of the localhost.
-
createWar
Creates a simple war file made of provided classes.- Parameters:
warFile-classes-- Returns:
- file usable for deployment.
-
download
Downloads content from the url. Expects there is a service listening and returning textual response. Therefore this is usable just for simple servlets.- Parameters:
url-- Returns:
- content from the url.
- Throws:
IOException
-