Search in sources :

Example 1 with ZooKeeperTestingServerManager

use of com.spotify.helios.ZooKeeperTestingServerManager in project helios by spotify.

the class TaskHistoryWriterTest method setUp.

@Before
public void setUp() throws Exception {
    zk = new ZooKeeperTestingServerManager();
    agentStateDirs = Files.createTempDirectory("helios-agents");
    client = new DefaultZooKeeperClient(zk.curatorWithSuperAuth());
    makeWriter(client);
    final ZooKeeperClientProvider zkProvider = new ZooKeeperClientProvider(client, ZooKeeperModelReporter.noop());
    final List<EventSender> eventSenders = Collections.emptyList();
    masterModel = new ZooKeeperMasterModel(zkProvider, "test", eventSenders, TaskStatusEvent.TASK_STATUS_EVENT_TOPIC);
    client.ensurePath(Paths.configJobs());
    client.ensurePath(Paths.configJobRefs());
    client.ensurePath(Paths.historyJobHostEvents(JOB_ID, HOSTNAME));
    masterModel.registerHost(HOSTNAME, "foo");
    masterModel.addJob(JOB);
}
Also used : ZooKeeperClientProvider(com.spotify.helios.servicescommon.coordination.ZooKeeperClientProvider) EventSender(com.spotify.helios.servicescommon.EventSender) ZooKeeperTestingServerManager(com.spotify.helios.ZooKeeperTestingServerManager) ZooKeeperMasterModel(com.spotify.helios.master.ZooKeeperMasterModel) DefaultZooKeeperClient(com.spotify.helios.servicescommon.coordination.DefaultZooKeeperClient) Before(org.junit.Before)

Example 2 with ZooKeeperTestingServerManager

use of com.spotify.helios.ZooKeeperTestingServerManager in project helios by spotify.

the class ZooKeeperAclInitializerTest method setUp.

@Before
public void setUp() {
    aclProvider = ZooKeeperAclProviders.heliosAclProvider(MASTER_USER, digest(MASTER_USER, MASTER_PASSWORD), AGENT_USER, digest(AGENT_USER, AGENT_PASSWORD));
    zk = new ZooKeeperTestingServerManager();
}
Also used : ZooKeeperTestingServerManager(com.spotify.helios.ZooKeeperTestingServerManager) Before(org.junit.Before)

Example 3 with ZooKeeperTestingServerManager

use of com.spotify.helios.ZooKeeperTestingServerManager in project helios by spotify.

the class PersistentPathChildrenCacheTest method setup.

@Before
public void setup() throws Exception {
    zk = new ZooKeeperTestingServerManager();
    zk.ensure("/foos");
    directory = Files.createTempDirectory("helios-test");
    stateFile = directory.resolve("persistent-path-children-cache-test-nodes.json");
    startCache();
}
Also used : ZooKeeperTestingServerManager(com.spotify.helios.ZooKeeperTestingServerManager) Before(org.junit.Before)

Example 4 with ZooKeeperTestingServerManager

use of com.spotify.helios.ZooKeeperTestingServerManager in project helios by spotify.

the class AgentStateDirConflictTest method setup.

@Before
public void setup() throws Exception {
    zk = new ZooKeeperTestingServerManager();
    dueh = Thread.getDefaultUncaughtExceptionHandler();
    Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {

        @Override
        public void uncaughtException(final Thread thread, final Throwable th) {
        }
    });
    stateDir = Files.createTempDirectory("helios-agent-conflict-test");
    first = makeAgent("first");
    second = makeAgent("second");
}
Also used : ZooKeeperTestingServerManager(com.spotify.helios.ZooKeeperTestingServerManager) Before(org.junit.Before)

Example 5 with ZooKeeperTestingServerManager

use of com.spotify.helios.ZooKeeperTestingServerManager in project helios by spotify.

the class ZooKeeperRegistrarServiceUtilTest method setUp.

@Before
public void setUp() throws Exception {
    testingServerManager = new ZooKeeperTestingServerManager();
    testingServerManager.awaitUp(5, TimeUnit.SECONDS);
    zkClient = new DefaultZooKeeperClient(testingServerManager.curatorWithSuperAuth());
}
Also used : ZooKeeperTestingServerManager(com.spotify.helios.ZooKeeperTestingServerManager) DefaultZooKeeperClient(com.spotify.helios.servicescommon.coordination.DefaultZooKeeperClient) Before(org.junit.Before)

Aggregations

ZooKeeperTestingServerManager (com.spotify.helios.ZooKeeperTestingServerManager)5 Before (org.junit.Before)5 DefaultZooKeeperClient (com.spotify.helios.servicescommon.coordination.DefaultZooKeeperClient)2 ZooKeeperMasterModel (com.spotify.helios.master.ZooKeeperMasterModel)1 EventSender (com.spotify.helios.servicescommon.EventSender)1 ZooKeeperClientProvider (com.spotify.helios.servicescommon.coordination.ZooKeeperClientProvider)1