Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove obsolete members #1146

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions src/Testcontainers/Configurations/TestcontainersSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ namespace DotNet.Testcontainers.Configurations
using DotNet.Testcontainers.Containers;
using DotNet.Testcontainers.Images;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;

/// <summary>
/// This class represents the Testcontainers settings.
/// </summary>
[PublicAPI]
public static class TestcontainersSettings
{
private static readonly ManualResetEventSlim ManualResetEvent = new ManualResetEventSlim(true);

[CanBeNull]
private static readonly IDockerEndpointAuthenticationProvider DockerEndpointAuthProvider
= new IDockerEndpointAuthenticationProvider[]
Expand Down Expand Up @@ -103,29 +100,13 @@ static TestcontainersSettings()
public static string HubImageNamePrefix { get; set; }
= EnvironmentConfiguration.Instance.GetHubImageNamePrefix() ?? PropertiesFileConfiguration.Instance.GetHubImageNamePrefix();

/// <summary>
/// Gets or sets the logger.
/// </summary>
[NotNull]
[Obsolete("Use the builder API WithLogger(ILogger) instead.")]
public static ILogger Logger { get; set; }
= ConsoleLogger.Instance;

/// <summary>
/// Gets or sets the host operating system.
/// </summary>
[NotNull]
public static IOperatingSystem OS { get; set; }
= RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? (IOperatingSystem)new Windows(DockerEndpointAuthConfig) : new Unix(DockerEndpointAuthConfig);

/// <summary>
/// Gets the wait handle that signals settings initialized.
/// </summary>
[NotNull]
[Obsolete("This property is no longer supported.")]
public static WaitHandle SettingsInitialized
=> ManualResetEvent.WaitHandle;

/// <inheritdoc cref="PortForwardingContainer.ExposeHostPortsAsync" />
public static Task ExposeHostPortsAsync(ushort port, CancellationToken ct = default)
=> ExposeHostPortsAsync(new[] { port }, ct);
Expand Down
12 changes: 0 additions & 12 deletions src/Testcontainers/Containers/DockerContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ public DockerContainer(IContainerConfiguration configuration)
_configuration = configuration;
}

/// <summary>
/// Initializes a new instance of the <see cref="DockerContainer" /> class.
/// </summary>
/// <param name="configuration">The container configuration.</param>
/// <param name="logger">The logger.</param>
[Obsolete("Use the constructor DockerContainer(IContainerConfiguration) instead.")]
public DockerContainer(IContainerConfiguration configuration, ILogger logger)
{
_client = new TestcontainersClient(configuration.SessionId, configuration.DockerEndpointAuthConfig, logger);
_configuration = configuration;
}

/// <inheritdoc />
public event EventHandler Creating;

Expand Down
14 changes: 0 additions & 14 deletions src/Testcontainers/Containers/ResourceReaper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,6 @@ private ResourceReaper(Guid sessionId, IDockerEndpointAuthenticationConfiguratio
[PublicAPI]
public Guid SessionId { get; }

/// <summary>
/// Starts and returns the default <see cref="ResourceReaper" /> instance.
/// </summary>
/// <param name="dockerEndpointAuthConfig">The Docker endpoint authentication configuration.</param>
/// <param name="isWindowsEngineEnabled">Determines whether the Windows engine is enabled or not.</param>
/// <param name="ct">The cancellation token to cancel the <see cref="ResourceReaper" /> initialization.</param>
/// <returns>Task that completes when the <see cref="ResourceReaper" /> has been started.</returns>
[PublicAPI]
[Obsolete("Use GetAndStartDefaultAsync(IDockerEndpointAuthenticationConfiguration, ILogger, bool, CancellationToken) instead.")]
public static Task<ResourceReaper> GetAndStartDefaultAsync(IDockerEndpointAuthenticationConfiguration dockerEndpointAuthConfig, bool isWindowsEngineEnabled = false, CancellationToken ct = default)
{
return GetAndStartDefaultAsync(dockerEndpointAuthConfig, ConsoleLogger.Instance, isWindowsEngineEnabled, ct);
}

/// <summary>
/// Starts and returns the default <see cref="ResourceReaper" /> instance.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public sealed class DefaultResourceReaperTest : IAsyncLifetime
{
public async Task InitializeAsync()
{
var resourceReaper = await ResourceReaper.GetAndStartDefaultAsync(TestcontainersSettings.OS.DockerEndpointAuthConfig)
var resourceReaper = await ResourceReaper.GetAndStartDefaultAsync(TestcontainersSettings.OS.DockerEndpointAuthConfig, ConsoleLogger.Instance)
.ConfigureAwait(false);

await resourceReaper.DisposeAsync()
Expand Down
Loading