public class TestingServer
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
TestingServer()
Create the server using a random port
|
TestingServer(InstanceSpec spec) |
TestingServer(int port)
Create the server using the given port
|
TestingServer(int port,
java.io.File tempDirectory)
Create the server using the given port
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the server and any open clients and delete the temp directory
|
java.lang.String |
getConnectString()
Returns the connection string to use
|
int |
getPort()
Return the port being used
|
java.io.File |
getTempDirectory()
Returns the temp directory being used
|
void |
stop()
Stop the server without deleting the temp directory
|
public TestingServer() throws java.lang.Exception
java.lang.Exception
- errorspublic TestingServer(int port) throws java.lang.Exception
port
- the portjava.lang.Exception
- errorspublic TestingServer(int port, java.io.File tempDirectory) throws java.lang.Exception
port
- the porttempDirectory
- directory to usejava.lang.Exception
- errorspublic TestingServer(InstanceSpec spec) throws java.lang.Exception
java.lang.Exception
public int getPort()
public java.io.File getTempDirectory()
public void stop() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public java.lang.String getConnectString()