Package org.glassfish.main.itest.tools
Class GlassFishTestEnvironment
java.lang.Object
org.glassfish.main.itest.tools.GlassFishTestEnvironment
This class represents GlassFish installation outside test environment.
Ensures that the domain in executed before first test started, and that the domain stops after tests are finished.
- Author:
- David Matejcek
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.glassfish.admin.rest.client.ClientWrapperCreates aClientinstance for the domain administrator.static voidThis will delete the jobs.xml filestatic Asadminstatic Pathstatic Filestatic HttpURLConnectionopenConnection(int port, String context) Creates an unencryptedHttpURLConnectionfor the gine port and context.static HttpURLConnectionopenConnection(String context) Creates aHttpURLConnectionfor the admin administrator.
-
Constructor Details
-
GlassFishTestEnvironment
public GlassFishTestEnvironment()
-
-
Method Details
-
getAsadmin
- Returns:
Asadmincommand api for tests.
-
getTargetDirectory
- Returns:
- project's target directory.
-
getDomain1Directory
- Returns:
- domain1 directory absolute path
-
createClient
public static org.glassfish.admin.rest.client.ClientWrapper createClient()Creates aClientinstance for the domain administrator. Caller is responsible for closing.- Returns:
- new
Clientinstance
-
openConnection
Creates aHttpURLConnectionfor the admin administrator.- Parameters:
context- - part of the url behind thehttp://localhost:4848- Returns:
- a new disconnected
HttpURLConnection. - Throws:
IOException
-
openConnection
Creates an unencryptedHttpURLConnectionfor the gine port and context.- Parameters:
port-context- - part of the url behind thehttp://localhost:[port]- Returns:
- a new disconnected
HttpURLConnection. - Throws:
IOException
-
deleteJobsFile
public static void deleteJobsFile()This will delete the jobs.xml file
-