From 31c29bbf62178f14d49e1c19f8e78d8e3a8d710c Mon Sep 17 00:00:00 2001
From: jmorris
`7IXIekGF^%L@>`Cb-$v#jW`mBi^~Mz z0hSlznMe|(Ch2|j<^|^T$-blZG-C{!%#3N}RZ@sUF_hz3KYoeH7N`q9C=+^rZJFx3 zb@=&ccmDJ3sP}?Lg`CKd=RXpJz}i97uT) z>f7})38H!Jz!q1IYJltM;AdgXBx`ANpmc*`NI9^jS@h kv;4r^OK z_K{L~r4~(rt&{gx<6fgvUjWWv7UR%?k)1R+IG|b;%b^?al9{OdzoHmp9AUA(geWMV z&FA0jcTyL)rKILj^MlMAEgu$Hfp%3wY89yfjo{Y7M8qtpncRo~jm)ebki`;H={C}g iGcp$t5{Q)gzH8lLaJl2Zvq+72U|}5<)ILXd8Q+Au!YR)H literal 0 HcmV?d00001 diff --git a/src/Couchbase.Analytics/DI/ClusterOptionsExtensions.cs b/src/Couchbase.OperationalInsights/DI/ClusterOptionsExtensions.cs similarity index 93% rename from src/Couchbase.Analytics/DI/ClusterOptionsExtensions.cs rename to src/Couchbase.OperationalInsights/DI/ClusterOptionsExtensions.cs index e4a5f9f..f52ef82 100644 --- a/src/Couchbase.Analytics/DI/ClusterOptionsExtensions.cs +++ b/src/Couchbase.OperationalInsights/DI/ClusterOptionsExtensions.cs @@ -19,9 +19,9 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.Options; -namespace Couchbase.AnalyticsClient.DI; +namespace Couchbase.OperationalInsightsClient.DI; public static class ClusterOptionsExtensions { diff --git a/src/Couchbase.Analytics/DI/ClusterServiceLifetime.cs b/src/Couchbase.OperationalInsights/DI/ClusterServiceLifetime.cs similarity index 96% rename from src/Couchbase.Analytics/DI/ClusterServiceLifetime.cs rename to src/Couchbase.OperationalInsights/DI/ClusterServiceLifetime.cs index fd38805..ff22155 100644 --- a/src/Couchbase.Analytics/DI/ClusterServiceLifetime.cs +++ b/src/Couchbase.OperationalInsights/DI/ClusterServiceLifetime.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.DI; +namespace Couchbase.OperationalInsightsClient.DI; /// /// Represents the scope used for a custom cluster service. diff --git a/src/Couchbase.Analytics/Database.cs b/src/Couchbase.OperationalInsights/Database.cs similarity index 96% rename from src/Couchbase.Analytics/Database.cs rename to src/Couchbase.OperationalInsights/Database.cs index d409861..73e0033 100644 --- a/src/Couchbase.Analytics/Database.cs +++ b/src/Couchbase.OperationalInsights/Database.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient; +namespace Couchbase.OperationalInsightsClient; public sealed class Database { diff --git a/src/Couchbase.Analytics/DnsUtil/IDnsEndpointResolver.cs b/src/Couchbase.OperationalInsights/DnsUtil/IDnsEndpointResolver.cs similarity index 94% rename from src/Couchbase.Analytics/DnsUtil/IDnsEndpointResolver.cs rename to src/Couchbase.OperationalInsights/DnsUtil/IDnsEndpointResolver.cs index 3d74848..cfce63d 100644 --- a/src/Couchbase.Analytics/DnsUtil/IDnsEndpointResolver.cs +++ b/src/Couchbase.OperationalInsights/DnsUtil/IDnsEndpointResolver.cs @@ -21,7 +21,7 @@ using System.Net; -namespace Couchbase.AnalyticsClient.DnsUtil; +namespace Couchbase.OperationalInsightsClient.DnsUtil; public interface IDnsEndpointResolver { diff --git a/src/Couchbase.Analytics/Exceptions/InvalidCredentialException.cs b/src/Couchbase.OperationalInsights/Exceptions/InvalidCredentialException.cs similarity index 81% rename from src/Couchbase.Analytics/Exceptions/InvalidCredentialException.cs rename to src/Couchbase.OperationalInsights/Exceptions/InvalidCredentialException.cs index 8a40e57..bba8d99 100644 --- a/src/Couchbase.Analytics/Exceptions/InvalidCredentialException.cs +++ b/src/Couchbase.OperationalInsights/Exceptions/InvalidCredentialException.cs @@ -19,14 +19,14 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.Internal.Retry; +using Couchbase.OperationalInsightsClient.Internal.Retry; -namespace Couchbase.AnalyticsClient.Exceptions; +namespace Couchbase.OperationalInsightsClient.Exceptions; /// -/// Thrown if the analytics service returns HTTP status code 401 or analytics error code 20000 +/// Thrown if the insights service returns HTTP status code 401 or insights error code 20000 /// -public class InvalidCredentialException : AnalyticsException +public class InvalidCredentialException : OperationalInsightsException { public InvalidCredentialException() { diff --git a/src/Couchbase.Analytics/Exceptions/AnalyticsException.cs b/src/Couchbase.OperationalInsights/Exceptions/OperationalInsightsException.cs similarity index 61% rename from src/Couchbase.Analytics/Exceptions/AnalyticsException.cs rename to src/Couchbase.OperationalInsights/Exceptions/OperationalInsightsException.cs index f65554f..2f6a5f2 100644 --- a/src/Couchbase.Analytics/Exceptions/AnalyticsException.cs +++ b/src/Couchbase.OperationalInsights/Exceptions/OperationalInsightsException.cs @@ -20,43 +20,43 @@ #endregion using System.Text; -using Couchbase.AnalyticsClient.Internal.Retry; +using Couchbase.OperationalInsightsClient.Internal.Retry; -namespace Couchbase.AnalyticsClient.Exceptions; +namespace Couchbase.OperationalInsightsClient.Exceptions; ///-/// Base exception type for Analytics. +/// Base exception type for OperationalInsights. /// -public class AnalyticsException : Exception +public class OperationalInsightsException : Exception { internal ErrorContext? ErrorContext { get; set; } - public AnalyticsException() + public OperationalInsightsException() { } - public AnalyticsException(string? message) : base(message) + public OperationalInsightsException(string? message) : base(message) { } - public AnalyticsException(string? message, Exception? innerException) : base(message, innerException) + public OperationalInsightsException(string? message, Exception? innerException) : base(message, innerException) { } - internal AnalyticsException(string? message, ErrorContext? errorContext) : base(message) + internal OperationalInsightsException(string? message, ErrorContext? errorContext) : base(message) { ErrorContext = errorContext; } - internal AnalyticsException(string? message, Exception? innerException, ErrorContext? errorContext) : base(message, innerException) + internal OperationalInsightsException(string? message, Exception? innerException, ErrorContext? errorContext) : base(message, innerException) { ErrorContext = errorContext; } - internal AnalyticsException(string? message, AggregateException? aggregateException, ErrorContext? errorContext) : base(message, aggregateException) + internal OperationalInsightsException(string? message, AggregateException? aggregateException, ErrorContext? errorContext) : base(message, aggregateException) { ErrorContext = errorContext; } diff --git a/src/Couchbase.Analytics/Exceptions/AnalyticsTimeoutException.cs b/src/Couchbase.OperationalInsights/Exceptions/OperationalInsightsTimeoutException.cs similarity index 59% rename from src/Couchbase.Analytics/Exceptions/AnalyticsTimeoutException.cs rename to src/Couchbase.OperationalInsights/Exceptions/OperationalInsightsTimeoutException.cs index bf6712b..e61d24c 100644 --- a/src/Couchbase.Analytics/Exceptions/AnalyticsTimeoutException.cs +++ b/src/Couchbase.OperationalInsights/Exceptions/OperationalInsightsTimeoutException.cs @@ -19,35 +19,35 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.Internal.Retry; +using Couchbase.OperationalInsightsClient.Internal.Retry; -namespace Couchbase.AnalyticsClient.Exceptions; +namespace Couchbase.OperationalInsightsClient.Exceptions; ///-/// Thrown if the SDK detects a client-side timeout, or the server returns analytics error code 21002 (server-side timeout). +/// Thrown if the SDK detects a client-side timeout, or the server returns insights error code 21002 (server-side timeout). /// -public class AnalyticsTimeoutException : AnalyticsException +public class OperationalInsightsTimeoutException : OperationalInsightsException { - public AnalyticsTimeoutException() + public OperationalInsightsTimeoutException() { } - public AnalyticsTimeoutException(string? message) : base(message) + public OperationalInsightsTimeoutException(string? message) : base(message) { } - public AnalyticsTimeoutException(string? message, Exception? innerException) : base(message, innerException) + public OperationalInsightsTimeoutException(string? message, Exception? innerException) : base(message, innerException) { } - internal AnalyticsTimeoutException(string? message, Exception? innerException, ErrorContext? errorContext) : base(message, innerException, errorContext) + internal OperationalInsightsTimeoutException(string? message, Exception? innerException, ErrorContext? errorContext) : base(message, innerException, errorContext) { } - internal AnalyticsTimeoutException(string? message, ErrorContext? errorContext) : base(message, errorContext) + internal OperationalInsightsTimeoutException(string? message, ErrorContext? errorContext) : base(message, errorContext) { } } diff --git a/src/Couchbase.Analytics/Exceptions/QueryException.cs b/src/Couchbase.OperationalInsights/Exceptions/QueryException.cs similarity index 82% rename from src/Couchbase.Analytics/Exceptions/QueryException.cs rename to src/Couchbase.OperationalInsights/Exceptions/QueryException.cs index 7e56098..1527935 100644 --- a/src/Couchbase.Analytics/Exceptions/QueryException.cs +++ b/src/Couchbase.OperationalInsights/Exceptions/QueryException.cs @@ -19,14 +19,14 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.Internal.Retry; +using Couchbase.OperationalInsightsClient.Internal.Retry; -namespace Couchbase.AnalyticsClient.Exceptions; +namespace Couchbase.OperationalInsightsClient.Exceptions; ///This is the user's only indication that a request is potentially retriable, since the SDK automatically retries retriable operations until the timeout duration elapses. ///-/// Thrown if the analytics service returns a response with an error code other than 20000 or 21002. +/// Thrown if the insights service returns a response with an error code other than 20000 or 21002. /// -public class QueryException : AnalyticsException +public class QueryException : OperationalInsightsException { public QueryException() { diff --git a/src/Couchbase.Analytics/Exceptions/QueryNotFoundException.cs b/src/Couchbase.OperationalInsights/Exceptions/QueryNotFoundException.cs similarity index 86% rename from src/Couchbase.Analytics/Exceptions/QueryNotFoundException.cs rename to src/Couchbase.OperationalInsights/Exceptions/QueryNotFoundException.cs index d692ca0..8db9d34 100644 --- a/src/Couchbase.Analytics/Exceptions/QueryNotFoundException.cs +++ b/src/Couchbase.OperationalInsights/Exceptions/QueryNotFoundException.cs @@ -19,13 +19,13 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Exceptions; +namespace Couchbase.OperationalInsightsClient.Exceptions; ///-/// Exception thrown when the analytics service returns an HTTP Status 404 Not Found. +/// Exception thrown when the insights service returns an HTTP Status 404 Not Found. /// Currently only applies to the server async query requests API. /// -public class QueryNotFoundException : AnalyticsException +public class QueryNotFoundException : OperationalInsightsException { public QueryNotFoundException() : base("Query not found.") { } diff --git a/src/Couchbase.Analytics/HTTP/CertificateCredential.cs b/src/Couchbase.OperationalInsights/HTTP/CertificateCredential.cs similarity index 98% rename from src/Couchbase.Analytics/HTTP/CertificateCredential.cs rename to src/Couchbase.OperationalInsights/HTTP/CertificateCredential.cs index 1291609..95ca61b 100644 --- a/src/Couchbase.Analytics/HTTP/CertificateCredential.cs +++ b/src/Couchbase.OperationalInsights/HTTP/CertificateCredential.cs @@ -23,7 +23,7 @@ using System.Security.Cryptography.X509Certificates; using System.Text; -namespace Couchbase.AnalyticsClient.HTTP; +namespace Couchbase.OperationalInsightsClient.HTTP; ////// A client certificate (mTLS) credential that authenticates during the TLS handshake diff --git a/src/Couchbase.Analytics/HTTP/Credential.cs b/src/Couchbase.OperationalInsights/HTTP/Credential.cs similarity index 97% rename from src/Couchbase.Analytics/HTTP/Credential.cs rename to src/Couchbase.OperationalInsights/HTTP/Credential.cs index 7f37142..d1c8491 100644 --- a/src/Couchbase.Analytics/HTTP/Credential.cs +++ b/src/Couchbase.OperationalInsights/HTTP/Credential.cs @@ -22,7 +22,7 @@ using System.Net.Http.Headers; using System.Text; -namespace Couchbase.AnalyticsClient.HTTP; +namespace Couchbase.OperationalInsightsClient.HTTP; /// /// A username and password credential that authenticates using the HTTP Basic scheme. diff --git a/src/Couchbase.Analytics/HTTP/ICredential.cs b/src/Couchbase.OperationalInsights/HTTP/ICredential.cs similarity index 94% rename from src/Couchbase.Analytics/HTTP/ICredential.cs rename to src/Couchbase.OperationalInsights/HTTP/ICredential.cs index 5ad8284..03e23bf 100644 --- a/src/Couchbase.Analytics/HTTP/ICredential.cs +++ b/src/Couchbase.OperationalInsights/HTTP/ICredential.cs @@ -21,10 +21,10 @@ using System.Net.Http.Headers; -namespace Couchbase.AnalyticsClient.HTTP; +namespace Couchbase.OperationalInsightsClient.HTTP; /// -/// Represents a credential used to authenticate HTTP requests to the analytics service. +/// Represents a credential used to authenticate HTTP requests to the insights service. /// ////// Implementations should pre-compute the value at diff --git a/src/Couchbase.Analytics/HTTP/IHttpClientHandler.cs b/src/Couchbase.OperationalInsights/HTTP/IHttpClientHandler.cs similarity index 95% rename from src/Couchbase.Analytics/HTTP/IHttpClientHandler.cs rename to src/Couchbase.OperationalInsights/HTTP/IHttpClientHandler.cs index 2817695..f0b9109 100644 --- a/src/Couchbase.Analytics/HTTP/IHttpClientHandler.cs +++ b/src/Couchbase.OperationalInsights/HTTP/IHttpClientHandler.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.HTTP; +namespace Couchbase.OperationalInsightsClient.HTTP; public interface IHttpClientHandler { diff --git a/src/Couchbase.Analytics/HTTP/JwtCredential.cs b/src/Couchbase.OperationalInsights/HTTP/JwtCredential.cs similarity index 97% rename from src/Couchbase.Analytics/HTTP/JwtCredential.cs rename to src/Couchbase.OperationalInsights/HTTP/JwtCredential.cs index 3b45158..e551d16 100644 --- a/src/Couchbase.Analytics/HTTP/JwtCredential.cs +++ b/src/Couchbase.OperationalInsights/HTTP/JwtCredential.cs @@ -22,7 +22,7 @@ using System.Net.Http.Headers; using System.Text; -namespace Couchbase.AnalyticsClient.HTTP; +namespace Couchbase.OperationalInsightsClient.HTTP; /// /// A JSON Web Token (JWT) credential that authenticates using the HTTP Bearer scheme. diff --git a/src/Couchbase.Analytics/HTTP/MediaType.cs b/src/Couchbase.OperationalInsights/HTTP/MediaType.cs similarity index 94% rename from src/Couchbase.Analytics/HTTP/MediaType.cs rename to src/Couchbase.OperationalInsights/HTTP/MediaType.cs index 2c75dd1..7818135 100644 --- a/src/Couchbase.Analytics/HTTP/MediaType.cs +++ b/src/Couchbase.OperationalInsights/HTTP/MediaType.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.HTTP; +namespace Couchbase.OperationalInsightsClient.HTTP; public static class MediaType { diff --git a/src/Couchbase.Analytics/Internal/ConnectionString.cs b/src/Couchbase.OperationalInsights/Internal/ConnectionString.cs similarity index 98% rename from src/Couchbase.Analytics/Internal/ConnectionString.cs rename to src/Couchbase.OperationalInsights/Internal/ConnectionString.cs index 3b0cb2a..4ec842b 100644 --- a/src/Couchbase.Analytics/Internal/ConnectionString.cs +++ b/src/Couchbase.OperationalInsights/Internal/ConnectionString.cs @@ -21,10 +21,10 @@ using System.Text; using System.Text.RegularExpressions; -using Couchbase.AnalyticsClient.Internal.Utils; -using Couchbase.AnalyticsClient.Utils; +using Couchbase.OperationalInsightsClient.Internal.Utils; +using Couchbase.OperationalInsightsClient.Utils; -namespace Couchbase.AnalyticsClient.Internal; +namespace Couchbase.OperationalInsightsClient.Internal; internal class ConnectionString { @@ -140,7 +140,7 @@ internal Uri GetDnsBootStrapUri() }.Uri; } - internal Uri GetAnalyticsServiceUri() + internal Uri GetOperationalInsightsServiceUri() { return new UriBuilder { diff --git a/src/Couchbase.Analytics/Internal/DI/ConstructorSelector.cs b/src/Couchbase.OperationalInsights/Internal/DI/ConstructorSelector.cs similarity index 97% rename from src/Couchbase.Analytics/Internal/DI/ConstructorSelector.cs rename to src/Couchbase.OperationalInsights/Internal/DI/ConstructorSelector.cs index 195c08f..3e5583e 100644 --- a/src/Couchbase.Analytics/Internal/DI/ConstructorSelector.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/ConstructorSelector.cs @@ -22,7 +22,7 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; internal static class ConstructorSelector { diff --git a/src/Couchbase.Analytics/Internal/DI/CouchbaseServiceProvider.cs b/src/Couchbase.OperationalInsights/Internal/DI/CouchbaseServiceProvider.cs similarity index 98% rename from src/Couchbase.Analytics/Internal/DI/CouchbaseServiceProvider.cs rename to src/Couchbase.OperationalInsights/Internal/DI/CouchbaseServiceProvider.cs index 5a12d8b..cbeb903 100644 --- a/src/Couchbase.Analytics/Internal/DI/CouchbaseServiceProvider.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/CouchbaseServiceProvider.cs @@ -21,7 +21,7 @@ using System.Collections.ObjectModel; -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; internal sealed class CouchbaseServiceProvider : ICouchbaseServiceProvider { diff --git a/src/Couchbase.Analytics/Internal/DI/CouchbaseServiceProviderExtensions.cs b/src/Couchbase.OperationalInsights/Internal/DI/CouchbaseServiceProviderExtensions.cs similarity index 96% rename from src/Couchbase.Analytics/Internal/DI/CouchbaseServiceProviderExtensions.cs rename to src/Couchbase.OperationalInsights/Internal/DI/CouchbaseServiceProviderExtensions.cs index d212cc2..485a528 100644 --- a/src/Couchbase.Analytics/Internal/DI/CouchbaseServiceProviderExtensions.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/CouchbaseServiceProviderExtensions.cs @@ -19,9 +19,9 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.Utils; +using Couchbase.OperationalInsightsClient.Utils; -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; /// /// Extensions for . diff --git a/src/Couchbase.Analytics/Internal/DI/DefaultServices.cs b/src/Couchbase.OperationalInsights/Internal/DI/DefaultServices.cs similarity index 85% rename from src/Couchbase.Analytics/Internal/DI/DefaultServices.cs rename to src/Couchbase.OperationalInsights/Internal/DI/DefaultServices.cs index db96be1..63f3ac0 100644 --- a/src/Couchbase.Analytics/Internal/DI/DefaultServices.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/DefaultServices.cs @@ -20,12 +20,12 @@ #endregion using System.Text.Json; -using Couchbase.AnalyticsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.Internal.HTTP; using Couchbase.Core.Json; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; internal static class DefaultServices { @@ -48,7 +48,7 @@ public static IDictionary GetDefaultServices() => yield return (typeof(ICouchbaseHttpClientFactory), new SingletonServiceFactory(typeof(CouchbaseHttpClientFactory))); - // Register AnalyticsService directly (it now includes retry functionality via static utilities) - yield return (typeof(IAnalyticsService), new SingletonServiceFactory(typeof(AnalyticsService))); + // Register OperationalInsightsService directly (it now includes retry functionality via static utilities) + yield return (typeof(IOperationalInsightsService), new SingletonServiceFactory(typeof(OperationalInsightsService))); } } diff --git a/src/Couchbase.Analytics/Internal/DI/ICouchbaseServiceProvider.cs b/src/Couchbase.OperationalInsights/Internal/DI/ICouchbaseServiceProvider.cs similarity index 95% rename from src/Couchbase.Analytics/Internal/DI/ICouchbaseServiceProvider.cs rename to src/Couchbase.OperationalInsights/Internal/DI/ICouchbaseServiceProvider.cs index 6c80c12..4cc432f 100644 --- a/src/Couchbase.Analytics/Internal/DI/ICouchbaseServiceProvider.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/ICouchbaseServiceProvider.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; /// /// Extends with a method to test for service registration. diff --git a/src/Couchbase.Analytics/Internal/DI/IServiceFactory.cs b/src/Couchbase.OperationalInsights/Internal/DI/IServiceFactory.cs similarity index 96% rename from src/Couchbase.Analytics/Internal/DI/IServiceFactory.cs rename to src/Couchbase.OperationalInsights/Internal/DI/IServiceFactory.cs index bb17920..18d224f 100644 --- a/src/Couchbase.Analytics/Internal/DI/IServiceFactory.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/IServiceFactory.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; /// /// A factory capable of returning a service. diff --git a/src/Couchbase.Analytics/Internal/DI/LazyService.cs b/src/Couchbase.OperationalInsights/Internal/DI/LazyService.cs similarity index 92% rename from src/Couchbase.Analytics/Internal/DI/LazyService.cs rename to src/Couchbase.OperationalInsights/Internal/DI/LazyService.cs index 786fa15..2519089 100644 --- a/src/Couchbase.Analytics/Internal/DI/LazyService.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/LazyService.cs @@ -20,9 +20,9 @@ #endregion using System.Diagnostics.CodeAnalysis; -using Couchbase.AnalyticsClient.Exceptions; +using Couchbase.OperationalInsightsClient.Exceptions; -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; /// /// References a singleton of a service that isn't instantiated until required. @@ -54,6 +54,6 @@ public T GetValueOrThrow() [DoesNotReturn] private static void ThrowServiceException() => - throw new AnalyticsException( + throw new OperationalInsightsException( $"Service {typeof(T).FullName} is not registered."); } diff --git a/src/Couchbase.Analytics/Internal/DI/PreferredConstructorAttribute.cs b/src/Couchbase.OperationalInsights/Internal/DI/PreferredConstructorAttribute.cs similarity index 95% rename from src/Couchbase.Analytics/Internal/DI/PreferredConstructorAttribute.cs rename to src/Couchbase.OperationalInsights/Internal/DI/PreferredConstructorAttribute.cs index d8ecac8..8aee5dc 100644 --- a/src/Couchbase.Analytics/Internal/DI/PreferredConstructorAttribute.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/PreferredConstructorAttribute.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; /// /// Marks a public constructor as preferred for selection by service factories. If applied, the diff --git a/src/Couchbase.Analytics/Internal/DI/SingletonGenericServiceFactory.cs b/src/Couchbase.OperationalInsights/Internal/DI/SingletonGenericServiceFactory.cs similarity index 98% rename from src/Couchbase.Analytics/Internal/DI/SingletonGenericServiceFactory.cs rename to src/Couchbase.OperationalInsights/Internal/DI/SingletonGenericServiceFactory.cs index ada36a9..0c2e788 100644 --- a/src/Couchbase.Analytics/Internal/DI/SingletonGenericServiceFactory.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/SingletonGenericServiceFactory.cs @@ -21,9 +21,9 @@ using System.Collections.Concurrent; using System.Diagnostics.CodeAnalysis; -using Couchbase.AnalyticsClient.Utils; +using Couchbase.OperationalInsightsClient.Utils; -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; /// /// Implementation of which constructs more specific types diff --git a/src/Couchbase.Analytics/Internal/DI/SingletonServiceFactory.cs b/src/Couchbase.OperationalInsights/Internal/DI/SingletonServiceFactory.cs similarity index 97% rename from src/Couchbase.Analytics/Internal/DI/SingletonServiceFactory.cs rename to src/Couchbase.OperationalInsights/Internal/DI/SingletonServiceFactory.cs index 4f018f4..53916f0 100644 --- a/src/Couchbase.Analytics/Internal/DI/SingletonServiceFactory.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/SingletonServiceFactory.cs @@ -20,9 +20,9 @@ #endregion using System.Diagnostics.CodeAnalysis; -using Couchbase.AnalyticsClient.Utils; +using Couchbase.OperationalInsightsClient.Utils; -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; internal sealed class SingletonServiceFactory : IServiceFactory { diff --git a/src/Couchbase.Analytics/Internal/DI/TransientServiceFactory.cs b/src/Couchbase.OperationalInsights/Internal/DI/TransientServiceFactory.cs similarity index 97% rename from src/Couchbase.Analytics/Internal/DI/TransientServiceFactory.cs rename to src/Couchbase.OperationalInsights/Internal/DI/TransientServiceFactory.cs index f482b5b..34b57e6 100644 --- a/src/Couchbase.Analytics/Internal/DI/TransientServiceFactory.cs +++ b/src/Couchbase.OperationalInsights/Internal/DI/TransientServiceFactory.cs @@ -20,9 +20,9 @@ #endregion using System.Diagnostics.CodeAnalysis; -using Couchbase.AnalyticsClient.Utils; +using Couchbase.OperationalInsightsClient.Utils; -namespace Couchbase.AnalyticsClient.Internal.DI; +namespace Couchbase.OperationalInsightsClient.Internal.DI; /// /// Implementation of which creates a transient diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/DnsEndpointConnector.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/DnsEndpointConnector.cs similarity index 95% rename from src/Couchbase.Analytics/Internal/DnsUtil/DnsEndpointConnector.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/DnsEndpointConnector.cs index 7848ef5..be89a48 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/DnsEndpointConnector.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/DnsEndpointConnector.cs @@ -21,10 +21,10 @@ using System.Net; using System.Net.Sockets; -using Couchbase.AnalyticsClient.DnsUtil; -using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +using Couchbase.OperationalInsightsClient.DnsUtil; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; -namespace Couchbase.AnalyticsClient.Internal.DnsUtil; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil; /// /// Adapted from https://github.com/MihaZupan/DnsRoundRobin. diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/DnsEndpointResolver.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/DnsEndpointResolver.cs similarity index 89% rename from src/Couchbase.Analytics/Internal/DnsUtil/DnsEndpointResolver.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/DnsEndpointResolver.cs index 97744b4..5d6fccb 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/DnsEndpointResolver.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/DnsEndpointResolver.cs @@ -20,10 +20,10 @@ #endregion using System.Net; -using Couchbase.AnalyticsClient.DnsUtil; -using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +using Couchbase.OperationalInsightsClient.DnsUtil; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; -namespace Couchbase.AnalyticsClient.Internal.DnsUtil; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil; internal class DnsEndpointResolver : IDnsEndpointResolver { diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/EndpointConnectionManager.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/EndpointConnectionManager.cs similarity index 96% rename from src/Couchbase.Analytics/Internal/DnsUtil/EndpointConnectionManager.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/EndpointConnectionManager.cs index 6eaa52b..d8995c6 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/EndpointConnectionManager.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/EndpointConnectionManager.cs @@ -21,11 +21,11 @@ using System.Net; using System.Net.Sockets; -using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -namespace Couchbase.AnalyticsClient.Internal.DnsUtil; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil; internal partial class EndpointConnectionManager { @@ -67,7 +67,7 @@ public async Task ConnectToEndpointsAsync( } } - // If all endpoints failed, throw. This should be caught internally to throw AnalyticsException. + // If all endpoints failed, throw. This should be caught internally to throw OperationalInsightsException. throw new AggregateException("Failed to connect to all available endpoints.", allExceptions); } diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/EndpointSelectionMode.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/EndpointSelectionMode.cs similarity index 95% rename from src/Couchbase.Analytics/Internal/DnsUtil/EndpointSelectionMode.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/EndpointSelectionMode.cs index b8898a5..d7ce2a1 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/EndpointSelectionMode.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/EndpointSelectionMode.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.DnsUtil; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil; internal enum EndpointSelectionMode { diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/CountBasedDnsRefreshStrategy.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/CountBasedDnsRefreshStrategy.cs similarity index 96% rename from src/Couchbase.Analytics/Internal/DnsUtil/Strategies/CountBasedDnsRefreshStrategy.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/CountBasedDnsRefreshStrategy.cs index fee213f..90788d0 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/CountBasedDnsRefreshStrategy.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/CountBasedDnsRefreshStrategy.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; internal class CountBasedDnsRefreshStrategy : IDnsRefreshStrategy { diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/IDnsRefreshStrategy.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/IDnsRefreshStrategy.cs similarity index 92% rename from src/Couchbase.Analytics/Internal/DnsUtil/Strategies/IDnsRefreshStrategy.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/IDnsRefreshStrategy.cs index 0d5ab0b..fbe4379 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/IDnsRefreshStrategy.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/IDnsRefreshStrategy.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; internal interface IDnsRefreshStrategy { diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/IEndpointSelectionStrategy.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/IEndpointSelectionStrategy.cs similarity index 92% rename from src/Couchbase.Analytics/Internal/DnsUtil/Strategies/IEndpointSelectionStrategy.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/IEndpointSelectionStrategy.cs index f93707f..5846909 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/IEndpointSelectionStrategy.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/IEndpointSelectionStrategy.cs @@ -21,7 +21,7 @@ using System.Net; -namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; internal interface IEndpointSelectionStrategy { diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/RandomEndpointSelector.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/RandomEndpointSelector.cs similarity index 97% rename from src/Couchbase.Analytics/Internal/DnsUtil/Strategies/RandomEndpointSelector.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/RandomEndpointSelector.cs index 1e09f65..a092f74 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/RandomEndpointSelector.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/RandomEndpointSelector.cs @@ -21,7 +21,7 @@ using System.Net; -namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; internal class RandomEndpointSelector : IEndpointSelectionStrategy { diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/RoundRobinEndpointSelector.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/RoundRobinEndpointSelector.cs similarity index 96% rename from src/Couchbase.Analytics/Internal/DnsUtil/Strategies/RoundRobinEndpointSelector.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/RoundRobinEndpointSelector.cs index 4fea227..10101a0 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/RoundRobinEndpointSelector.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/RoundRobinEndpointSelector.cs @@ -21,7 +21,7 @@ using System.Net; -namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; internal class RoundRobinEndpointSelector : IEndpointSelectionStrategy { diff --git a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/TimeBasedDnsRefreshStrategy.cs b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/TimeBasedDnsRefreshStrategy.cs similarity index 95% rename from src/Couchbase.Analytics/Internal/DnsUtil/Strategies/TimeBasedDnsRefreshStrategy.cs rename to src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/TimeBasedDnsRefreshStrategy.cs index e8d7f32..318e3dc 100644 --- a/src/Couchbase.Analytics/Internal/DnsUtil/Strategies/TimeBasedDnsRefreshStrategy.cs +++ b/src/Couchbase.OperationalInsights/Internal/DnsUtil/Strategies/TimeBasedDnsRefreshStrategy.cs @@ -21,7 +21,7 @@ using System.Diagnostics; -namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +namespace Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; internal class TimeBasedDnsRefreshStrategy : IDnsRefreshStrategy { diff --git a/src/Couchbase.Analytics/Internal/HTTP/AuthenticationHandler.cs b/src/Couchbase.OperationalInsights/Internal/HTTP/AuthenticationHandler.cs similarity index 95% rename from src/Couchbase.Analytics/Internal/HTTP/AuthenticationHandler.cs rename to src/Couchbase.OperationalInsights/Internal/HTTP/AuthenticationHandler.cs index 3b7c66a..9c7956f 100644 --- a/src/Couchbase.Analytics/Internal/HTTP/AuthenticationHandler.cs +++ b/src/Couchbase.OperationalInsights/Internal/HTTP/AuthenticationHandler.cs @@ -19,9 +19,9 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.HTTP; +using Couchbase.OperationalInsightsClient.HTTP; -namespace Couchbase.AnalyticsClient.Internal.HTTP; +namespace Couchbase.OperationalInsightsClient.Internal.HTTP; /// /// A delegating handler that sets the Authorization header on outgoing HTTP requests diff --git a/src/Couchbase.Analytics/Internal/HTTP/CouchbaseHttpClientFactory.cs b/src/Couchbase.OperationalInsights/Internal/HTTP/CouchbaseHttpClientFactory.cs similarity index 96% rename from src/Couchbase.Analytics/Internal/HTTP/CouchbaseHttpClientFactory.cs rename to src/Couchbase.OperationalInsights/Internal/HTTP/CouchbaseHttpClientFactory.cs index 42b39a7..e0de598 100644 --- a/src/Couchbase.Analytics/Internal/HTTP/CouchbaseHttpClientFactory.cs +++ b/src/Couchbase.OperationalInsights/Internal/HTTP/CouchbaseHttpClientFactory.cs @@ -21,15 +21,15 @@ using System.Net.Sockets; using System.Security.Cryptography.X509Certificates; -using Couchbase.AnalyticsClient.Certificates; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal.DnsUtil; -using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; -using Couchbase.AnalyticsClient.Internal.Utils; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.Certificates; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; +using Couchbase.OperationalInsightsClient.Internal.Utils; +using Couchbase.OperationalInsightsClient.Options; using Microsoft.Extensions.Logging; -namespace Couchbase.AnalyticsClient.Internal.HTTP; +namespace Couchbase.OperationalInsightsClient.Internal.HTTP; internal partial class CouchbaseHttpClientFactory : ICouchbaseHttpClientFactory { diff --git a/src/Couchbase.Analytics/Internal/HTTP/HttpServiceBase.cs b/src/Couchbase.OperationalInsights/Internal/HTTP/HttpServiceBase.cs similarity index 95% rename from src/Couchbase.Analytics/Internal/HTTP/HttpServiceBase.cs rename to src/Couchbase.OperationalInsights/Internal/HTTP/HttpServiceBase.cs index db5a711..ba35703 100644 --- a/src/Couchbase.Analytics/Internal/HTTP/HttpServiceBase.cs +++ b/src/Couchbase.OperationalInsights/Internal/HTTP/HttpServiceBase.cs @@ -19,9 +19,9 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.Internal.Utils; +using Couchbase.OperationalInsightsClient.Internal.Utils; -namespace Couchbase.AnalyticsClient.Internal.HTTP; +namespace Couchbase.OperationalInsightsClient.Internal.HTTP; /// /// Base class for HTTP services to inherit from to provide consistent access to clusterOptions, diff --git a/src/Couchbase.Analytics/Internal/HTTP/ICouchbaseHttpClientFactory.cs b/src/Couchbase.OperationalInsights/Internal/HTTP/ICouchbaseHttpClientFactory.cs similarity index 96% rename from src/Couchbase.Analytics/Internal/HTTP/ICouchbaseHttpClientFactory.cs rename to src/Couchbase.OperationalInsights/Internal/HTTP/ICouchbaseHttpClientFactory.cs index 86b7615..61cf172 100644 --- a/src/Couchbase.Analytics/Internal/HTTP/ICouchbaseHttpClientFactory.cs +++ b/src/Couchbase.OperationalInsights/Internal/HTTP/ICouchbaseHttpClientFactory.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.HTTP; +namespace Couchbase.OperationalInsightsClient.Internal.HTTP; /// /// Creates an /// The errors array from the server response. /// The internal error context to be propagated - ///which may be safely configured and disposed, but while diff --git a/src/Couchbase.Analytics/Internal/IAnalyticsService.cs b/src/Couchbase.OperationalInsights/Internal/IOperationalInsightsService.cs similarity index 90% rename from src/Couchbase.Analytics/Internal/IAnalyticsService.cs rename to src/Couchbase.OperationalInsights/Internal/IOperationalInsightsService.cs index b2e784c..fc546dc 100644 --- a/src/Couchbase.Analytics/Internal/IAnalyticsService.cs +++ b/src/Couchbase.OperationalInsights/Internal/IOperationalInsightsService.cs @@ -19,13 +19,13 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.Results; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.Results; -namespace Couchbase.AnalyticsClient.Internal; +namespace Couchbase.OperationalInsightsClient.Internal; -internal interface IAnalyticsService +internal interface IOperationalInsightsService { Uri Uri { get; } diff --git a/src/Couchbase.Analytics/Internal/AnalyticsService.cs b/src/Couchbase.OperationalInsights/Internal/OperationalInsightsService.cs similarity index 81% rename from src/Couchbase.Analytics/Internal/AnalyticsService.cs rename to src/Couchbase.OperationalInsights/Internal/OperationalInsightsService.cs index 1eed903..aeccc94 100644 --- a/src/Couchbase.Analytics/Internal/AnalyticsService.cs +++ b/src/Couchbase.OperationalInsights/Internal/OperationalInsightsService.cs @@ -22,37 +22,37 @@ using System.Net; using System.Text; using System.Text.Json; -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.Exceptions; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal.HTTP; -using Couchbase.AnalyticsClient.Internal.Results; -using Couchbase.AnalyticsClient.Internal.Retry; -using Couchbase.AnalyticsClient.Logging; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.Query; -using Couchbase.AnalyticsClient.Results; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.Exceptions; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.Internal.Results; +using Couchbase.OperationalInsightsClient.Internal.Retry; +using Couchbase.OperationalInsightsClient.Logging; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.Query; +using Couchbase.OperationalInsightsClient.Results; using Couchbase.Core.Json; using Couchbase.Core.Utils; using Microsoft.Extensions.Logging; -namespace Couchbase.AnalyticsClient.Internal; +namespace Couchbase.OperationalInsightsClient.Internal; -internal sealed partial class AnalyticsService : HttpServiceBase, IAnalyticsService +internal sealed partial class OperationalInsightsService : HttpServiceBase, IOperationalInsightsService { private readonly ClusterOptions _clusterOptions; - private readonly ILogger _logger; + private readonly ILogger _logger; private readonly TypedRedactor _redactor; private readonly Uri _baseUri; - public AnalyticsService(ClusterOptions clusterOptions, ICouchbaseHttpClientFactory httpClientFactory, - ILogger logger, TypedRedactor redactor) : base(httpClientFactory) + public OperationalInsightsService(ClusterOptions clusterOptions, ICouchbaseHttpClientFactory httpClientFactory, + ILogger logger, TypedRedactor redactor) : base(httpClientFactory) { _clusterOptions = clusterOptions; _logger = logger; _redactor = redactor; HttpClientFactory = httpClientFactory; - Uri = clusterOptions.ConnectionStringValue!.GetAnalyticsServiceUri(); + Uri = clusterOptions.ConnectionStringValue!.GetOperationalInsightsServiceUri(); _baseUri = clusterOptions.ConnectionStringValue!.GetBaseServiceUri(); } @@ -68,7 +68,7 @@ public async Task SendAsync(string statement, QueryOptions options } /// - /// Core query execution logic - the golden path for sending analytics requests. + /// Core query execution logic - the golden path for sending insights requests. /// private async TaskExecuteQueryAsync(StringContent content, HttpClient httpClient, bool asStreaming, IDeserializer deserializer, ErrorContext errorContext, CancellationToken cancellationToken = default) { @@ -86,9 +86,9 @@ private async Task ExecuteQueryAsync(StringContent content, HttpCl var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - AnalyticsResultBase result = asStreaming - ? new StreamingAnalyticsResult(stream, deserializer, httpClient) - : new BlockingAnalyticsResult(stream, deserializer, httpClient); + OperationalInsightsResultBase result = asStreaming + ? new StreamingOperationalInsightsResult(stream, deserializer, httpClient) + : new BlockingOperationalInsightsResult(stream, deserializer, httpClient); result.StatusCode = response.StatusCode; errorContext.StatusCode = response.StatusCode; @@ -97,14 +97,14 @@ private async Task ExecuteQueryAsync(StringContent content, HttpCl if (!response.IsSuccessStatusCode) { - throw AnalyticsErrorMapper.MapHttpErrorCode(result, errorContext); + throw OperationalInsightsErrorMapper.MapHttpErrorCode(result, errorContext); } return result; } catch (TaskCanceledException taskCanceledEx) { - throw new AnalyticsTimeoutException("The analytics request was canceled via its cancellation token.", taskCanceledEx, errorContext); + throw new OperationalInsightsTimeoutException("The insights request was canceled via its cancellation token.", taskCanceledEx, errorContext); } } @@ -154,18 +154,18 @@ private async Task ExecuteWithRetryAsync(string statement, QueryOp if (result.Errors is { Count: > 0 }) { // Per RFC: retry if ALL errors are retriable - if (AnalyticsErrorMapper.AreErrorsRetriable(result.Errors)) + if (OperationalInsightsErrorMapper.AreErrorsRetriable(result.Errors)) { LogRetriableServerErrors(_logger, options.ClientContextId); - lastException = AnalyticsErrorMapper.MapServiceErrors(result.Errors, errorContext); + lastException = OperationalInsightsErrorMapper.MapServiceErrors(result.Errors, errorContext); await RetryUtils.BackoffAsync(attempt, cancellationToken).ConfigureAwait(false); continue; } // Non-retriable server errors - throw - throw AnalyticsErrorMapper.MapServiceErrors(result.Errors, errorContext); + throw OperationalInsightsErrorMapper.MapServiceErrors(result.Errors, errorContext); } return result; @@ -178,10 +178,10 @@ private async Task ExecuteWithRetryAsync(string statement, QueryOp // "No successful connection(s)" is retryable if (httpRequestException.InnerException is AggregateException aggregateEx) { - lastException = new AnalyticsException("No connections could be established to any of the endpoints.", aggregateEx, errorContext); + lastException = new OperationalInsightsException("No connections could be established to any of the endpoints.", aggregateEx, errorContext); } - if (!AnalyticsErrorMapper.IsRetriableHttpException(httpRequestException)) + if (!OperationalInsightsErrorMapper.IsRetriableHttpException(httpRequestException)) { LogNonRetriableHttpException(_logger); throw; @@ -259,7 +259,7 @@ public async Task StartQueryAsync(string statement, StartQueryOptio catch (JsonException ex) { var preview = responseBody.Length > 200 ? responseBody[..200] + "..." : responseBody; - throw new AnalyticsException( + throw new OperationalInsightsException( $"Server returned non-JSON response (HTTP {(int)response.StatusCode}). Body preview: {preview}", ex, errorContext); } @@ -275,14 +275,14 @@ public async Task StartQueryAsync(string statement, StartQueryOptio if (errors is { Length: > 0 }) { - if (AnalyticsErrorMapper.AreErrorsRetriable(errors)) + if (OperationalInsightsErrorMapper.AreErrorsRetriable(errors)) { - lastException = AnalyticsErrorMapper.MapServiceErrors(errors, errorContext); + lastException = OperationalInsightsErrorMapper.MapServiceErrors(errors, errorContext); await RetryUtils.BackoffAsync(attempt, cancellationToken).ConfigureAwait(false); continue; } - throw AnalyticsErrorMapper.MapServiceErrors(errors, errorContext); + throw OperationalInsightsErrorMapper.MapServiceErrors(errors, errorContext); } if (!response.IsSuccessStatusCode) @@ -290,12 +290,12 @@ public async Task StartQueryAsync(string statement, StartQueryOptio // 503 is retriable if (response.StatusCode == HttpStatusCode.ServiceUnavailable) { - lastException = new AnalyticsException("Service temporarily unavailable.", errorContext); + lastException = new OperationalInsightsException("Service temporarily unavailable.", errorContext); await RetryUtils.BackoffAsync(attempt, cancellationToken).ConfigureAwait(false); continue; } - throw new AnalyticsException($"HTTP {(int)response.StatusCode} {response.StatusCode}", errorContext); + throw new OperationalInsightsException($"HTTP {(int)response.StatusCode} {response.StatusCode}", errorContext); } // Parse the successful response @@ -304,7 +304,7 @@ public async Task StartQueryAsync(string statement, StartQueryOptio if (string.IsNullOrWhiteSpace(requestId) || string.IsNullOrWhiteSpace(handlePath)) { - throw new AnalyticsException("Server response is missing required 'requestID' or 'handle' fields.", errorContext); + throw new OperationalInsightsException("Server response is missing required 'requestID' or 'handle' fields.", errorContext); } LogAsyncStartQuerySucceeded(_logger, options.ClientContextId, _redactor.SystemData(handlePath), _redactor.SystemData(requestId), (int)response.StatusCode); @@ -316,10 +316,10 @@ public async Task StartQueryAsync(string statement, StartQueryOptio if (httpRequestException.InnerException is AggregateException aggregateEx) { - lastException = new AnalyticsException("No connections could be established to any of the endpoints.", aggregateEx, errorContext); + lastException = new OperationalInsightsException("No connections could be established to any of the endpoints.", aggregateEx, errorContext); } - if (!AnalyticsErrorMapper.IsRetriableHttpException(httpRequestException)) + if (!OperationalInsightsErrorMapper.IsRetriableHttpException(httpRequestException)) { throw; } @@ -328,7 +328,7 @@ public async Task StartQueryAsync(string statement, StartQueryOptio } catch (TaskCanceledException taskCanceledEx) { - throw new AnalyticsTimeoutException("The async StartQuery request was canceled.", taskCanceledEx, errorContext); + throw new OperationalInsightsTimeoutException("The async StartQuery request was canceled.", taskCanceledEx, errorContext); } catch (OperationCanceledException) { @@ -383,7 +383,7 @@ public async Task FetchStatusAsync(QueryHandle handle, FetchStatusO catch (JsonException ex) { var preview = responseBody.Length > 200 ? responseBody[..200] + "..." : responseBody; - throw new AnalyticsException( + throw new OperationalInsightsException( $"Server returned non-JSON response (HTTP {(int)response.StatusCode}). Body preview: {preview}", ex, errorContext); } @@ -392,7 +392,7 @@ public async Task FetchStatusAsync(QueryHandle handle, FetchStatusO if (string.IsNullOrWhiteSpace(status)) { - throw new AnalyticsException("Server response is missing required 'status' field.", errorContext); + throw new OperationalInsightsException("Server response is missing required 'status' field.", errorContext); } if (!response.IsSuccessStatusCode) @@ -410,9 +410,9 @@ public async Task FetchStatusAsync(QueryHandle handle, FetchStatusO { if (errors is { Count: > 0 }) { - throw AnalyticsErrorMapper.MapServiceErrors(errors, errorContext); + throw OperationalInsightsErrorMapper.MapServiceErrors(errors, errorContext); } - throw new AnalyticsException($"Query status fetch failed with HTTP {(int)response.StatusCode} and status: {status}", errorContext); + throw new OperationalInsightsException($"Query status fetch failed with HTTP {(int)response.StatusCode} and status: {status}", errorContext); } LogFetchStatusResponse(_logger, _redactor.SystemData(handle.Handle), status, (int)response.StatusCode); @@ -429,9 +429,9 @@ public async Task FetchStatusAsync(QueryHandle handle, FetchStatusO { if (errors is { Count: > 0 }) { - throw AnalyticsErrorMapper.MapServiceErrors(errors, errorContext); + throw OperationalInsightsErrorMapper.MapServiceErrors(errors, errorContext); } - throw new AnalyticsTimeoutException("The query evaluation timed out on the server.", errorContext: errorContext); + throw new OperationalInsightsTimeoutException("The query evaluation timed out on the server.", errorContext: errorContext); } if (string.Equals(status, "fatal", StringComparison.OrdinalIgnoreCase) || @@ -440,9 +440,9 @@ public async Task FetchStatusAsync(QueryHandle handle, FetchStatusO { if (errors is { Count: > 0 }) { - throw AnalyticsErrorMapper.MapServiceErrors(errors, errorContext); + throw OperationalInsightsErrorMapper.MapServiceErrors(errors, errorContext); } - throw new AnalyticsException($"Query execution failed on the server (status: {status}).", errorContext); + throw new OperationalInsightsException($"Query execution failed on the server (status: {status}).", errorContext); } // For queued, running, and success — return a QueryStatus @@ -453,11 +453,11 @@ public async Task FetchStatusAsync(QueryHandle handle, FetchStatusO return new QueryStatus(handle.RequestId, root, this); } - throw new AnalyticsException($"Unrecognized query status from server: '{status}'.", errorContext); + throw new OperationalInsightsException($"Unrecognized query status from server: '{status}'.", errorContext); } catch (TaskCanceledException taskCanceledEx) { - throw new AnalyticsTimeoutException("The FetchStatus request was canceled.", taskCanceledEx); + throw new OperationalInsightsTimeoutException("The FetchStatus request was canceled.", taskCanceledEx); } } @@ -489,8 +489,8 @@ public async Task FetchResultsAsync(string requestId, string handl var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - // Reuse the existing StreamingAnalyticsResult - the response format is identical to sync queries - var result = new StreamingAnalyticsResult(stream, deserializer, httpClient); + // Reuse the existing StreamingOperationalInsightsResult - the response format is identical to sync queries + var result = new StreamingOperationalInsightsResult(stream, deserializer, httpClient); result.StatusCode = response.StatusCode; await result.InitializeAsync(cancellationToken).ConfigureAwait(false); @@ -499,14 +499,14 @@ public async Task FetchResultsAsync(string requestId, string handl { var errorContext = new ErrorContext(string.Empty, LightweightStopwatch.StartNew(), timeout); errorContext.StatusCode = response.StatusCode; - throw AnalyticsErrorMapper.MapHttpErrorCode(result, errorContext); + throw OperationalInsightsErrorMapper.MapHttpErrorCode(result, errorContext); } return result; } catch (TaskCanceledException taskCanceledEx) { - throw new AnalyticsTimeoutException("The FetchResults request was canceled.", taskCanceledEx); + throw new OperationalInsightsTimeoutException("The FetchResults request was canceled.", taskCanceledEx); } } @@ -539,12 +539,12 @@ public async Task DiscardResultsAsync(string requestId, string handlePath, Disca if (response.StatusCode != HttpStatusCode.Accepted) { - throw new AnalyticsException($"Unexpected response from DiscardResults: HTTP {(int)response.StatusCode} {response.StatusCode}"); + throw new OperationalInsightsException($"Unexpected response from DiscardResults: HTTP {(int)response.StatusCode} {response.StatusCode}"); } } catch (TaskCanceledException taskCanceledEx) { - throw new AnalyticsTimeoutException("The DiscardResults request was canceled.", taskCanceledEx); + throw new OperationalInsightsTimeoutException("The DiscardResults request was canceled.", taskCanceledEx); } } @@ -581,12 +581,12 @@ public async Task CancelQueryAsync(string requestId, CancelOptions options, Canc if (!response.IsSuccessStatusCode) { - throw new AnalyticsException($"Unexpected response from CancelQuery: HTTP {(int)response.StatusCode} {response.StatusCode}"); + throw new OperationalInsightsException($"Unexpected response from CancelQuery: HTTP {(int)response.StatusCode} {response.StatusCode}"); } } catch (TaskCanceledException taskCanceledEx) { - throw new AnalyticsTimeoutException("The CancelQuery request was canceled.", taskCanceledEx); + throw new OperationalInsightsTimeoutException("The CancelQuery request was canceled.", taskCanceledEx); } } @@ -596,19 +596,19 @@ public async Task CancelQueryAsync(string requestId, CancelOptions options, Canc private static void ThrowGlobalTimeout(Exception? lastException, TimeSpan elapsed, ErrorContext? errorContext = null) { - var timeoutException = new AnalyticsTimeoutException( - $"Analytics query timed-out after {elapsed.TotalSeconds:F2} seconds.", lastException, errorContext); + var timeoutException = new OperationalInsightsTimeoutException( + $"OperationalInsights query timed-out after {elapsed.TotalSeconds:F2} seconds.", lastException, errorContext); throw timeoutException; } private static Exception ThrowTooManyRetries(ErrorContext errorContext) { - throw new AnalyticsException("Exceeded maximum number of retries.", errorContext: errorContext); + throw new OperationalInsightsException("Exceeded maximum number of retries.", errorContext: errorContext); } #region Logging - [LoggerMessage(1, LogLevel.Debug, "Analytics query attempt {Attempt} starting for {ClientContextId} on context [{QueryContext}]: {Statement} (elapsed: {Elapsed}ms)")] + [LoggerMessage(1, LogLevel.Debug, "OperationalInsights query attempt {Attempt} starting for {ClientContextId} on context [{QueryContext}]: {Statement} (elapsed: {Elapsed}ms)")] private static partial void LogQueryAttemptStarting(ILogger logger, int attempt, string? clientContextId, string queryContext, Redacted statement, double elapsed); [LoggerMessage(2, LogLevel.Debug, "Received retriable server errors for ClientContextId {ClientContextId}, retrying...")] @@ -617,7 +617,7 @@ private static Exception ThrowTooManyRetries(ErrorContext errorContext) [LoggerMessage(3, LogLevel.Debug, "HttpRequestException is not retriable, failing immediately")] private static partial void LogNonRetriableHttpException(ILogger logger); - [LoggerMessage(4, LogLevel.Debug, "Analytics query attempt {Attempt} for ClientContextId {ClientContextId} on context [{QueryContext}]: {Statement} failed: {Error} (elapsed: {Elapsed}ms)")] + [LoggerMessage(4, LogLevel.Debug, "OperationalInsights query attempt {Attempt} for ClientContextId {ClientContextId} on context [{QueryContext}]: {Statement} failed: {Error} (elapsed: {Elapsed}ms)")] private static partial void LogQueryAttemptFailed(ILogger logger, Exception ex, int attempt, string? clientContextId, string queryContext, Redacted statement, string error, double elapsed); [LoggerMessage(5, LogLevel.Debug, "Async StartQuery attempt {Attempt} sending POST to {Uri} for {ClientContextId} on context [{QueryContext}]: {Statement} (elapsed: {Elapsed}ms)")] diff --git a/src/Couchbase.Analytics/Internal/Results/BlockingAnalyticsResult.cs b/src/Couchbase.OperationalInsights/Internal/Results/BlockingOperationalInsightsResult.cs similarity index 74% rename from src/Couchbase.Analytics/Internal/Results/BlockingAnalyticsResult.cs rename to src/Couchbase.OperationalInsights/Internal/Results/BlockingOperationalInsightsResult.cs index 5920b61..1b6382a 100644 --- a/src/Couchbase.Analytics/Internal/Results/BlockingAnalyticsResult.cs +++ b/src/Couchbase.OperationalInsights/Internal/Results/BlockingOperationalInsightsResult.cs @@ -20,39 +20,39 @@ #endregion using System.Runtime.CompilerServices; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.Query; -using Couchbase.AnalyticsClient.Results; -using Couchbase.AnalyticsClient.Utils; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.Query; +using Couchbase.OperationalInsightsClient.Results; +using Couchbase.OperationalInsightsClient.Utils; using Couchbase.Core.Json; -namespace Couchbase.AnalyticsClient.Internal.Results; +namespace Couchbase.OperationalInsightsClient.Internal.Results; /// -/// A "blocking" result class for Analytics queries. +/// A "blocking" result class for OperationalInsights queries. /// -///For large result sets use the -internal class BlockingAnalyticsResult : AnalyticsResultBase +///class by setting to true, which is the default. For large result sets use the +internal class BlockingOperationalInsightsResult : OperationalInsightsResultBase { - private IEnumerableclass by setting to true, which is the default. ? _rows; + private IEnumerable ? _rows; private int _enumerated; // 0 = not started, 1 = started (atomic via Interlocked) - public BlockingAnalyticsResult(Stream responseStream, IDeserializer serializer, IDisposable? ownedForCleanup = null) + public BlockingOperationalInsightsResult(Stream responseStream, IDeserializer serializer, IDisposable? ownedForCleanup = null) : base(responseStream, serializer, ownedForCleanup) { } - public override IAsyncEnumerator GetAsyncEnumerator( + public override IAsyncEnumerator GetAsyncEnumerator( CancellationToken cancellationToken = default) => EnumerateRows(cancellationToken).GetAsyncEnumerator(cancellationToken); - private async IAsyncEnumerable EnumerateRows( + private async IAsyncEnumerable EnumerateRows( [EnumeratorCancellation] CancellationToken cancellationToken = default) { if (_rows == null) { throw new InvalidOperationException( - $"{nameof(BlockingAnalyticsResult)} has not been initialized, call InitializeAsync first"); + $"{nameof(BlockingOperationalInsightsResult)} has not been initialized, call InitializeAsync first"); } if (Interlocked.CompareExchange(ref _enumerated, 1, 0) != 0) @@ -79,7 +79,7 @@ public override async Task InitializeAsync(CancellationToken cancellationToken = MetaData = new QueryMetaData(); - var rows = new List (); + var rows = new List (); while (true) { @@ -101,7 +101,7 @@ public override async Task InitializeAsync(CancellationToken cancellationToken = { await foreach (var token in reader.ReadTokensAsync(cancellationToken).ConfigureAwait(false)) { - rows.Add(new AnalyticsRow(token)); + rows.Add(new OperationalInsightsRow(token)); } break; } diff --git a/src/Couchbase.Analytics/Internal/Results/AnalyticsResultBase.cs b/src/Couchbase.OperationalInsights/Internal/Results/OperationalInsightsResultBase.cs similarity index 80% rename from src/Couchbase.Analytics/Internal/Results/AnalyticsResultBase.cs rename to src/Couchbase.OperationalInsights/Internal/Results/OperationalInsightsResultBase.cs index e295ec4..ef9b219 100644 --- a/src/Couchbase.Analytics/Internal/Results/AnalyticsResultBase.cs +++ b/src/Couchbase.OperationalInsights/Internal/Results/OperationalInsightsResultBase.cs @@ -20,13 +20,13 @@ #endregion using System.Net; -using Couchbase.AnalyticsClient.Query; -using Couchbase.AnalyticsClient.Results; +using Couchbase.OperationalInsightsClient.Query; +using Couchbase.OperationalInsightsClient.Results; using Couchbase.Core.Json; -namespace Couchbase.AnalyticsClient.Internal.Results; +namespace Couchbase.OperationalInsightsClient.Internal.Results; -internal abstract class AnalyticsResultBase : IQueryResult +internal abstract class OperationalInsightsResultBase : IQueryResult { protected readonly Stream ResponseStream; protected readonly IDeserializer Serializer; @@ -34,24 +34,24 @@ internal abstract class AnalyticsResultBase : IQueryResult private bool _disposed; /// - /// Creates a new AnalyticsResultBase. + /// Creates a new OperationalInsightsResultBase. /// ///to read. /// The to use for converting the response to an object. /// Additional object to dispose when complete. - protected AnalyticsResultBase(Stream responseStream, IDeserializer serializer, IDisposable? ownedForCleanup = null) + protected OperationalInsightsResultBase(Stream responseStream, IDeserializer serializer, IDisposable? ownedForCleanup = null) { ResponseStream = responseStream ?? throw new ArgumentNullException(nameof(responseStream)); Serializer = serializer; _ownedForCleanup = ownedForCleanup; } - public abstract IAsyncEnumerator GetAsyncEnumerator( + public abstract IAsyncEnumerator GetAsyncEnumerator( CancellationToken cancellationToken = default); public abstract Task InitializeAsync(CancellationToken cancellationToken = default); - public IAsyncEnumerable Rows { get; protected set; } = null!; + public IAsyncEnumerable Rows { get; protected set; } = null!; public QueryMetaData MetaData { get; protected set; } = null!; public IReadOnlyList Errors { get; protected set; } = Array.Empty (); diff --git a/src/Couchbase.Analytics/Internal/Results/StreamingAnalyticsResult.cs b/src/Couchbase.OperationalInsights/Internal/Results/StreamingOperationalInsightsResult.cs similarity index 87% rename from src/Couchbase.Analytics/Internal/Results/StreamingAnalyticsResult.cs rename to src/Couchbase.OperationalInsights/Internal/Results/StreamingOperationalInsightsResult.cs index 11b41cb..52a9b9c 100644 --- a/src/Couchbase.Analytics/Internal/Results/StreamingAnalyticsResult.cs +++ b/src/Couchbase.OperationalInsights/Internal/Results/StreamingOperationalInsightsResult.cs @@ -20,18 +20,18 @@ #endregion using System.Runtime.CompilerServices; -using Couchbase.AnalyticsClient.Query; -using Couchbase.AnalyticsClient.Results; +using Couchbase.OperationalInsightsClient.Query; +using Couchbase.OperationalInsightsClient.Results; using Couchbase.Core.Json; -namespace Couchbase.AnalyticsClient.Internal.Results; +namespace Couchbase.OperationalInsightsClient.Internal.Results; /// -/// A streaming response class for Analytics queries. +/// A streaming response class for OperationalInsights queries. /// ////// This is the default response type. -internal class StreamingAnalyticsResult : AnalyticsResultBase +internal class StreamingOperationalInsightsResult : OperationalInsightsResultBase { private bool _isInitialized; private bool _hasResultsArray; @@ -39,7 +39,7 @@ internal class StreamingAnalyticsResult : AnalyticsResultBase private IJsonStreamReader _jsonReader; private bool _disposed; - public StreamingAnalyticsResult(Stream stream, IDeserializer serializer, IDisposable? ownedForCleanup = null) + public StreamingOperationalInsightsResult(Stream stream, IDeserializer serializer, IDisposable? ownedForCleanup = null) : base(stream, serializer, ownedForCleanup) { _jsonReader = serializer.CreateJsonStreamReader(stream); @@ -57,17 +57,17 @@ public override async Task InitializeAsync(CancellationToken cancellationToken = Rows = EnumerateRows(cancellationToken); } - public override IAsyncEnumeratorGetAsyncEnumerator( + public override IAsyncEnumerator GetAsyncEnumerator( CancellationToken cancellationToken = default) => EnumerateRows(cancellationToken).GetAsyncEnumerator(cancellationToken); - private async IAsyncEnumerable EnumerateRows( + private async IAsyncEnumerable EnumerateRows( [EnumeratorCancellation] CancellationToken cancellationToken = default) { if (!_isInitialized) { throw new InvalidOperationException( - $"{nameof(StreamingAnalyticsResult)} has not been initialized, call InitializeAsync first"); + $"{nameof(StreamingOperationalInsightsResult)} has not been initialized, call InitializeAsync first"); } if (_jsonReader == null) @@ -87,7 +87,7 @@ private async IAsyncEnumerable EnumerateRows( { await foreach (var token in _jsonReader.ReadTokensAsync(cancellationToken).ConfigureAwait(false)) { - yield return new AnalyticsRow(token); + yield return new OperationalInsightsRow(token); } await ReadResponseAttributes(cancellationToken).ConfigureAwait(false); diff --git a/src/Couchbase.Analytics/Internal/Retry/ErrorContext.cs b/src/Couchbase.OperationalInsights/Internal/Retry/ErrorContext.cs similarity index 94% rename from src/Couchbase.Analytics/Internal/Retry/ErrorContext.cs rename to src/Couchbase.OperationalInsights/Internal/Retry/ErrorContext.cs index 96a0860..d058ece 100644 --- a/src/Couchbase.Analytics/Internal/Retry/ErrorContext.cs +++ b/src/Couchbase.OperationalInsights/Internal/Retry/ErrorContext.cs @@ -22,10 +22,10 @@ using System.Net; using System.Text.Json; using System.Text.Json.Serialization; -using Couchbase.AnalyticsClient.Query; +using Couchbase.OperationalInsightsClient.Query; using Couchbase.Core.Utils; -namespace Couchbase.AnalyticsClient.Internal.Retry; +namespace Couchbase.OperationalInsightsClient.Internal.Retry; internal class ErrorContext { diff --git a/src/Couchbase.Analytics/Internal/Retry/AnalyticsErrorMapper.cs b/src/Couchbase.OperationalInsights/Internal/Retry/OperationalInsightsErrorMapper.cs similarity index 73% rename from src/Couchbase.Analytics/Internal/Retry/AnalyticsErrorMapper.cs rename to src/Couchbase.OperationalInsights/Internal/Retry/OperationalInsightsErrorMapper.cs index 4194a61..a046fb6 100644 --- a/src/Couchbase.Analytics/Internal/Retry/AnalyticsErrorMapper.cs +++ b/src/Couchbase.OperationalInsights/Internal/Retry/OperationalInsightsErrorMapper.cs @@ -21,49 +21,49 @@ using System.Net; using System.Net.Sockets; -using Couchbase.AnalyticsClient.Exceptions; -using Couchbase.AnalyticsClient.Internal.Results; -using Couchbase.AnalyticsClient.Query; +using Couchbase.OperationalInsightsClient.Exceptions; +using Couchbase.OperationalInsightsClient.Internal.Results; +using Couchbase.OperationalInsightsClient.Query; using TimeoutException = System.TimeoutException; -namespace Couchbase.AnalyticsClient.Internal.Retry; +namespace Couchbase.OperationalInsightsClient.Internal.Retry; /// -/// Static utility for mapping HTTP status codes and server error codes to Analytics exceptions. +/// Static utility for mapping HTTP status codes and server error codes to OperationalInsights exceptions. /// -internal static class AnalyticsErrorMapper +internal static class OperationalInsightsErrorMapper { ///- /// Maps an HTTP status code to the appropriate Analytics exception type. + /// Maps an HTTP status code to the appropriate OperationalInsights exception type. /// - /// The Http request result + /// The Http request result /// /// The request's error context - ///An AnalyticsException or one of its subclasses. - internal static AnalyticsException MapHttpErrorCode(AnalyticsResultBase analyticsResult, ErrorContext errorContext) + ///An OperationalInsightsException or one of its subclasses. + internal static OperationalInsightsException MapHttpErrorCode(OperationalInsightsResultBase insightsResult, ErrorContext errorContext) { - errorContext.Errors = analyticsResult.Errors.ToList(); + errorContext.Errors = insightsResult.Errors.ToList(); var statusCode = errorContext.StatusCode ?? throw new InvalidOperationException("StatusCode is null in error context"); return statusCode switch { HttpStatusCode.Unauthorized => new InvalidCredentialException($"Authentication failed - invalid credentials. Code: {(int)statusCode} - {statusCode}", errorContext), - HttpStatusCode.ServiceUnavailable => new AnalyticsException($"Service temporarily unavailable. Code: {(int)statusCode} - {statusCode}", errorContext), + HttpStatusCode.ServiceUnavailable => new OperationalInsightsException($"Service temporarily unavailable. Code: {(int)statusCode} - {statusCode}", errorContext), HttpStatusCode.BadRequest => MapServerErrorCode(errorContext.Errors[0], errorContext), - _ => new AnalyticsException($"HTTP {(int)statusCode} {statusCode}", errorContext) + _ => new OperationalInsightsException($"HTTP {(int)statusCode} {statusCode}", errorContext) }; } ///- /// Maps a server error code to the appropriate Analytics exception type. + /// Maps a server error code to the appropriate OperationalInsights exception type. /// /// The error from the server response. - ///An AnalyticsException or one of its subclasses. - private static AnalyticsException MapServerErrorCode(QueryError queryError, ErrorContext errorContext) + ///An OperationalInsightsException or one of its subclasses. + private static OperationalInsightsException MapServerErrorCode(QueryError queryError, ErrorContext errorContext) { return queryError.Code switch { 20000 => new InvalidCredentialException(queryError.Message, errorContext), - 21002 => new AnalyticsTimeoutException($"{queryError.Message}. Error code: {queryError.Code}", errorContext), + 21002 => new OperationalInsightsTimeoutException($"{queryError.Message}. Error code: {queryError.Code}", errorContext), _ => new QueryException(queryError.Message, errorContext) { Code = queryError.Code, ServerMessage = queryError.Message } }; } @@ -75,12 +75,12 @@ private static AnalyticsException MapServerErrorCode(QueryError queryError, Erro ///An AnalyticsException or one of its subclasses. - internal static AnalyticsException MapServiceErrors(IReadOnlyListerrors, ErrorContext errorContext) + /// An OperationalInsightsException or one of its subclasses. + internal static OperationalInsightsException MapServiceErrors(IReadOnlyListerrors, ErrorContext errorContext) { if (errors == null || errors.Count == 0) { - return new AnalyticsException("Unknown server error"); + return new OperationalInsightsException("Unknown server error"); } errorContext.Errors = errors.ToList(); diff --git a/src/Couchbase.Analytics/Internal/Retry/RetryUtils.cs b/src/Couchbase.OperationalInsights/Internal/Retry/RetryUtils.cs similarity index 97% rename from src/Couchbase.Analytics/Internal/Retry/RetryUtils.cs rename to src/Couchbase.OperationalInsights/Internal/Retry/RetryUtils.cs index 7bb8cdc..45c681e 100644 --- a/src/Couchbase.Analytics/Internal/Retry/RetryUtils.cs +++ b/src/Couchbase.OperationalInsights/Internal/Retry/RetryUtils.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.Retry; +namespace Couchbase.OperationalInsightsClient.Internal.Retry; /// /// Static utility methods for retry logic. diff --git a/src/Couchbase.Analytics/Internal/Utils/ClientIdentifier.cs b/src/Couchbase.OperationalInsights/Internal/Utils/ClientIdentifier.cs similarity index 97% rename from src/Couchbase.Analytics/Internal/Utils/ClientIdentifier.cs rename to src/Couchbase.OperationalInsights/Internal/Utils/ClientIdentifier.cs index f6cacbe..e2ecb38 100644 --- a/src/Couchbase.Analytics/Internal/Utils/ClientIdentifier.cs +++ b/src/Couchbase.OperationalInsights/Internal/Utils/ClientIdentifier.cs @@ -22,7 +22,7 @@ using System.Net.Http.Headers; using System.Runtime.InteropServices; -namespace Couchbase.AnalyticsClient.Internal.Utils; +namespace Couchbase.OperationalInsightsClient.Internal.Utils; internal static class ClientIdentifier { diff --git a/src/Couchbase.Analytics/Internal/Utils/ConnectionStringParams.cs b/src/Couchbase.OperationalInsights/Internal/Utils/ConnectionStringParams.cs similarity index 95% rename from src/Couchbase.Analytics/Internal/Utils/ConnectionStringParams.cs rename to src/Couchbase.OperationalInsights/Internal/Utils/ConnectionStringParams.cs index c9759d9..4e73d3e 100644 --- a/src/Couchbase.Analytics/Internal/Utils/ConnectionStringParams.cs +++ b/src/Couchbase.OperationalInsights/Internal/Utils/ConnectionStringParams.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.Utils; +namespace Couchbase.OperationalInsightsClient.Internal.Utils; internal static class ConnectionStringParams { diff --git a/src/Couchbase.Analytics/Internal/Utils/CurrentAssembly.cs b/src/Couchbase.OperationalInsights/Internal/Utils/CurrentAssembly.cs similarity index 96% rename from src/Couchbase.Analytics/Internal/Utils/CurrentAssembly.cs rename to src/Couchbase.OperationalInsights/Internal/Utils/CurrentAssembly.cs index 3ef0d59..ab556cd 100644 --- a/src/Couchbase.Analytics/Internal/Utils/CurrentAssembly.cs +++ b/src/Couchbase.OperationalInsights/Internal/Utils/CurrentAssembly.cs @@ -21,7 +21,7 @@ using System.Reflection; -namespace Couchbase.AnalyticsClient.Internal.Utils; +namespace Couchbase.OperationalInsightsClient.Internal.Utils; internal static class CurrentAssembly { diff --git a/src/Couchbase.Analytics/Internal/Utils/IEnumerableExtensions.cs b/src/Couchbase.OperationalInsights/Internal/Utils/IEnumerableExtensions.cs similarity index 99% rename from src/Couchbase.Analytics/Internal/Utils/IEnumerableExtensions.cs rename to src/Couchbase.OperationalInsights/Internal/Utils/IEnumerableExtensions.cs index 4120753..c5ea09d 100644 --- a/src/Couchbase.Analytics/Internal/Utils/IEnumerableExtensions.cs +++ b/src/Couchbase.OperationalInsights/Internal/Utils/IEnumerableExtensions.cs @@ -21,9 +21,9 @@ using System.Runtime.InteropServices; using System.Security.Cryptography; -using Couchbase.AnalyticsClient.Utils; +using Couchbase.OperationalInsightsClient.Utils; -namespace Couchbase.AnalyticsClient.Internal.Utils +namespace Couchbase.OperationalInsightsClient.Internal.Utils { internal static class ArrayExtensions { diff --git a/src/Couchbase.Analytics/Internal/Utils/SequenceGenerator.cs b/src/Couchbase.OperationalInsights/Internal/Utils/SequenceGenerator.cs similarity index 97% rename from src/Couchbase.Analytics/Internal/Utils/SequenceGenerator.cs rename to src/Couchbase.OperationalInsights/Internal/Utils/SequenceGenerator.cs index afd7ba3..5942e22 100644 --- a/src/Couchbase.Analytics/Internal/Utils/SequenceGenerator.cs +++ b/src/Couchbase.OperationalInsights/Internal/Utils/SequenceGenerator.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Internal.Utils; +namespace Couchbase.OperationalInsightsClient.Internal.Utils; internal static class SequenceGenerator { diff --git a/src/Couchbase.Analytics/Logging/IRedactor.cs b/src/Couchbase.OperationalInsights/Logging/IRedactor.cs similarity index 96% rename from src/Couchbase.Analytics/Logging/IRedactor.cs rename to src/Couchbase.OperationalInsights/Logging/IRedactor.cs index 319afd6..edb802d 100644 --- a/src/Couchbase.Analytics/Logging/IRedactor.cs +++ b/src/Couchbase.OperationalInsights/Logging/IRedactor.cs @@ -21,7 +21,7 @@ using System.Diagnostics.CodeAnalysis; -namespace Couchbase.AnalyticsClient.Logging; +namespace Couchbase.OperationalInsightsClient.Logging; /// /// An interface used for redacting specific log information. diff --git a/src/Couchbase.Analytics/Logging/Redacted.cs b/src/Couchbase.OperationalInsights/Logging/Redacted.cs similarity index 98% rename from src/Couchbase.Analytics/Logging/Redacted.cs rename to src/Couchbase.OperationalInsights/Logging/Redacted.cs index 101419a..4212be1 100644 --- a/src/Couchbase.Analytics/Logging/Redacted.cs +++ b/src/Couchbase.OperationalInsights/Logging/Redacted.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Couchbase.AnalyticsClient.Logging; +namespace Couchbase.OperationalInsightsClient.Logging; /// /// Wraps a value in an optional pair of redaction tags when written to a string. diff --git a/src/Couchbase.Analytics/Logging/RedactionLevel.cs b/src/Couchbase.OperationalInsights/Logging/RedactionLevel.cs similarity index 95% rename from src/Couchbase.Analytics/Logging/RedactionLevel.cs rename to src/Couchbase.OperationalInsights/Logging/RedactionLevel.cs index 9ac7037..20e2074 100644 --- a/src/Couchbase.Analytics/Logging/RedactionLevel.cs +++ b/src/Couchbase.OperationalInsights/Logging/RedactionLevel.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Logging; +namespace Couchbase.OperationalInsightsClient.Logging; /// /// Specifies the level of log redaction. diff --git a/src/Couchbase.Analytics/Logging/TypedRedactor.cs b/src/Couchbase.OperationalInsights/Logging/TypedRedactor.cs similarity index 98% rename from src/Couchbase.Analytics/Logging/TypedRedactor.cs rename to src/Couchbase.OperationalInsights/Logging/TypedRedactor.cs index a787174..ab1a6d4 100644 --- a/src/Couchbase.Analytics/Logging/TypedRedactor.cs +++ b/src/Couchbase.OperationalInsights/Logging/TypedRedactor.cs @@ -21,7 +21,7 @@ using System.Runtime.CompilerServices; -namespace Couchbase.AnalyticsClient.Logging; +namespace Couchbase.OperationalInsightsClient.Logging; /// /// Provides strongly-typed log redaction. Returns structs diff --git a/src/Couchbase.Analytics/Options/CancelOptions.cs b/src/Couchbase.OperationalInsights/Options/CancelOptions.cs similarity index 94% rename from src/Couchbase.Analytics/Options/CancelOptions.cs rename to src/Couchbase.OperationalInsights/Options/CancelOptions.cs index b029aef..5f54879 100644 --- a/src/Couchbase.Analytics/Options/CancelOptions.cs +++ b/src/Couchbase.OperationalInsights/Options/CancelOptions.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Options; +namespace Couchbase.OperationalInsightsClient.Options; /// /// Options for canceling an asynchronous server-side query. diff --git a/src/Couchbase.Analytics/Options/ClusterOptions.cs b/src/Couchbase.OperationalInsights/Options/ClusterOptions.cs similarity index 95% rename from src/Couchbase.Analytics/Options/ClusterOptions.cs rename to src/Couchbase.OperationalInsights/Options/ClusterOptions.cs index 02ca98b..f35822f 100644 --- a/src/Couchbase.Analytics/Options/ClusterOptions.cs +++ b/src/Couchbase.OperationalInsights/Options/ClusterOptions.cs @@ -21,18 +21,18 @@ using System.ComponentModel; using System.Security.Authentication; -using Couchbase.AnalyticsClient.DI; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal; -using Couchbase.AnalyticsClient.Internal.DI; -using Couchbase.AnalyticsClient.Internal.Utils; -using Couchbase.AnalyticsClient.Logging; +using Couchbase.OperationalInsightsClient.DI; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal; +using Couchbase.OperationalInsightsClient.Internal.DI; +using Couchbase.OperationalInsightsClient.Internal.Utils; +using Couchbase.OperationalInsightsClient.Logging; using Couchbase.Core.Json; using Couchbase.Core.Utils; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -namespace Couchbase.AnalyticsClient.Options; +namespace Couchbase.OperationalInsightsClient.Options; public record ClusterOptions { diff --git a/src/Couchbase.Analytics/Options/DiscardResultsOptions.cs b/src/Couchbase.OperationalInsights/Options/DiscardResultsOptions.cs similarity index 94% rename from src/Couchbase.Analytics/Options/DiscardResultsOptions.cs rename to src/Couchbase.OperationalInsights/Options/DiscardResultsOptions.cs index 27ec2fa..2c68268 100644 --- a/src/Couchbase.Analytics/Options/DiscardResultsOptions.cs +++ b/src/Couchbase.OperationalInsights/Options/DiscardResultsOptions.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Options; +namespace Couchbase.OperationalInsightsClient.Options; /// /// Options for discarding results of an asynchronous server-side query. diff --git a/src/Couchbase.Analytics/Options/FetchResultsOptions.cs b/src/Couchbase.OperationalInsights/Options/FetchResultsOptions.cs similarity index 96% rename from src/Couchbase.Analytics/Options/FetchResultsOptions.cs rename to src/Couchbase.OperationalInsights/Options/FetchResultsOptions.cs index 4dade0a..0a15a10 100644 --- a/src/Couchbase.Analytics/Options/FetchResultsOptions.cs +++ b/src/Couchbase.OperationalInsights/Options/FetchResultsOptions.cs @@ -21,7 +21,7 @@ using Couchbase.Core.Json; -namespace Couchbase.AnalyticsClient.Options; +namespace Couchbase.OperationalInsightsClient.Options; /// /// Options for fetching results of an asynchronous server-side query. diff --git a/src/Couchbase.Analytics/Options/FetchStatusOptions.cs b/src/Couchbase.OperationalInsights/Options/FetchStatusOptions.cs similarity index 94% rename from src/Couchbase.Analytics/Options/FetchStatusOptions.cs rename to src/Couchbase.OperationalInsights/Options/FetchStatusOptions.cs index f0bc570..5f38cea 100644 --- a/src/Couchbase.Analytics/Options/FetchStatusOptions.cs +++ b/src/Couchbase.OperationalInsights/Options/FetchStatusOptions.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Options; +namespace Couchbase.OperationalInsightsClient.Options; /// /// Options for fetching the status of an asynchronous server-side query. diff --git a/src/Couchbase.Analytics/Options/QueryOptions.cs b/src/Couchbase.OperationalInsights/Options/QueryOptions.cs similarity index 98% rename from src/Couchbase.Analytics/Options/QueryOptions.cs rename to src/Couchbase.OperationalInsights/Options/QueryOptions.cs index 5d3948b..d092a7d 100644 --- a/src/Couchbase.Analytics/Options/QueryOptions.cs +++ b/src/Couchbase.OperationalInsights/Options/QueryOptions.cs @@ -20,11 +20,11 @@ #endregion using System.Text.Json; -using Couchbase.AnalyticsClient.Query; +using Couchbase.OperationalInsightsClient.Query; using Couchbase.Core.Json; using Couchbase.Core.Utils; -namespace Couchbase.AnalyticsClient.Options; +namespace Couchbase.OperationalInsightsClient.Options; public record QueryOptions { @@ -82,7 +82,7 @@ public record QueryOptions public uint? MaxRetries { get; init; } /// - /// Raw parameters passed directly to the analytics service for advanced options. + /// Raw parameters passed directly to the insights service for advanced options. /// Use public Dictionaryor to create updated copies. /// Raw { get; init; } = new(); diff --git a/src/Couchbase.Analytics/Options/SecurityOptions.cs b/src/Couchbase.OperationalInsights/Options/SecurityOptions.cs similarity index 98% rename from src/Couchbase.Analytics/Options/SecurityOptions.cs rename to src/Couchbase.OperationalInsights/Options/SecurityOptions.cs index 3f0d1be..1e60a88 100644 --- a/src/Couchbase.Analytics/Options/SecurityOptions.cs +++ b/src/Couchbase.OperationalInsights/Options/SecurityOptions.cs @@ -21,9 +21,9 @@ using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; -using Couchbase.AnalyticsClient.Certificates; +using Couchbase.OperationalInsightsClient.Certificates; -namespace Couchbase.AnalyticsClient.Options; +namespace Couchbase.OperationalInsightsClient.Options; public record SecurityOptions { diff --git a/src/Couchbase.Analytics/Options/StartQueryOptions.cs b/src/Couchbase.OperationalInsights/Options/StartQueryOptions.cs similarity index 97% rename from src/Couchbase.Analytics/Options/StartQueryOptions.cs rename to src/Couchbase.OperationalInsights/Options/StartQueryOptions.cs index 271aa27..1cdfac6 100644 --- a/src/Couchbase.Analytics/Options/StartQueryOptions.cs +++ b/src/Couchbase.OperationalInsights/Options/StartQueryOptions.cs @@ -20,10 +20,10 @@ #endregion using System.Text.Json; -using Couchbase.AnalyticsClient.Query; +using Couchbase.OperationalInsightsClient.Query; using Couchbase.Core.Utils; -namespace Couchbase.AnalyticsClient.Options; +namespace Couchbase.OperationalInsightsClient.Options; /// /// Options for starting an asynchronous server-side query via . @@ -78,7 +78,7 @@ public record StartQueryOptions public uint? MaxRetries { get; init; } /// - /// Raw parameters passed directly to the analytics service for advanced options. + /// Raw parameters passed directly to the insights service for advanced options. /// public DictionaryRaw { get; init; } = new(); diff --git a/src/Couchbase.Analytics/Options/TimeoutOptions.cs b/src/Couchbase.OperationalInsights/Options/TimeoutOptions.cs similarity index 97% rename from src/Couchbase.Analytics/Options/TimeoutOptions.cs rename to src/Couchbase.OperationalInsights/Options/TimeoutOptions.cs index 0e7e2eb..04deb21 100644 --- a/src/Couchbase.Analytics/Options/TimeoutOptions.cs +++ b/src/Couchbase.OperationalInsights/Options/TimeoutOptions.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Options; +namespace Couchbase.OperationalInsightsClient.Options; public record TimeoutOptions { diff --git a/src/Couchbase.OperationalInsights/Properties/AssemblyInfo.cs b/src/Couchbase.OperationalInsights/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..04040c6 --- /dev/null +++ b/src/Couchbase.OperationalInsights/Properties/AssemblyInfo.cs @@ -0,0 +1,8 @@ +using System.Runtime.CompilerServices; + +#if !SIGNING +[assembly: InternalsVisibleTo("Couchbase.OperationalInsights.UnitTests")] +[assembly: InternalsVisibleTo("Couchbase.OperationalInsightsClient.FunctionalTests")] +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] +[assembly: InternalsVisibleTo("Couchbase.OperationalInsights.Performer")] +#endif diff --git a/src/Couchbase.Analytics/Query/AsyncQueryMetrics.cs b/src/Couchbase.OperationalInsights/Query/AsyncQueryMetrics.cs similarity index 95% rename from src/Couchbase.Analytics/Query/AsyncQueryMetrics.cs rename to src/Couchbase.OperationalInsights/Query/AsyncQueryMetrics.cs index ecc6ab6..199b033 100644 --- a/src/Couchbase.Analytics/Query/AsyncQueryMetrics.cs +++ b/src/Couchbase.OperationalInsights/Query/AsyncQueryMetrics.cs @@ -21,7 +21,7 @@ using System.Text.Json.Serialization; -namespace Couchbase.AnalyticsClient.Query; +namespace Couchbase.OperationalInsightsClient.Query; internal sealed class AsyncQueryMetrics : QueryMetricsBase { diff --git a/src/Couchbase.Analytics/Query/QueryContext.cs b/src/Couchbase.OperationalInsights/Query/QueryContext.cs similarity index 96% rename from src/Couchbase.Analytics/Query/QueryContext.cs rename to src/Couchbase.OperationalInsights/Query/QueryContext.cs index 6cc2a14..017aa11 100644 --- a/src/Couchbase.Analytics/Query/QueryContext.cs +++ b/src/Couchbase.OperationalInsights/Query/QueryContext.cs @@ -19,11 +19,11 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Query; +namespace Couchbase.OperationalInsightsClient.Query; /// /// Represents a query context that combines a database and scope into a formatted string -/// suitable for Analytics queries. +/// suitable for OperationalInsights queries. /// public sealed class QueryContext { diff --git a/src/Couchbase.Analytics/Query/QueryError.cs b/src/Couchbase.OperationalInsights/Query/QueryError.cs similarity index 95% rename from src/Couchbase.Analytics/Query/QueryError.cs rename to src/Couchbase.OperationalInsights/Query/QueryError.cs index e2609ee..a5f1743 100644 --- a/src/Couchbase.Analytics/Query/QueryError.cs +++ b/src/Couchbase.OperationalInsights/Query/QueryError.cs @@ -22,7 +22,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Couchbase.AnalyticsClient.Query; +namespace Couchbase.OperationalInsightsClient.Query; public record QueryError( [property: JsonPropertyName("code")] diff --git a/src/Couchbase.Analytics/Query/QueryMetaData.cs b/src/Couchbase.OperationalInsights/Query/QueryMetaData.cs similarity index 95% rename from src/Couchbase.Analytics/Query/QueryMetaData.cs rename to src/Couchbase.OperationalInsights/Query/QueryMetaData.cs index 4ad2bf5..78bc481 100644 --- a/src/Couchbase.Analytics/Query/QueryMetaData.cs +++ b/src/Couchbase.OperationalInsights/Query/QueryMetaData.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Query; +namespace Couchbase.OperationalInsightsClient.Query; public sealed class QueryMetaData { diff --git a/src/Couchbase.Analytics/Query/QueryMetrics.cs b/src/Couchbase.OperationalInsights/Query/QueryMetrics.cs similarity index 96% rename from src/Couchbase.Analytics/Query/QueryMetrics.cs rename to src/Couchbase.OperationalInsights/Query/QueryMetrics.cs index 308f27e..8fd5ea9 100644 --- a/src/Couchbase.Analytics/Query/QueryMetrics.cs +++ b/src/Couchbase.OperationalInsights/Query/QueryMetrics.cs @@ -21,7 +21,7 @@ using System.Text.Json.Serialization; -namespace Couchbase.AnalyticsClient.Query; +namespace Couchbase.OperationalInsightsClient.Query; public sealed class QueryMetrics : QueryMetricsBase { diff --git a/src/Couchbase.Analytics/Query/QueryMetricsBase.cs b/src/Couchbase.OperationalInsights/Query/QueryMetricsBase.cs similarity index 96% rename from src/Couchbase.Analytics/Query/QueryMetricsBase.cs rename to src/Couchbase.OperationalInsights/Query/QueryMetricsBase.cs index 9d6691f..6adeee2 100644 --- a/src/Couchbase.Analytics/Query/QueryMetricsBase.cs +++ b/src/Couchbase.OperationalInsights/Query/QueryMetricsBase.cs @@ -22,7 +22,7 @@ using System.Text.Json.Serialization; using Couchbase.Core.Json; -namespace Couchbase.AnalyticsClient.Query; +namespace Couchbase.OperationalInsightsClient.Query; public abstract class QueryMetricsBase { diff --git a/src/Couchbase.Analytics/Query/QueryPriority.cs b/src/Couchbase.OperationalInsights/Query/QueryPriority.cs similarity index 94% rename from src/Couchbase.Analytics/Query/QueryPriority.cs rename to src/Couchbase.OperationalInsights/Query/QueryPriority.cs index 289d958..1675e81 100644 --- a/src/Couchbase.Analytics/Query/QueryPriority.cs +++ b/src/Couchbase.OperationalInsights/Query/QueryPriority.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Query; +namespace Couchbase.OperationalInsightsClient.Query; public enum QueryPriority { diff --git a/src/Couchbase.Analytics/Query/QueryScanConsistency.cs b/src/Couchbase.OperationalInsights/Query/QueryScanConsistency.cs similarity index 97% rename from src/Couchbase.Analytics/Query/QueryScanConsistency.cs rename to src/Couchbase.OperationalInsights/Query/QueryScanConsistency.cs index 8cc1357..e11f626 100644 --- a/src/Couchbase.Analytics/Query/QueryScanConsistency.cs +++ b/src/Couchbase.OperationalInsights/Query/QueryScanConsistency.cs @@ -21,7 +21,7 @@ using System.ComponentModel; -namespace Couchbase.AnalyticsClient.Query; +namespace Couchbase.OperationalInsightsClient.Query; ////// The scan consistency setting specifies the consistency guarantee for index scanning. diff --git a/src/Couchbase.Analytics/Query/QueryWarning.cs b/src/Couchbase.OperationalInsights/Query/QueryWarning.cs similarity index 94% rename from src/Couchbase.Analytics/Query/QueryWarning.cs rename to src/Couchbase.OperationalInsights/Query/QueryWarning.cs index 7e381dc..22c6803 100644 --- a/src/Couchbase.Analytics/Query/QueryWarning.cs +++ b/src/Couchbase.OperationalInsights/Query/QueryWarning.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Query; +namespace Couchbase.OperationalInsightsClient.Query; public sealed class QueryWarning { diff --git a/src/Couchbase.Analytics/Results/IQueryResult.cs b/src/Couchbase.OperationalInsights/Results/IQueryResult.cs similarity index 83% rename from src/Couchbase.Analytics/Results/IQueryResult.cs rename to src/Couchbase.OperationalInsights/Results/IQueryResult.cs index 48816f0..e2ee0f8 100644 --- a/src/Couchbase.Analytics/Results/IQueryResult.cs +++ b/src/Couchbase.OperationalInsights/Results/IQueryResult.cs @@ -20,13 +20,13 @@ #endregion using System.Net; -using Couchbase.AnalyticsClient.Query; +using Couchbase.OperationalInsightsClient.Query; -namespace Couchbase.AnalyticsClient.Results; +namespace Couchbase.OperationalInsightsClient.Results; -public interface IQueryResult : IDisposable, IAsyncDisposable, IAsyncEnumerable +public interface IQueryResult : IDisposable, IAsyncDisposable, IAsyncEnumerable { - IAsyncEnumerable Rows { get; } + IAsyncEnumerable Rows { get; } public QueryMetaData MetaData { get; } diff --git a/src/Couchbase.Analytics/Results/AnalyticsRow.cs b/src/Couchbase.OperationalInsights/Results/OperationalInsightsRow.cs similarity index 88% rename from src/Couchbase.Analytics/Results/AnalyticsRow.cs rename to src/Couchbase.OperationalInsights/Results/OperationalInsightsRow.cs index 7d5e909..007f560 100644 --- a/src/Couchbase.Analytics/Results/AnalyticsRow.cs +++ b/src/Couchbase.OperationalInsights/Results/OperationalInsightsRow.cs @@ -21,13 +21,13 @@ using Couchbase.Core.Json; -namespace Couchbase.AnalyticsClient.Results; +namespace Couchbase.OperationalInsightsClient.Results; -public sealed class AnalyticsRow +public sealed class OperationalInsightsRow { private readonly IJsonToken _token; - internal AnalyticsRow(IJsonToken token) + internal OperationalInsightsRow(IJsonToken token) { _token = token ?? throw new ArgumentNullException(nameof(token)); } diff --git a/src/Couchbase.Analytics/Scope.cs b/src/Couchbase.OperationalInsights/Scope.cs similarity index 92% rename from src/Couchbase.Analytics/Scope.cs rename to src/Couchbase.OperationalInsights/Scope.cs index f737887..a0cb293 100644 --- a/src/Couchbase.Analytics/Scope.cs +++ b/src/Couchbase.OperationalInsights/Scope.cs @@ -19,12 +19,12 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.Query; -using Couchbase.AnalyticsClient.Results; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.Query; +using Couchbase.OperationalInsightsClient.Results; -namespace Couchbase.AnalyticsClient; +namespace Couchbase.OperationalInsightsClient; public sealed class Scope { diff --git a/src/Couchbase.Analytics/Utils/HostEndpoint.cs b/src/Couchbase.OperationalInsights/Utils/HostEndpoint.cs similarity index 99% rename from src/Couchbase.Analytics/Utils/HostEndpoint.cs rename to src/Couchbase.OperationalInsights/Utils/HostEndpoint.cs index 70991be..2e998b6 100644 --- a/src/Couchbase.Analytics/Utils/HostEndpoint.cs +++ b/src/Couchbase.OperationalInsights/Utils/HostEndpoint.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Utils; +namespace Couchbase.OperationalInsightsClient.Utils; /// /// diff --git a/src/Couchbase.Analytics/Utils/HostEndpointWithPort.cs b/src/Couchbase.OperationalInsights/Utils/HostEndpointWithPort.cs similarity index 99% rename from src/Couchbase.Analytics/Utils/HostEndpointWithPort.cs rename to src/Couchbase.OperationalInsights/Utils/HostEndpointWithPort.cs index e6834c4..effa6db 100644 --- a/src/Couchbase.Analytics/Utils/HostEndpointWithPort.cs +++ b/src/Couchbase.OperationalInsights/Utils/HostEndpointWithPort.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Utils; +namespace Couchbase.OperationalInsightsClient.Utils; /// /// A host name and port pair. Unlike this type requires a port number. diff --git a/src/Couchbase.Analytics/Utils/StringExtensions.cs b/src/Couchbase.OperationalInsights/Utils/StringExtensions.cs similarity index 99% rename from src/Couchbase.Analytics/Utils/StringExtensions.cs rename to src/Couchbase.OperationalInsights/Utils/StringExtensions.cs index f101522..89cb439 100644 --- a/src/Couchbase.Analytics/Utils/StringExtensions.cs +++ b/src/Couchbase.OperationalInsights/Utils/StringExtensions.cs @@ -19,7 +19,7 @@ * ************************************************************/ #endregion -namespace Couchbase.AnalyticsClient.Utils; +namespace Couchbase.OperationalInsightsClient.Utils; public static class StringExtensions { diff --git a/src/Couchbase.Analytics/Utils/ThrowHelper.cs b/src/Couchbase.OperationalInsights/Utils/ThrowHelper.cs similarity index 97% rename from src/Couchbase.Analytics/Utils/ThrowHelper.cs rename to src/Couchbase.OperationalInsights/Utils/ThrowHelper.cs index c5b5f7e..cdb7679 100644 --- a/src/Couchbase.Analytics/Utils/ThrowHelper.cs +++ b/src/Couchbase.OperationalInsights/Utils/ThrowHelper.cs @@ -21,7 +21,7 @@ using System.Diagnostics.CodeAnalysis; -namespace Couchbase.AnalyticsClient.Utils; +namespace Couchbase.OperationalInsightsClient.Utils; public class ThrowHelper { diff --git a/tests/Couchbase.Analytics.FunctionalTests/AsyncAnalyticsTests.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/AsyncOperationalInsightsTests.cs similarity index 90% rename from tests/Couchbase.Analytics.FunctionalTests/AsyncAnalyticsTests.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/AsyncOperationalInsightsTests.cs index 52feb12..b584c44 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/AsyncAnalyticsTests.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/AsyncOperationalInsightsTests.cs @@ -1,27 +1,27 @@ using System.Diagnostics; -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.Exceptions; -using Couchbase.AnalyticsClient.FunctionalTests.Fixtures; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.Exceptions; +using Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; +using Couchbase.OperationalInsightsClient.Options; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.FunctionalTests; +namespace Couchbase.OperationalInsightsClient.FunctionalTests; [Collection(SimpleCollection.Name)] -public class AsyncAnalyticsTests +public class AsyncOperationalInsightsTests { private readonly SimpleFixture _simpleFixture; private readonly ITestOutputHelper _outputHelper; - public AsyncAnalyticsTests(SimpleFixture fixture, ITestOutputHelper outputHelper) + public AsyncOperationalInsightsTests(SimpleFixture fixture, ITestOutputHelper outputHelper) { _simpleFixture = fixture; _outputHelper = outputHelper; } [Fact] - public async Task Test_AsyncAnalytics_EndToEnd_Cluster() + public async Task Test_AsyncOperationalInsights_EndToEnd_Cluster() { var statement = "select i from array_range(1, 100) as i;"; var queryOptions = new StartQueryOptions() @@ -58,7 +58,7 @@ public async Task Test_AsyncAnalytics_EndToEnd_Cluster() } [Fact] - public async Task Test_AsyncAnalytics_Cancellation_Cluster() + public async Task Test_AsyncOperationalInsights_Cancellation_Cluster() { // Use a statement that takes some time to execute (Cartesian product to delay) var statement = "select * from array_range(1, 5000) as a, array_range(1, 5000) as b;"; @@ -101,7 +101,7 @@ public async Task Test_AsyncAnalytics_Cancellation_Cluster() } [Fact] - public async Task Test_AsyncAnalytics_DiscardResults_Cluster() + public async Task Test_AsyncOperationalInsights_DiscardResults_Cluster() { var statement = "select i from array_range(1, 5) as i;"; var queryOptions = new StartQueryOptions(); @@ -130,7 +130,7 @@ await Assert.ThrowsAsync (async () => } [Fact] - public async Task Test_AsyncAnalytics_EndToEnd_Scope() + public async Task Test_AsyncOperationalInsights_EndToEnd_Scope() { var statement = "select i from array_range(1, 10) as i;"; var queryOptions = new StartQueryOptions() @@ -166,7 +166,7 @@ public async Task Test_AsyncAnalytics_EndToEnd_Scope() } [Fact] - public async Task Test_AsyncAnalytics_Metadata_Cluster() + public async Task Test_AsyncOperationalInsights_Metadata_Cluster() { var statement = "select i from array_range(1, 100) as i;"; var queryOptions = new StartQueryOptions() diff --git a/tests/Couchbase.Analytics.FunctionalTests/CertificateAuthenticationTests.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/CertificateAuthenticationTests.cs similarity index 91% rename from tests/Couchbase.Analytics.FunctionalTests/CertificateAuthenticationTests.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/CertificateAuthenticationTests.cs index b895b87..8c610a0 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/CertificateAuthenticationTests.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/CertificateAuthenticationTests.cs @@ -1,10 +1,10 @@ -using Couchbase.AnalyticsClient.FunctionalTests.Fixtures; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.FunctionalTests; +namespace Couchbase.OperationalInsightsClient.FunctionalTests; [Collection(CertificateCollection.Name)] public class CertificateAuthenticationTests @@ -48,7 +48,7 @@ public async Task Test_Query_With_Invalid_Certificate_Fails() new ClusterOptions()); // The server should reject the TLS handshake with an untrusted client cert, - // which surfaces as an HttpRequestException or AnalyticsException + // which surfaces as an HttpRequestException or OperationalInsightsException await Assert.ThrowsAnyAsync (async () => { await invalidCluster.ExecuteQueryAsync( diff --git a/tests/Couchbase.Analytics.FunctionalTests/ClusterTests.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/ClusterTests.cs similarity index 82% rename from tests/Couchbase.Analytics.FunctionalTests/ClusterTests.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/ClusterTests.cs index c5e14c0..9fe66c3 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/ClusterTests.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/ClusterTests.cs @@ -1,8 +1,8 @@ -using Couchbase.AnalyticsClient.FunctionalTests.Fixtures; +using Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.FunctionalTests; +namespace Couchbase.OperationalInsightsClient.FunctionalTests; [Collection(SimpleCollection.Name)] public class ClusterTests diff --git a/tests/Couchbase.Analytics.FunctionalTests/Couchbase.Analytics.FunctionalTests.csproj b/tests/Couchbase.OperationalInsights.FunctionalTests/Couchbase.OperationalInsights.FunctionalTests.csproj similarity index 82% rename from tests/Couchbase.Analytics.FunctionalTests/Couchbase.Analytics.FunctionalTests.csproj rename to tests/Couchbase.OperationalInsights.FunctionalTests/Couchbase.OperationalInsights.FunctionalTests.csproj index 656a49a..5b3fcd0 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Couchbase.Analytics.FunctionalTests.csproj +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Couchbase.OperationalInsights.FunctionalTests.csproj @@ -4,14 +4,14 @@ net8.0;net10.0 enable enable -Couchbase.AnalyticsClient.FunctionalTests -Couchbase.AnalyticsClient.FunctionalTests +Couchbase.OperationalInsightsClient.FunctionalTests +Couchbase.OperationalInsightsClient.FunctionalTests false true - diff --git a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/CertificateCollection.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/CertificateCollection.cs similarity index 70% rename from tests/Couchbase.Analytics.FunctionalTests/Fixtures/CertificateCollection.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/CertificateCollection.cs index 3591d5c..5eee8c7 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/CertificateCollection.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/CertificateCollection.cs @@ -1,6 +1,6 @@ using Xunit; -namespace Couchbase.AnalyticsClient.FunctionalTests.Fixtures; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; [CollectionDefinition(Name)] public class CertificateCollection : ICollectionFixture+ diff --git a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/CertificateFixture.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/CertificateFixture.cs similarity index 86% rename from tests/Couchbase.Analytics.FunctionalTests/Fixtures/CertificateFixture.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/CertificateFixture.cs index b498623..da37147 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/CertificateFixture.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/CertificateFixture.cs @@ -1,11 +1,11 @@ -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Microsoft.Extensions.Configuration; -namespace Couchbase.AnalyticsClient.FunctionalTests.Fixtures; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; /// -/// Fixture that connects to the analytics cluster using mTLS (client certificate) authentication. +/// Fixture that connects to the insights cluster using mTLS (client certificate) authentication. /// Requires public class CertificateFixture : IDisposable @@ -39,7 +39,7 @@ public CertificateFixture() // mTLS requires a direct-to-node connection because the nginx passive // load balancer terminates TLS at L7 and does not forward client - // certificates to the analytics service. + // certificates to the insights service. var connectionString = FixtureSettings.DirectConnectionString ?? FixtureSettings.ConnectionString!; diff --git a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/FixtureSettings.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/FixtureSettings.cs similarity index 95% rename from tests/Couchbase.Analytics.FunctionalTests/Fixtures/FixtureSettings.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/FixtureSettings.cs index c2083e3..bff26ad 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/FixtureSettings.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/FixtureSettings.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Couchbase.AnalyticsClient.FunctionalTests.Fixtures; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; public class FixtureSettings { diff --git a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/JwtCollection.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/JwtCollection.cs similarity index 68% rename from tests/Couchbase.Analytics.FunctionalTests/Fixtures/JwtCollection.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/JwtCollection.cs index f7f64bd..7166fb4 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/JwtCollection.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/JwtCollection.cs @@ -1,6 +1,6 @@ using Xunit; -namespace Couchbase.AnalyticsClient.FunctionalTests.Fixtures; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; [CollectionDefinition(Name)] public class JwtCollection : ICollectionFixtureClientCertPath andClientKeyPath to be set insettings.json . ///diff --git a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/JwtFixture.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/JwtFixture.cs similarity index 83% rename from tests/Couchbase.Analytics.FunctionalTests/Fixtures/JwtFixture.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/JwtFixture.cs index 59fd37d..ef62a1c 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/JwtFixture.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/JwtFixture.cs @@ -1,11 +1,11 @@ -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Microsoft.Extensions.Configuration; -namespace Couchbase.AnalyticsClient.FunctionalTests.Fixtures; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; /// -/// Fixture that connects to the analytics cluster using JWT (Bearer) authentication. +/// Fixture that connects to the insights cluster using JWT (Bearer) authentication. /// Requires public class JwtFixture : IDisposable diff --git a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/Analytics2Fixture.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/OperationalInsights2Fixture.cs similarity index 93% rename from tests/Couchbase.Analytics.FunctionalTests/Fixtures/Analytics2Fixture.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/OperationalInsights2Fixture.cs index 1d4b09c..622741d 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/Analytics2Fixture.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/OperationalInsights2Fixture.cs @@ -1,10 +1,10 @@ -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Microsoft.Extensions.Configuration; -namespace Couchbase.AnalyticsClient.FunctionalTests.Fixtures; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; -public class Analytics2Fixture : IDisposable +public class OperationalInsights2Fixture : IDisposable { public FixtureSettings FixtureSettings { get; private set; } public ClusterOptions ClusterOptions { get; private set; } @@ -45,7 +45,7 @@ public class Analytics2Fixture : IDisposable "jVdwvwO8oLhQUli14cQyj41pEMCgdFB3YFAJapSpsw==\n" + "-----END CERTIFICATE-----\n"; - public Analytics2Fixture() + public OperationalInsights2Fixture() { FixtureSettings = GetFixtureSettings(); ClusterOptions = CreateClusterOptions(); diff --git a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/SimpleCollection.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/SimpleCollection.cs similarity index 84% rename from tests/Couchbase.Analytics.FunctionalTests/Fixtures/SimpleCollection.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/SimpleCollection.cs index 9b23eac..fe9bac6 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/SimpleCollection.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/SimpleCollection.cs @@ -1,6 +1,6 @@ using Xunit; -namespace Couchbase.AnalyticsClient.FunctionalTests.Fixtures +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures { [CollectionDefinition(Name)] public class SimpleCollection : ICollectionFixtureJwtToken to be set insettings.json . ///diff --git a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/SimpleFixture.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/SimpleFixture.cs similarity index 96% rename from tests/Couchbase.Analytics.FunctionalTests/Fixtures/SimpleFixture.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/SimpleFixture.cs index 0516b10..70dc52c 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/SimpleFixture.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/SimpleFixture.cs @@ -1,8 +1,8 @@ -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Microsoft.Extensions.Configuration; -namespace Couchbase.AnalyticsClient.FunctionalTests.Fixtures +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures { public class SimpleFixture : IDisposable { diff --git a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/TestCollection.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/TestCollection.cs similarity index 65% rename from tests/Couchbase.Analytics.FunctionalTests/Fixtures/TestCollection.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/TestCollection.cs index a903dc7..a6cd0e3 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Fixtures/TestCollection.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Fixtures/TestCollection.cs @@ -1,9 +1,9 @@ using Xunit; -namespace Couchbase.AnalyticsClient.FunctionalTests.Fixtures; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; [CollectionDefinition(Name)] -public class TestCollection : ICollectionFixture +public class TestCollection : ICollectionFixture { public const string Name = "XUnitCollection"; // This class has no code, and is never created. Its purpose is simply diff --git a/tests/Couchbase.Analytics.FunctionalTests/Internal/CouchbaseHttpClientTests.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Internal/CouchbaseHttpClientTests.cs similarity index 85% rename from tests/Couchbase.Analytics.FunctionalTests/Internal/CouchbaseHttpClientTests.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Internal/CouchbaseHttpClientTests.cs index 9d235ef..3873933 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Internal/CouchbaseHttpClientTests.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Internal/CouchbaseHttpClientTests.cs @@ -1,19 +1,19 @@ using System.Net; using System.Reflection; -using Couchbase.AnalyticsClient.DnsUtil; -using Couchbase.AnalyticsClient.Exceptions; -using Couchbase.AnalyticsClient.FunctionalTests.Fixtures; -using Couchbase.AnalyticsClient.FunctionalTests.Utils; -using Couchbase.AnalyticsClient.Internal; -using Couchbase.AnalyticsClient.Internal.DI; -using Couchbase.AnalyticsClient.Internal.DnsUtil; -using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; -using Couchbase.AnalyticsClient.Internal.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.DnsUtil; +using Couchbase.OperationalInsightsClient.Exceptions; +using Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; +using Couchbase.OperationalInsightsClient.FunctionalTests.Utils; +using Couchbase.OperationalInsightsClient.Internal; +using Couchbase.OperationalInsightsClient.Internal.DI; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; +using Couchbase.OperationalInsightsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.FunctionalTests.Internal; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Internal; [Collection(TestCollection.Name)] public class CouchbaseHttpClientTests @@ -26,10 +26,10 @@ private enum IpReplacementStrategy All } - private readonly Analytics2Fixture _fixture; + private readonly OperationalInsights2Fixture _fixture; private ITestOutputHelper? _outputHelper; - public CouchbaseHttpClientTests(Analytics2Fixture fixture, ITestOutputHelper? outputHelper) + public CouchbaseHttpClientTests(OperationalInsights2Fixture fixture, ITestOutputHelper? outputHelper) { _fixture = fixture; _outputHelper = outputHelper; @@ -99,11 +99,11 @@ public async Task ResolveEndpointsAsync(string hostname, Cancellati } } - private void GetAnalyticsService(out IAnalyticsService service, out ICouchbaseServiceProvider serviceProvider) + private void GetOperationalInsightsService(out IOperationalInsightsService service, out ICouchbaseServiceProvider serviceProvider) { serviceProvider = _fixture.ClusterOptions.BuildServiceProvider(); Assert.NotNull(serviceProvider); - service = serviceProvider.GetRequiredService (); + service = serviceProvider.GetRequiredService (); Assert.NotNull(service); } @@ -149,7 +149,7 @@ public async Task Test_Requests_Should_Succeed_If_Some_IPs_Are_Unreachable() // so the ConnectCallback (and therefore the injected TestDnsEndpointResolver logic) doesn't run again. // (We could refresh the SocketsHttpHandler, but it's much cleaner to just re-create the ClusterOptions) _fixture.ResetCluster(SmallTimeoutOptions); - GetAnalyticsService(out var service, out var serviceProvider); + GetOperationalInsightsService(out var service, out var serviceProvider); // First, do not replace any IPs, so we can test the normal case var testResolver = new TestDnsEndpointResolver(new CountBasedDnsRefreshStrategy(1), _outputHelper, ipReplacement: IpReplacementStrategy.None); InjectFakeDnsEndpointResolver(serviceProvider, testResolver); @@ -165,7 +165,7 @@ public async Task Test_Requests_Should_Succeed_If_Some_IPs_Are_Unreachable() public async Task Test_Requests_Should_Succeed_If_One_IP_Is_Unreachable() { _fixture.ResetCluster(SmallTimeoutOptions); - GetAnalyticsService(out var service, out var serviceProvider); + GetOperationalInsightsService(out var service, out var serviceProvider); var testResolverMissingOneIP = new TestDnsEndpointResolver(new CountBasedDnsRefreshStrategy(1), _outputHelper, ipReplacement: IpReplacementStrategy.Single); InjectFakeDnsEndpointResolver(serviceProvider, testResolverMissingOneIP); var response = await service.SendAsync("SELECT \"hello\" as greeting", new QueryOptions()); @@ -180,7 +180,7 @@ public async Task Test_Requests_Should_Succeed_If_One_IP_Is_Unreachable() public async Task Test_Requests_Should_Succeed_If_Multiple_IPs_Are_Unreachable() { _fixture.ResetCluster(SmallTimeoutOptions); - GetAnalyticsService(out var service, out var serviceProvider); + GetOperationalInsightsService(out var service, out var serviceProvider); var testResolverMissingMultipleIPs = new TestDnsEndpointResolver(new CountBasedDnsRefreshStrategy(1), _outputHelper, ipReplacement: IpReplacementStrategy.Multiple); InjectFakeDnsEndpointResolver(serviceProvider, testResolverMissingMultipleIPs); var response = await service.SendAsync("SELECT \"hello\" as greeting", new QueryOptions()); @@ -196,9 +196,9 @@ public async Task Test_Requests_Should_Succeed_If_Multiple_IPs_Are_Unreachable() public async Task Test_Requests_Should_Fail_If_All_IPs_Are_Unreachable() { _fixture.ResetCluster(SmallTimeoutOptions); - GetAnalyticsService(out var service, out var serviceProvider); + GetOperationalInsightsService(out var service, out var serviceProvider); var testResolver = new TestDnsEndpointResolver(new CountBasedDnsRefreshStrategy(1), _outputHelper, ipReplacement: IpReplacementStrategy.All); InjectFakeDnsEndpointResolver(serviceProvider, testResolver); - await Assert.ThrowsAsync (() => service.SendAsync("SELECT \"hello\" as greeting", new QueryOptions())); + await Assert.ThrowsAsync (() => service.SendAsync("SELECT \"hello\" as greeting", new QueryOptions())); } } diff --git a/tests/Couchbase.Analytics.FunctionalTests/Internal/AnalyticsServiceTests.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Internal/OperationalInsightsServiceTests.cs similarity index 89% rename from tests/Couchbase.Analytics.FunctionalTests/Internal/AnalyticsServiceTests.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Internal/OperationalInsightsServiceTests.cs index 5e55a59..2561505 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Internal/AnalyticsServiceTests.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Internal/OperationalInsightsServiceTests.cs @@ -1,27 +1,27 @@ using System.Text.Json; -using Couchbase.AnalyticsClient.Exceptions; -using Couchbase.AnalyticsClient.FunctionalTests.Fixtures; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.Exceptions; +using Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; +using Couchbase.OperationalInsightsClient.Options; using DnsClient; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.FunctionalTests.Internal; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Internal; [Collection(SimpleCollection.Name)] -public class AnalyticsServiceTests +public class OperationalInsightsServiceTests { private readonly SimpleFixture _simpleFixture; private readonly ITestOutputHelper _outputHelper; - public AnalyticsServiceTests(SimpleFixture fixture, ITestOutputHelper outputHelper) + public OperationalInsightsServiceTests(SimpleFixture fixture, ITestOutputHelper outputHelper) { _simpleFixture = fixture; _outputHelper = outputHelper; } [Fact] - public async Task TestGetAnalyticsAsync() + public async Task TestGetOperationalInsightsAsync() { var response = await _simpleFixture.Cluster.ExecuteQueryAsync("SELECT 1;", new QueryOptions()); @@ -137,7 +137,7 @@ public async Task Test_Cancellation_Works_Streaming() new QueryOptions() { Timeout = TimeSpan.FromSeconds(10), AsStreaming = true }, cts.Token); - await Assert.ThrowsAsync (async () => await task.ConfigureAwait(false)); + await Assert.ThrowsAsync (async () => await task.ConfigureAwait(false)); } [Fact] @@ -151,7 +151,7 @@ public async Task Test_Cancellation_Works_Blocking() new QueryOptions() { Timeout = TimeSpan.FromSeconds(10), AsStreaming = false }, cts.Token); - await Assert.ThrowsAsync (async () => await task.ConfigureAwait(false)); + await Assert.ThrowsAsync (async () => await task.ConfigureAwait(false)); } [Fact] diff --git a/tests/Couchbase.Analytics.FunctionalTests/JwtAuthenticationTests.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/JwtAuthenticationTests.cs similarity index 87% rename from tests/Couchbase.Analytics.FunctionalTests/JwtAuthenticationTests.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/JwtAuthenticationTests.cs index c51087c..b6a0412 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/JwtAuthenticationTests.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/JwtAuthenticationTests.cs @@ -1,11 +1,11 @@ -using Couchbase.AnalyticsClient.Exceptions; -using Couchbase.AnalyticsClient.FunctionalTests.Fixtures; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.Exceptions; +using Couchbase.OperationalInsightsClient.FunctionalTests.Fixtures; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.FunctionalTests; +namespace Couchbase.OperationalInsightsClient.FunctionalTests; [Collection(JwtCollection.Name)] public class JwtAuthenticationTests @@ -65,7 +65,7 @@ public async Task Test_Query_With_Invalid_Jwt_Fails() invalidCredential, new ClusterOptions()); - await Assert.ThrowsAnyAsync (async () => + await Assert.ThrowsAnyAsync (async () => { await invalidCluster.ExecuteQueryAsync( "SELECT 1 AS value;", diff --git a/tests/Couchbase.Analytics.FunctionalTests/Utils/GreetingResponse.cs b/tests/Couchbase.OperationalInsights.FunctionalTests/Utils/GreetingResponse.cs similarity index 68% rename from tests/Couchbase.Analytics.FunctionalTests/Utils/GreetingResponse.cs rename to tests/Couchbase.OperationalInsights.FunctionalTests/Utils/GreetingResponse.cs index 719ba27..c999057 100644 --- a/tests/Couchbase.Analytics.FunctionalTests/Utils/GreetingResponse.cs +++ b/tests/Couchbase.OperationalInsights.FunctionalTests/Utils/GreetingResponse.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Couchbase.AnalyticsClient.FunctionalTests.Utils; +namespace Couchbase.OperationalInsightsClient.FunctionalTests.Utils; public class GreetingResponse { diff --git a/tests/Couchbase.Analytics.FunctionalTests/settings.json b/tests/Couchbase.OperationalInsights.FunctionalTests/settings.json similarity index 100% rename from tests/Couchbase.Analytics.FunctionalTests/settings.json rename to tests/Couchbase.OperationalInsights.FunctionalTests/settings.json diff --git a/tests/Couchbase.Analytics.FunctionalTests/xunit.runner.json b/tests/Couchbase.OperationalInsights.FunctionalTests/xunit.runner.json similarity index 100% rename from tests/Couchbase.Analytics.FunctionalTests/xunit.runner.json rename to tests/Couchbase.OperationalInsights.FunctionalTests/xunit.runner.json diff --git a/tests/Couchbase.Analytics.UnitTests/Async/QueryHandleTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Async/QueryHandleTests.cs similarity index 84% rename from tests/Couchbase.Analytics.UnitTests/Async/QueryHandleTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Async/QueryHandleTests.cs index ce1ab25..8b0b5c9 100644 --- a/tests/Couchbase.Analytics.UnitTests/Async/QueryHandleTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Async/QueryHandleTests.cs @@ -1,19 +1,19 @@ using System.Text.Json; -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.Internal; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.UnitTests.Helpers; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.Internal; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.UnitTests.Helpers; using Moq; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Async; +namespace Couchbase.OperationalInsightsClient.UnitTests.Async; public class QueryHandleTests { [Fact] public void Constructor_InitializesProperties() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryHandle("test-handle", "test-req", "{}", serviceMock.Object); Assert.Equal("test-handle", handle.Handle); @@ -23,7 +23,7 @@ public void Constructor_InitializesProperties() [Fact] public async Task FetchStatusAsync_DelegatesToService() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryHandle("test-handle", "test-req", "{}", serviceMock.Object); var expectedStatus = TestHandleFactory.CreateQueryStatus("test-req", """{"status":"running"}""", serviceMock.Object); @@ -39,7 +39,7 @@ public async Task FetchStatusAsync_DelegatesToService() [Fact] public async Task CancelAsync_DelegatesToService() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryHandle("test-handle", "test-req", "{}", serviceMock.Object); var options = new CancelOptions(); @@ -54,7 +54,7 @@ public async Task CancelAsync_DelegatesToService() [Fact] public void Constructor_NullArguments_ThrowsArgumentNullException() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); Assert.Throws (() => TestHandleFactory.CreateQueryHandle(null!, "req", "{}", serviceMock.Object)); Assert.Throws (() => TestHandleFactory.CreateQueryHandle("handle", null!, "{}", serviceMock.Object)); @@ -65,7 +65,7 @@ public void Constructor_NullArguments_ThrowsArgumentNullException() [Fact] public async Task FetchStatusAsync_FluentOptions_DelegatesProperly() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryHandle("test-handle", "test-req", "{}", serviceMock.Object); var expectedStatus = TestHandleFactory.CreateQueryStatus("test-req", """{"status":"success","handle":"/result/path"}""", serviceMock.Object); @@ -82,7 +82,7 @@ public async Task FetchStatusAsync_FluentOptions_DelegatesProperly() [Fact] public async Task CancelAsync_FluentOptions_DelegatesProperly() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryHandle("test-handle", "test-req", "{}", serviceMock.Object); serviceMock.Setup(x => x.CancelQueryAsync("test-req", It.IsAny (), It.IsAny ())) diff --git a/tests/Couchbase.Analytics.UnitTests/Async/QueryResultHandleTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Async/QueryResultHandleTests.cs similarity index 83% rename from tests/Couchbase.Analytics.UnitTests/Async/QueryResultHandleTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Async/QueryResultHandleTests.cs index 2f95a11..b24d2b9 100644 --- a/tests/Couchbase.Analytics.UnitTests/Async/QueryResultHandleTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Async/QueryResultHandleTests.cs @@ -1,20 +1,20 @@ using System.Text.Json; -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.Internal; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.Results; -using Couchbase.AnalyticsClient.UnitTests.Helpers; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.Internal; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.Results; +using Couchbase.OperationalInsightsClient.UnitTests.Helpers; using Moq; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Async; +namespace Couchbase.OperationalInsightsClient.UnitTests.Async; public class QueryResultHandleTests { [Fact] public void Constructor_InitializesProperties() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryResultHandle("test-path", "test-req", "{}", serviceMock.Object); Assert.Equal("test-req", handle.RequestId); @@ -23,7 +23,7 @@ public void Constructor_InitializesProperties() [Fact] public async Task FetchResultsAsync_DelegatesToService() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryResultHandle("test-path", "test-req", "{}", serviceMock.Object); var expectedResult = new Mock ().Object; var options = new FetchResultsOptions(); @@ -40,7 +40,7 @@ public async Task FetchResultsAsync_DelegatesToService() [Fact] public async Task DiscardResultsAsync_DelegatesToService() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryResultHandle("test-path", "test-req", "{}", serviceMock.Object); var options = new DiscardResultsOptions(); @@ -55,7 +55,7 @@ public async Task DiscardResultsAsync_DelegatesToService() [Fact] public void Constructor_NullArguments_ThrowsArgumentNullException() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); Assert.Throws (() => TestHandleFactory.CreateQueryResultHandle(null!, "req", "{}", serviceMock.Object)); Assert.Throws (() => TestHandleFactory.CreateQueryResultHandle("path", null!, "{}", serviceMock.Object)); @@ -66,7 +66,7 @@ public void Constructor_NullArguments_ThrowsArgumentNullException() [Fact] public async Task FetchResultsAsync_FluentOptions_DelegatesProperly() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryResultHandle("test-path", "test-req", "{}", serviceMock.Object); var expectedResult = new Mock ().Object; @@ -83,7 +83,7 @@ public async Task FetchResultsAsync_FluentOptions_DelegatesProperly() [Fact] public async Task DiscardResultsAsync_FluentOptions_DelegatesProperly() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var handle = TestHandleFactory.CreateQueryResultHandle("test-path", "test-req", "{}", serviceMock.Object); serviceMock.Setup(x => x.DiscardResultsAsync("test-req", "test-path", It.IsAny (), It.IsAny ())) diff --git a/tests/Couchbase.Analytics.UnitTests/Async/QueryStatusTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Async/QueryStatusTests.cs similarity index 87% rename from tests/Couchbase.Analytics.UnitTests/Async/QueryStatusTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Async/QueryStatusTests.cs index 773bcf1..fe03160 100644 --- a/tests/Couchbase.Analytics.UnitTests/Async/QueryStatusTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Async/QueryStatusTests.cs @@ -1,18 +1,18 @@ using System.Text.Json; -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.Internal; -using Couchbase.AnalyticsClient.UnitTests.Helpers; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.Internal; +using Couchbase.OperationalInsightsClient.UnitTests.Helpers; using Moq; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Async; +namespace Couchbase.OperationalInsightsClient.UnitTests.Async; public class QueryStatusTests { [Fact] public void ResultsReady_WhenSuccess_ReturnsTrue() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = """ { "status": "success", @@ -31,7 +31,7 @@ public void ResultsReady_WhenSuccess_ReturnsTrue() [InlineData("queued")] public void ResultsReady_WhenNotSuccess_ReturnsFalse(string serverStatus) { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = $$"""{"status": "{{serverStatus}}"}"""; var status = TestHandleFactory.CreateQueryStatus("req-1", json, serviceMock.Object); @@ -42,7 +42,7 @@ public void ResultsReady_WhenNotSuccess_ReturnsFalse(string serverStatus) [Fact] public void ResultHandle_WhenReady_ReturnsQueryResultHandle() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = """ { "status": "success", @@ -61,7 +61,7 @@ public void ResultHandle_WhenReady_ReturnsQueryResultHandle() [Fact] public void ResultHandle_WhenNotReady_ThrowsInvalidOperationException() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = """{"status": "running"}"""; var status = TestHandleFactory.CreateQueryStatus("req-1", json, serviceMock.Object); @@ -73,7 +73,7 @@ public void ResultHandle_WhenNotReady_ThrowsInvalidOperationException() [Fact] public void ToString_IncludesAllAvailableFields() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = """ { "status": "success", @@ -110,7 +110,7 @@ public void ToString_IncludesAllAvailableFields() [Fact] public void ToString_WithMetricsOnly_OmitsMissingFields() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = """ { "status": "running", @@ -140,7 +140,7 @@ public void ToString_WithMetricsOnly_OmitsMissingFields() [Fact] public void ToString_MinimalResponse_NoMetrics() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = """{"status": "queued"}"""; var status = TestHandleFactory.CreateQueryStatus("req-1", json, serviceMock.Object); @@ -155,7 +155,7 @@ public void ToString_MinimalResponse_NoMetrics() [Fact] public void ToString_CreatedAtOnly_IncludesTimestamp() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = """ { "status": "running", @@ -172,7 +172,7 @@ public void ToString_CreatedAtOnly_IncludesTimestamp() [Fact] public void Constructor_NullArguments_ThrowsArgumentNullException() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); Assert.Throws (() => TestHandleFactory.CreateQueryStatus(null!, "{}", serviceMock.Object)); Assert.Throws (() => new QueryStatus("req", default(JsonElement), serviceMock.Object)); @@ -182,7 +182,7 @@ public void Constructor_NullArguments_ThrowsArgumentNullException() [Fact] public void InternalProperties_ParsedCorrectly() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = """ { "status": "success", @@ -213,7 +213,7 @@ public void InternalProperties_ParsedCorrectly() [Fact] public void InternalProperties_MissingFields_DefaultGracefully() { - var serviceMock = new Mock (); + var serviceMock = new Mock (); var json = """{"status": "running"}"""; var status = TestHandleFactory.CreateQueryStatus("req-1", json, serviceMock.Object); diff --git a/tests/Couchbase.Analytics.UnitTests/ClusterDisposalTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/ClusterDisposalTests.cs similarity index 87% rename from tests/Couchbase.Analytics.UnitTests/ClusterDisposalTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/ClusterDisposalTests.cs index fd90c11..4d5294a 100644 --- a/tests/Couchbase.Analytics.UnitTests/ClusterDisposalTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/ClusterDisposalTests.cs @@ -1,10 +1,10 @@ -using Couchbase.AnalyticsClient; -using Couchbase.AnalyticsClient.HTTP; +using Couchbase.OperationalInsightsClient; +using Couchbase.OperationalInsightsClient.HTTP; using Microsoft.Extensions.Logging; using Moq; using Xunit; -namespace Couchbase.Analytics.UnitTests; +namespace Couchbase.OperationalInsights.UnitTests; public class ClusterDisposalTests { diff --git a/tests/Couchbase.Analytics.UnitTests/ClusterTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/ClusterTests.cs similarity index 97% rename from tests/Couchbase.Analytics.UnitTests/ClusterTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/ClusterTests.cs index b34f974..8e2047e 100644 --- a/tests/Couchbase.Analytics.UnitTests/ClusterTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/ClusterTests.cs @@ -1,12 +1,12 @@ using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Moq; using Xunit; #nullable enable -namespace Couchbase.AnalyticsClient.UnitTests +namespace Couchbase.OperationalInsightsClient.UnitTests { public class ClusterTest { diff --git a/tests/Couchbase.Analytics.UnitTests/Couchbase.Analytics.UnitTests.csproj b/tests/Couchbase.OperationalInsights.UnitTests/Couchbase.OperationalInsights.UnitTests.csproj similarity index 84% rename from tests/Couchbase.Analytics.UnitTests/Couchbase.Analytics.UnitTests.csproj rename to tests/Couchbase.OperationalInsights.UnitTests/Couchbase.OperationalInsights.UnitTests.csproj index a69b635..bed6fa3 100644 --- a/tests/Couchbase.Analytics.UnitTests/Couchbase.Analytics.UnitTests.csproj +++ b/tests/Couchbase.OperationalInsights.UnitTests/Couchbase.OperationalInsights.UnitTests.csproj @@ -4,13 +4,13 @@ net8.0;net10.0 enable enable -Couchbase.AnalyticsClient.UnitTests +Couchbase.OperationalInsightsClient.UnitTests false true - @@ -31,7 +31,7 @@+ - + PreserveNewest diff --git a/tests/Couchbase.Analytics.UnitTests/HTTP/CredentialTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/HTTP/CredentialTests.cs similarity index 97% rename from tests/Couchbase.Analytics.UnitTests/HTTP/CredentialTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/HTTP/CredentialTests.cs index 6dec555..82fd319 100644 --- a/tests/Couchbase.Analytics.UnitTests/HTTP/CredentialTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/HTTP/CredentialTests.cs @@ -1,7 +1,7 @@ -using Couchbase.AnalyticsClient.HTTP; +using Couchbase.OperationalInsightsClient.HTTP; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.HTTP; +namespace Couchbase.OperationalInsightsClient.UnitTests.HTTP; public class CredentialTests { @@ -193,7 +193,7 @@ private static System.Security.Cryptography.X509Certificates.X509Certificate2 Cr var fullCert = CreateSelfSignedCert(); // Export only the public portion (DER) and reimport — strips the private key var publicBytes = fullCert.Export(System.Security.Cryptography.X509Certificates.X509ContentType.Cert); - return Couchbase.AnalyticsClient.Certificates.CertificateLoader.LoadCertificate(publicBytes); + return Couchbase.OperationalInsightsClient.Certificates.CertificateLoader.LoadCertificate(publicBytes); } [Fact] diff --git a/tests/Couchbase.Analytics.UnitTests/Helpers/TestHandleFactory.cs b/tests/Couchbase.OperationalInsights.UnitTests/Helpers/TestHandleFactory.cs similarity index 70% rename from tests/Couchbase.Analytics.UnitTests/Helpers/TestHandleFactory.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Helpers/TestHandleFactory.cs index 6875f22..8031bec 100644 --- a/tests/Couchbase.Analytics.UnitTests/Helpers/TestHandleFactory.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Helpers/TestHandleFactory.cs @@ -1,8 +1,8 @@ using System.Text.Json; -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.Internal; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.Internal; -namespace Couchbase.AnalyticsClient.UnitTests.Helpers; +namespace Couchbase.OperationalInsightsClient.UnitTests.Helpers; /// /// Convenience factory for creating handle objects from raw JSON strings in tests. @@ -10,19 +10,19 @@ namespace Couchbase.AnalyticsClient.UnitTests.Helpers; /// internal static class TestHandleFactory { - public static QueryHandle CreateQueryHandle(string handle, string requestId, string responseJson, IAnalyticsService service) + public static QueryHandle CreateQueryHandle(string handle, string requestId, string responseJson, IOperationalInsightsService service) { using var doc = JsonDocument.Parse(responseJson); return new QueryHandle(handle, requestId, doc.RootElement.Clone(), service); } - public static QueryResultHandle CreateQueryResultHandle(string handlePath, string requestId, string responseJson, IAnalyticsService service) + public static QueryResultHandle CreateQueryResultHandle(string handlePath, string requestId, string responseJson, IOperationalInsightsService service) { using var doc = JsonDocument.Parse(responseJson); return new QueryResultHandle(handlePath, requestId, doc.RootElement.Clone(), service); } - public static QueryStatus CreateQueryStatus(string requestId, string responseJson, IAnalyticsService service) + public static QueryStatus CreateQueryStatus(string requestId, string responseJson, IOperationalInsightsService service) { using var doc = JsonDocument.Parse(responseJson); return new QueryStatus(requestId, doc.RootElement.Clone(), service); diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/BlockingAnalyticsResultTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/BlockingOperationalInsightsResultTests.cs similarity index 68% rename from tests/Couchbase.Analytics.UnitTests/Internal/BlockingAnalyticsResultTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/BlockingOperationalInsightsResultTests.cs index b498f43..29b9577 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/BlockingAnalyticsResultTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/BlockingOperationalInsightsResultTests.cs @@ -1,18 +1,18 @@ -using Couchbase.AnalyticsClient.Internal.Results; +using Couchbase.OperationalInsightsClient.Internal.Results; using Couchbase.Core.Json; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Internal; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal; -public class BlockingAnalyticsResultTest +public class BlockingOperationalInsightsResultTest { [Fact] public async Task InitializeAsync_ShouldReadResponseStream() { // Arrange - var json = File.ReadAllBytes("JsonDocuments/analyticsResponse.json"); + var json = File.ReadAllBytes("JsonDocuments/insightsResponse.json"); var stream = new MemoryStream(json); - var result = new BlockingAnalyticsResult(stream, new StjJsonDeserializer()); + var result = new BlockingOperationalInsightsResult(stream, new StjJsonDeserializer()); // Act await result.InitializeAsync(); @@ -27,7 +27,7 @@ public async Task Error_23000_ShouldHaveErrorMessageAndCode() // Arrange var json = File.ReadAllBytes("JsonDocuments/error-23000-response.json"); var stream = new MemoryStream(json); - var result = new BlockingAnalyticsResult(stream, new StjJsonDeserializer()); + var result = new BlockingOperationalInsightsResult(stream, new StjJsonDeserializer()); // Act await result.InitializeAsync(); @@ -35,7 +35,7 @@ public async Task Error_23000_ShouldHaveErrorMessageAndCode() // Assert Assert.Single(result.Errors); var error = result.Errors[0]; - Assert.Equal("Enterprise Analytics is temporarily unavailable", error.Message); + Assert.Equal("Enterprise OperationalInsights is temporarily unavailable", error.Message); Assert.Equal(23000, error.Code); Assert.True(error.Retriable); } @@ -45,7 +45,7 @@ public async Task GetAsyncEnumerator_ShouldThrowNotImplementedException() { // Arrange var stream = new MemoryStream(); - var result = new BlockingAnalyticsResult(stream, new StjJsonDeserializer()); + var result = new BlockingOperationalInsightsResult(stream, new StjJsonDeserializer()); // Act & Assert await Assert.ThrowsAsync(async () => await result.GetAsyncEnumerator().MoveNextAsync().ConfigureAwait(false)); @@ -58,7 +58,7 @@ public void Constructor_ShouldInitializeProperties() var stream = new MemoryStream(); // Act - var result = new BlockingAnalyticsResult(stream, new StjJsonDeserializer()); + var result = new BlockingOperationalInsightsResult(stream, new StjJsonDeserializer()); // Assert Assert.NotNull(result); @@ -68,9 +68,9 @@ public void Constructor_ShouldInitializeProperties() public async Task EnumerateRows_SecondEnumeration_ThrowsInvalidOperationException() { // Arrange - var json = File.ReadAllBytes("JsonDocuments/analyticsResponse.json"); + var json = File.ReadAllBytes("JsonDocuments/insightsResponse.json"); var stream = new MemoryStream(json); - var result = new BlockingAnalyticsResult(stream, new StjJsonDeserializer()); + var result = new BlockingOperationalInsightsResult(stream, new StjJsonDeserializer()); await result.InitializeAsync(CancellationToken.None); // Act — first enumeration should succeed diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/ClusterOptionTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/ClusterOptionTests.cs similarity index 92% rename from tests/Couchbase.Analytics.UnitTests/Internal/ClusterOptionTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/ClusterOptionTests.cs index 4faaa89..8a5c1b4 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/ClusterOptionTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/ClusterOptionTests.cs @@ -1,10 +1,10 @@ using System.Security.Cryptography.X509Certificates; -using Couchbase.AnalyticsClient.Certificates; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.Certificates; +using Couchbase.OperationalInsightsClient.Options; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.UnitTests.Internal; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal; public class ClusterOptionTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/ClusterRetryTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/ClusterRetryTests.cs similarity index 96% rename from tests/Couchbase.Analytics.UnitTests/Internal/ClusterRetryTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/ClusterRetryTests.cs index 0de9710..0d4e89a 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/ClusterRetryTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/ClusterRetryTests.cs @@ -1,12 +1,12 @@ using System.Net; using System.Text; using System.Text.Json; -using Couchbase.AnalyticsClient.DI; -using Couchbase.AnalyticsClient.Exceptions; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal.HTTP; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.Query; +using Couchbase.OperationalInsightsClient.DI; +using Couchbase.OperationalInsightsClient.Exceptions; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.Query; using Couchbase.Core.Json; using Microsoft.Extensions.Logging; using Moq; @@ -14,7 +14,7 @@ using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.UnitTests.Internal; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal; public class ClusterRetryTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/ConnectionStringTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/ConnectionStringTests.cs similarity index 98% rename from tests/Couchbase.Analytics.UnitTests/Internal/ConnectionStringTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/ConnectionStringTests.cs index 72fc9c4..dae6838 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/ConnectionStringTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/ConnectionStringTests.cs @@ -1,10 +1,10 @@ using System.Security.Authentication; -using Couchbase.AnalyticsClient.Certificates; -using Couchbase.AnalyticsClient.Internal; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.Certificates; +using Couchbase.OperationalInsightsClient.Internal; +using Couchbase.OperationalInsightsClient.Options; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Internal +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal { public class ConnectionStringTest { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/DI/ConstructorSelectorTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/ConstructorSelectorTests.cs similarity index 95% rename from tests/Couchbase.Analytics.UnitTests/Internal/DI/ConstructorSelectorTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/ConstructorSelectorTests.cs index 50f484b..8bc8fa8 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/DI/ConstructorSelectorTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/ConstructorSelectorTests.cs @@ -1,8 +1,8 @@ -using Couchbase.AnalyticsClient.Internal.DI; +using Couchbase.OperationalInsightsClient.Internal.DI; using Microsoft.Extensions.DependencyInjection; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Internal.DI +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal.DI { public class ConstructorSelectorTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/DI/CouchbaseServiceProviderTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/CouchbaseServiceProviderTests.cs similarity index 96% rename from tests/Couchbase.Analytics.UnitTests/Internal/DI/CouchbaseServiceProviderTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/CouchbaseServiceProviderTests.cs index 2819401..b59f790 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/DI/CouchbaseServiceProviderTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/CouchbaseServiceProviderTests.cs @@ -1,8 +1,8 @@ -using Couchbase.AnalyticsClient.Internal.DI; +using Couchbase.OperationalInsightsClient.Internal.DI; using Moq; using Xunit; -namespace Couchbase.Analytics.UnitTests.Internal.DI; +namespace Couchbase.OperationalInsights.UnitTests.Internal.DI; public class CouchbaseServiceProviderTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/DI/SingletonGenericServiceFactoryTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/SingletonGenericServiceFactoryTests.cs similarity index 93% rename from tests/Couchbase.Analytics.UnitTests/Internal/DI/SingletonGenericServiceFactoryTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/SingletonGenericServiceFactoryTests.cs index ec6b150..e926f76 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/DI/SingletonGenericServiceFactoryTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/SingletonGenericServiceFactoryTests.cs @@ -1,8 +1,8 @@ -using Couchbase.AnalyticsClient.Internal.DI; +using Couchbase.OperationalInsightsClient.Internal.DI; using Moq; using Xunit; -namespace Couchbase.Analytics.UnitTests.Internal.DI; +namespace Couchbase.OperationalInsights.UnitTests.Internal.DI; public interface IFakeGenericService : IDisposable { } diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/DI/SingletonServiceFactoryTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/SingletonServiceFactoryTests.cs similarity index 78% rename from tests/Couchbase.Analytics.UnitTests/Internal/DI/SingletonServiceFactoryTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/SingletonServiceFactoryTests.cs index 8688a13..a53640a 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/DI/SingletonServiceFactoryTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/SingletonServiceFactoryTests.cs @@ -1,8 +1,8 @@ -using Couchbase.AnalyticsClient.Internal.DI; +using Couchbase.OperationalInsightsClient.Internal.DI; using Moq; using Xunit; -namespace Couchbase.Analytics.UnitTests.Internal.DI; +namespace Couchbase.OperationalInsights.UnitTests.Internal.DI; public class SingletonServiceFactoryTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/DI/TransientServiceFactoryTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/TransientServiceFactoryTests.cs similarity index 89% rename from tests/Couchbase.Analytics.UnitTests/Internal/DI/TransientServiceFactoryTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/TransientServiceFactoryTests.cs index 24c75a6..09d1858 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/DI/TransientServiceFactoryTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DI/TransientServiceFactoryTests.cs @@ -1,8 +1,8 @@ -using Couchbase.AnalyticsClient.Internal.DI; +using Couchbase.OperationalInsightsClient.Internal.DI; using Moq; using Xunit; -namespace Couchbase.Analytics.UnitTests.Internal.DI; +namespace Couchbase.OperationalInsights.UnitTests.Internal.DI; public class TransientServiceFactoryTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/DnsUtil/ConnectCallbackRoundRobinTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DnsUtil/ConnectCallbackRoundRobinTests.cs similarity index 90% rename from tests/Couchbase.Analytics.UnitTests/Internal/DnsUtil/ConnectCallbackRoundRobinTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/DnsUtil/ConnectCallbackRoundRobinTests.cs index a4ed555..f30066a 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/DnsUtil/ConnectCallbackRoundRobinTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DnsUtil/ConnectCallbackRoundRobinTests.cs @@ -1,17 +1,17 @@ using System.Net; using System.Reflection; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal.DnsUtil; -using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; -using Couchbase.AnalyticsClient.Internal.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; +using Couchbase.OperationalInsightsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Microsoft.Extensions.Logging; using Moq; using Xunit; using Xunit.Abstractions; using Xunit.Sdk; -namespace Couchbase.AnalyticsClient.UnitTests.Internal.DnsUtil; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal.DnsUtil; public class ConnectCallbackRoundRobinTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/DnsUtil/EndpointConnectionManagerTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DnsUtil/EndpointConnectionManagerTests.cs similarity index 81% rename from tests/Couchbase.Analytics.UnitTests/Internal/DnsUtil/EndpointConnectionManagerTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/DnsUtil/EndpointConnectionManagerTests.cs index 1565d61..85c07c3 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/DnsUtil/EndpointConnectionManagerTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DnsUtil/EndpointConnectionManagerTests.cs @@ -1,10 +1,10 @@ using System.Net; -using Couchbase.AnalyticsClient.Internal.DnsUtil; -using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.UnitTests.Internal.DnsUtil; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal.DnsUtil; public class EndpointConnectionManagerTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/DnsUtil/EndpointSelectionStrategyTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DnsUtil/EndpointSelectionStrategyTests.cs similarity index 95% rename from tests/Couchbase.Analytics.UnitTests/Internal/DnsUtil/EndpointSelectionStrategyTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/DnsUtil/EndpointSelectionStrategyTests.cs index 7c96cfd..decbe14 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/DnsUtil/EndpointSelectionStrategyTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/DnsUtil/EndpointSelectionStrategyTests.cs @@ -1,9 +1,9 @@ using System.Net; -using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies; +using Couchbase.OperationalInsightsClient.Internal.DnsUtil.Strategies; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.UnitTests.Internal.DnsUtil; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal.DnsUtil; public class EndpointSelectionStrategyTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/ExecuteQueryTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/ExecuteQueryTests.cs similarity index 88% rename from tests/Couchbase.Analytics.UnitTests/Internal/ExecuteQueryTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/ExecuteQueryTests.cs index 3308c56..15230dd 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/ExecuteQueryTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/ExecuteQueryTests.cs @@ -1,15 +1,15 @@ -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.DI; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.Query; -using Couchbase.AnalyticsClient.Results; -using Couchbase.AnalyticsClient.UnitTests.Helpers; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.DI; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.Query; +using Couchbase.OperationalInsightsClient.Results; +using Couchbase.OperationalInsightsClient.UnitTests.Helpers; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.UnitTests.Internal; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal; public class ExecuteQueryTests { @@ -23,7 +23,7 @@ public ExecuteQueryTests(ITestOutputHelper outputHelper) // Shim used for this test private sealed class FakeQueryResult : IQueryResult { - public IAsyncEnumerable Rows => this; + public IAsyncEnumerable Rows => this; public QueryMetaData MetaData { get; } = new(); @@ -37,14 +37,14 @@ public void Dispose() public ValueTask DisposeAsync() => ValueTask.CompletedTask; - public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { throw new NotImplementedException(); } } // Fake service that captures the last QueryOptions it received so we can inspect them in this test - private sealed class FakeAnalyticsService : IAnalyticsService + private sealed class FakeOperationalInsightsService : IOperationalInsightsService { public Uri Uri { get; } = new Uri("http://localhost"); @@ -102,13 +102,13 @@ private static string FormatStartOptions(StartQueryOptions o) [Fact] public async Task ExecuteQuery_WithFunc_AppliesOptions_OnCluster() { - var fakeService = new FakeAnalyticsService(); + var fakeService = new FakeOperationalInsightsService(); var cluster = Cluster.Create( "http://localhost:18095", Credential.Create("user", "pass"), opts => opts - .AddClusterService (fakeService) + .AddClusterService (fakeService) ); QueryOptions? before = null; @@ -153,12 +153,12 @@ public async Task ExecuteQuery_WithFunc_AppliesOptions_OnCluster() [Fact] public async Task ExecuteQuery_WithFunc_AppliesOptions_OnScope_AndPreservesQueryContext() { - var fakeService = new FakeAnalyticsService(); + var fakeService = new FakeOperationalInsightsService(); var cluster = Cluster.Create( "http://localhost:18095", Credential.Create("user", "pass"), - opts => opts.AddClusterService (fakeService) + opts => opts.AddClusterService (fakeService) ); var scope = cluster.Database("db1").Scope("sc1"); @@ -194,13 +194,13 @@ public async Task ExecuteQuery_WithFunc_AppliesOptions_OnScope_AndPreservesQuery [Fact] public async Task StartQueryAsync_WithFunc_AppliesOptions_OnCluster() { - var fakeService = new FakeAnalyticsService(); + var fakeService = new FakeOperationalInsightsService(); var cluster = Cluster.Create( "http://localhost:18095", Credential.Create("user", "pass"), opts => opts - .AddClusterService (fakeService) + .AddClusterService (fakeService) ); StartQueryOptions? before = null; @@ -243,12 +243,12 @@ public async Task StartQueryAsync_WithFunc_AppliesOptions_OnCluster() [Fact] public async Task StartQueryAsync_WithFunc_AppliesOptions_OnScope_AndPreservesQueryContext() { - var fakeService = new FakeAnalyticsService(); + var fakeService = new FakeOperationalInsightsService(); var cluster = Cluster.Create( "http://localhost:18095", Credential.Create("user", "pass"), - opts => opts.AddClusterService (fakeService) + opts => opts.AddClusterService (fakeService) ); var scope = cluster.Database("db1").Scope("sc1"); @@ -282,13 +282,13 @@ public async Task StartQueryAsync_WithFunc_AppliesOptions_OnScope_AndPreservesQu [Fact] public async Task StartQueryAsync_WithOptionsObject_AppliesOptions_OnCluster() { - var fakeService = new FakeAnalyticsService(); + var fakeService = new FakeOperationalInsightsService(); var cluster = Cluster.Create( "http://localhost:18095", Credential.Create("user", "pass"), opts => opts - .AddClusterService (fakeService) + .AddClusterService (fakeService) ); var options = new StartQueryOptions() @@ -322,12 +322,12 @@ public async Task StartQueryAsync_WithOptionsObject_AppliesOptions_OnCluster() [Fact] public async Task StartQueryAsync_WithOptionsObject_AppliesOptions_OnScope_AndPreservesQueryContext() { - var fakeService = new FakeAnalyticsService(); + var fakeService = new FakeOperationalInsightsService(); var cluster = Cluster.Create( "http://localhost:18095", Credential.Create("user", "pass"), - opts => opts.AddClusterService (fakeService) + opts => opts.AddClusterService (fakeService) ); var scope = cluster.Database("db1").Scope("sc1"); diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/HTTP/AuthenticationHandlerTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/HTTP/AuthenticationHandlerTests.cs similarity index 96% rename from tests/Couchbase.Analytics.UnitTests/Internal/HTTP/AuthenticationHandlerTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/HTTP/AuthenticationHandlerTests.cs index 9ae0d2f..ad0f841 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/HTTP/AuthenticationHandlerTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/HTTP/AuthenticationHandlerTests.cs @@ -1,9 +1,9 @@ using System.Net; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal.HTTP; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Internal.HTTP; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal.HTTP; public class AuthenticationHandlerTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/HTTP/CouchbaseHttpClientFactoryTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/HTTP/CouchbaseHttpClientFactoryTests.cs similarity index 83% rename from tests/Couchbase.Analytics.UnitTests/Internal/HTTP/CouchbaseHttpClientFactoryTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/HTTP/CouchbaseHttpClientFactoryTests.cs index 717a4db..dffd111 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/HTTP/CouchbaseHttpClientFactoryTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/HTTP/CouchbaseHttpClientFactoryTests.cs @@ -1,10 +1,10 @@ -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Microsoft.Extensions.Logging.Abstractions; using Xunit; -namespace Couchbase.Analytics.UnitTests.Internal.HTTP; +namespace Couchbase.OperationalInsights.UnitTests.Internal.HTTP; public class CouchbaseHttpClientFactoryTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/HTTP/AnalyticsHttpClientFactoryTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/HTTP/OperationalInsightsHttpClientFactoryTests.cs similarity index 97% rename from tests/Couchbase.Analytics.UnitTests/Internal/HTTP/AnalyticsHttpClientFactoryTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/HTTP/OperationalInsightsHttpClientFactoryTests.cs index c834884..1246c72 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/HTTP/AnalyticsHttpClientFactoryTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/HTTP/OperationalInsightsHttpClientFactoryTests.cs @@ -1,12 +1,12 @@ using System.Security.Authentication; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal.HTTP; -using Couchbase.AnalyticsClient.Options; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.Options; using Microsoft.Extensions.Logging; using Moq; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Internal.HTTP; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal.HTTP; public class CouchbaseHttpClientFactoryTest { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/AnalyticsServiceTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/OperationalInsightsServiceTests.cs similarity index 84% rename from tests/Couchbase.Analytics.UnitTests/Internal/AnalyticsServiceTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/OperationalInsightsServiceTests.cs index de13562..c64cd4f 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/AnalyticsServiceTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/OperationalInsightsServiceTests.cs @@ -1,13 +1,13 @@ using System.Net; using System.Text; -using Couchbase.AnalyticsClient.Async; -using Couchbase.AnalyticsClient.Exceptions; -using Couchbase.AnalyticsClient.Internal; -using Couchbase.AnalyticsClient.Internal.HTTP; -using Couchbase.AnalyticsClient.Internal.Results; -using Couchbase.AnalyticsClient.Logging; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.UnitTests.Helpers; +using Couchbase.OperationalInsightsClient.Async; +using Couchbase.OperationalInsightsClient.Exceptions; +using Couchbase.OperationalInsightsClient.Internal; +using Couchbase.OperationalInsightsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.Internal.Results; +using Couchbase.OperationalInsightsClient.Logging; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.UnitTests.Helpers; using Couchbase.Core.Json; using Microsoft.Extensions.Logging; using Moq; @@ -15,22 +15,22 @@ using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.UnitTests.Internal; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal; -public class AnalyticsServiceTests +public class OperationalInsightsServiceTests { private readonly ITestOutputHelper _outputHelper; private readonly Mock _httpClientFactoryMock; - private readonly Mock > _loggerMock; + private readonly Mock > _loggerMock; private readonly Mock _jsonSerializerMock; private readonly Uri _endPoint; private readonly ClusterOptions _clusterOptions; - public AnalyticsServiceTests(ITestOutputHelper outputHelper) + public OperationalInsightsServiceTests(ITestOutputHelper outputHelper) { _outputHelper = outputHelper; _httpClientFactoryMock = new Mock (); - _loggerMock = new Mock >(); + _loggerMock = new Mock >(); _jsonSerializerMock = new Mock (); _jsonSerializerMock.Setup(x => x.CreateJsonStreamReader(It.IsAny (), It.IsAny ())) @@ -43,7 +43,7 @@ public AnalyticsServiceTests(ITestOutputHelper outputHelper) public void Constructor_InitializesCorrectly() { // Arrange & Act - var service = new AnalyticsService( + var service = new OperationalInsightsService( _clusterOptions, _httpClientFactoryMock.Object, _loggerMock.Object, @@ -59,7 +59,7 @@ public void Constructor_InitializesCorrectly() } [Fact] - public async Task SendAsync_ValidQuery_ReturnsBlockingAnalyticsResult() + public async Task SendAsync_ValidQuery_ReturnsBlockingOperationalInsightsResult() { // Arrange var responseContent = new StringContent("{}", Encoding.UTF8, "application/json"); @@ -76,7 +76,7 @@ public async Task SendAsync_ValidQuery_ReturnsBlockingAnalyticsResult() var httpClient = new HttpClient(httpClientMock.Object); _httpClientFactoryMock.Setup(f => f.Create()).Returns(httpClient); - var service = new AnalyticsService( + var service = new OperationalInsightsService( _clusterOptions, _httpClientFactoryMock.Object, _loggerMock.Object, @@ -88,7 +88,7 @@ public async Task SendAsync_ValidQuery_ReturnsBlockingAnalyticsResult() var result = await service.SendAsync("SELECT * FROM `bucket`", queryOptions); // Assert - Assert.IsType (result); + Assert.IsType (result); _httpClientFactoryMock.Verify(f => f.Create(), Times.Once); } @@ -100,7 +100,7 @@ public async Task SendAsync_WithPriority_AddsPriorityHeader() var responseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = responseContent }; var requestMessage = new HttpRequestMessage(HttpMethod.Post, "http://localhost/api/v1/request"); - requestMessage.Headers.Add("Analytics-Priority", "true"); + requestMessage.Headers.Add("OperationalInsights-Priority", "true"); var httpClientMock = new Mock (); httpClientMock @@ -113,7 +113,7 @@ public async Task SendAsync_WithPriority_AddsPriorityHeader() var httpClient = new HttpClient(httpClientMock.Object); _httpClientFactoryMock.Setup(f => f.Create()).Returns(httpClient); - var service = new AnalyticsService( + var service = new OperationalInsightsService( _clusterOptions, _httpClientFactoryMock.Object, _loggerMock.Object, @@ -125,11 +125,11 @@ public async Task SendAsync_WithPriority_AddsPriorityHeader() var result = await service.SendAsync("SELECT * FROM `bucket`", queryOptions); // Assert - Assert.IsType (result); + Assert.IsType (result); } [Fact] - public async Task SendAsync_WithStreaming_ReturnsStreamingAnalyticsResult() + public async Task SendAsync_WithStreaming_ReturnsStreamingOperationalInsightsResult() { // Arrange var httpClientMock = new Mock (); @@ -146,7 +146,7 @@ public async Task SendAsync_WithStreaming_ReturnsStreamingAnalyticsResult() ItExpr.IsAny ()) .ReturnsAsync(responseMessage); - var service = new AnalyticsService( + var service = new OperationalInsightsService( _clusterOptions, _httpClientFactoryMock.Object, _loggerMock.Object, @@ -158,7 +158,7 @@ public async Task SendAsync_WithStreaming_ReturnsStreamingAnalyticsResult() var result = await service.SendAsync("SELECT * FROM `bucket`", queryOptions); // Assert - Assert.IsType (result); + Assert.IsType (result); _httpClientFactoryMock.Verify(f => f.Create(), Times.Once); } @@ -176,7 +176,7 @@ public async Task FetchStatusAsync_When404_ThrowsQueryNotFoundException() var httpClient = new HttpClient(httpClientMock.Object); _httpClientFactoryMock.Setup(f => f.Create()).Returns(httpClient); - var service = new AnalyticsService( + var service = new OperationalInsightsService( _clusterOptions, _httpClientFactoryMock.Object, _loggerMock.Object, @@ -203,7 +203,7 @@ public async Task FetchResultsAsync_When404_ThrowsQueryNotFoundException() var httpClient = new HttpClient(httpClientMock.Object); _httpClientFactoryMock.Setup(f => f.Create()).Returns(httpClient); - var service = new AnalyticsService( + var service = new OperationalInsightsService( _clusterOptions, _httpClientFactoryMock.Object, _loggerMock.Object, @@ -228,7 +228,7 @@ public async Task DiscardResultsAsync_When404_CompletesSuccessfully() var httpClient = new HttpClient(httpClientMock.Object); _httpClientFactoryMock.Setup(f => f.Create()).Returns(httpClient); - var service = new AnalyticsService( + var service = new OperationalInsightsService( _clusterOptions, _httpClientFactoryMock.Object, _loggerMock.Object, @@ -255,7 +255,7 @@ public async Task CancelQueryAsync_When404_CompletesSuccessfully() var httpClient = new HttpClient(httpClientMock.Object); _httpClientFactoryMock.Setup(f => f.Create()).Returns(httpClient); - var service = new AnalyticsService( + var service = new OperationalInsightsService( _clusterOptions, _httpClientFactoryMock.Object, _loggerMock.Object, diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/QueryContextTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/QueryContextTests.cs similarity index 94% rename from tests/Couchbase.Analytics.UnitTests/Internal/QueryContextTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/QueryContextTests.cs index f45ccda..7d6f752 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/QueryContextTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/QueryContextTests.cs @@ -1,17 +1,17 @@ using System.Net; using System.Text; -using Couchbase.AnalyticsClient.DI; -using Couchbase.AnalyticsClient.HTTP; -using Couchbase.AnalyticsClient.Internal.HTTP; -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.Query; +using Couchbase.OperationalInsightsClient.DI; +using Couchbase.OperationalInsightsClient.HTTP; +using Couchbase.OperationalInsightsClient.Internal.HTTP; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.Query; using Couchbase.Core.Json; using Microsoft.Extensions.Logging; using Moq; using Moq.Protected; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Internal; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal; public class QueryContextTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/QueryOptionTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/QueryOptionTests.cs similarity index 97% rename from tests/Couchbase.Analytics.UnitTests/Internal/QueryOptionTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/QueryOptionTests.cs index 0456e04..94c5dfc 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/QueryOptionTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/QueryOptionTests.cs @@ -1,9 +1,9 @@ -using Couchbase.AnalyticsClient.Options; -using Couchbase.AnalyticsClient.Query; +using Couchbase.OperationalInsightsClient.Options; +using Couchbase.OperationalInsightsClient.Query; using Couchbase.Core.Json; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Internal; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal; public class QueryOptionTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/RetryUtilsTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/RetryUtilsTests.cs similarity index 97% rename from tests/Couchbase.Analytics.UnitTests/Internal/RetryUtilsTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/RetryUtilsTests.cs index 39c218a..985d916 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/RetryUtilsTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/RetryUtilsTests.cs @@ -1,8 +1,8 @@ -using Couchbase.AnalyticsClient.Internal.Retry; +using Couchbase.OperationalInsightsClient.Internal.Retry; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.UnitTests.Internal; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal; public class RetryUtilsTests { diff --git a/tests/Couchbase.Analytics.UnitTests/Internal/StreamingAnalyticsResultTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Internal/StreamingOperationalInsightsResultTests.cs similarity index 60% rename from tests/Couchbase.Analytics.UnitTests/Internal/StreamingAnalyticsResultTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Internal/StreamingOperationalInsightsResultTests.cs index e1ee4f4..19b7226 100644 --- a/tests/Couchbase.Analytics.UnitTests/Internal/StreamingAnalyticsResultTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Internal/StreamingOperationalInsightsResultTests.cs @@ -1,31 +1,31 @@ using System.Text.Json; -using Couchbase.AnalyticsClient.Internal.Results; +using Couchbase.OperationalInsightsClient.Internal.Results; using Couchbase.Core.Json; using Moq; using Xunit; using Xunit.Abstractions; -namespace Couchbase.AnalyticsClient.UnitTests.Internal; +namespace Couchbase.OperationalInsightsClient.UnitTests.Internal; -public class StreamingAnalyticsResultTests +public class StreamingOperationalInsightsResultTests { private readonly ITestOutputHelper _output; - public StreamingAnalyticsResultTests(ITestOutputHelper output) + public StreamingOperationalInsightsResultTests(ITestOutputHelper output) { _output = output; } [Fact] - public async Task StreamingAnalyticsResult_DeserializesCorrectly() + public async Task StreamingOperationalInsightsResult_DeserializesCorrectly() { - var json = File.ReadAllBytes("JsonDocuments/analyticsResponse.json"); + var json = File.ReadAllBytes("JsonDocuments/insightsResponse.json"); var stream = new MemoryStream(json); - var analyticsResult = new StreamingAnalyticsResult(stream, new StjJsonDeserializer(), new Mock ().Object); - await analyticsResult.InitializeAsync(CancellationToken.None); + var insightsResult = new StreamingOperationalInsightsResult(stream, new StjJsonDeserializer(), new Mock ().Object); + await insightsResult.InitializeAsync(CancellationToken.None); - var airlines = await analyticsResult.ToListAsync(CancellationToken.None); + var airlines = await insightsResult.ToListAsync(CancellationToken.None); Assert.NotNull(airlines); Assert.NotEmpty(airlines); } @@ -59,7 +59,7 @@ public void Constructor_InitializesCorrectly() var mockDisposable = new Mock (); // Act - var result = new StreamingAnalyticsResult(mockStream, mockDisposable.Object); + var result = new StreamingOperationalInsightsResult(mockStream, mockDisposable.Object); // Assert Assert.NotNull(result); @@ -74,7 +74,7 @@ public async Task InitializeAsync_CompletesSuccessfully() mockSerializer.Setup(x => x.CreateJsonStreamReader(It.IsAny (), It.IsAny ())) .Returns(new Mock ().Object); - var result = new StreamingAnalyticsResult(mockStream, mockSerializer.Object); + var result = new StreamingOperationalInsightsResult(mockStream, mockSerializer.Object); // Act await result.InitializeAsync(); @@ -87,9 +87,9 @@ public async Task InitializeAsync_CompletesSuccessfully() public async Task EnumerateRows_SecondEnumeration_ThrowsInvalidOperationException() { // Arrange - var json = File.ReadAllBytes("JsonDocuments/analyticsResponse.json"); + var json = File.ReadAllBytes("JsonDocuments/insightsResponse.json"); var stream = new MemoryStream(json); - var result = new StreamingAnalyticsResult(stream, new StjJsonDeserializer()); + var result = new StreamingOperationalInsightsResult(stream, new StjJsonDeserializer()); await result.InitializeAsync(CancellationToken.None); // Act — first enumeration should succeed @@ -109,7 +109,7 @@ public async Task DisposeAsync_DisposesOwnedResources() // Arrange var stream = new MemoryStream(); var ownedResource = new Mock (); - var result = new StreamingAnalyticsResult(stream, new StjJsonDeserializer(), ownedResource.Object); + var result = new StreamingOperationalInsightsResult(stream, new StjJsonDeserializer(), ownedResource.Object); // Act await result.DisposeAsync(); @@ -125,7 +125,7 @@ public async Task DisposeAsync_CalledTwice_DisposesOnlyOnce() // Arrange var stream = new MemoryStream(); var ownedResource = new Mock (); - var result = new StreamingAnalyticsResult(stream, new StjJsonDeserializer(), ownedResource.Object); + var result = new StreamingOperationalInsightsResult(stream, new StjJsonDeserializer(), ownedResource.Object); // Act await result.DisposeAsync(); @@ -136,34 +136,34 @@ public async Task DisposeAsync_CalledTwice_DisposesOnlyOnce() } [Fact] - public async Task StreamingAnalyticsResult_DdlResponse_NoResultsArray_InitializesSuccessfully() + public async Task StreamingOperationalInsightsResult_DdlResponse_NoResultsArray_InitializesSuccessfully() { // Arrange - DDL responses (CREATE DATABASE, DROP SCOPE, etc.) don't have a "results" array var json = File.ReadAllBytes("JsonDocuments/ddlResponse.json"); var stream = new MemoryStream(json); - var analyticsResult = new StreamingAnalyticsResult(stream, new StjJsonDeserializer()); + var insightsResult = new StreamingOperationalInsightsResult(stream, new StjJsonDeserializer()); // Act - await analyticsResult.InitializeAsync(CancellationToken.None); + await insightsResult.InitializeAsync(CancellationToken.None); // Assert - should initialize without throwing - Assert.NotNull(analyticsResult.MetaData); - Assert.Equal("8c090478-269b-4051-b660-c2a5ae2c4aaa", analyticsResult.MetaData.RequestId); + Assert.NotNull(insightsResult.MetaData); + Assert.Equal("8c090478-269b-4051-b660-c2a5ae2c4aaa", insightsResult.MetaData.RequestId); } [Fact] - public async Task StreamingAnalyticsResult_DdlResponse_EnumerationReturnsEmpty() + public async Task StreamingOperationalInsightsResult_DdlResponse_EnumerationReturnsEmpty() { // Arrange - DDL responses have no results to enumerate var json = File.ReadAllBytes("JsonDocuments/ddlResponse.json"); var stream = new MemoryStream(json); - var analyticsResult = new StreamingAnalyticsResult(stream, new StjJsonDeserializer()); - await analyticsResult.InitializeAsync(CancellationToken.None); + var insightsResult = new StreamingOperationalInsightsResult(stream, new StjJsonDeserializer()); + await insightsResult.InitializeAsync(CancellationToken.None); // Act - var rows = await analyticsResult.ToListAsync(CancellationToken.None); + var rows = await insightsResult.ToListAsync(CancellationToken.None); // Assert - should return empty list, not throw Assert.NotNull(rows); @@ -171,20 +171,20 @@ public async Task StreamingAnalyticsResult_DdlResponse_EnumerationReturnsEmpty() } [Fact] - public async Task StreamingAnalyticsResult_DdlResponse_MetricsAvailable() + public async Task StreamingOperationalInsightsResult_DdlResponse_MetricsAvailable() { // Arrange var json = File.ReadAllBytes("JsonDocuments/ddlResponse.json"); var stream = new MemoryStream(json); - var analyticsResult = new StreamingAnalyticsResult(stream, new StjJsonDeserializer()); - await analyticsResult.InitializeAsync(CancellationToken.None); + var insightsResult = new StreamingOperationalInsightsResult(stream, new StjJsonDeserializer()); + await insightsResult.InitializeAsync(CancellationToken.None); // Act - enumerate to completion (empty) - await analyticsResult.ToListAsync(CancellationToken.None); + await insightsResult.ToListAsync(CancellationToken.None); // Assert - metrics should still be available - Assert.NotNull(analyticsResult.MetaData.Metrics); - Assert.Equal(0, analyticsResult.MetaData.Metrics.ResultCount); + Assert.NotNull(insightsResult.MetaData.Metrics); + Assert.Equal(0, insightsResult.MetaData.Metrics.ResultCount); } } diff --git a/tests/Couchbase.Analytics.UnitTests/JsonDocuments/ddlResponse.json b/tests/Couchbase.OperationalInsights.UnitTests/JsonDocuments/ddlResponse.json similarity index 100% rename from tests/Couchbase.Analytics.UnitTests/JsonDocuments/ddlResponse.json rename to tests/Couchbase.OperationalInsights.UnitTests/JsonDocuments/ddlResponse.json diff --git a/tests/Couchbase.Analytics.UnitTests/JsonDocuments/error-23000-response.json b/tests/Couchbase.OperationalInsights.UnitTests/JsonDocuments/error-23000-response.json similarity index 87% rename from tests/Couchbase.Analytics.UnitTests/JsonDocuments/error-23000-response.json rename to tests/Couchbase.OperationalInsights.UnitTests/JsonDocuments/error-23000-response.json index f131ee6..eb38112 100644 --- a/tests/Couchbase.Analytics.UnitTests/JsonDocuments/error-23000-response.json +++ b/tests/Couchbase.OperationalInsights.UnitTests/JsonDocuments/error-23000-response.json @@ -4,7 +4,7 @@ "errors": [ { "code": 23000, - "msg": "Enterprise Analytics is temporarily unavailable", + "msg": "Enterprise OperationalInsights is temporarily unavailable", "retriable": true } ], diff --git a/tests/Couchbase.Analytics.UnitTests/JsonDocuments/analyticsResponse.json b/tests/Couchbase.OperationalInsights.UnitTests/JsonDocuments/insightsResponse.json similarity index 100% rename from tests/Couchbase.Analytics.UnitTests/JsonDocuments/analyticsResponse.json rename to tests/Couchbase.OperationalInsights.UnitTests/JsonDocuments/insightsResponse.json diff --git a/tests/Couchbase.Analytics.UnitTests/Logging/RedactionTests.cs b/tests/Couchbase.OperationalInsights.UnitTests/Logging/RedactionTests.cs similarity index 98% rename from tests/Couchbase.Analytics.UnitTests/Logging/RedactionTests.cs rename to tests/Couchbase.OperationalInsights.UnitTests/Logging/RedactionTests.cs index 96e7edb..6a839c7 100644 --- a/tests/Couchbase.Analytics.UnitTests/Logging/RedactionTests.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/Logging/RedactionTests.cs @@ -19,10 +19,10 @@ * ************************************************************/ #endregion -using Couchbase.AnalyticsClient.Logging; +using Couchbase.OperationalInsightsClient.Logging; using Xunit; -namespace Couchbase.AnalyticsClient.UnitTests.Logging; +namespace Couchbase.OperationalInsightsClient.UnitTests.Logging; public class RedactionTests { diff --git a/tests/Couchbase.Analytics.UnitTests/POCOs/Airline.cs b/tests/Couchbase.OperationalInsights.UnitTests/POCOs/Airline.cs similarity index 82% rename from tests/Couchbase.Analytics.UnitTests/POCOs/Airline.cs rename to tests/Couchbase.OperationalInsights.UnitTests/POCOs/Airline.cs index e7a1abb..bca7590 100644 --- a/tests/Couchbase.Analytics.UnitTests/POCOs/Airline.cs +++ b/tests/Couchbase.OperationalInsights.UnitTests/POCOs/Airline.cs @@ -1,4 +1,4 @@ -namespace Couchbase.AnalyticsClient.UnitTests.POCOs; +namespace Couchbase.OperationalInsightsClient.UnitTests.POCOs; public class Airline {