Search in sources :

Example 1 with TraceServiceGrpc

use of io.opencensus.proto.agent.trace.v1.TraceServiceGrpc in project instrumentation-java by census-instrumentation.

the class FakeOcAgentTraceServiceGrpcImplTest method config.

@Test
public void config() {
    FakeOcAgentTraceServiceGrpcImpl traceServiceGrpc = new FakeOcAgentTraceServiceGrpcImpl();
    StreamObserver<CurrentLibraryConfig> currentConfigObsever = traceServiceGrpc.config(updatedConfigObserver);
    CurrentLibraryConfig currentLibraryConfig = CurrentLibraryConfig.getDefaultInstance();
    currentConfigObsever.onNext(currentLibraryConfig);
    assertThat(traceServiceGrpc.getCurrentLibraryConfigs()).containsExactly(currentLibraryConfig);
    assertThat(updatedLibraryConfigs).containsExactly(traceServiceGrpc.getUpdatedLibraryConfig());
    updatedLibraryConfigs.clear();
}
Also used : CurrentLibraryConfig(io.opencensus.proto.agent.trace.v1.CurrentLibraryConfig) Test(org.junit.Test)

Example 2 with TraceServiceGrpc

use of io.opencensus.proto.agent.trace.v1.TraceServiceGrpc in project instrumentation-java by census-instrumentation.

the class FakeOcAgentTraceServiceGrpcImplTest method export.

@Test
public void export() {
    FakeOcAgentTraceServiceGrpcImpl traceServiceGrpc = new FakeOcAgentTraceServiceGrpcImpl();
    StreamObserver<ExportTraceServiceRequest> exportRequestObserver = traceServiceGrpc.export(exportResponseObserver);
    ExportTraceServiceRequest request = ExportTraceServiceRequest.getDefaultInstance();
    exportRequestObserver.onNext(request);
    assertThat(traceServiceGrpc.getExportTraceServiceRequests()).containsExactly(request);
}
Also used : ExportTraceServiceRequest(io.opencensus.proto.agent.trace.v1.ExportTraceServiceRequest) Test(org.junit.Test)

Example 3 with TraceServiceGrpc

use of io.opencensus.proto.agent.trace.v1.TraceServiceGrpc in project instrumentation-java by census-instrumentation.

the class FakeOcAgentTraceServiceGrpcImplTest method config_WithNeverSampler.

@Test
public void config_WithNeverSampler() {
    FakeOcAgentTraceServiceGrpcImpl traceServiceGrpc = new FakeOcAgentTraceServiceGrpcImpl();
    traceServiceGrpc.setUpdatedLibraryConfig(neverSampledLibraryConfig);
    StreamObserver<CurrentLibraryConfig> currentConfigObsever = traceServiceGrpc.config(updatedConfigObserver);
    CurrentLibraryConfig currentLibraryConfig = CurrentLibraryConfig.getDefaultInstance();
    currentConfigObsever.onNext(currentLibraryConfig);
    assertThat(traceServiceGrpc.getCurrentLibraryConfigs()).containsExactly(currentLibraryConfig);
    assertThat(updatedLibraryConfigs).containsExactly(neverSampledLibraryConfig);
    updatedLibraryConfigs.clear();
}
Also used : CurrentLibraryConfig(io.opencensus.proto.agent.trace.v1.CurrentLibraryConfig) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 CurrentLibraryConfig (io.opencensus.proto.agent.trace.v1.CurrentLibraryConfig)2 ExportTraceServiceRequest (io.opencensus.proto.agent.trace.v1.ExportTraceServiceRequest)1