Search in sources :

Example 1 with FlowStatusGenerator

use of org.apache.gobblin.service.monitoring.FlowStatusGenerator in project incubator-gobblin by apache.

the class FlowStatusTest method setUp.

@BeforeClass
public void setUp() throws Exception {
    ConfigBuilder configBuilder = ConfigBuilder.create();
    JobStatusRetriever jobStatusRetriever = new TestJobStatusRetriever();
    final FlowStatusGenerator flowStatusGenerator = FlowStatusGenerator.builder().jobStatusRetriever(jobStatusRetriever).build();
    Injector injector = Guice.createInjector(new Module() {

        @Override
        public void configure(Binder binder) {
            binder.bind(FlowStatusGenerator.class).annotatedWith(Names.named(FlowStatusResource.FLOW_STATUS_GENERATOR_INJECT_NAME)).toInstance(flowStatusGenerator);
        }
    });
    _server = EmbeddedRestliServer.builder().resources(Lists.<Class<? extends BaseResource>>newArrayList(FlowStatusResource.class)).injector(injector).build();
    _server.startAsync();
    _server.awaitRunning();
    _client = new FlowStatusClient(String.format("http://localhost:%s/", _server.getPort()));
    messageJoiner = Joiner.on(FlowStatusResource.MESSAGE_SEPARATOR);
}
Also used : Binder(com.google.inject.Binder) Injector(com.google.inject.Injector) BaseResource(com.linkedin.restli.server.resources.BaseResource) ConfigBuilder(org.apache.gobblin.config.ConfigBuilder) AfterClass(org.testng.annotations.AfterClass) BeforeClass(org.testng.annotations.BeforeClass) Module(com.google.inject.Module) FlowStatusGenerator(org.apache.gobblin.service.monitoring.FlowStatusGenerator) JobStatusRetriever(org.apache.gobblin.service.monitoring.JobStatusRetriever) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

Binder (com.google.inject.Binder)1 Injector (com.google.inject.Injector)1 Module (com.google.inject.Module)1 BaseResource (com.linkedin.restli.server.resources.BaseResource)1 ConfigBuilder (org.apache.gobblin.config.ConfigBuilder)1 FlowStatusGenerator (org.apache.gobblin.service.monitoring.FlowStatusGenerator)1 JobStatusRetriever (org.apache.gobblin.service.monitoring.JobStatusRetriever)1 AfterClass (org.testng.annotations.AfterClass)1 BeforeClass (org.testng.annotations.BeforeClass)1