public abstract class SystemTestBase extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BUSYBOX |
static DockerHost |
DOCKER_HOST |
org.junit.rules.ExpectedException |
exception |
static List<String> |
IDLE_COMMAND |
static int |
INTERNAL_PORT |
static int |
LONG_WAIT_MINUTES |
org.junit.rules.TemporaryFolder |
temporaryFolder |
TemporaryPorts |
temporaryPorts |
static String |
TEST_HOST |
static String |
TEST_MASTER |
static String |
TEST_USER |
String |
testJobName |
String |
testJobVersion |
String |
testTag |
static int |
WAIT_TIMEOUT_SECONDS |
org.junit.rules.TestRule |
watcher |
protected String |
zkClusterId |
protected static String |
zooKeeperNamespace |
| Constructor and Description |
|---|
SystemTestBase() |
| Modifier and Type | Method and Description |
|---|---|
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 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 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,
List<String> command,
Map<String,String> env,
Map<String,PortMapping> ports,
Map<ServiceEndpoint,ServicePorts> registration,
Integer gracePeriod,
Map<String,String> volumes,
Date expires) |
protected HeliosClient |
defaultClient() |
protected void |
deployJob(JobId jobId,
String host) |
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 <T> T |
getOrNull(com.google.common.util.concurrent.ListenableFuture<T> future) |
protected boolean |
isIntegration() |
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 int |
masterAdminPort() |
protected String |
masterEndpoint() |
protected String |
masterName() |
protected int |
masterPort() |
protected String |
readLogFully(com.sun.jersey.api.client.ClientResponse logs) |
protected static void |
removeContainer(com.spotify.docker.client.DockerClient dockerClient,
String containerId) |
protected List<String> |
setupDefaultMaster(String... args) |
protected AgentMain |
startAgent(String... args) |
protected AgentMain |
startDefaultAgent(String host,
String... args) |
protected void |
startDefaultMaster(String... args) |
protected void |
startDefaultMasterDontWaitForZK(CuratorClientFactory curatorClientFactory,
String... args) |
protected String |
startJob(JobId jobId,
String host) |
protected MasterMain |
startMaster(String... args) |
static void |
staticSetup() |
protected String |
stopJob(JobId jobId,
String host) |
protected void |
tearDownJobs() |
protected TemporaryPorts |
temporaryPorts() |
protected String |
testHost() |
protected void |
undeployJob(JobId jobId,
String host) |
protected void |
waitForMasterToConnectToZK() |
protected ZooKeeperTestManager |
zk() |
protected ZooKeeperTestManager |
zooKeeperTestManager() |
public static final int WAIT_TIMEOUT_SECONDS
public static final int LONG_WAIT_MINUTES
public static final int INTERNAL_PORT
public static final String BUSYBOX
public final String testTag
public final String testJobName
public final String testJobVersion
public static final DockerHost DOCKER_HOST
public static final String TEST_USER
public static final String TEST_HOST
public static final String TEST_MASTER
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 static String zooKeeperNamespace
protected final String zkClusterId
public static void staticSetup()
protected ZooKeeperTestManager zooKeeperTestManager()
protected void tearDownJobs()
throws InterruptedException,
ExecutionException
protected boolean isIntegration()
protected TemporaryPorts temporaryPorts()
protected ZooKeeperTestManager zk()
protected String masterEndpoint()
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 void startDefaultMaster(String... args) throws Exception
Exceptionprotected void waitForMasterToConnectToZK()
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, 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 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 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 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 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 <T> T getOrNull(com.google.common.util.concurrent.ListenableFuture<T> future)
throws ExecutionException,
InterruptedException
protected String readLogFully(com.sun.jersey.api.client.ClientResponse logs) throws IOException
IOExceptionprotected 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.DockerException, InterruptedException
com.spotify.docker.client.DockerExceptionInterruptedExceptionCopyright © 2014. All rights reserved.