public class TestingServer extends Object implements 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,
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
|
String |
getConnectString()
Returns the connection string to use
|
int |
getPort()
Return the port being used
|
File |
getTempDirectory()
Returns the temp directory being used
|
void |
stop()
Stop the server without deleting the temp directory
|
public TestingServer() throws Exception
Exception
- errorspublic TestingServer(int port) throws Exception
port
- the portException
- errorspublic TestingServer(int port, File tempDirectory) throws Exception
port
- the porttempDirectory
- directory to useException
- errorspublic TestingServer(InstanceSpec spec) throws Exception
Exception
public int getPort()
public File getTempDirectory()
public void stop() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public String getConnectString()
Copyright © 2011–2014 The Apache Software Foundation. All rights reserved.