public abstract class SystemTestBase extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
AGENT_DIGEST |
static String |
AGENT_PASSWORD |
static String |
AGENT_USER |
static String |
ALPINE |
static String |
BUSYBOX |
static String |
BUSYBOX_WITH_DIGEST |
static com.spotify.docker.client.DockerHost |
DOCKER_HOST |
org.junit.rules.ExpectedException |
exception |
protected org.apache.http.impl.client.CloseableHttpClient |
httpClient |
static List<String> |
IDLE_COMMAND |
static int |
LONG_WAIT_SECONDS |
static String |
MASTER_DIGEST |
static String |
MASTER_PASSWORD |
static String |
MASTER_USER |
static String |
MEMCACHED |
static String |
NGINX |
org.junit.rules.TemporaryFolder |
temporaryFolder |
TemporaryPorts |
temporaryPorts |
static String |
TEST_HOST |
static String |
TEST_MASTER |
static String |
TEST_USER |
String |
testJobName |
String |
testJobNameAndVersion |
String |
testJobVersion |
String |
testTag |
static String |
UHTTPD |
static int |
WAIT_TIMEOUT_SECONDS |
org.junit.rules.TestRule |
watcher |
protected String |
zkClusterId |
| Constructor and Description |
|---|
SystemTestBase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertJobEquals(Job expected,
Job actual) |
protected void |
assertJobsEqual(Map<JobId,Job> expected,
Map<JobId,Job> actual) |
protected DeploymentGroupStatus |
awaitDeploymentGroupStatus(HeliosClient client,
String name,
DeploymentGroupStatus.State expected) |
protected void |
awaitHostRegistered(HeliosClient client,
String host,
int timeout,
TimeUnit timeUnit) |
protected void |
awaitHostRegistered(String name,
long timeout,
TimeUnit timeUnit) |
protected HostStatus |
awaitHostStatus(HeliosClient client,
String host,
HostStatus.Status status,
int timeout,
TimeUnit timeUnit) |
protected HostStatus |
awaitHostStatus(String name,
HostStatus.Status status,
int timeout,
TimeUnit timeUnit) |
protected HostStatus |
awaitHostStatusWithHostInfo(HeliosClient client,
String host,
HostStatus.Status status,
int timeout,
TimeUnit timeUnit) |
protected HostStatus |
awaitHostStatusWithLabels(HeliosClient client,
String host,
HostStatus.Status status,
Map<String,String> labels) |
protected TaskStatus |
awaitJobState(HeliosClient client,
String host,
JobId jobId,
TaskStatus.State state,
int timeout,
TimeUnit timeunit) |
protected TaskStatus |
awaitJobThrottle(HeliosClient client,
String host,
JobId jobId,
ThrottleState throttled,
int timeout,
TimeUnit timeunit) |
protected void |
awaitTaskGone(HeliosClient client,
String host,
JobId jobId,
long timeout,
TimeUnit timeunit) |
protected TaskStatus |
awaitTaskState(JobId jobId,
String host,
TaskStatus.State state) |
void |
baseSetup() |
void |
baseTeardown() |
protected String |
cli(String command,
List<String> args) |
protected String |
cli(String command,
Object... args) |
protected String |
cli(String command,
String... args) |
protected HeliosClient |
client(String user,
String endpoint) |
protected <T> T |
cliJson(Class<T> klass,
String command,
List<String> args) |
protected <T> T |
cliJson(Class<T> klass,
String command,
String... args) |
protected JobId |
createJob(Job job) |
protected JobId |
createJob(String name,
String version,
String image,
List<String> command) |
protected JobId |
createJob(String name,
String version,
String image,
List<String> command,
Date expires) |
protected JobId |
createJob(String name,
String version,
String image,
List<String> command,
com.google.common.collect.ImmutableMap<String,String> env) |
protected JobId |
createJob(String name,
String version,
String image,
List<String> command,
Map<String,String> env,
Map<String,PortMapping> ports) |
protected JobId |
createJob(String name,
String version,
String image,
List<String> command,
Map<String,String> env,
Map<String,PortMapping> ports,
Map<ServiceEndpoint,ServicePorts> registration) |
protected JobId |
createJob(String name,
String version,
String image,
List<String> command,
Map<String,String> env,
Map<String,PortMapping> ports,
Map<ServiceEndpoint,ServicePorts> registration,
Integer gracePeriod,
Map<String,String> volumes) |
protected JobId |
createJob(String name,
String version,
String image,
String hostname,
List<String> command,
Map<String,String> env,
Map<String,PortMapping> ports,
Map<ServiceEndpoint,ServicePorts> registration,
Integer gracePeriod,
Map<String,String> volumes,
Date expires) |
protected String |
createJobRawOutput(Job job) |
protected HeliosClient |
defaultClient() |
protected void |
deployJob(JobId jobId,
String host) |
protected void |
deployJob(JobId jobId,
String host,
String token) |
protected String |
deregisterHost(String host) |
com.google.common.collect.Range<Integer> |
dockerPortRange() |
void |
dockerSetup() |
protected List<String> |
flatten(Iterable<?> values) |
protected List<String> |
flatten(Object... values) |
protected com.spotify.docker.client.DockerClient |
getNewDockerClient() |
protected <T> T |
getOrNull(com.google.common.util.concurrent.ListenableFuture<T> future) |
protected List<com.spotify.docker.client.messages.Container> |
listContainers(com.spotify.docker.client.DockerClient dockerClient,
String needle) |
protected ByteArrayOutputStream |
main(Collection<String> args) |
protected ByteArrayOutputStream |
main(String... args) |
protected String |
masterAdminEndpoint() |
protected int |
masterAdminPort() |
protected String |
masterEndpoint() |
protected String |
masterName() |
protected int |
masterPort() |
protected static String |
randomHexString() |
protected static void |
removeContainer(com.spotify.docker.client.DockerClient dockerClient,
String containerId) |
protected void |
resetAgentStateDir() |
protected List<String> |
setupDefaultMaster(int offset,
String... args) |
protected List<String> |
setupDefaultMaster(String... args) |
protected AgentMain |
startAgent(String... args) |
protected AgentMain |
startDefaultAgent(String host,
String... args) |
protected MasterMain |
startDefaultMaster(int offset,
String... args) |
protected MasterMain |
startDefaultMaster(String... args) |
protected void |
startDefaultMasterDontWaitForZk(CuratorClientFactory curatorClientFactory,
String... args) |
protected Map<String,MasterMain> |
startDefaultMasters(int numMasters,
String... args) |
protected String |
startJob(JobId jobId,
String host) |
protected MasterMain |
startMaster(String... args) |
static void |
staticSetup() |
protected void |
stopAgent(AgentMain main) |
protected String |
stopJob(JobId jobId,
String host) |
protected TemporaryPorts |
temporaryPorts() |
protected String |
testHost() |
protected void |
undeployJob(JobId jobId,
String host) |
protected void |
waitForMasterToBeFullyUp() |
protected ZooKeeperTestManager |
zk() |
protected ZooKeeperTestManager |
zooKeeperTestManager() |
public static final int WAIT_TIMEOUT_SECONDS
public static final int LONG_WAIT_SECONDS
public static final String BUSYBOX
public static final String BUSYBOX_WITH_DIGEST
public static final String NGINX
public static final String UHTTPD
public static final String ALPINE
public static final String MEMCACHED
public final String testTag
public final String testJobName
public final String testJobVersion
public final String testJobNameAndVersion
public static final com.spotify.docker.client.DockerHost DOCKER_HOST
public static final String TEST_USER
public static final String TEST_HOST
public static final String TEST_MASTER
public static final String MASTER_USER
public static final String MASTER_PASSWORD
public static final String AGENT_USER
public static final String AGENT_PASSWORD
public static final String MASTER_DIGEST
public static final String AGENT_DIGEST
public final TemporaryPorts temporaryPorts
public final org.junit.rules.TemporaryFolder temporaryFolder
public final org.junit.rules.ExpectedException exception
public final org.junit.rules.TestRule watcher
protected final String zkClusterId
protected org.apache.http.impl.client.CloseableHttpClient httpClient
public static void staticSetup()
protected com.spotify.docker.client.DockerClient getNewDockerClient()
throws Exception
Exceptionprotected ZooKeeperTestManager zooKeeperTestManager()
protected TemporaryPorts temporaryPorts()
protected ZooKeeperTestManager zk()
protected String masterEndpoint()
protected String masterAdminEndpoint()
protected String masterName() throws InterruptedException, ExecutionException
protected HeliosClient defaultClient()
protected HeliosClient client(String user, String endpoint)
protected int masterPort()
protected int masterAdminPort()
public com.google.common.collect.Range<Integer> dockerPortRange()
protected String testHost() throws InterruptedException, ExecutionException
protected List<String> setupDefaultMaster(String... args) throws Exception
Exceptionprotected List<String> setupDefaultMaster(int offset, String... args) throws Exception
Exceptionprotected MasterMain startDefaultMaster(String... args) throws Exception
Exceptionprotected MasterMain startDefaultMaster(int offset, String... args) throws Exception
Exceptionprotected Map<String,MasterMain> startDefaultMasters(int numMasters, String... args) throws Exception
Exceptionprotected void waitForMasterToBeFullyUp()
throws Exception
Exceptionprotected void startDefaultMasterDontWaitForZk(CuratorClientFactory curatorClientFactory, String... args) throws Exception
Exceptionprotected AgentMain startDefaultAgent(String host, String... args) throws Exception
Exceptionprotected MasterMain startMaster(String... args) throws Exception
Exceptionprotected JobId createJob(String name, String version, String image, List<String> command) throws Exception
Exceptionprotected JobId createJob(String name, String version, String image, List<String> command, Date expires) throws Exception
Exceptionprotected JobId createJob(String name, String version, String image, List<String> command, com.google.common.collect.ImmutableMap<String,String> env) throws Exception
Exceptionprotected JobId createJob(String name, String version, String image, List<String> command, Map<String,String> env, Map<String,PortMapping> ports) throws Exception
Exceptionprotected JobId createJob(String name, String version, String image, List<String> command, Map<String,String> env, Map<String,PortMapping> ports, Map<ServiceEndpoint,ServicePorts> registration) throws Exception
Exceptionprotected JobId createJob(String name, String version, String image, List<String> command, Map<String,String> env, Map<String,PortMapping> ports, Map<ServiceEndpoint,ServicePorts> registration, Integer gracePeriod, Map<String,String> volumes) throws Exception
Exceptionprotected JobId createJob(String name, String version, String image, String hostname, List<String> command, Map<String,String> env, Map<String,PortMapping> ports, Map<ServiceEndpoint,ServicePorts> registration, Integer gracePeriod, Map<String,String> volumes, Date expires) throws Exception
Exceptionprotected void deployJob(JobId jobId, String host, String token) throws Exception
Exceptionprotected <T> T cliJson(Class<T> klass, String command, String... args) throws Exception
Exceptionprotected <T> T cliJson(Class<T> klass, String command, List<String> args) throws Exception
Exceptionprotected ByteArrayOutputStream main(String... args) throws Exception
Exceptionprotected ByteArrayOutputStream main(Collection<String> args) throws Exception
Exceptionprotected void awaitHostRegistered(String name, long timeout, TimeUnit timeUnit) throws Exception
Exceptionprotected void awaitHostRegistered(HeliosClient client, String host, int timeout, TimeUnit timeUnit) throws Exception
Exceptionprotected HostStatus awaitHostStatus(HeliosClient client, String host, HostStatus.Status status, int timeout, TimeUnit timeUnit) throws Exception
Exceptionprotected HostStatus awaitHostStatus(String name, HostStatus.Status status, int timeout, TimeUnit timeUnit) throws Exception
Exceptionprotected TaskStatus awaitJobState(HeliosClient client, String host, JobId jobId, TaskStatus.State state, int timeout, TimeUnit timeunit) throws Exception
Exceptionprotected TaskStatus awaitJobThrottle(HeliosClient client, String host, JobId jobId, ThrottleState throttled, int timeout, TimeUnit timeunit) throws Exception
Exceptionprotected HostStatus awaitHostStatusWithLabels(HeliosClient client, String host, HostStatus.Status status, Map<String,String> labels) throws Exception
Exceptionprotected HostStatus awaitHostStatusWithHostInfo(HeliosClient client, String host, HostStatus.Status status, int timeout, TimeUnit timeUnit) throws Exception
Exceptionprotected TaskStatus awaitTaskState(JobId jobId, String host, TaskStatus.State state) throws Exception
Exceptionprotected void awaitTaskGone(HeliosClient client, String host, JobId jobId, long timeout, TimeUnit timeunit) throws Exception
Exceptionprotected DeploymentGroupStatus awaitDeploymentGroupStatus(HeliosClient client, String name, DeploymentGroupStatus.State expected) throws Exception
Exceptionprotected <T> T getOrNull(com.google.common.util.concurrent.ListenableFuture<T> future)
throws ExecutionException,
InterruptedException
protected static void removeContainer(com.spotify.docker.client.DockerClient dockerClient,
String containerId)
throws Exception
Exceptionprotected List<com.spotify.docker.client.messages.Container> listContainers(com.spotify.docker.client.DockerClient dockerClient, String needle) throws com.spotify.docker.client.exceptions.DockerException, InterruptedException
com.spotify.docker.client.exceptions.DockerExceptionInterruptedExceptionprotected static String randomHexString()
protected void resetAgentStateDir()
throws IOException
IOExceptionCopyright © 2017. All rights reserved.