Search in sources :

Example 1 with AgentProcessContext

use of alluxio.hub.agent.process.AgentProcessContext in project alluxio by Alluxio.

the class AgentRpcServerTest method testAwaitTermination.

@Test
public void testAwaitTermination() throws Exception {
    AlluxioConfiguration conf = getTestSpecificTestConfig();
    AgentProcessContext ctx = TestAgentProcessContextFactory.simpleContext(conf);
    AgentRpcServer server = new AgentRpcServer(conf, ctx);
    // shut down server once started.
    Thread t = new Thread(server::close);
    assertTrue(server.isServing());
    t.start();
    server.awaitTermination();
    t.join();
    assertFalse(server.isServing());
}
Also used : AgentProcessContext(alluxio.hub.agent.process.AgentProcessContext) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) Test(org.junit.Test) BaseHubTest(alluxio.hub.test.BaseHubTest)

Aggregations

AlluxioConfiguration (alluxio.conf.AlluxioConfiguration)1 AgentProcessContext (alluxio.hub.agent.process.AgentProcessContext)1 BaseHubTest (alluxio.hub.test.BaseHubTest)1 Test (org.junit.Test)1