From b843e8dfaf136c8d8dcca0574f4a40d8dafce235 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Fri, 29 Jan 2021 17:57:42 -0800 Subject: [PATCH] Removed dependency from ConsoleExporter (#1760) * Removed dependency from ConsoleExporter * Correcting the namespace * Use TestExporter instead of InMemory Exporter * Removed unnecessary using statements Co-authored-by: Cijo Thomas --- test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj | 1 - .../Trace/ExportProcessorTest.cs | 13 +++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj b/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj index 6cdaa6f1269..4bce77a0f41 100644 --- a/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj +++ b/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj @@ -9,7 +9,6 @@ - diff --git a/test/OpenTelemetry.Tests/Trace/ExportProcessorTest.cs b/test/OpenTelemetry.Tests/Trace/ExportProcessorTest.cs index f22e5f4ed17..6dd537b0be5 100644 --- a/test/OpenTelemetry.Tests/Trace/ExportProcessorTest.cs +++ b/test/OpenTelemetry.Tests/Trace/ExportProcessorTest.cs @@ -14,14 +14,11 @@ // limitations under the License. // -using System.Collections.Generic; using System.Diagnostics; -using OpenTelemetry.Exporter; -using OpenTelemetry.Exporter.Console; -using OpenTelemetry.Trace; +using OpenTelemetry.Tests; using Xunit; -namespace OpenTelemetry.Tests.Trace +namespace OpenTelemetry.Trace.Tests { public class ExportProcessorTest { @@ -31,7 +28,7 @@ public class ExportProcessorTest public void ExportProcessorIgnoresActivityWhenDropped() { var sampler = new AlwaysOffSampler(); - var processor = new TestActivityExportProcessor(new ConsoleActivityExporter(null)); + var processor = new TestActivityExportProcessor(new TestExporter(_ => { })); using var activitySource = new ActivitySource(ActivitySourceName); using var sdk = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) @@ -52,7 +49,7 @@ public void ExportProcessorIgnoresActivityWhenDropped() public void ExportProcessorIgnoresActivityMarkedAsRecordOnly() { var sampler = new RecordOnlySampler(); - var processor = new TestActivityExportProcessor(new ConsoleActivityExporter(null)); + var processor = new TestActivityExportProcessor(new TestExporter(_ => { })); using var activitySource = new ActivitySource(ActivitySourceName); using var sdk = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) @@ -73,7 +70,7 @@ public void ExportProcessorIgnoresActivityMarkedAsRecordOnly() public void ExportProcessorExportsActivityMarkedAsRecordAndSample() { var sampler = new AlwaysOnSampler(); - var processor = new TestActivityExportProcessor(new ConsoleActivityExporter(null)); + var processor = new TestActivityExportProcessor(new TestExporter(_ => { })); using var activitySource = new ActivitySource(ActivitySourceName); using var sdk = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName)