diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
deleted file mode 100644
index 22ec7d7b..00000000
--- a/.config/dotnet-tools.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "version": 1,
- "isRoot": true,
- "tools": {
- "paket": {
- "version": "5.258.1",
- "commands": [
- "paket"
- ]
- }
- }
-}
\ No newline at end of file
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 00000000..3729ff0c
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/azds.yaml
+**/bin
+**/charts
+**/docker-compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md
\ No newline at end of file
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..5f22e83b
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,23 @@
+[*.cs]
+# CS0618: Type or member is obsolete
+dotnet_diagnostic.CS0618.severity = none
+# VSTHRD200: Use "Async" suffix for async methods
+dotnet_diagnostic.VSTHRD200.severity = none
+# SYSLIB0011: Type or member is obsolete
+dotnet_diagnostic.SYSLIB0011.severity = none
+# CS0168: Variable is declared but never used
+dotnet_diagnostic.CS0168.severity = none
+# CA1416: Validate platform compatibility
+dotnet_diagnostic.CA1416.severity = error
+
+
+# CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
+dotnet_diagnostic.CS4014.severity = none
+# CS0169: The field is never used
+dotnet_diagnostic.CS0169.severity = none
+# CS0414: The field is assigned but its value is never used
+dotnet_diagnostic.CS0414.severity = none
+# CS0219: The variable is assigned but its value is never used
+dotnet_diagnostic.CS0219.severity = none
+# CS0649: Field is never assigned to, and will always have its default value
+dotnet_diagnostic.CS0649.severity = none
diff --git a/.gitignore b/.gitignore
index 27f972f5..ce306bb4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,7 @@ bld/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
+testlogs/
# NUNIT
*.VisualState.xml
@@ -258,4 +259,7 @@ OrleansAdoNetContent/
/.paket/
-launchSettings.json
+/testlogs/
+/CustomEvent
+/output*
+/whitesource
diff --git a/Directory.Build.props b/Directory.Build.props
index b4fcf061..ee8f1ca6 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,11 +1,40 @@
-
- Gigya Inc.
- © 2020 Gigya Inc.
- Microdot Framework
- Microdot Framework
-
- 3.3.23
- $(SolutionDir)\test.runsettings
-
+
+ Gigya Inc.
+ © 2021 Gigya Inc.
+ Microdot Framework
+ Microdot Framework
+ https://github.com/gigya/microdot
+ https://github.com/gigya/microdot/blob/master/LICENSE.md
+ gigya microdot microservice microservices
+ 4.1.9
+ true
+
+
+
+ netstandard2.0;netstandard2.1;net5.0;net6.0
+ win10-x64;linux-x64
+ latest
+ true
+ Library
+ false
+ bin\$(Configuration)
+ $(SolutionDir)test.runsettings
+ $(SolutionDir)main.ruleset
+
+
+
+
+
+
+
+
+
+ true
+ true
+ true
+ true
+
diff --git a/Directory.Build.targets b/Directory.Build.targets
new file mode 100644
index 00000000..1ee72736
--- /dev/null
+++ b/Directory.Build.targets
@@ -0,0 +1,63 @@
+
+
+ 3.5.1
+
+
+ 3.6.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Gigya.Microdot.Common.Tests/DummyCertificateLocator.cs b/Gigya.Microdot.Common.Tests/DummyCertificateLocator.cs
index e89b5c45..443d0d1d 100644
--- a/Gigya.Microdot.Common.Tests/DummyCertificateLocator.cs
+++ b/Gigya.Microdot.Common.Tests/DummyCertificateLocator.cs
@@ -1,7 +1,7 @@
-using System;
+using Gigya.Microdot.SharedLogic.HttpService;
+using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
-using Gigya.Microdot.SharedLogic.HttpService;
namespace Gigya.Microdot.Common.Tests
{
@@ -10,8 +10,21 @@ public class DummyCertificateLocator : ICertificateLocator
public X509Certificate2 GetCertificate(string certName)
{
var ecdsa = ECDsa.Create(); // generate asymmetric key pair
- var req = new CertificateRequest("cn=foobar", ecdsa, HashAlgorithmName.SHA256);
- return req.CreateSelfSigned(DateTimeOffset.Now, DateTimeOffset.Now.AddYears(5));
+
+ //var req = new CertificateRequest("cn=foobar", ecdsa, HashAlgorithmName.SHA256);
+ //return req.CreateSelfSigned(DateTimeOffset.Now, DateTimeOffset.Now.AddYears(5));
+
+ return CreateSelfSignedRequest("cn=foobar", ecdsa, HashAlgorithmName.SHA256);
+ }
+
+ private X509Certificate2 CreateSelfSignedRequest(string subjectName, ECDsa key, HashAlgorithmName hashAlgorithm)
+ {
+ Type certificateRequestType = Type.GetType("System.Security.Cryptography.X509Certificates.CertificateRequest");
+
+ object request = certificateRequestType?.GetConstructor(new[] { subjectName.GetType(), key.GetType(), hashAlgorithm.GetType() })
+ ?.Invoke(new object[] { subjectName, key, hashAlgorithm });
+
+ return (X509Certificate2)certificateRequestType?.GetMethod("CreateSelfSigned")?.Invoke(request, new object[] { DateTimeOffset.Now, DateTimeOffset.Now.AddYears(5) });
}
}
}
diff --git a/Gigya.Microdot.Common.Tests/FakesLoggersModules.cs b/Gigya.Microdot.Common.Tests/FakesLoggersModules.cs
index f05d3799..73396277 100644
--- a/Gigya.Microdot.Common.Tests/FakesLoggersModules.cs
+++ b/Gigya.Microdot.Common.Tests/FakesLoggersModules.cs
@@ -1,10 +1,10 @@
-using System;
using Gigya.Microdot.Fakes;
using Gigya.Microdot.Interfaces.Events;
using Gigya.Microdot.Interfaces.Logging;
using Gigya.Microdot.Ninject;
using Ninject;
using Ninject.Syntax;
+using System;
namespace Gigya.Microdot.Common.Tests
{
diff --git a/Gigya.Microdot.Common.Tests/Gigya.Microdot.Common.Tests.csproj b/Gigya.Microdot.Common.Tests/Gigya.Microdot.Common.Tests.csproj
index 9c886a36..38f3036a 100644
--- a/Gigya.Microdot.Common.Tests/Gigya.Microdot.Common.Tests.csproj
+++ b/Gigya.Microdot.Common.Tests/Gigya.Microdot.Common.Tests.csproj
@@ -1,16 +1,15 @@
-
- net472
- Gigya.Microdot.Common.Tests
- $(SolutionDir)main.ruleset
-
-
-
-
-
-
-
-
-
+
+ Gigya.Microdot.Common.Tests
+
+
+
+
+
+
+
+
+
+
diff --git a/Gigya.Microdot.Common.Tests/KernelTestingExtensions.cs b/Gigya.Microdot.Common.Tests/KernelTestingExtensions.cs
index 31fec285..2d7b5042 100644
--- a/Gigya.Microdot.Common.Tests/KernelTestingExtensions.cs
+++ b/Gigya.Microdot.Common.Tests/KernelTestingExtensions.cs
@@ -1,11 +1,11 @@
-using System;
-using System.Diagnostics;
-using Gigya.Microdot.Common.Tests;
+using Gigya.Microdot.Common.Tests;
using Gigya.Microdot.Hosting;
using Gigya.Microdot.Interfaces;
using Gigya.Microdot.Interfaces.Logging;
using Gigya.Microdot.SharedLogic.HttpService;
using Ninject;
+using System;
+using System.Diagnostics;
namespace Gigya.Microdot.Fakes.KernelUtils
diff --git a/Gigya.Microdot.Common.Tests/Properties/AssemblyInfo.cs b/Gigya.Microdot.Common.Tests/Properties/AssemblyInfo.cs
index c29581eb..d767500b 100644
--- a/Gigya.Microdot.Common.Tests/Properties/AssemblyInfo.cs
+++ b/Gigya.Microdot.Common.Tests/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
+using System.Runtime.InteropServices;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
diff --git a/Gigya.Microdot.Common.Tests/SpyEventPublisher.cs b/Gigya.Microdot.Common.Tests/SpyEventPublisher.cs
index 62996d94..c0ecf52d 100644
--- a/Gigya.Microdot.Common.Tests/SpyEventPublisher.cs
+++ b/Gigya.Microdot.Common.Tests/SpyEventPublisher.cs
@@ -1,7 +1,7 @@
-using System.Collections.Concurrent;
-using System.Threading.Tasks;
using Gigya.Microdot.Interfaces.Events;
using NSubstitute;
+using System.Collections.Concurrent;
+using System.Threading.Tasks;
namespace Gigya.Microdot.Common.Tests
{
diff --git a/Gigya.Microdot.Common.Tests/paket.references b/Gigya.Microdot.Common.Tests/paket.references
deleted file mode 100644
index 6e564ef8..00000000
--- a/Gigya.Microdot.Common.Tests/paket.references
+++ /dev/null
@@ -1,6 +0,0 @@
-NSubstitute
-Ninject
-System.Threading.Tasks.Dataflow
-System.Data.DataSetExtensions
-Microsoft.CSharp
-System.Net.Http
\ No newline at end of file
diff --git a/Gigya.Microdot.Configuration/ConfigCache.cs b/Gigya.Microdot.Configuration/ConfigCache.cs
index cccbcc8c..a1701d41 100644
--- a/Gigya.Microdot.Configuration/ConfigCache.cs
+++ b/Gigya.Microdot.Configuration/ConfigCache.cs
@@ -20,12 +20,12 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Interfaces.Logging;
+using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
-using Gigya.Microdot.Interfaces.Logging;
-using Newtonsoft.Json.Linq;
namespace Gigya.Microdot.Configuration
{
diff --git a/Gigya.Microdot.Configuration/ConfigFileDeclaration.cs b/Gigya.Microdot.Configuration/ConfigFileDeclaration.cs
index cc6589fe..22d9e611 100644
--- a/Gigya.Microdot.Configuration/ConfigFileDeclaration.cs
+++ b/Gigya.Microdot.Configuration/ConfigFileDeclaration.cs
@@ -20,8 +20,8 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
using Newtonsoft.Json;
+using System;
namespace Gigya.Microdot.Configuration
{
diff --git a/Gigya.Microdot.Configuration/ConfigItem.cs b/Gigya.Microdot.Configuration/ConfigItem.cs
index 12742e96..071455ff 100644
--- a/Gigya.Microdot.Configuration/ConfigItem.cs
+++ b/Gigya.Microdot.Configuration/ConfigItem.cs
@@ -20,14 +20,14 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.Exceptions;
+using Gigya.Microdot.Interfaces.Configuration;
+using Gigya.Microdot.SharedLogic.Exceptions;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Xml;
-using Gigya.Common.Contracts.Exceptions;
-using Gigya.Microdot.Interfaces.Configuration;
-using Gigya.Microdot.SharedLogic.Exceptions;
namespace Gigya.Microdot.Configuration
{
@@ -89,15 +89,15 @@ public string Value
public XmlNode Node { get; set; }
- static readonly Regex MATCH_ENCRYPTED_CONFIG_STRING = new Regex(@"\$enc\((?.*?)\)", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
+ static readonly Regex MATCH_ENCRYPTED_CONFIG_STRING = new(@"\$enc\((?.*?)\)", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
private string DecryptRawValue(string rawValue)
{
return MATCH_ENCRYPTED_CONFIG_STRING.Replace(rawValue, m =>
{
- var inner = m.Groups[1].Value;
- if (ConfigDecryptor. IsValidEncryptedStringFormat(inner))
+ var inner = m.Groups["encrypted"].Value;
+ if (ConfigDecryptor.IsValidEncryptedStringFormat(inner))
{
try
{
diff --git a/Gigya.Microdot.Configuration/ConfigurationFilesWatcher.cs b/Gigya.Microdot.Configuration/ConfigurationFilesWatcher.cs
index 78168725..143fc997 100644
--- a/Gigya.Microdot.Configuration/ConfigurationFilesWatcher.cs
+++ b/Gigya.Microdot.Configuration/ConfigurationFilesWatcher.cs
@@ -20,12 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.LanguageExtensions;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks.Dataflow;
-using Gigya.Microdot.LanguageExtensions;
-using Gigya.Microdot.SharedLogic.Utils;
namespace Gigya.Microdot.Configuration
{
diff --git a/Gigya.Microdot.Configuration/ConfigurationLocationsParser.cs b/Gigya.Microdot.Configuration/ConfigurationLocationsParser.cs
index 23dca0b3..d9867ba5 100644
--- a/Gigya.Microdot.Configuration/ConfigurationLocationsParser.cs
+++ b/Gigya.Microdot.Configuration/ConfigurationLocationsParser.cs
@@ -20,6 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.Exceptions;
+using Gigya.Microdot.Interfaces.SystemWrappers;
+using Gigya.Microdot.SharedLogic;
+using Gigya.Microdot.SharedLogic.Exceptions;
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -27,12 +32,6 @@
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
-using Gigya.Common.Contracts.Exceptions;
-using Gigya.Microdot.Interfaces.SystemWrappers;
-using Gigya.Microdot.SharedLogic;
-using Gigya.Microdot.SharedLogic.Exceptions;
-using Gigya.Microdot.SharedLogic.Utils;
-using Newtonsoft.Json;
namespace Gigya.Microdot.Configuration
{
diff --git a/Gigya.Microdot.Configuration/ConfigurationVerificator.cs b/Gigya.Microdot.Configuration/ConfigurationVerificator.cs
index a65ad473..e1dfea2e 100644
--- a/Gigya.Microdot.Configuration/ConfigurationVerificator.cs
+++ b/Gigya.Microdot.Configuration/ConfigurationVerificator.cs
@@ -20,14 +20,14 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.Diagnostics;
-using Gigya.Microdot.Interfaces;
using Gigya.Microdot.Configuration.Objects;
+using Gigya.Microdot.Interfaces;
using Gigya.Microdot.Interfaces.SystemWrappers;
using Gigya.Microdot.SharedLogic.Exceptions;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
// ReSharper disable RedundantDefaultMemberInitializer
#pragma warning disable 1591 // XML docs for public members
diff --git a/Gigya.Microdot.Configuration/FileBasedConfigItemsSource.cs b/Gigya.Microdot.Configuration/FileBasedConfigItemsSource.cs
index ce6feba7..8c4373ff 100644
--- a/Gigya.Microdot.Configuration/FileBasedConfigItemsSource.cs
+++ b/Gigya.Microdot.Configuration/FileBasedConfigItemsSource.cs
@@ -20,6 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.Exceptions;
+using Gigya.Microdot.Interfaces.Configuration;
+using Gigya.Microdot.Interfaces.SystemWrappers;
+using Gigya.Microdot.SharedLogic.Exceptions;
+using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
@@ -27,11 +32,6 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml;
-using Gigya.Common.Contracts.Exceptions;
-using Gigya.Microdot.Interfaces.Configuration;
-using Gigya.Microdot.Interfaces.SystemWrappers;
-using Gigya.Microdot.SharedLogic.Exceptions;
-using Newtonsoft.Json.Linq;
namespace Gigya.Microdot.Configuration
{
@@ -43,7 +43,7 @@ public class FileBasedConfigItemsSource : IConfigItemsSource
private readonly IEnvironment _environment;
private readonly ConfigDecryptor _configDecryptor;
- private readonly Regex paramMatcher = new Regex(@"([^\\]|^)%(?[^%]+)%", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
+ private readonly Regex paramMatcher = new(@"([^\\]|^)%(?[^%]+)%", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
///
@@ -87,8 +87,8 @@ public FileBasedConfigItemsSource(
.Cast()
.Select(match => new
{
- Placehodler = "%" + match.Groups[1].Value + "%",
- Value = _environment[match.Groups[1].Value.ToUpperInvariant()]
+ Placehodler = $"%{match.Groups["envName"].Value}%",
+ Value = _environment[match.Groups["envName"].Value.ToUpperInvariant()]
}).ToList();
if (list.Any())
@@ -111,7 +111,7 @@ public FileBasedConfigItemsSource(
if (notFoundEnvVariables.Any())
{
- throw new EnvironmentException("Configuration is dependent on following enviroment variables:" + string.Join("\n", notFoundEnvVariables) + "\n but they are not set.");
+ throw new EnvironmentException($"Configuration is dependent on following enviroment variables:{string.Join("\n", notFoundEnvVariables)}\n but they are not set.");
}
// return merged configuration
@@ -161,19 +161,16 @@ private async Task ReadConfiguration(ConfigFile configFile, Dictionary
}
catch (FileNotFoundException ex)
{
- var errMsg = string.Format("Missing configuration file: " + configFile.FullName);
- throw new ConfigurationException(errMsg, ex);
+ throw new ConfigurationException($"Missing configuration file: {configFile.FullName}", ex);
}
catch (IOException ex)
{
// the file didn't finish being written yet
- var errMsg = string.Format("Error loading configuration file: " + configFile.FullName);
- throw new ConfigurationException(errMsg, ex);
+ throw new ConfigurationException($"Error loading configuration file: {configFile.FullName}", ex);
}
catch (Exception ex)
{
- var errMsg = string.Format("Missing or invalid configuration file: " + configFile.FullName);
- throw new ConfigurationException(errMsg, ex);
+ throw new ConfigurationException($"Missing or invalid configuration file: {configFile.FullName}", ex);
}
}
diff --git a/Gigya.Microdot.Configuration/Gigya.Microdot.Configuration.csproj b/Gigya.Microdot.Configuration/Gigya.Microdot.Configuration.csproj
index f4d916c9..1b4c9523 100644
--- a/Gigya.Microdot.Configuration/Gigya.Microdot.Configuration.csproj
+++ b/Gigya.Microdot.Configuration/Gigya.Microdot.Configuration.csproj
@@ -1,15 +1,19 @@
-
- netstandard2.0
- 1591
- Gigya.Microdot.Configuration
- true
- $(SolutionDir)main.ruleset
-
-
-
-
-
-
+
+ Gigya.Microdot.Configuration
+
+ A configuration system based on a hierarchy of XML files, the values of
+ which are accessed using strongly-typed configuration objects. Supports
+ modification of the files on live service, environment variable substitution,
+ encryption and collections. Part of the Microdot framework.
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Gigya.Microdot.Configuration/IConfigEventFactory.cs b/Gigya.Microdot.Configuration/IConfigEventFactory.cs
index 65c8aa39..124fc907 100644
--- a/Gigya.Microdot.Configuration/IConfigEventFactory.cs
+++ b/Gigya.Microdot.Configuration/IConfigEventFactory.cs
@@ -20,8 +20,8 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Threading.Tasks.Dataflow;
using Gigya.Microdot.Interfaces.Configuration;
+using System.Threading.Tasks.Dataflow;
namespace Gigya.Microdot.Configuration
{
diff --git a/Gigya.Microdot.Configuration/Objects/ConfigObjectCreator.cs b/Gigya.Microdot.Configuration/Objects/ConfigObjectCreator.cs
index 4cd27cea..4b944091 100644
--- a/Gigya.Microdot.Configuration/Objects/ConfigObjectCreator.cs
+++ b/Gigya.Microdot.Configuration/Objects/ConfigObjectCreator.cs
@@ -20,23 +20,22 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks.Dataflow;
using Gigya.Common.Contracts.Exceptions;
using Gigya.Microdot.Interfaces;
using Gigya.Microdot.Interfaces.Configuration;
using Gigya.Microdot.Interfaces.Logging;
using Gigya.Microdot.SharedLogic.Exceptions;
using Gigya.Microdot.SharedLogic.Monitor;
-using Metrics;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks.Dataflow;
namespace Gigya.Microdot.Configuration.Objects
{
@@ -48,7 +47,7 @@ public class ConfigObjectCreator : IConfigObjectCreator
///
public object ChangeNotifications { get; private set; }
- private object Latest { get; set; }
+ private volatile object Latest;
private UsageTracking UsageTracking { get; }
private ILog Log { get; }
private Type ObjectType { get; }
@@ -200,6 +199,9 @@ public void Reload()
{
if (Latest != null)
ValidationErrors = null;
+
+ //if (ConfigPath.Contains("StackTraceEnhancerSettings"))
+ // Log.Info(_=> _($"RemoveThis: Decided that config was not changed for path {ConfigPath}. Old config :{LatestNode} new config: {config}"));
return;
}
diff --git a/Gigya.Microdot.Configuration/Objects/ConfigObjectsCache.cs b/Gigya.Microdot.Configuration/Objects/ConfigObjectsCache.cs
index e613cf42..9ef851e1 100644
--- a/Gigya.Microdot.Configuration/Objects/ConfigObjectsCache.cs
+++ b/Gigya.Microdot.Configuration/Objects/ConfigObjectsCache.cs
@@ -1,6 +1,6 @@
-using System;
+using Gigya.Microdot.Interfaces;
+using System;
using System.Collections.Generic;
-using Gigya.Microdot.Interfaces;
namespace Gigya.Microdot.Configuration.Objects
{
diff --git a/Gigya.Microdot.Configuration/Objects/IConfigObjectsCache.cs b/Gigya.Microdot.Configuration/Objects/IConfigObjectsCache.cs
index bf8fb82f..f2d6dd8c 100644
--- a/Gigya.Microdot.Configuration/Objects/IConfigObjectsCache.cs
+++ b/Gigya.Microdot.Configuration/Objects/IConfigObjectsCache.cs
@@ -1,9 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Gigya.Microdot.Interfaces;
+using Gigya.Microdot.Interfaces;
+using System;
namespace Gigya.Microdot.Configuration.Objects
{
diff --git a/Gigya.Microdot.Configuration/Objects/RecursiveValidation.cs b/Gigya.Microdot.Configuration/Objects/RecursiveValidation.cs
index c45f56b0..535efb44 100644
--- a/Gigya.Microdot.Configuration/Objects/RecursiveValidation.cs
+++ b/Gigya.Microdot.Configuration/Objects/RecursiveValidation.cs
@@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
-using System.Text;
namespace Gigya.Microdot.Configuration.Objects
{
diff --git a/Gigya.Microdot.Configuration/Properties/AssemblyInfo.cs b/Gigya.Microdot.Configuration/Properties/AssemblyInfo.cs
index 268f6c7d..41594e4e 100644
--- a/Gigya.Microdot.Configuration/Properties/AssemblyInfo.cs
+++ b/Gigya.Microdot.Configuration/Properties/AssemblyInfo.cs
@@ -21,6 +21,5 @@
#endregion
using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo("Gigya.Common.Configuration")]
diff --git a/Gigya.Microdot.Configuration/ServicePointManagerDefaultConfig.cs b/Gigya.Microdot.Configuration/ServicePointManagerDefaultConfig.cs
index f130916c..2f7420d5 100644
--- a/Gigya.Microdot.Configuration/ServicePointManagerDefaultConfig.cs
+++ b/Gigya.Microdot.Configuration/ServicePointManagerDefaultConfig.cs
@@ -20,8 +20,8 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
using Gigya.Microdot.Interfaces.Configuration;
+using System;
namespace Gigya.Microdot.Configuration
{
diff --git a/Gigya.Microdot.Configuration/UsageTracking.cs b/Gigya.Microdot.Configuration/UsageTracking.cs
index 805b54d6..706d3439 100644
--- a/Gigya.Microdot.Configuration/UsageTracking.cs
+++ b/Gigya.Microdot.Configuration/UsageTracking.cs
@@ -20,10 +20,10 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Interfaces.Logging;
using System;
using System.Collections.Concurrent;
using System.Linq;
-using Gigya.Microdot.Interfaces.Logging;
namespace Gigya.Microdot.Configuration
{
diff --git a/Gigya.Microdot.Configuration/paket.references b/Gigya.Microdot.Configuration/paket.references
deleted file mode 100644
index 70911872..00000000
--- a/Gigya.Microdot.Configuration/paket.references
+++ /dev/null
@@ -1,8 +0,0 @@
-Gigya.ServiceContract
-System.Threading.Tasks.Dataflow
-Newtonsoft.Json
-System.ComponentModel.Annotations
-System.Configuration.ConfigurationManager
-
-Microsoft.CSharp
-System.Net.Http
diff --git a/Gigya.Microdot.Configuration/paket.template b/Gigya.Microdot.Configuration/paket.template
deleted file mode 100644
index c366c30f..00000000
--- a/Gigya.Microdot.Configuration/paket.template
+++ /dev/null
@@ -1,13 +0,0 @@
-type
- project
-description
- A configuration system based on a hierarchy of XML files, the values of
- which are accessed using strongly-typed configuration objects. Supports
- modification of the files on live service, environment variable substitution,
- encryption and collections. Part of the Microdot framework.
-projectUrl
- https://github.com/gigya/microdot
-licenseUrl
- https://github.com/gigya/microdot/blob/master/LICENSE.md
-tags
- gigya microdot microservice microservices configuration
diff --git a/Gigya.Microdot.Fakes/ConsoleLog.cs b/Gigya.Microdot.Fakes/ConsoleLog.cs
index 9f6039da..98b4d169 100644
--- a/Gigya.Microdot.Fakes/ConsoleLog.cs
+++ b/Gigya.Microdot.Fakes/ConsoleLog.cs
@@ -20,12 +20,12 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.SharedLogic.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
-using Gigya.Microdot.SharedLogic.Logging;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/ConsoleLogLoggersModules.cs b/Gigya.Microdot.Fakes/ConsoleLogLoggersModules.cs
index bbfe9652..a54fc7ac 100644
--- a/Gigya.Microdot.Fakes/ConsoleLogLoggersModules.cs
+++ b/Gigya.Microdot.Fakes/ConsoleLogLoggersModules.cs
@@ -1,10 +1,10 @@
-using System;
-using Gigya.Microdot.Fakes;
+using Gigya.Microdot.Fakes;
using Gigya.Microdot.Interfaces.Events;
using Gigya.Microdot.Interfaces.Logging;
using Gigya.Microdot.Ninject;
using Ninject;
using Ninject.Syntax;
+using System;
namespace Gigya.Microdot.UnitTests.Caching.Host
{
diff --git a/Gigya.Microdot.Fakes/DateTimeFake.cs b/Gigya.Microdot.Fakes/DateTimeFake.cs
index 74417f4c..4c998586 100644
--- a/Gigya.Microdot.Fakes/DateTimeFake.cs
+++ b/Gigya.Microdot.Fakes/DateTimeFake.cs
@@ -20,11 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Interfaces.SystemWrappers;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
-using Gigya.Microdot.Interfaces.SystemWrappers;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/Discovery/AlwaysLocalHostDiscovery.cs b/Gigya.Microdot.Fakes/Discovery/AlwaysLocalHostDiscovery.cs
index 9f0003fc..ca1a32d2 100644
--- a/Gigya.Microdot.Fakes/Discovery/AlwaysLocalHostDiscovery.cs
+++ b/Gigya.Microdot.Fakes/Discovery/AlwaysLocalHostDiscovery.cs
@@ -20,12 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Threading.Tasks;
using Gigya.Microdot.ServiceDiscovery;
-using Gigya.Microdot.ServiceDiscovery.Config;
using Gigya.Microdot.ServiceDiscovery.Rewrite;
using Gigya.Microdot.SharedLogic.Rewrite;
+using System;
+using System.Threading.Tasks;
namespace Gigya.Microdot.Fakes.Discovery
{
diff --git a/Gigya.Microdot.Fakes/Discovery/LocalhostEndPointHandle.cs b/Gigya.Microdot.Fakes/Discovery/LocalhostEndPointHandle.cs
index 283fc333..db3c526b 100644
--- a/Gigya.Microdot.Fakes/Discovery/LocalhostEndPointHandle.cs
+++ b/Gigya.Microdot.Fakes/Discovery/LocalhostEndPointHandle.cs
@@ -20,9 +20,9 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
using Gigya.Microdot.ServiceDiscovery;
using Gigya.Microdot.SharedLogic;
+using System;
namespace Gigya.Microdot.Fakes.Discovery
{
diff --git a/Gigya.Microdot.Fakes/Discovery/LocalhostServiceDiscovery.cs b/Gigya.Microdot.Fakes/Discovery/LocalhostServiceDiscovery.cs
index a0fb76ba..fa8b6189 100644
--- a/Gigya.Microdot.Fakes/Discovery/LocalhostServiceDiscovery.cs
+++ b/Gigya.Microdot.Fakes/Discovery/LocalhostServiceDiscovery.cs
@@ -20,10 +20,10 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Threading.Tasks;
using Gigya.Microdot.ServiceDiscovery.Rewrite;
using Gigya.Microdot.SharedLogic;
using Gigya.Microdot.SharedLogic.Rewrite;
+using System.Threading.Tasks;
namespace Gigya.Microdot.Fakes.Discovery
{
diff --git a/Gigya.Microdot.Fakes/FakeHealthMonitor.cs b/Gigya.Microdot.Fakes/FakeHealthMonitor.cs
index 957bd384..9a3c947e 100644
--- a/Gigya.Microdot.Fakes/FakeHealthMonitor.cs
+++ b/Gigya.Microdot.Fakes/FakeHealthMonitor.cs
@@ -20,10 +20,10 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Collections.Generic;
using Gigya.Microdot.SharedLogic.Monitor;
using Metrics;
+using System;
+using System.Collections.Generic;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/FakeLog.cs b/Gigya.Microdot.Fakes/FakeLog.cs
index 57ab210a..cb9d6778 100644
--- a/Gigya.Microdot.Fakes/FakeLog.cs
+++ b/Gigya.Microdot.Fakes/FakeLog.cs
@@ -20,13 +20,13 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.SharedLogic.Events;
+using Gigya.Microdot.SharedLogic.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Text;
-using Gigya.Microdot.SharedLogic.Events;
-using Gigya.Microdot.SharedLogic.Logging;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/Gigya.Microdot.Fakes.csproj b/Gigya.Microdot.Fakes/Gigya.Microdot.Fakes.csproj
index a9874476..663792b1 100644
--- a/Gigya.Microdot.Fakes/Gigya.Microdot.Fakes.csproj
+++ b/Gigya.Microdot.Fakes/Gigya.Microdot.Fakes.csproj
@@ -1,16 +1,16 @@
-
- netstandard2.0
- Gigya.Microdot.Fakes
- $(SolutionDir)main.ruleset
-
-
-
-
-
-
-
-
-
+
+ Gigya.Microdot.Fakes
+ Tools to help write tests for Microdot services.
+ gigya microdot microservice microservices fakes mocks mocking unit-testing
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Gigya.Microdot.Fakes/LogSpy.cs b/Gigya.Microdot.Fakes/LogSpy.cs
index a158e917..6e89f6d7 100644
--- a/Gigya.Microdot.Fakes/LogSpy.cs
+++ b/Gigya.Microdot.Fakes/LogSpy.cs
@@ -20,13 +20,13 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.SharedLogic.Events;
+using Gigya.Microdot.SharedLogic.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
-using Gigya.Microdot.SharedLogic.Events;
-using Gigya.Microdot.SharedLogic.Logging;
namespace Gigya.Microdot.Fakes
{
@@ -54,6 +54,14 @@ public IEnumerable LogEntries
}
}
+ public void ClearLog()
+ {
+ lock (LogEntriesList)
+ {
+ LogEntriesList.Clear();
+ }
+ }
+
protected override Task WriteLog(TraceEventType severity, LogCallSiteInfo logCallSiteInfo, string message, IDictionary encryptedTags, IDictionary unencryptedTags, Exception exception = null, string stackTrace = null)
{
diff --git a/Gigya.Microdot.Fakes/ManualConfigurationEvents.cs b/Gigya.Microdot.Fakes/ManualConfigurationEvents.cs
index c92069af..5b3f18f8 100644
--- a/Gigya.Microdot.Fakes/ManualConfigurationEvents.cs
+++ b/Gigya.Microdot.Fakes/ManualConfigurationEvents.cs
@@ -20,16 +20,16 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Configuration;
+using Gigya.Microdot.Interfaces.Configuration;
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
-using Gigya.Microdot.Configuration;
-using Gigya.Microdot.Interfaces.Configuration;
namespace Gigya.Microdot.Fakes
{
- public class ManualConfigurationEvents : IConfigurationDataWatcher
+ public class ManualConfigurationEvents : IConfigurationDataWatcher
{
private readonly IConfigEventFactory _eventFactory;
private readonly BroadcastBlock block = new BroadcastBlock(null);
diff --git a/Gigya.Microdot.Fakes/MetricsInitializerFake.cs b/Gigya.Microdot.Fakes/MetricsInitializerFake.cs
index 6ade636d..983ecaa5 100644
--- a/Gigya.Microdot.Fakes/MetricsInitializerFake.cs
+++ b/Gigya.Microdot.Fakes/MetricsInitializerFake.cs
@@ -1,8 +1,8 @@
-using System;
-using System.Threading.Tasks;
-using Gigya.Microdot.Interfaces;
+using Gigya.Microdot.Interfaces;
using Gigya.Microdot.Interfaces.Logging;
using Metrics;
+using System;
+using System.Threading.Tasks;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/MockConfigItemsCollection.cs b/Gigya.Microdot.Fakes/MockConfigItemsCollection.cs
index f6ed60f8..3268e850 100644
--- a/Gigya.Microdot.Fakes/MockConfigItemsCollection.cs
+++ b/Gigya.Microdot.Fakes/MockConfigItemsCollection.cs
@@ -20,10 +20,10 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
-using Gigya.Microdot.Configuration;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/NullEventPublisher.cs b/Gigya.Microdot.Fakes/NullEventPublisher.cs
index a9d024b3..79059cc8 100644
--- a/Gigya.Microdot.Fakes/NullEventPublisher.cs
+++ b/Gigya.Microdot.Fakes/NullEventPublisher.cs
@@ -20,8 +20,8 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Threading.Tasks;
using Gigya.Microdot.Interfaces.Events;
+using System.Threading.Tasks;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/NullLog.cs b/Gigya.Microdot.Fakes/NullLog.cs
index 457acb19..8663352f 100644
--- a/Gigya.Microdot.Fakes/NullLog.cs
+++ b/Gigya.Microdot.Fakes/NullLog.cs
@@ -20,11 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.SharedLogic.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
-using Gigya.Microdot.SharedLogic.Logging;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/OverridableConfigItems.cs b/Gigya.Microdot.Fakes/OverridableConfigItems.cs
index 036dae23..9d61c1d3 100644
--- a/Gigya.Microdot.Fakes/OverridableConfigItems.cs
+++ b/Gigya.Microdot.Fakes/OverridableConfigItems.cs
@@ -20,11 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Configuration;
+using Gigya.Microdot.Interfaces.Configuration;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
-using Gigya.Microdot.Configuration;
-using Gigya.Microdot.Interfaces.Configuration;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/Properties/AssemblyInfo.cs b/Gigya.Microdot.Fakes/Properties/AssemblyInfo.cs
index d625fc36..eed5f5ba 100644
--- a/Gigya.Microdot.Fakes/Properties/AssemblyInfo.cs
+++ b/Gigya.Microdot.Fakes/Properties/AssemblyInfo.cs
@@ -20,7 +20,6 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Reflection;
using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
diff --git a/Gigya.Microdot.Fakes/TraceLog.cs b/Gigya.Microdot.Fakes/TraceLog.cs
index 88b469f8..14928d53 100644
--- a/Gigya.Microdot.Fakes/TraceLog.cs
+++ b/Gigya.Microdot.Fakes/TraceLog.cs
@@ -20,12 +20,12 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.SharedLogic.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
-using Gigya.Microdot.SharedLogic.Logging;
namespace Gigya.Microdot.Fakes
{
diff --git a/Gigya.Microdot.Fakes/paket.references b/Gigya.Microdot.Fakes/paket.references
deleted file mode 100644
index 8d51eaca..00000000
--- a/Gigya.Microdot.Fakes/paket.references
+++ /dev/null
@@ -1,3 +0,0 @@
-Ninject
-System.Net.Http
-System.Threading.Tasks.Dataflow
diff --git a/Gigya.Microdot.Fakes/paket.template b/Gigya.Microdot.Fakes/paket.template
deleted file mode 100644
index 7127d911..00000000
--- a/Gigya.Microdot.Fakes/paket.template
+++ /dev/null
@@ -1,10 +0,0 @@
-type
- project
-description
- Tools to help write tests for Microdot services.
-projectUrl
- https://github.com/gigya/microdot
-licenseUrl
- https://github.com/gigya/microdot/blob/master/LICENSE.md
-tags
- gigya microdot microservice microservices fakes mocks mocking unit-testing
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/CrashHandler.cs b/Gigya.Microdot.Hosting/CrashHandler.cs
index c08eacfe..ca95ae07 100644
--- a/Gigya.Microdot.Hosting/CrashHandler.cs
+++ b/Gigya.Microdot.Hosting/CrashHandler.cs
@@ -20,11 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Interfaces.Events;
+using Gigya.Microdot.SharedLogic.Events;
using System;
using System.Diagnostics;
using System.Threading;
-using Gigya.Microdot.Interfaces.Events;
-using Gigya.Microdot.SharedLogic.Events;
namespace Gigya.Microdot.Hosting
{
diff --git a/Gigya.Microdot.Hosting/Environment/ApplicationInfoSource.cs b/Gigya.Microdot.Hosting/Environment/ApplicationInfoSource.cs
index 2ab99619..7f3482fe 100644
--- a/Gigya.Microdot.Hosting/Environment/ApplicationInfoSource.cs
+++ b/Gigya.Microdot.Hosting/Environment/ApplicationInfoSource.cs
@@ -14,6 +14,10 @@ public sealed class ApplicationInfoSource : IHostEnvironmentSource
public string ConsulAddress { get; }
+ public string HostIPAddress { get; }
+
+ public string ContainerName { get; }
+
public string InstanceName { get; }
public CurrentApplicationInfo ApplicationInfo { get; }
diff --git a/Gigya.Microdot.Hosting/Environment/EnvironmentVarialbesConfigurationSource.cs b/Gigya.Microdot.Hosting/Environment/EnvironmentVarialbesConfigurationSource.cs
index 4e0a94a9..e3377424 100644
--- a/Gigya.Microdot.Hosting/Environment/EnvironmentVarialbesConfigurationSource.cs
+++ b/Gigya.Microdot.Hosting/Environment/EnvironmentVarialbesConfigurationSource.cs
@@ -1,10 +1,8 @@
using Gigya.Microdot.LanguageExtensions;
using Gigya.Microdot.SharedLogic;
-using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
-using System.Text;
namespace Gigya.Microdot.Hosting.Environment
{
@@ -18,6 +16,10 @@ public sealed class EnvironmentVarialbesConfigurationSource : IHostEnvironmentSo
public string DeploymentEnvironment { get; }
public string ConsulAddress { get; }
+
+ public string HostIPAddress { get; }
+
+ public string ContainerName { get; }
public string InstanceName { get; }
@@ -37,6 +39,8 @@ public EnvironmentVarialbesConfigurationSource()
this.Region = System.Environment.GetEnvironmentVariable("REGION");
this.DeploymentEnvironment = System.Environment.GetEnvironmentVariable("ENV");
this.ConsulAddress = System.Environment.GetEnvironmentVariable("CONSUL");
+ this.HostIPAddress = System.Environment.GetEnvironmentVariable("HOSTIPADDRESS");
+ this.ContainerName = System.Environment.GetEnvironmentVariable("CONTAINERNAME");
this.InstanceName = System.Environment.GetEnvironmentVariable("GIGYA_SERVICE_INSTANCE_NAME");
this.ConfigRoot = System.Environment.GetEnvironmentVariable("GIGYA_CONFIG_ROOT")?.To(x => new DirectoryInfo(x));
this.LoadPathsFile = System.Environment.GetEnvironmentVariable("GIGYA_CONFIG_PATHS_FILE")?.To(x => new FileInfo(x));
diff --git a/Gigya.Microdot.Hosting/Environment/FreeHostEnvironmentSource.cs b/Gigya.Microdot.Hosting/Environment/FreeHostEnvironmentSource.cs
index 5fb726a6..6e48d271 100644
--- a/Gigya.Microdot.Hosting/Environment/FreeHostEnvironmentSource.cs
+++ b/Gigya.Microdot.Hosting/Environment/FreeHostEnvironmentSource.cs
@@ -20,9 +20,9 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.SharedLogic;
using System.Collections.Generic;
using System.IO;
-using Gigya.Microdot.SharedLogic;
namespace Gigya.Microdot.Hosting.Environment
{
@@ -35,6 +35,10 @@ public sealed class FreeHostEnvironmentSource : IHostEnvironmentSource
public string DeploymentEnvironment { get; }
public string ConsulAddress { get; }
+
+ public string HostIPAddress { get; }
+
+ public string ContainerName { get; }
public string InstanceName { get; }
@@ -51,6 +55,8 @@ public FreeHostEnvironmentSource(
string region = null,
string deploymentEnvironment = null,
string consulAddress = null,
+ string HostIPAddress = null,
+ string containerName = null,
string instanceName = null,
CurrentApplicationInfo applicationInfo = null,
DirectoryInfo configRoot = null,
@@ -62,6 +68,8 @@ public FreeHostEnvironmentSource(
this.Region = region;
this.DeploymentEnvironment = deploymentEnvironment;
this.ConsulAddress = consulAddress;
+ this.HostIPAddress = HostIPAddress;
+ this.ContainerName = ContainerName;
this.InstanceName = instanceName;
this.ApplicationInfo = applicationInfo;
this.ConfigRoot = configRoot;
diff --git a/Gigya.Microdot.Hosting/Environment/HostEnvironment.cs b/Gigya.Microdot.Hosting/Environment/HostEnvironment.cs
index 4e45f34f..bb41d826 100644
--- a/Gigya.Microdot.Hosting/Environment/HostEnvironment.cs
+++ b/Gigya.Microdot.Hosting/Environment/HostEnvironment.cs
@@ -20,17 +20,16 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.IO;
using Gigya.Common.Contracts.Exceptions;
using Gigya.Microdot.Interfaces.Configuration;
using Gigya.Microdot.Interfaces.SystemWrappers;
using Gigya.Microdot.LanguageExtensions;
using Gigya.Microdot.SharedLogic;
-using Gigya.Microdot.SharedLogic.Utils;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.IO;
namespace Gigya.Microdot.Hosting.Environment
{
@@ -64,6 +63,8 @@ public HostEnvironment(IEnumerable sources)
Region = pipeParameter(nameof(Region), Region, s.Region);
DeploymentEnvironment = pipeParameter(nameof(DeploymentEnvironment), DeploymentEnvironment, s.DeploymentEnvironment);
ConsulAddress = pipeParameter(nameof(ConsulAddress), ConsulAddress, s.ConsulAddress);
+ HostIPAddress = pipeParameter(nameof(HostIPAddress), HostIPAddress, s.HostIPAddress);
+ ContainerName = pipeParameter(nameof(ContainerName), ContainerName, s.ContainerName);
ApplicationInfo = pipeParameter(nameof(ApplicationInfo), ApplicationInfo, s.ApplicationInfo);
InstanceName = pipeParameter(nameof(InstanceName), InstanceName, s.InstanceName);
ConfigRoot = pipeFsiParameter(nameof(ConfigRoot), ConfigRoot, s.ConfigRoot);
@@ -154,6 +155,8 @@ private FileInfo GetDefaultPathsFile() =>
public string Region { get; }
public string DeploymentEnvironment { get; }
public string ConsulAddress { get; }
+ public string HostIPAddress { get; }
+ public string ContainerName { get; }
public DirectoryInfo ConfigRoot { get; }
public FileInfo LoadPathsFile { get; }
public CurrentApplicationInfo ApplicationInfo { get; }
@@ -178,9 +181,10 @@ public static HostEnvironment CreateDefaultEnvironment(string serviceName, Versi
public static IEnumerable GetDefaultSources(string serviceName, Version infraVersion, ServiceArguments arguments = null)
{
- var l = new List(3);
-
- l.Add(new EnvironmentVarialbesConfigurationSource());
+ var l = new List(3)
+ {
+ new EnvironmentVarialbesConfigurationSource()
+ };
if (System.Environment.GetEnvironmentVariable("GIGYA_ENVVARS_FILE") is string path)
{
@@ -194,8 +198,7 @@ public static IEnumerable GetDefaultSources(string servi
if (arguments != null)
{
- l.Add(new FreeHostEnvironmentSource(
- instanceName: arguments.InstanceName));
+ l.Add(new FreeHostEnvironmentSource(instanceName: arguments.InstanceName));
}
l.Add(
@@ -204,7 +207,8 @@ public static IEnumerable GetDefaultSources(string servi
serviceName,
System.Environment.UserName,
System.Net.Dns.GetHostName(),
- infraVersion: infraVersion)));
+ infraVersion: infraVersion,
+ containerName: System.Environment.GetEnvironmentVariable("CONTAINERNAME"))));
return l;
}
diff --git a/Gigya.Microdot.Hosting/Environment/IHostEnvironmentSource.cs b/Gigya.Microdot.Hosting/Environment/IHostEnvironmentSource.cs
index 4048c533..55de90e4 100644
--- a/Gigya.Microdot.Hosting/Environment/IHostEnvironmentSource.cs
+++ b/Gigya.Microdot.Hosting/Environment/IHostEnvironmentSource.cs
@@ -20,9 +20,9 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.SharedLogic;
using System.Collections.Generic;
using System.IO;
-using Gigya.Microdot.SharedLogic;
namespace Gigya.Microdot.Hosting.Environment
{
@@ -32,6 +32,8 @@ public interface IHostEnvironmentSource
string Region { get; }
string DeploymentEnvironment { get; }
string ConsulAddress { get; }
+ string HostIPAddress { get; }
+ string ContainerName { get; }
string InstanceName { get; }
CurrentApplicationInfo ApplicationInfo { get; }
DirectoryInfo ConfigRoot { get; }
diff --git a/Gigya.Microdot.Hosting/Environment/LegacyFileHostConfigurationSource.cs b/Gigya.Microdot.Hosting/Environment/LegacyFileHostConfigurationSource.cs
index a6fed439..36970724 100644
--- a/Gigya.Microdot.Hosting/Environment/LegacyFileHostConfigurationSource.cs
+++ b/Gigya.Microdot.Hosting/Environment/LegacyFileHostConfigurationSource.cs
@@ -19,6 +19,10 @@ public sealed class LegacyFileHostConfigurationSource : IHostEnvironmentSource
public string DeploymentEnvironment { get; }
public string ConsulAddress { get; }
+
+ public string HostIPAddress { get; }
+
+ public string ContainerName { get; }
public string InstanceName { get; }
@@ -40,6 +44,8 @@ public LegacyFileHostConfigurationSource(string path)
Region = get("REGION");
DeploymentEnvironment = get("ENV");
ConsulAddress = get("CONSUL");
+ HostIPAddress = get("HOSTIPADDRESS");
+ ContainerName = get("CONTAINERNAME");
InstanceName = get("GIGYA_SERVICE_INSTANCE_NAME");
ConfigRoot = get("GIGYA_CONFIG_ROOT")?.To(x => new DirectoryInfo(x));
diff --git a/Gigya.Microdot.Hosting/Environment/TestHostEnvironmentSource.cs b/Gigya.Microdot.Hosting/Environment/TestHostEnvironmentSource.cs
index 3ff8613f..d5e6e939 100644
--- a/Gigya.Microdot.Hosting/Environment/TestHostEnvironmentSource.cs
+++ b/Gigya.Microdot.Hosting/Environment/TestHostEnvironmentSource.cs
@@ -20,10 +20,10 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Collections.Generic;
-using System.IO;
using Gigya.Microdot.LanguageExtensions;
using Gigya.Microdot.SharedLogic;
+using System.Collections.Generic;
+using System.IO;
namespace Gigya.Microdot.Hosting.Environment
{
@@ -36,6 +36,10 @@ public sealed class TestHostEnvironmentSource : IHostEnvironmentSource
public string DeploymentEnvironment { get; }
public string ConsulAddress { get; }
+
+ public string HostIPAddress { get; }
+
+ public string ContainerName { get; }
public string InstanceName { get; }
@@ -52,6 +56,8 @@ public TestHostEnvironmentSource(
string region = null,
string deploymentEnvironment = null,
string consulAddress = null,
+ string hostIPAddress = null,
+ string containerName = null,
string instanceName = null,
CurrentApplicationInfo applicationInfo = null,
DirectoryInfo configRoot = null,
@@ -63,6 +69,8 @@ public TestHostEnvironmentSource(
this.Region = region ?? "region";
this.DeploymentEnvironment = deploymentEnvironment ?? "env";
this.ConsulAddress = consulAddress ?? "addr";
+ this.HostIPAddress = hostIPAddress;
+ this.ContainerName = containerName;
this.InstanceName = instanceName ?? "test-instance";
this.ApplicationInfo = applicationInfo ?? new CurrentApplicationInfo(appName ?? "test", System.Environment.UserName, System.Net.Dns.GetHostName());
this.ConfigRoot = configRoot ?? new DirectoryInfo(this.GetType().Assembly.Location.To(Path.GetDirectoryName));
diff --git a/Gigya.Microdot.Hosting/Events/ServiceCallEvent.cs b/Gigya.Microdot.Hosting/Events/ServiceCallEvent.cs
index da443625..7ead61b9 100644
--- a/Gigya.Microdot.Hosting/Events/ServiceCallEvent.cs
+++ b/Gigya.Microdot.Hosting/Events/ServiceCallEvent.cs
@@ -20,13 +20,12 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text.RegularExpressions;
using Gigya.Microdot.Interfaces.Events;
using Gigya.Microdot.SharedLogic.Events;
using Gigya.Microdot.SharedLogic.HttpService;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
namespace Gigya.Microdot.Hosting.Events
{
diff --git a/Gigya.Microdot.Hosting/Events/StatsEvent.cs b/Gigya.Microdot.Hosting/Events/StatsEvent.cs
index 310cbcde..3fe58c57 100644
--- a/Gigya.Microdot.Hosting/Events/StatsEvent.cs
+++ b/Gigya.Microdot.Hosting/Events/StatsEvent.cs
@@ -20,12 +20,12 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Collections.Generic;
-using System.Globalization;
using Gigya.Microdot.Interfaces.Events;
using Gigya.Microdot.SharedLogic.Events;
using Gigya.Microdot.SharedLogic.Measurement;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
namespace Gigya.Microdot.Hosting.Events
{
diff --git a/Gigya.Microdot.Hosting/Gigya.Microdot.Hosting.csproj b/Gigya.Microdot.Hosting/Gigya.Microdot.Hosting.csproj
index 303cdb35..ccf23f24 100644
--- a/Gigya.Microdot.Hosting/Gigya.Microdot.Hosting.csproj
+++ b/Gigya.Microdot.Hosting/Gigya.Microdot.Hosting.csproj
@@ -1,19 +1,14 @@
-
- netstandard2.0
- true
- Gigya.Microdot.Hosting
- CODE_ANALYSIS;DEBUG;TRACE
- $(SolutionDir)main.ruleset
- 8.0
-
-
-
-
-
-
-
-
-
+
+ Gigya.Microdot.Hosting
+ Infrastructure used for hosting Microdot services, part of the Microdot framework.
+ gigya microdot microservice microservices
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/HttpService/AbstractServiceActivator.cs b/Gigya.Microdot.Hosting/HttpService/AbstractServiceActivator.cs
index 8cd28955..c3d4b022 100644
--- a/Gigya.Microdot.Hosting/HttpService/AbstractServiceActivator.cs
+++ b/Gigya.Microdot.Hosting/HttpService/AbstractServiceActivator.cs
@@ -20,11 +20,8 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
using System.Diagnostics;
-using System.Reflection;
using System.Threading.Tasks;
-using Gigya.Common.Contracts;
namespace Gigya.Microdot.Hosting.HttpService
{
diff --git a/Gigya.Microdot.Hosting/HttpService/EndPointMetaData.cs b/Gigya.Microdot.Hosting/HttpService/EndPointMetaData.cs
index eb0bb234..3c52b46c 100644
--- a/Gigya.Microdot.Hosting/HttpService/EndPointMetaData.cs
+++ b/Gigya.Microdot.Hosting/HttpService/EndPointMetaData.cs
@@ -21,12 +21,11 @@
#endregion
-using System;
+using Gigya.Microdot.SharedLogic.Events;
+using Gigya.ServiceContract.Attributes;
using System.Collections.Immutable;
using System.Linq;
using System.Reflection;
-using Gigya.Microdot.SharedLogic.Events;
-using Gigya.ServiceContract.Attributes;
namespace Gigya.Microdot.Hosting.HttpService
{
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/ConfigurationResponseBuilder.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/ConfigurationResponseBuilder.cs
index ef71a859..df0d3a2e 100644
--- a/Gigya.Microdot.Hosting/HttpService/Endpoints/ConfigurationResponseBuilder.cs
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/ConfigurationResponseBuilder.cs
@@ -20,6 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Configuration;
+using Gigya.Microdot.Interfaces;
+using Gigya.Microdot.Interfaces.SystemWrappers;
+using Gigya.Microdot.SharedLogic;
+using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -30,11 +35,6 @@
using System.Reflection;
using System.Runtime;
using System.Text;
-using Gigya.Microdot.Configuration;
-using Gigya.Microdot.Interfaces;
-using Gigya.Microdot.Interfaces.SystemWrappers;
-using Gigya.Microdot.SharedLogic;
-using Newtonsoft.Json;
namespace Gigya.Microdot.Hosting.HttpService.Endpoints
{
@@ -161,10 +161,15 @@ private Dictionary GetHashes()
private Dictionary GetEnvironmentVariables()
{
+ string[] envs = { "DC", "ZONE", "REGION", "ENV", "CONSUL", "OS" };
+
return System.Environment.GetEnvironmentVariables()
.OfType()
.Select(x => new { Name = (string)x.Key, Value = (string)x.Value })
- .Where(x => x.Name.ToUpper() == "DC" || x.Name.ToUpper() == "ZONE" || x.Name.ToUpper() == "REGION" || x.Name.ToUpper() == "ENV" || x.Name.ToUpper().Contains("GIGYA"))
+ .Where(x => envs.Contains(x.Name.ToUpper())
+ || x.Name.ToUpper().Contains("GIGYA")
+ || x.Name.ToUpper().Contains("DOTNET")
+ )
.OrderBy(x => x.Name)
.ToDictionary(x => x.Name, x => x.Value);
}
@@ -173,7 +178,7 @@ private Dictionary GetAssemblyVersions()
{
var specialVersions = new[] { new { Name = "(service)", Version = GetVersion(Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly()) } };
var assemblyVersions = AssemblyProvider.GetAssemblies()
- .Where(x => x.GlobalAssemblyCache == false)
+ //.Where(x => x.GlobalAssemblyCache == false)
.Select(a => new { a.GetName().Name, Version = GetVersion(a) });
return specialVersions
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCCollectionResult.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCCollectionResult.cs
new file mode 100644
index 00000000..cd9f5bbf
--- /dev/null
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCCollectionResult.cs
@@ -0,0 +1,16 @@
+namespace Gigya.Microdot.Hosting.HttpService.Endpoints.GCEndpoint
+{
+ public class GCCollectionResult
+ {
+ public long TotalMemoryBeforeGC { get; }
+ public long TotalMemoryAfterGC { get; }
+ public long ElapsedMilliseconds { get; }
+
+ public GCCollectionResult(long totalMemoryBeforeGc, long totalMemoryAfterGc, long elapsedMilliseconds)
+ {
+ TotalMemoryBeforeGC = totalMemoryBeforeGc;
+ TotalMemoryAfterGC = totalMemoryAfterGc;
+ ElapsedMilliseconds = elapsedMilliseconds;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCCustomEndpoint.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCCustomEndpoint.cs
new file mode 100644
index 00000000..b05f9510
--- /dev/null
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCCustomEndpoint.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Net;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+
+namespace Gigya.Microdot.Hosting.HttpService.Endpoints.GCEndpoint
+{
+ public class GCCustomEndpoint:ICustomEndpoint
+ {
+ private readonly IGCEndpointHandler _gcEndpointHandler;
+
+ public GCCustomEndpoint(IGCEndpointHandler gcEndpointHandler)
+ {
+ _gcEndpointHandler = gcEndpointHandler;
+ }
+ public async Task TryHandle(HttpListenerContext context, WriteResponseDelegate writeResponse)
+ {
+ try
+ {
+ var url = context?.Request.Url;
+ var sourceIPAddress = context?.Request.RemoteEndPoint?.Address;
+ var queryString = context?.Request.QueryString;
+
+ var gcHandleResult = await _gcEndpointHandler.Handle(url, queryString, sourceIPAddress);
+
+ if (gcHandleResult.Successful)
+ {
+ await writeResponse(
+ JsonConvert.SerializeObject(new
+ {
+ gcHandleResult.Message,
+ gcHandleResult.GcCollectionResult
+ })
+ ).ConfigureAwait(false);
+
+ return true;
+ }
+ }
+ catch (Exception e)
+ {
+ // ignore exceptions
+ }
+
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCEndpointHandler.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCEndpointHandler.cs
new file mode 100644
index 00000000..fc7dfc4c
--- /dev/null
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCEndpointHandler.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Specialized;
+using System.Net;
+using System.Threading.Tasks;
+using Gigya.Microdot.Hosting.Service;
+using Gigya.Microdot.Interfaces.Logging;
+
+namespace Gigya.Microdot.Hosting.HttpService.Endpoints.GCEndpoint
+{
+ public interface IGCEndpointHandler
+ {
+ Task Handle(Uri url, NameValueCollection queryString, IPAddress ipAddress);
+ }
+
+ public class GCEndpointHandler : IGCEndpointHandler
+ {
+ private readonly Func _microdotHostingConfigFactory;
+ private readonly ILog _logger;
+ private readonly IGCEndpointHandlerUtils _gcEndpointHandlerUtils;
+
+ public GCEndpointHandler(Func microdotHostingConfigFactory,
+ ILog logger,
+ IGCEndpointHandlerUtils gcEndpointHandlerUtils)
+ {
+ _microdotHostingConfigFactory = microdotHostingConfigFactory;
+ _logger = logger;
+ _gcEndpointHandlerUtils = gcEndpointHandlerUtils;
+ }
+
+ public async Task Handle(Uri url, NameValueCollection queryString, IPAddress ipAddress)
+ {
+ if (url.AbsolutePath != "/force-traffic-affecting-gc")
+ return new GCHandlingResult(false);
+
+ var config = _microdotHostingConfigFactory();
+
+ if (config.GCEndpointEnabled)
+ {
+
+ if (_gcEndpointHandlerUtils.TryProcessAsTokenGenerationRequest(queryString, ipAddress, out var additionalInfo))
+ return new GCHandlingResult(true, additionalInfo);
+
+ if (false == _gcEndpointHandlerUtils.ValidateToken(queryString, out additionalInfo))
+ return new GCHandlingResult(true, additionalInfo);
+
+ if (false == _gcEndpointHandlerUtils.ValidateGcType(queryString, out additionalInfo, out var gcType))
+ return new GCHandlingResult(true, additionalInfo);
+
+ var gcCollectionResult = _gcEndpointHandlerUtils.Collect(gcType);
+
+ _logger.Warn(log=>log("GC endpoint was called",unencryptedTags:new
+ {
+ GcType = gcType,
+ TotalMemoryAfterGC = gcCollectionResult.TotalMemoryAfterGC,
+ TotalMemoryBeforeGC = gcCollectionResult.TotalMemoryBeforeGC,
+ GCDuration = gcCollectionResult.ElapsedMilliseconds,
+ IPAddress = ipAddress.ToString()
+ }));
+
+ return new GCHandlingResult(
+ successful:true,
+ message:"GC ran successfully",
+ gcCollectionResult: gcCollectionResult);
+
+ }
+ else
+ {
+ return new GCHandlingResult(false);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCHandlingResult.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCHandlingResult.cs
new file mode 100644
index 00000000..020b3c51
--- /dev/null
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCHandlingResult.cs
@@ -0,0 +1,16 @@
+namespace Gigya.Microdot.Hosting.HttpService.Endpoints.GCEndpoint
+{
+ public class GCHandlingResult
+ {
+ public bool Successful { get; }
+ public string Message { get; }
+ public GCCollectionResult GcCollectionResult { get; }
+
+ public GCHandlingResult(bool successful, string message = null, GCCollectionResult gcCollectionResult = null)
+ {
+ Successful = successful;
+ Message = message;
+ GcCollectionResult = gcCollectionResult;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCTokenContainer.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCTokenContainer.cs
new file mode 100644
index 00000000..49493b6e
--- /dev/null
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCTokenContainer.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Concurrent;
+using Gigya.Microdot.Interfaces.SystemWrappers;
+
+namespace Gigya.Microdot.Hosting.HttpService.Endpoints.GCEndpoint
+{
+ public interface IGCTokenContainer
+ {
+ Guid GenerateToken();
+ bool ValidateToken(Guid tokenToValidate);
+ }
+
+ public class GCTokenContainer : IGCTokenContainer
+ {
+ private readonly IDateTime _dateTimeFactory;
+ private ConcurrentDictionary _gcCollectionTokens = new ConcurrentDictionary();
+
+
+ public GCTokenContainer(IDateTime _dateTimeFactory)
+ {
+ this._dateTimeFactory = _dateTimeFactory;
+ }
+
+
+ public Guid GenerateToken()
+ {
+ var now = _dateTimeFactory.UtcNow;
+
+ foreach (var tokenKvp in _gcCollectionTokens)
+ {
+ if (now - tokenKvp.Value > TimeSpan.FromMinutes(30))
+ {
+ _gcCollectionTokens.TryRemove(tokenKvp.Key, out _);
+ }
+ }
+
+ var newToken = Guid.NewGuid();
+ _gcCollectionTokens.TryAdd(newToken, now);
+
+ return newToken;
+ }
+
+ public bool ValidateToken(Guid tokenToValidate)
+ {
+ var now = _dateTimeFactory.UtcNow;
+
+ if (_gcCollectionTokens.TryGetValue(tokenToValidate, out var toeknCreationTime))
+ {
+ if (now - toeknCreationTime < TimeSpan.FromMinutes(30))
+ return true;
+
+ _gcCollectionTokens.TryRemove(tokenToValidate, out toeknCreationTime);
+ }
+
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCTokenHandler.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCTokenHandler.cs
new file mode 100644
index 00000000..5a21cda4
--- /dev/null
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCTokenHandler.cs
@@ -0,0 +1,168 @@
+using System;
+using System.Collections.Specialized;
+using System.Diagnostics;
+using System.Linq;
+using System.Net;
+using System.Runtime;
+using Gigya.Microdot.Hosting.Service;
+using Gigya.Microdot.Interfaces.Logging;
+using Gigya.Microdot.Interfaces.SystemWrappers;
+
+namespace Gigya.Microdot.Hosting.HttpService.Endpoints.GCEndpoint
+{
+ public interface IGCEndpointHandlerUtils
+ {
+ bool TryProcessAsTokenGenerationRequest(NameValueCollection queryString, IPAddress ipAddress,
+ out string additionalInfo);
+ bool ValidateToken(NameValueCollection queryString, out string additionalInfo);
+ bool ValidateGcType(NameValueCollection queryString, out string additionalInfo, out GCType gcType);
+ GCCollectionResult Collect(GCType gcType);
+ }
+
+ public class GCEndpointHandlerUtils : IGCEndpointHandlerUtils
+ {
+ private readonly Func _microdotHostingConfigFactory;
+ private readonly ILog _logger;
+ private readonly IDateTime _dateTimeFactory;
+ private readonly IGCTokenContainer _gcTokenContainer;
+ private DateTime _lastCalled = DateTime.MinValue;
+
+ public GCEndpointHandlerUtils(Func microdotHostingConfigFactory,
+ ILog logger, IDateTime dateTimeFactory, IGCTokenContainer gcTokenContainer)
+ {
+ _microdotHostingConfigFactory = microdotHostingConfigFactory;
+ _logger = logger;
+ _dateTimeFactory = dateTimeFactory;
+ _gcTokenContainer = gcTokenContainer;
+ }
+
+ public bool TryProcessAsTokenGenerationRequest(NameValueCollection queryString, IPAddress ipAddress,
+ out string additionalInfo)
+ {
+ var isGetTokenRequest = queryString.AllKeys.Any(x=> x=="getToken");
+
+ if (isGetTokenRequest)
+ {
+ var config = _microdotHostingConfigFactory();
+ var configGcGetTokenCooldown = config.GCGetTokenCooldown;
+ var now = _dateTimeFactory.UtcNow;
+
+ if (false == AssertCoolDownTime(configGcGetTokenCooldown, now, out var gcEndpointCooldownWaitTimeLeft))
+ {
+ additionalInfo = $"GC getToken cooldown in effect, will be ready in {gcEndpointCooldownWaitTimeLeft}";
+ return true;
+ }
+
+ var token = _gcTokenContainer.GenerateToken();
+
+ _logger.Warn(log=>log("GC getToken was called, see result in Token tag",unencryptedTags:new
+ {
+ Token = token,
+ IPAddress = ipAddress.ToString()
+ }));
+
+ _lastCalled = now;
+
+ additionalInfo = $"GC token generated";
+ return true;
+ }
+
+ additionalInfo = null;
+ return false;
+ }
+
+ public bool ValidateToken(NameValueCollection queryString, out string additionalInfo)
+ {
+ var requestToken = queryString.Get("token")?.ToUpper();
+
+ if ( requestToken == null
+ || false == Guid.TryParse(requestToken, out var parsedToken)
+ || false == _gcTokenContainer.ValidateToken(parsedToken)
+ )
+ {
+ additionalInfo = "Illegal request";
+ return false;
+ }
+
+ additionalInfo = null;
+ return true;
+ }
+
+ public bool ValidateGcType(NameValueCollection queryString, out string additionalInfo, out GCType gcType)
+ {
+ var gcTypeQueryParam = queryString.Get("gcType");
+
+ if (false == Enum.TryParse(gcTypeQueryParam, out gcType))
+ {
+ additionalInfo = "GCEndpoint called with unsupported GCType";
+ return false;
+ }
+
+ additionalInfo = null;
+ return true;
+ }
+
+ public GCCollectionResult Collect(GCType gcType)
+ {
+ var sp = Stopwatch.StartNew();
+ var totalMemoryBeforeGC = System.GC.GetTotalMemory(false);
+
+ switch (gcType)
+ {
+ case GCType.Gen0:
+ System.GC.Collect(0, GCCollectionMode.Forced);
+ break;
+ case GCType.Gen1:
+ System.GC.Collect(1, GCCollectionMode.Forced);
+ break;
+ case GCType.Gen2:
+ System.GC.Collect(2, GCCollectionMode.Forced);
+ break;
+ case GCType.LOHCompaction:
+ GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
+ System.GC.Collect(2, GCCollectionMode.Forced,false, true);
+ break;
+ case GCType.BlockingLohCompaction:
+ GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
+ System.GC.Collect(2, GCCollectionMode.Forced,true, true);
+ break;
+ default:
+ throw new ArgumentException("GCType");
+ }
+
+ var totalMemoryAfterGc = System.GC.GetTotalMemory(false);
+
+ return new GCCollectionResult(
+ totalMemoryBeforeGc: totalMemoryBeforeGC,
+ totalMemoryAfterGc: totalMemoryAfterGc,
+ elapsedMilliseconds: sp.ElapsedMilliseconds
+ );
+ }
+
+ private bool AssertCoolDownTime(TimeSpan? configGcEndpointCooldown, DateTime now, out TimeSpan gcEndpointCooldownWaitTimeLeft)
+ {
+ if (configGcEndpointCooldown != null
+ && configGcEndpointCooldown.HasValue)
+ {
+ gcEndpointCooldownWaitTimeLeft =
+ now - this._lastCalled - configGcEndpointCooldown.Value;
+
+ if (gcEndpointCooldownWaitTimeLeft < TimeSpan.Zero)
+ {
+ gcEndpointCooldownWaitTimeLeft = gcEndpointCooldownWaitTimeLeft.Negate();
+ return false;
+ }
+ else
+ {
+ gcEndpointCooldownWaitTimeLeft = TimeSpan.Zero;
+ }
+ }
+ else
+ {
+ gcEndpointCooldownWaitTimeLeft = TimeSpan.MaxValue;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCType.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCType.cs
new file mode 100644
index 00000000..080c2016
--- /dev/null
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/GCEndpoint/GCType.cs
@@ -0,0 +1,11 @@
+namespace Gigya.Microdot.Hosting.HttpService.Endpoints.GCEndpoint
+{
+ public enum GCType
+ {
+ Gen0,
+ Gen1,
+ Gen2,
+ LOHCompaction,
+ BlockingLohCompaction
+ }
+}
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/HealthEndpoint.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/HealthEndpoint.cs
index 5797bd57..e48586d1 100644
--- a/Gigya.Microdot.Hosting/HttpService/Endpoints/HealthEndpoint.cs
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/HealthEndpoint.cs
@@ -20,12 +20,12 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.Exceptions;
+using Gigya.Microdot.SharedLogic;
using System;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
-using Gigya.Common.Contracts.Exceptions;
-using Gigya.Microdot.SharedLogic;
namespace Gigya.Microdot.Hosting.HttpService.Endpoints
{
@@ -68,7 +68,8 @@ public async Task TryHandle(HttpListenerContext context, WriteResponseDele
else
{
var healthStatusResult = await CheckServiceHealth().ConfigureAwait(false);
-
+ if (healthStatusResult == null)
+ return false;
var status = healthStatusResult.IsHealthy ? HttpStatusCode.OK : HttpStatusCode.InternalServerError;
var json = healthStatusResult.Message;
await writeResponse(json, status).ConfigureAwait(false);
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/SchemaEndpoint.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/SchemaEndpoint.cs
index 26959527..720c4b01 100644
--- a/Gigya.Microdot.Hosting/HttpService/Endpoints/SchemaEndpoint.cs
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/SchemaEndpoint.cs
@@ -20,21 +20,37 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Net;
-using System.Threading.Tasks;
using Gigya.Common.Contracts.HttpService;
+using Gigya.Microdot.SharedLogic.HttpService;
using Newtonsoft.Json;
+using System.Net;
+using System.Threading.Tasks;
namespace Gigya.Microdot.Hosting.HttpService.Endpoints
{
public class SchemaEndpoint : ICustomEndpoint
{
private readonly string _jsonSchema;
+
+ public SchemaEndpoint(ServiceSchema schemaProvider, IServiceSchemaPostProcessor serviceSchemaPostProcessor)
+ {
+ _jsonSchema = GenerateJsonSchema(schemaProvider, serviceSchemaPostProcessor);
+ }
- public SchemaEndpoint(ServiceSchema schemaProvider)
+ private string GenerateJsonSchema(ServiceSchema schemaProvider,
+ IServiceSchemaPostProcessor serviceSchemaPostProcessor)
{
- _jsonSchema = JsonConvert.SerializeObject(schemaProvider, new JsonSerializerSettings{Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore});
- }
+ serviceSchemaPostProcessor.PostProcessServiceSchema(schemaProvider);
+
+ var jsonSchema = JsonConvert.SerializeObject(schemaProvider,
+ new JsonSerializerSettings
+ {
+ NullValueHandling = NullValueHandling.Ignore,
+ Formatting = Formatting.Indented,
+ DateParseHandling = DateParseHandling.None,
+ });
+ return jsonSchema;
+ }
public async Task TryHandle(HttpListenerContext context, WriteResponseDelegate writeResponse)
{
diff --git a/Gigya.Microdot.Hosting/HttpService/Endpoints/StatusEndpoints.cs b/Gigya.Microdot.Hosting/HttpService/Endpoints/StatusEndpoints.cs
new file mode 100644
index 00000000..33939d70
--- /dev/null
+++ b/Gigya.Microdot.Hosting/HttpService/Endpoints/StatusEndpoints.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Net;
+using System.Threading.Tasks;
+using Gigya.Common.Contracts.Exceptions;
+using Gigya.Microdot.Hosting.Service;
+using Gigya.Microdot.Interfaces.Logging;
+
+namespace Gigya.Microdot.Hosting.HttpService.Endpoints
+{
+ public class StatusEndpoints: ICustomEndpoint
+ {
+ private readonly Func _microdotHostingConfigFactory;
+ private readonly ILog _logger;
+
+ public StatusEndpoints(Func microdotHostingConfigFactory, ILog logger)
+ {
+ _microdotHostingConfigFactory = microdotHostingConfigFactory;
+ _logger = logger;
+ }
+
+ public async Task TryHandle(HttpListenerContext context, WriteResponseDelegate writeResponse)
+ {
+ var microdotHostingConfig = _microdotHostingConfigFactory();
+
+ foreach (var statusEndpoint in microdotHostingConfig.StatusEndpoints)
+ {
+ if (context.Request.Url.AbsolutePath.Equals(statusEndpoint, StringComparison.InvariantCultureIgnoreCase))
+ {
+ if (microdotHostingConfig.ShouldLogStatusEndpoint)
+ {
+ _logger.Info(log =>
+ {
+ log("Status", unencryptedTags: new Tags
+ {
+ { "RemoteIP", context?.Request?.RemoteEndPoint?.Address?.ToString() ?? "0" },
+ { "RemotePort", context?.Request?.RemoteEndPoint?.Port.ToString() },
+ { "StatusEndpoint", statusEndpoint }
+ });
+ });
+ }
+
+ await writeResponse(string.Empty).ConfigureAwait(false);
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Gigya.Microdot.Hosting/HttpService/HttpServiceListener.cs b/Gigya.Microdot.Hosting/HttpService/HttpServiceListener.cs
index 294545fe..df83e2be 100644
--- a/Gigya.Microdot.Hosting/HttpService/HttpServiceListener.cs
+++ b/Gigya.Microdot.Hosting/HttpService/HttpServiceListener.cs
@@ -20,17 +20,6 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Reflection;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
using Gigya.Common.Contracts;
using Gigya.Common.Contracts.Exceptions;
using Gigya.Common.Contracts.HttpService;
@@ -51,6 +40,16 @@
using Gigya.ServiceContract.Exceptions;
using Metrics;
using Newtonsoft.Json;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
using Timer = Metrics.Timer;
@@ -539,7 +538,17 @@ private void ValidateRequest(HttpListenerContext context)
{
context.Response.Headers.Add("Allow", "POST");
_failureCounter.Increment("NonPostRequest");
- throw new RequestException("Only POST calls are allowed.");
+ throw new RequestException(
+ "Only POST calls are allowed.",
+ unencrypted: new Tags
+ {
+ { "RemoteIP", context?.Request?.RemoteEndPoint?.Address?.ToString() ?? "0" },
+ { "RemotePort", context?.Request?.RemoteEndPoint?.Port.ToString() }
+ },
+ encrypted:new Tags()
+ {
+ { "requestedUrl", context?.Request?.Url?.ToString() }
+ });
}
if (context.Request.ContentType == null || context.Request.ContentType.StartsWith("application/json") == false)
diff --git a/Gigya.Microdot.Hosting/HttpService/IServiceEndPointDefinition.cs b/Gigya.Microdot.Hosting/HttpService/IServiceEndPointDefinition.cs
index 23e37d3d..0d1c1e7e 100644
--- a/Gigya.Microdot.Hosting/HttpService/IServiceEndPointDefinition.cs
+++ b/Gigya.Microdot.Hosting/HttpService/IServiceEndPointDefinition.cs
@@ -20,16 +20,16 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Collections.Generic;
using Gigya.Common.Contracts.HttpService;
using Gigya.Microdot.SharedLogic.HttpService;
+using System;
+using System.Collections.Generic;
namespace Gigya.Microdot.Hosting.HttpService
{
- ///
- /// Contains the metadata for establishing the service endpoing and resolving calls handled by a service.
- ///
+ ///
+ /// Contains the metadata for establishing the service endpoing and resolving calls handled by a service.
+ ///
public interface IServiceEndPointDefinition
{
///
diff --git a/Gigya.Microdot.Hosting/HttpService/IServiceInterfacesMapper.cs b/Gigya.Microdot.Hosting/HttpService/IServiceInterfacesMapper.cs
index 0415eed1..812cfec9 100644
--- a/Gigya.Microdot.Hosting/HttpService/IServiceInterfacesMapper.cs
+++ b/Gigya.Microdot.Hosting/HttpService/IServiceInterfacesMapper.cs
@@ -25,10 +25,10 @@
namespace Gigya.Microdot.Hosting.HttpService
{
- ///
- /// Mapping between service interfaces to grain interfaces. Used in Orleans for additional type information (for creating grain references).
- /// The map is an identity map outside orleans.
- ///
+ ///
+ /// Mapping between service interfaces to grain interfaces. Used in Orleans for additional type information (for creating grain references).
+ /// The map is an identity map outside orleans.
+ ///
public interface IServiceInterfaceMapper
{
///
diff --git a/Gigya.Microdot.Hosting/HttpService/IWarmup.cs b/Gigya.Microdot.Hosting/HttpService/IWarmup.cs
index 08b6ba93..78135131 100644
--- a/Gigya.Microdot.Hosting/HttpService/IWarmup.cs
+++ b/Gigya.Microdot.Hosting/HttpService/IWarmup.cs
@@ -20,7 +20,6 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Threading.Tasks;
namespace Gigya.Microdot.Hosting.HttpService
{
diff --git a/Gigya.Microdot.Hosting/HttpService/IdentityServiceInterfaceMapper.cs b/Gigya.Microdot.Hosting/HttpService/IdentityServiceInterfaceMapper.cs
index a18f0e60..88b70248 100644
--- a/Gigya.Microdot.Hosting/HttpService/IdentityServiceInterfaceMapper.cs
+++ b/Gigya.Microdot.Hosting/HttpService/IdentityServiceInterfaceMapper.cs
@@ -20,15 +20,15 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.Exceptions;
+using Gigya.Common.Contracts.HttpService;
using System;
using System.Linq;
using System.Reflection;
-using Gigya.Common.Contracts.Exceptions;
-using Gigya.Common.Contracts.HttpService;
namespace Gigya.Microdot.Hosting.HttpService
{
- public class IdentityServiceInterfaceMapper : ServiceInterfaceMapper
+ public class IdentityServiceInterfaceMapper : ServiceInterfaceMapper
{
public IdentityServiceInterfaceMapper(Type serviceInterfaceType) : this(new[] { serviceInterfaceType }) { }
diff --git a/Gigya.Microdot.Hosting/HttpService/ServerRequestPublisher.cs b/Gigya.Microdot.Hosting/HttpService/ServerRequestPublisher.cs
index 73a4d2f5..9dbaa6d9 100644
--- a/Gigya.Microdot.Hosting/HttpService/ServerRequestPublisher.cs
+++ b/Gigya.Microdot.Hosting/HttpService/ServerRequestPublisher.cs
@@ -1,9 +1,9 @@
-using System;
-using System.Collections.Generic;
-using Gigya.Microdot.Hosting.Events;
+using Gigya.Microdot.Hosting.Events;
using Gigya.Microdot.Interfaces.Events;
using Gigya.Microdot.Interfaces.Logging;
using Gigya.Microdot.SharedLogic.Events;
+using System;
+using System.Collections.Generic;
namespace Gigya.Microdot.Hosting.HttpService
{
diff --git a/Gigya.Microdot.Hosting/HttpService/ServiceEndPointDefinition.cs b/Gigya.Microdot.Hosting/HttpService/ServiceEndPointDefinition.cs
index d845d0a5..9b418d74 100644
--- a/Gigya.Microdot.Hosting/HttpService/ServiceEndPointDefinition.cs
+++ b/Gigya.Microdot.Hosting/HttpService/ServiceEndPointDefinition.cs
@@ -20,11 +20,6 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
using Gigya.Common.Contracts.Exceptions;
using Gigya.Common.Contracts.HttpService;
using Gigya.Microdot.Interfaces;
@@ -32,6 +27,11 @@
using Gigya.Microdot.SharedLogic;
using Gigya.Microdot.SharedLogic.Exceptions;
using Gigya.Microdot.SharedLogic.HttpService;
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
namespace Gigya.Microdot.Hosting.HttpService
{
diff --git a/Gigya.Microdot.Hosting/HttpService/ServiceInterfaceMapper.cs b/Gigya.Microdot.Hosting/HttpService/ServiceInterfaceMapper.cs
index c6cae0f5..5ecb7302 100644
--- a/Gigya.Microdot.Hosting/HttpService/ServiceInterfaceMapper.cs
+++ b/Gigya.Microdot.Hosting/HttpService/ServiceInterfaceMapper.cs
@@ -20,11 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.Exceptions;
+using Gigya.Microdot.Hosting.HttpService.Endpoints;
using System;
using System.Collections.Generic;
using System.Linq;
-using Gigya.Common.Contracts.Exceptions;
-using Gigya.Microdot.Hosting.HttpService.Endpoints;
namespace Gigya.Microdot.Hosting.HttpService
{
diff --git a/Gigya.Microdot.Hosting/HttpService/ServiceMethod.cs b/Gigya.Microdot.Hosting/HttpService/ServiceMethod.cs
index a1b86730..e80cd41e 100644
--- a/Gigya.Microdot.Hosting/HttpService/ServiceMethod.cs
+++ b/Gigya.Microdot.Hosting/HttpService/ServiceMethod.cs
@@ -20,16 +20,16 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.HttpService;
using System;
using System.Reflection;
using System.Threading.Tasks;
-using Gigya.Common.Contracts.HttpService;
namespace Gigya.Microdot.Hosting.HttpService
{
- ///
- /// A representation of a service method which contains the method to be invoked, and in Orleans, the grain interface type too.
- ///
+ ///
+ /// A representation of a service method which contains the method to be invoked, and in Orleans, the grain interface type too.
+ ///
public class ServiceMethod
{
/// The type of the grain interface, used in Orleans to create a grain reference (not used elsewhere)
diff --git a/Gigya.Microdot.Hosting/HttpService/ServiceMethodResolver.cs b/Gigya.Microdot.Hosting/HttpService/ServiceMethodResolver.cs
index 5ee6b13a..15480a9f 100644
--- a/Gigya.Microdot.Hosting/HttpService/ServiceMethodResolver.cs
+++ b/Gigya.Microdot.Hosting/HttpService/ServiceMethodResolver.cs
@@ -20,17 +20,17 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.Exceptions;
+using Gigya.Microdot.SharedLogic.HttpService;
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Reflection;
-using Gigya.Common.Contracts.Exceptions;
-using Gigya.Microdot.SharedLogic.HttpService;
namespace Gigya.Microdot.Hosting.HttpService
{
- internal class ServiceMethodResolver
+ internal class ServiceMethodResolver
{
private Dictionary MethodCache { get; }
diff --git a/Gigya.Microdot.Hosting/Metrics/MetricsConfiguration.cs b/Gigya.Microdot.Hosting/Metrics/MetricsConfiguration.cs
index 23dc2e3c..8a4e5a7c 100644
--- a/Gigya.Microdot.Hosting/Metrics/MetricsConfiguration.cs
+++ b/Gigya.Microdot.Hosting/Metrics/MetricsConfiguration.cs
@@ -1,5 +1,5 @@
-using System;
-using Gigya.Microdot.Interfaces.Configuration;
+using Gigya.Microdot.Interfaces.Configuration;
+using System;
namespace Gigya.Microdot.Hosting.Metrics
{
diff --git a/Gigya.Microdot.Hosting/Metrics/MetricsInitializer.cs b/Gigya.Microdot.Hosting/Metrics/MetricsInitializer.cs
index 08348280..cf475c69 100644
--- a/Gigya.Microdot.Hosting/Metrics/MetricsInitializer.cs
+++ b/Gigya.Microdot.Hosting/Metrics/MetricsInitializer.cs
@@ -1,13 +1,13 @@
-using System;
-using System.Net;
-using System.Threading.Tasks;
-using Gigya.Common.Contracts.Exceptions;
+using Gigya.Common.Contracts.Exceptions;
using Gigya.Microdot.Interfaces;
using Gigya.Microdot.Interfaces.Configuration;
using Gigya.Microdot.SharedLogic;
using Gigya.Microdot.SharedLogic.Monitor;
using Metrics;
using Metrics.Logging;
+using System;
+using System.Net;
+using System.Threading.Tasks;
using ILog = Gigya.Microdot.Interfaces.Logging.ILog;
namespace Gigya.Microdot.Hosting.Metrics
diff --git a/Gigya.Microdot.Hosting/Properties/AssemblyInfo.cs b/Gigya.Microdot.Hosting/Properties/AssemblyInfo.cs
index 261a4ceb..e0d5c3ec 100644
--- a/Gigya.Microdot.Hosting/Properties/AssemblyInfo.cs
+++ b/Gigya.Microdot.Hosting/Properties/AssemblyInfo.cs
@@ -20,7 +20,6 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
diff --git a/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs b/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs
index 95149e7f..1b80b1fc 100644
--- a/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs
+++ b/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs
@@ -1,59 +1,73 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Diagnostics;
-using System.Linq;
-using System.ServiceProcess;
+#region Copyright
+// Copyright 2017 Gigya Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
+using System.Threading;
+using System.Threading.Tasks;
using Gigya.Common.Contracts.Exceptions;
-using Gigya.Microdot.Configuration;
-using Gigya.Microdot.Hosting.HttpService;
+using Gigya.Microdot.Configuration;
using Gigya.Microdot.Interfaces.Configuration;
-using Gigya.Microdot.Interfaces.SystemWrappers;
-using Gigya.Microdot.SharedLogic;
-using Gigya.Microdot.SharedLogic.SystemWrappers;
+using Gigya.Microdot.SharedLogic;
+
-namespace Gigya.Microdot.Hosting.Service
+namespace Gigya.Microdot.Hosting.Service
{
[ConfigurationRoot("Microdot.Hosting", RootStrategy.ReplaceClassNameWithPath)]
public class MicrodotHostingConfig : IConfigObject
{
public bool FailServiceStartOnConfigError = true;
public bool ExtendedDelaysTimeLogging = true;
+ public List StatusEndpoints = new List();
+ public bool ShouldLogStatusEndpoint = false;
+ public bool GCEndpointEnabled = false;
+ public TimeSpan? GCGetTokenCooldown = TimeSpan.FromHours(1);
}
+ [ConfigurationRoot("Microdot.Hosting.ThreadPool", RootStrategy.ReplaceClassNameWithPath)]
+ public class MicrodotHostingThreadPoolConfig : IConfigObject
+ {
+ public bool MinThreadOverrideEnabled = true;
+ public bool MaxThreadOverrideEnabled = false;
+ public int MinWorkerThreads = 64;
+ public int MinCompletionPortThreads = 64;
+ public int MaxWorkerThreads = 32767;
+ public int MaxCompletionPortThreads = 1000;
+ }
+
+
+
public abstract class ServiceHostBase : IDisposable
{
- private bool disposed;
- private object syncRoot = new object();
+ private bool _disposed;
+ private readonly object _syncRoot = new object();
public abstract string ServiceName { get; }
public ServiceArguments Arguments { get; private set; }
- private DelegatingServiceBase WindowsService { get; set; }
private ManualResetEvent StopEvent { get; }
protected TaskCompletionSource
CommandLineNonInteractive,
-
- ///
- /// Specifies that the service will run as a Windows service. This is the default value when compiled with
- /// 'Release'.
- ///
- WindowsService,
-
+
///
/// Specifies that the service will run to verify configuration objects only (while performing only minimal required initialization).
/// Available IConfigObject implementations (config objects) in service assemblies will be instantiated to pass validations.
@@ -387,15 +372,14 @@ public enum ConsoleOutputMode
Standard,
///
- /// Specifies that log messages should not be written to the console at all. This is the default when running
- /// as .
+ /// Specifies that log messages should not be written to the console at all.
///
Disabled
}
///
- /// Specifies how a silo hosten in a service should find other nodes.
+ /// Specifies how a silo hosted in a service should find other nodes.
///
public enum SiloClusterMode
{
@@ -422,7 +406,6 @@ public enum SiloClusterMode
///
/// Specifies that this node belongs to a real cluster, which has it's membership table managed by ZooKeeper and
/// the reminder table stored on an external database. This is the default when running as
- /// .
///
ZooKeeper
}
diff --git a/Gigya.Microdot.SharedLogic/SystemWrappers/DateTimeImpl.cs b/Gigya.Microdot.SharedLogic/SystemWrappers/DateTimeImpl.cs
index e71cf5a3..ef13e29a 100644
--- a/Gigya.Microdot.SharedLogic/SystemWrappers/DateTimeImpl.cs
+++ b/Gigya.Microdot.SharedLogic/SystemWrappers/DateTimeImpl.cs
@@ -20,10 +20,10 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Interfaces.SystemWrappers;
using System;
using System.Threading;
using System.Threading.Tasks;
-using Gigya.Microdot.Interfaces.SystemWrappers;
namespace Gigya.Microdot.SharedLogic.SystemWrappers
{
diff --git a/Gigya.Microdot.SharedLogic/SystemWrappers/FileSystem.cs b/Gigya.Microdot.SharedLogic/SystemWrappers/FileSystem.cs
index 7f40c388..9a61fb0e 100644
--- a/Gigya.Microdot.SharedLogic/SystemWrappers/FileSystem.cs
+++ b/Gigya.Microdot.SharedLogic/SystemWrappers/FileSystem.cs
@@ -20,11 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Microdot.Interfaces.SystemWrappers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
-using Gigya.Microdot.Interfaces.SystemWrappers;
namespace Gigya.Microdot.SharedLogic.SystemWrappers
{
diff --git a/Gigya.Microdot.SharedLogic/Utils/Assert.cs b/Gigya.Microdot.SharedLogic/Utils/Assert.cs
index 2eefa6b6..3d7cd93e 100644
--- a/Gigya.Microdot.SharedLogic/Utils/Assert.cs
+++ b/Gigya.Microdot.SharedLogic/Utils/Assert.cs
@@ -20,12 +20,13 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.Exceptions;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
-using Gigya.Common.Contracts.Exceptions;
-namespace Gigya.Microdot.SharedLogic.Utils {
+namespace Gigya.Microdot.SharedLogic.Utils
+{
/// A Gigya equivalent for Microsoft.VisualStudio.TestTools.UnitTesting.Assert, to prevent including that
/// dependency, and to throw our own exception type. Assertion errors should be communicated to developers somehow in
diff --git a/Gigya.Microdot.SharedLogic/Utils/Extensions.cs b/Gigya.Microdot.SharedLogic/Utils/Extensions.cs
index 3e35e7e2..d57edf79 100644
--- a/Gigya.Microdot.SharedLogic/Utils/Extensions.cs
+++ b/Gigya.Microdot.SharedLogic/Utils/Extensions.cs
@@ -20,13 +20,11 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
+using Gigya.Common.Contracts.Exceptions;
+using Gigya.Microdot.SharedLogic.Events;
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using Gigya.Common.Contracts.Exceptions;
-using Gigya.Microdot.SharedLogic.Events;
namespace Gigya.Microdot.SharedLogic.Utils
{
diff --git a/Gigya.Microdot.SharedLogic/Utils/System.Diagnostics.cs b/Gigya.Microdot.SharedLogic/Utils/System.Diagnostics.cs
index 67107a11..723b17ea 100644
--- a/Gigya.Microdot.SharedLogic/Utils/System.Diagnostics.cs
+++ b/Gigya.Microdot.SharedLogic/Utils/System.Diagnostics.cs
@@ -1,5 +1,8 @@
using System.Collections.Generic;
-
+using System.Runtime.InteropServices;
+#if NET6_0_OR_GREATER
+using System.Runtime.Versioning;
+#endif
// ReSharper disable CheckNamespace
namespace System.Diagnostics
{
@@ -9,12 +12,21 @@ public static class ProcessExtensions
///
/// Enumerates the indexes of cores assgined to the current process by CPU affinity.
///
+#if NET6_0_OR_GREATER
+ [SupportedOSPlatformGuard("windows")]
+ [SupportedOSPlatformGuard("linux")]
+#endif
public static IEnumerable ProcessorAffinityList(this Process p)
{
- var mask = (ulong)p.ProcessorAffinity.ToInt64();
- for (var i = 0; i < 64; i++)
- if ((mask & 1ul << i) > 0)
- yield return i;
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ var mask = (ulong)p.ProcessorAffinity.ToInt64();
+ for (var i = 0; i < 64; i++)
+ if ((mask & 1ul << i) > 0)
+ yield return i;
+ }
+ else
+ throw new NotSupportedException($"Platform '{RuntimeInformation.OSDescription}' not supported");
}
}
diff --git a/Gigya.Microdot.SharedLogic/paket.references b/Gigya.Microdot.SharedLogic/paket.references
deleted file mode 100644
index c1b081e6..00000000
--- a/Gigya.Microdot.SharedLogic/paket.references
+++ /dev/null
@@ -1,8 +0,0 @@
-Gigya.ServiceContract
-Newtonsoft.Json
-System.ComponentModel.Annotations
-System.Diagnostics.PerformanceCounter
-System.Net.Http
-System.Threading.Tasks.Dataflow
-System.ValueTuple
-Microsoft.CSharp
diff --git a/Gigya.Microdot.SharedLogic/paket.template b/Gigya.Microdot.SharedLogic/paket.template
deleted file mode 100644
index fc250aeb..00000000
--- a/Gigya.Microdot.SharedLogic/paket.template
+++ /dev/null
@@ -1,10 +0,0 @@
-type
- project
-description
- Various components and utilities shared between different parts of the Microdot framework.
-projectUrl
- https://github.com/gigya/microdot
-licenseUrl
- https://github.com/gigya/microdot/blob/master/LICENSE.md
-tags
- gigya microdot microservice microservices
\ No newline at end of file
diff --git a/Gigya.Microdot.Testing.Shared/App.config b/Gigya.Microdot.Testing.Shared/App.config
deleted file mode 100644
index 69ebeb2f..00000000
--- a/Gigya.Microdot.Testing.Shared/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Gigya.Microdot.Testing.Shared/Gigya.Microdot.Testing.Shared.csproj b/Gigya.Microdot.Testing.Shared/Gigya.Microdot.Testing.Shared.csproj
index 4a792fd2..ac072fef 100644
--- a/Gigya.Microdot.Testing.Shared/Gigya.Microdot.Testing.Shared.csproj
+++ b/Gigya.Microdot.Testing.Shared/Gigya.Microdot.Testing.Shared.csproj
@@ -1,23 +1,17 @@
-
- netstandard2.0
- true
- true
- Gigya.Microdot.Testing.Shared
- $(SolutionDir)main.ruleset
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Gigya.Microdot.Testing.Shared
+
+ Tools to help write tests for Microdot services.
+ The project contains logic for both Orleans and Non-Orleans host testers.
+
+ gigya microdot microservice microservices fakes mocks mocking unit-testing
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Gigya.Microdot.Testing.Shared/Service/DisposablePort.cs b/Gigya.Microdot.Testing.Shared/Service/DisposablePort.cs
index de8c8961..6cccc758 100644
--- a/Gigya.Microdot.Testing.Shared/Service/DisposablePort.cs
+++ b/Gigya.Microdot.Testing.Shared/Service/DisposablePort.cs
@@ -1,19 +1,19 @@
-using System;
+using Gigya.Microdot.SharedLogic;
+using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.NetworkInformation;
using System.Threading;
-using Gigya.Microdot.SharedLogic;
namespace Gigya.Microdot.Testing.Shared.Service
{
public class DisposablePort : IDisposable
{
public readonly int Port;
- private readonly List _semaphores = new List(4);
- private static ConcurrentDictionary portMaintainer = new ConcurrentDictionary();
+ private readonly List _mutexes = new List(4);
+ private static ConcurrentDictionary portMaintainerMutex = new ConcurrentDictionary();
internal DisposablePort(int port)
{
@@ -22,11 +22,11 @@ internal DisposablePort(int port)
public void Dispose()
{
- foreach (var x in _semaphores)
+ foreach (var x in _mutexes)
{
try
{
- portMaintainer.TryRemove(x, out _);
+ portMaintainerMutex.TryRemove(x, out _);
x.Dispose();
}
catch (Exception ex)
@@ -72,7 +72,7 @@ public static DisposablePort GetPort(int retries, int rangeFrom, int rangeTo, in
var randomPort = random.Next(rangeFrom, rangeTo);
- // Check the every port in the sequence isn't occupoed
+ // Check the every port in the sequence isn't occupied
bool freeRange = true;
for (int port = randomPort; port < randomPort + sequence; port++)
{
@@ -94,7 +94,8 @@ public static DisposablePort GetPort(int retries, int rangeFrom, int rangeTo, in
for (int port = randomPort; port < randomPort + sequence; port++)
{
var name = $"ServiceTester-{port}";
- if (Semaphore.TryOpenExisting(name, out var _))
+
+ if (Mutex.TryOpenExisting(name, out _))
{
someOneElseWantThisPort = true;
}
@@ -102,9 +103,9 @@ public static DisposablePort GetPort(int retries, int rangeFrom, int rangeTo, in
{
try
{
- var item = new Semaphore(1, 1, name);
- result._semaphores.Add(item);
- portMaintainer.TryAdd(item, DateTime.UtcNow);
+ var item = new Mutex(true, name);
+ result._mutexes.Add(item);
+ portMaintainerMutex.TryAdd(item, DateTime.UtcNow);
if (port == randomPort)
{
IsHttpSysLocked(port);
@@ -127,7 +128,7 @@ public static DisposablePort GetPort(int retries, int rangeFrom, int rangeTo, in
Console.WriteLine($"Service Tester found a free port: {randomPort}. " +
$"After retries: {retry}. " +
$"Initially occupied ports: {occupiedPorts.Count}. " +
- $"Port maintainer contains: {portMaintainer.Count}. " +
+ $"Port maintainer contains: {portMaintainerMutex.Count}. " +
$"New semaphore exceptions: {totalNewSemExceptions}. " +
$"Total elapsed, ms: {sw.ElapsedMilliseconds}");
return result;
@@ -138,7 +139,7 @@ public static DisposablePort GetPort(int retries, int rangeFrom, int rangeTo, in
throw new Exception($"Can't find free port in range: [{rangeFrom}-{rangeTo}]." +
$"Retries: {retries}. " +
$"Currently occupied ports: {Occupied().Count}. " +
- $"Port maintainer contains: {portMaintainer.Count}. " +
+ $"Port maintainer contains: {portMaintainerMutex.Count}. " +
$"New semaphore exceptions: {totalNewSemExceptions}. " +
$"Total elapsed, ms: {sw.ElapsedMilliseconds}." +
$"Process id: {Process.GetCurrentProcess().Id}");
diff --git a/Gigya.Microdot.Testing.Shared/Service/NonOrleansServiceTester.cs b/Gigya.Microdot.Testing.Shared/Service/NonOrleansServiceTester.cs
index e81fb3bf..11f0c063 100644
--- a/Gigya.Microdot.Testing.Shared/Service/NonOrleansServiceTester.cs
+++ b/Gigya.Microdot.Testing.Shared/Service/NonOrleansServiceTester.cs
@@ -22,10 +22,7 @@
#endregion Copyright
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Environment;
using Gigya.Microdot.Hosting.Service;
-using Gigya.Microdot.Ninject.Host;
using Gigya.Microdot.SharedLogic;
using System;
using System.Threading.Tasks;
diff --git a/Gigya.Microdot.Testing.Shared/Service/ServiceTesterBase.cs b/Gigya.Microdot.Testing.Shared/Service/ServiceTesterBase.cs
index 00295837..b8bb0ecc 100644
--- a/Gigya.Microdot.Testing.Shared/Service/ServiceTesterBase.cs
+++ b/Gigya.Microdot.Testing.Shared/Service/ServiceTesterBase.cs
@@ -23,17 +23,14 @@
#endregion Copyright
using Gigya.Microdot.Fakes.Discovery;
+using Gigya.Microdot.Ninject;
using Gigya.Microdot.ServiceDiscovery.Rewrite;
using Gigya.Microdot.ServiceProxy;
using Gigya.Microdot.ServiceProxy.Caching;
+using Gigya.Microdot.UnitTests.Caching.Host;
using Ninject;
using Ninject.Parameters;
using System;
-using Gigya.Microdot.Ninject;
-using Gigya.Microdot.UnitTests.Caching.Host;
-using Gigya.Microdot.Interfaces.Configuration;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Environment;
namespace Gigya.Microdot.Testing.Shared.Service
{
diff --git a/Gigya.Microdot.Testing.Shared/paket.references b/Gigya.Microdot.Testing.Shared/paket.references
deleted file mode 100644
index 7c9388f8..00000000
--- a/Gigya.Microdot.Testing.Shared/paket.references
+++ /dev/null
@@ -1,5 +0,0 @@
-Gigya.ServiceContract
-Ninject
-System.Threading.Tasks.Dataflow
-Microsoft.CSharp
-System.Net.Http
\ No newline at end of file
diff --git a/Gigya.Microdot.Testing.Shared/paket.template b/Gigya.Microdot.Testing.Shared/paket.template
deleted file mode 100644
index b262eb20..00000000
--- a/Gigya.Microdot.Testing.Shared/paket.template
+++ /dev/null
@@ -1,11 +0,0 @@
-type
- project
-description
- Tools to help write tests for Microdot services.
- The project contains logic for both Orleans and Non-Orleans host testers.
-projectUrl
- https://github.com/gigya/microdot
-licenseUrl
- https://github.com/gigya/microdot/blob/master/LICENSE.md
-tags
- gigya microdot microservice microservices fakes mocks mocking unit-testing
\ No newline at end of file
diff --git a/Gigya.Microdot.Testing/Gigya.Microdot.Testing.csproj b/Gigya.Microdot.Testing/Gigya.Microdot.Testing.csproj
index b5d50716..ed60016e 100644
--- a/Gigya.Microdot.Testing/Gigya.Microdot.Testing.csproj
+++ b/Gigya.Microdot.Testing/Gigya.Microdot.Testing.csproj
@@ -1,24 +1,16 @@
-
- netstandard2.0
- true
- true
- Gigya.Microdot.Testing
- $(SolutionDir)main.ruleset
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Gigya.Microdot.Testing
+
+ Tools to help write tests for Microdot services.
+ The project contains logic for Orleans host testers.
+
+ gigya microdot microservice microservices fakes mocks mocking unit-testing
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Gigya.Microdot.Testing/Service/ServiceTester.cs b/Gigya.Microdot.Testing/Service/ServiceTester.cs
index 483ef795..34971453 100644
--- a/Gigya.Microdot.Testing/Service/ServiceTester.cs
+++ b/Gigya.Microdot.Testing/Service/ServiceTester.cs
@@ -23,11 +23,8 @@
#endregion Copyright
using Gigya.Common.Contracts.HttpService;
-using Gigya.Microdot.Common.Tests;
using Gigya.Microdot.Fakes;
-using Gigya.Microdot.Hosting.Environment;
using Gigya.Microdot.Hosting.Service;
-using Gigya.Microdot.Ninject.Host;
using Gigya.Microdot.Orleans.Hosting;
using Gigya.Microdot.Orleans.Ninject.Host;
using Gigya.Microdot.SharedLogic;
@@ -73,14 +70,14 @@ public ServiceTester(ServiceArguments serviceArguments = null, Type customSerial
private void Initialize()
{
- Host = new TServiceHost()
+ Host = new TServiceHost
{
FailServiceStartOnConfigError = false
};
BasePort = ServiceArguments.BasePortOverride ?? GetBasePortFromHttpServiceAttribute();
- this.SiloStopped = Task.Run(() => this.Host.Run((ServiceArguments)this.ServiceArguments));
+ SiloStopped = Task.Run(() => Host.Run(ServiceArguments));
//Silo is ready or failed to start
Task.WaitAny(SiloStopped, Host.WaitForServiceStartedAsync());
@@ -101,7 +98,7 @@ private void Initialize()
throw new Exception("Silo Failed to start");
}
- protected int GetBasePortFromHttpServiceAttribute()
+ private int GetBasePortFromHttpServiceAttribute()
{
var commonConfig = new BaseCommonConfig();
var mapper = new OrleansServiceInterfaceMapper(new AssemblyProvider(new ApplicationDirectoryProvider(commonConfig), commonConfig, new ConsoleLog()));
diff --git a/Gigya.Microdot.Testing/paket.references b/Gigya.Microdot.Testing/paket.references
deleted file mode 100644
index dd8cf923..00000000
--- a/Gigya.Microdot.Testing/paket.references
+++ /dev/null
@@ -1,6 +0,0 @@
-Gigya.ServiceContract
-Ninject
-Microsoft.Orleans.Client
-Microsoft.CSharp
-System.Net.Http
-
diff --git a/Gigya.Microdot.Testing/paket.template b/Gigya.Microdot.Testing/paket.template
deleted file mode 100644
index 29a14918..00000000
--- a/Gigya.Microdot.Testing/paket.template
+++ /dev/null
@@ -1,11 +0,0 @@
-type
- project
-description
- Tools to help write tests for Microdot services.
- The project contains logic for Orleans host testers.
-projectUrl
- https://github.com/gigya/microdot
-licenseUrl
- https://github.com/gigya/microdot/blob/master/LICENSE.md
-tags
- gigya microdot microservice microservices fakes mocks mocking unit-testing
\ No newline at end of file
diff --git a/Gigya.ServiceContract/.paket/Paket.Restore.targets b/Gigya.ServiceContract/.paket/Paket.Restore.targets
deleted file mode 100644
index 8cb5986c..00000000
--- a/Gigya.ServiceContract/.paket/Paket.Restore.targets
+++ /dev/null
@@ -1,488 +0,0 @@
-
-
-
-
-
-
- $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
-
- $(MSBuildVersion)
- 15.0.0
- false
- true
-
- true
- $(MSBuildThisFileDirectory)
- $(MSBuildThisFileDirectory)..\
- $(PaketRootPath)paket-files\paket.restore.cached
- $(PaketRootPath)paket.lock
- classic
- proj
- assembly
- native
- /Library/Frameworks/Mono.framework/Commands/mono
- mono
-
-
- $(PaketRootPath)paket.bootstrapper.exe
- $(PaketToolsPath)paket.bootstrapper.exe
- $([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\
-
- "$(PaketBootStrapperExePath)"
- $(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"
-
-
- True
-
-
- False
-
- $(BaseIntermediateOutputPath.TrimEnd('\').TrimEnd('\/'))
-
-
-
-
-
-
-
-
- $(PaketRootPath)paket
- $(PaketToolsPath)paket
-
-
-
-
-
- $(PaketRootPath)paket.exe
- $(PaketToolsPath)paket.exe
-
-
-
-
-
- <_DotnetToolsJson Condition="Exists('$(PaketRootPath)/.config/dotnet-tools.json')">$([System.IO.File]::ReadAllText("$(PaketRootPath)/.config/dotnet-tools.json"))
- <_ConfigContainsPaket Condition=" '$(_DotnetToolsJson)' != ''">$(_DotnetToolsJson.Contains('"paket"'))
- <_ConfigContainsPaket Condition=" '$(_ConfigContainsPaket)' == ''">false
-
-
-
-
-
-
-
-
-
-
- <_PaketCommand>dotnet paket
-
-
-
-
-
- $(PaketToolsPath)paket
- $(PaketBootStrapperExeDir)paket
-
-
- paket
-
-
-
-
- <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))
- <_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"
- <_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"
- <_PaketCommand Condition=" '$(_PaketCommand)' == '' ">"$(PaketExePath)"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- $(NoWarn);NU1603;NU1604;NU1605;NU1608
- false
- true
-
-
-
-
-
-
-
-
- $([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))
-
-
-
-
-
-
- $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[0].Replace(`"`, ``).Replace(` `, ``))
- $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[1].Replace(`"`, ``).Replace(` `, ``))
-
-
-
-
- %(PaketRestoreCachedKeyValue.Value)
- %(PaketRestoreCachedKeyValue.Value)
-
-
-
-
- true
- false
- true
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.references.cached
-
- $(MSBuildProjectFullPath).paket.references
-
- $(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references
-
- $(MSBuildProjectDirectory)\paket.references
-
- false
- true
- true
- references-file-or-cache-not-found
-
-
-
-
- $([System.IO.File]::ReadAllText('$(PaketReferencesCachedFilePath)'))
- $([System.IO.File]::ReadAllText('$(PaketOriginalReferencesFilePath)'))
- references-file
- false
-
-
-
-
- false
-
-
-
-
- true
- target-framework '$(TargetFramework)' or '$(TargetFrameworks)' files @(PaketResolvedFilePaths)
-
-
-
-
-
-
-
-
-
-
- false
- true
-
-
-
-
-
-
-
-
-
-
- $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)
- $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])
- $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])
- $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])
- $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])
-
-
- %(PaketReferencesFileLinesInfo.PackageVersion)
- All
- runtime
- runtime
- true
- true
-
-
-
-
- $(PaketIntermediateOutputPath)/$(MSBuildProjectFile).paket.clitools
-
-
-
-
-
-
-
-
- $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[0])
- $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[1])
-
-
- %(PaketCliToolFileLinesInfo.PackageVersion)
-
-
-
-
-
-
-
-
-
- false
-
-
-
-
-
- <_NuspecFilesNewLocation Include="$(PaketIntermediateOutputPath)\$(Configuration)\*.nuspec"/>
-
-
-
-
-
- $(MSBuildProjectDirectory)/$(MSBuildProjectFile)
- true
- false
- true
- false
- true
- false
- true
- false
- true
- $(PaketIntermediateOutputPath)\$(Configuration)
- $(PaketIntermediateOutputPath)
-
-
-
- <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion.Split(`+`)[0]).nuspec"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Gigya.ServiceContract/.paket/paket.bootstrapper.exe b/Gigya.ServiceContract/.paket/paket.bootstrapper.exe
deleted file mode 100644
index b98e000b..00000000
Binary files a/Gigya.ServiceContract/.paket/paket.bootstrapper.exe and /dev/null differ
diff --git a/Gigya.ServiceContract/.paket/paket.exe b/Gigya.ServiceContract/.paket/paket.exe
deleted file mode 100644
index 3e92760f..00000000
Binary files a/Gigya.ServiceContract/.paket/paket.exe and /dev/null differ
diff --git a/Gigya.ServiceContract/.paket/paket.targets b/Gigya.ServiceContract/.paket/paket.targets
deleted file mode 100644
index 0fd370f9..00000000
--- a/Gigya.ServiceContract/.paket/paket.targets
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- true
-
- true
- $(MSBuildThisFileDirectory)
- $(MSBuildThisFileDirectory)..\
- /Library/Frameworks/Mono.framework/Commands/mono
- mono
-
-
-
- $(PaketToolsPath)paket.exe
- $(PaketToolsPath)paket.bootstrapper.exe
- "$(PaketExePath)"
- $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"
- "$(PaketBootStrapperExePath)" $(PaketBootStrapperCommandArgs)
- $(MonoPath) --runtime=v4.0.30319 $(PaketBootStrapperExePath) $(PaketBootStrapperCommandArgs)
-
- $(MSBuildProjectDirectory)\paket.references
- $(MSBuildStartupDirectory)\paket.references
- $(MSBuildProjectFullPath).paket.references
- $(PaketCommand) restore --references-files "$(PaketReferences)"
- $(PaketBootStrapperCommand)
-
- RestorePackages; $(BuildDependsOn);
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Gigya.ServiceContract/.paket/restore.bat b/Gigya.ServiceContract/.paket/restore.bat
deleted file mode 100644
index deb7a57f..00000000
--- a/Gigya.ServiceContract/.paket/restore.bat
+++ /dev/null
@@ -1,7 +0,0 @@
-@echo off
-cd /d %~dp0
-paket.bootstrapper.exe
-paket.exe restore
-echo.
-echo.
-pause
\ No newline at end of file
diff --git a/Gigya.ServiceContract/.paket/update.bat b/Gigya.ServiceContract/.paket/update.bat
deleted file mode 100644
index 3c4773b2..00000000
--- a/Gigya.ServiceContract/.paket/update.bat
+++ /dev/null
@@ -1,7 +0,0 @@
-@echo off
-cd /d %~dp0
-paket.bootstrapper.exe
-paket.exe update
-echo.
-echo.
-pause
\ No newline at end of file
diff --git a/Gigya.ServiceContract/Attributes/CachedAttribute.cs b/Gigya.ServiceContract/Attributes/CachedAttribute.cs
deleted file mode 100644
index 99487c2f..00000000
--- a/Gigya.ServiceContract/Attributes/CachedAttribute.cs
+++ /dev/null
@@ -1,350 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-
-namespace Gigya.Common.Contracts.Attributes
-{
- //
- // Specifies that the method should be cached using the CachingProxy.Set the relevant properties to control caching settings.Note
- // that clients may override these preferences with their own.Also note that clients using older versions of Microdot may ignore some
- // of these settings.
- //
- [AttributeUsage(AttributeTargets.Method)]
- public class CachedAttribute : Attribute, IMethodCachingSettings
- {
- public CachedAttribute()
- {
- if (RefreshTime > ExpirationTime)
- throw new ArgumentException("RefreshTime cannot be longer than ExpirationTime");
-
- if ((ResponseKindsToCache & ResponseKindsToIgnore) > 0)
- throw new ArgumentException("You cannot define a specific response kind both in ResponseKindsToCache and ResponseKindsToIgnore");
- }
-
- /// Defines which kinds of responses clients should cache (non-null, null, exceptions, etc). Default: non-null and null
- /// responses. Note that if the client called the method and received a response that needs to be cached (e.g. non-null), then later
- /// refreshes the response and receives a response that shouldn't be cached (e.g. null), it will remove the previous response from
- /// the cache, unless that kind of response is set to be ignored (see ). Also note that if you
- /// choose to cache exceptions, there's currently no way to revoke them (you can't add revoke keys to exceptions).
- public ResponseKinds ResponseKindsToCache { get; set; }
-
-
- /// When a client has a cached response but tries to obtain a fresh value (since it was revoked or is considered old), it
- /// will ignore bad responses (e.g. exceptions) and return the last-good value instead. This enum defines which kinds of responses
- /// to ignore. Note that you may not define the same kind both here and in .
- /// Default: all exceptions.
- public ResponseKinds ResponseKindsToIgnore { get; set; }
-
-
- /// You can either manually revoke responses from client caches (by returning Revocable<> responses and using
- /// an ICacheRevoker to revoke them), or define a time-to-live for cached responses so that clients will periodically fetch
- /// up-to-date responses. Using manual revokes is preferred since revoke messages typically arrive to clients immediately so they
- /// don't keep using stale responses once something was changed, i.e. they'll be "strongly consistent" instead of "eventually
- /// consistent". Using time-to-live will cause clients to use stale responses up to , and
- /// they will generate a constant stream of requests (as long as they use particular pieces of data) to fetch up-to-date values,
- /// even if the responses haven't changed.
- public RefreshMode RefreshMode { get; set; }
-
-
- ///
- /// Default: 1 minute. Once a response was cached, and assuming refreshing is enabled as per ,
- /// clients will periodically ATTEMPT to fetch a fresh response. If they fail to do so (e.g. in case of a timeout error, and in case
- /// that's not allowed by ), then they'll keep using the last-good cached response, up to
- /// , but they will keep retrying to fetch fresh values in the mean time. The higher this value,
- /// the lower the load on your service, and the less up-to-date responses clients will cache. Consider what issues could be caused
- /// by clients using stale responses (they might make wrong decisions based on these responses, or write that stale data somewhere).
- ///
- public TimeSpan? RefreshTime { get; set; }
-
- public double RefreshTimeInMinutes
- {
- get => RefreshTime?.TotalMinutes ?? -1;
- set => RefreshTime = value == -1 ? null : (TimeSpan?)TimeSpan.FromMinutes(value);
- }
-
-
- ///
- /// Default: 360 minutes (6 hours). How long should clients cache responses for. When that time passed, responses are evicted from
- /// the cache, unless they were refreshed earlier (see ), or unless
- /// specifies the expiration time is auto-extended when a cached response is used. Responses might be evicted earlier if they were
- /// explicitly revoked or due to RAM pressure on client machines. Note that in case your service is unavailable, incoming requests
- /// will fail and your service clients won't be able to fall back to cached responses after that time, possibly causing them to fail
- /// as well. When picking a value, think how long it might take you to restore your service in case of a production disaster (e.g. 6
- /// hours). But also consider what issues could be caused by clients using very old stale responses (they might make wrong decisions
- /// based on these responses, or write that stale data somewhere).
- ///
- public TimeSpan? ExpirationTime { get; set; }
-
- public double ExpirationTimeInMinutes
- {
- get => ExpirationTime?.TotalMinutes ?? -1;
- set => ExpirationTime = value == -1 ? null : (TimeSpan?)TimeSpan.FromMinutes(value);
- }
-
-
- ///
- /// Default: 1 second. When a client calls this method and receives a failure response (e.g. in case of a timeout error, and in case
- /// it should be ignored as per ), it will not cache the response, and will keep using the last-
- /// good response in the mean time, if any. However, it will wait a shorter delay than till it
- /// attempts to refresh the data, since the response is now considered old and shouldn't be used for much longer. This delay is used
- /// so clients don't "attack" your service when it's already potentially having availability issues. To disable, set to 0.
- ///
- public TimeSpan? FailedRefreshDelay { get; set; }
-
- public double FailedRefreshDelayInSeconds
- {
- get => FailedRefreshDelay?.TotalSeconds ?? -1;
- set => FailedRefreshDelay = value == -1 ? null : (TimeSpan?)TimeSpan.FromSeconds(value);
- }
-
-
- ///
- /// Default: Enabled. When a client calls this method multiple times concurrently with the same parameters, the caching layer will
- /// "group" the requests and issue a single request to this method, to reduce the load on this service. It is assumed that this
- /// method returns the exact same answer given the exact same parameters. This flag controls whether to use request grouping or not.
- ///
- public RequestGroupingBehavior RequestGroupingBehavior { get; set; }
-
-
- ///
- /// Determines what clients do when accessing a cached response that is considered old, i.e. its refresh time passed.
- ///
- public RefreshBehavior RefreshBehavior { get; set; }
-
-
- ///
- /// Dictates what clients do when a cached response is explicitly revoked by the server.
- ///
- public RevokedResponseBehavior RevokedResponseBehavior { get; set; }
-
-
- ///
- /// Defines how cached response expiration time is auto-extended.
- ///
- public ExpirationBehavior ExpirationBehavior { get; set; }
-
-
- ///
- /// Default: Enabled. When clients bypass their cache for specific requests using TracingContext.SuppressCaching(), this flag controls
- /// whether the response will be cached. I.e. clients ignore the cache while READING, but not necessarily when WRITING.
- ///
- public CacheResponsesWhenSupressedBehavior CacheResponsesWhenSupressedBehavior { get; set; }
-
- ///
- /// Default: Disabled. Defines whether to remove the previously cached response in case a response that we dont want to cache nor to ignore is received
- ///
- public NotIgnoredResponseBehavior NotIgnoredResponseBehavior { get; set; }
-
- // Not in use
- bool? IMethodCachingSettings.Enabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
- }
-
- public interface IMethodCachingSettings
- {
- bool? Enabled { get; set; }
- ResponseKinds ResponseKindsToCache { get; set; }
- ResponseKinds ResponseKindsToIgnore { get; set; }
- RefreshMode RefreshMode { get; set; }
- TimeSpan? RefreshTime { get; set; }
- TimeSpan? ExpirationTime { get; set; }
- TimeSpan? FailedRefreshDelay { get; set; }
- RequestGroupingBehavior RequestGroupingBehavior { get; set; }
- RefreshBehavior RefreshBehavior { get; set; }
- RevokedResponseBehavior RevokedResponseBehavior { get; set; }
- ExpirationBehavior ExpirationBehavior { get; set; }
- CacheResponsesWhenSupressedBehavior CacheResponsesWhenSupressedBehavior { get; set; }
- NotIgnoredResponseBehavior NotIgnoredResponseBehavior { get; set; }
- }
-
-
- /// The various kinds of responses that can be obtained from a service (non-null, null, exceptions).
- [Flags]
- public enum ResponseKinds
- {
- /// Normal, non-null response. This does not include non-null Revocable<> with a null inner Value.
- NonNullResponse = 1 << 0,
-
- /// Null response. This includes non-null Revocable<> with a null inner Value.
- NullResponse = 1 << 1,
-
- /// (e.g. 404 not found).
- RequestException = 1 << 2,
-
- /// (e.g. 500 internal server error).
- EnvironmentException = 1 << 3,
-
- /// or .
- TimeoutException = 1 << 4,
-
- /// Exceptions other than Request, Environment, Timeout and TaskCanceled.
- OtherExceptions = 1 << 5,
- }
-
-
- /// Controls if and how refreshes should be used.
- public enum RefreshMode
- {
- /// Use this option in case this method does not return Revocable<> responses or you don't use an
- /// ICacheRevoker to revoke cached responses. Clients will periodically fetch up-to-date responses.
- UseRefreshes = 1,
-
- /// Use this option in case this method returns Revocable<> responses and you use an ICacheRevoker to revoke cached
- /// responses. Refreshes will NOT be used (since you're revoking responses manually) except in case a client detects that it is
- /// unable to obtain cache revoke messages, in which case it will fall back to using soft expiration until it reconnects to the
- /// revoke messages stream. Note that during that time your service will experience higher incoming traffic.
- UseRefreshesWhenDisconnectedFromCacheRevokesBus = 2,
-
- /// DANGEROUS. Use this option to prevent clients from refreshing responses, up to the time they expire (see
- /// ).
- DoNotUseRefreshes = 3,
- }
-
-
- ///
- /// Whether or not to group outgoing requests to the same method with the same parameters.
- ///
- public enum RequestGroupingBehavior
- {
- Enabled = 1,
- Disabled = 2,
- }
-
-
- ///
- /// Determines what clients do when accessing a cached response that is considered old, i.e. its refresh time passed.
- ///
- public enum RefreshBehavior
- {
- ///
- /// When a client encounters a cached response that is older than , it will attempt to call
- /// this method and fetch a fresh value. If it fails to do so (i.e. the response does not match ),
- /// it will keep using the old value. This lets the client to continue providing service while this service is down. It is assumed
- /// that it is preferable to use stale responses over not providing service. The client will retry fetching a new value the next
- /// time it needs that response with a minimum delay of between retries, unless it had no
- /// previously-cache response, in which case it might issue a request as soon as it received a reply for the previous one. This is
- /// the default for Microdot v4+ clients.
- ///
- TryFetchNewValueOrUseOld = 1,
-
-
- ///
- /// DANGEROUS! When a client encounters a cached response that is older than , it will
- /// use it even though it's old (possibly several hours old), and will issue a request to obtain a fresh value so the NEXT time it
- /// needs it, it'll be (more) up-to-date (though if it needs it much later, it'll be old anyway). This behavior prioritizes low
- /// latency over fresh data. This is the default for Microdot v1, v2 and v3 clients.
- ///
- UseOldAndFetchNewValueInBackground = 2,
- }
-
-
- ///
- /// Dictates what clients do when a cached response is explicitly revoked by the server.
- ///
- public enum RevokedResponseBehavior
- {
- ///
- /// When a client receives a revoke message, it looks for all cached responses tagged with that message key and marks them
- /// as "stale". The NEXT time the client happens to need such a cached response (if it didn't expire by then), it will ignore
- /// the cached response and call this method to obtain fresh data. If the new response does not match
- /// , it will use the stale cached response. This lets the client to continue providing
- /// service while this service is down. It is assumed that it is preferable to use stale responses over not providing service.
- /// This is the default for Microdot v3+ clients.
- ///
- TryFetchNewValueNextTimeOrUseOld = 1,
-
- ///
- /// DANGEROUS! When a client receives a revoke message, it looks for all cached responses tagged with that message key and marks them
- /// as "stale". With this option, the NEXT time the client happens to need such a cached response (if it didn't expire by then), it
- /// will immediately return the stale response and initiate a background call to the target service to obtain an up-to-date response,
- /// for the next-next time it needs it. Use this option if your clients need the lowest latency possible, even at the cost of using
- /// stale data (that can be several hours out-of-date). This is the default for Microdot v1,v2 and v3 clients.
- ///
- TryFetchNewValueInBackgroundNextTime = 2,
-
- ///
- /// DANGEROUS! With this option, when a client receives a cache revoke message, it will look for all cached responses from that
- /// method tagged with that message key and immediately issue a request to this method to obtain an up-to-date value for each of
- /// them. Use this option if your clients need the lowest latency possible, even at the cost of issuing redundant calls to your
- /// method for data they haven't been using for a while. Use this in case your clients cache and actively use a large portion of
- /// all possible responses from that method.
- ///
- //TryFetchNewValueImmediately = 3,
-
- ///
- /// DANGEROUS! With this option, when a client receives a cache revoke message, it will immediately stop using all cached responses
- /// tagged with that message key. In case your service becomes unavailable the client will not have last-good cached responses
- /// to fall back to, which may cause it to fail, in turn. Use this option in case your clients must absolutely not use stale
- /// responses, even at the cost of not providing service.
- ///
- FetchNewValueNextTime = 4,
-
- ///
- /// DANGEROUS! With this option, when a client receives a cache revoke message, it will ignore the message and keep using stale
- /// responses. You can achieve a similar effect by not returning Revocable<> responses, or responses with an empty list of
- /// revoke keys. If that's inconvenient, you can use this option as a work-around.
- ///
- KeepUsingRevokedResponse = 5,
- }
-
-
- ///
- /// Defines how cached response expiration time is auto-extended.
- ///
- public enum ExpirationBehavior
- {
- ///
- /// This option defines that every time a response is read from the cache, its expiration is pushed forward. This is suitable when
- /// you use manual cache revokes and responses aren't auto-refreshed (since you set to
- /// ), hence their expiration isn't updated, and you don't want them to expire while
- /// they're still in use.
- ///
- ExtendExpirationWhenReadFromCache = 1,
-
- ///
- /// This option defines that cached responses will be expired on time, regardless if they were used or not. This is suitable when
- /// you set to ; refresh operations, that occur when clients make
- /// use of cached responses, automatically extend the expiration time.
- ///
- DoNotExtendExpirationWhenReadFromCache = 2,
- }
-
-
- ///
- /// When clients bypass their cache for specific requests using TracingContext.SuppressCaching(), this option controls
- /// whether the response will be cached. I.e. clients ignore the cache while READING, but not necessarily when WRITING.
- ///
- public enum CacheResponsesWhenSupressedBehavior
- {
- Enabled = 1,
- Disabled = 2,
- }
-
- ///
- /// Defines whether to remove the previously cached response in case a response that we dont want to cache nor to ignore is received
- ///
- public enum NotIgnoredResponseBehavior
- {
- RemoveCachedResponse = 1,
- KeepCachedResponse = 2,
- }
-}
diff --git a/Gigya.ServiceContract/Attributes/EventAttrubute.cs b/Gigya.ServiceContract/Attributes/EventAttrubute.cs
deleted file mode 100644
index b2cd58dc..00000000
--- a/Gigya.ServiceContract/Attributes/EventAttrubute.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-
-namespace Gigya.ServiceContract.Attributes
-{
- /// Mark the parameter as containing sensitive data.
- /// When sensitive data is automaticity logged (e.g. event publisher) it will be encrypted.
- ///
- [AttributeUsage(AttributeTargets.Parameter| AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field)]
-
- public class SensitiveAttribute : Attribute
- {
- /// Mark the parameter as containing Secretive data.
- ///it will never log automaticity (e.g. event publisher).
- ///
- public bool Secretive { get; set; }
- }
-
- /// Mark the parameter as containing nonsensitive data.
- /// When nonsensitive data is automaticity logged (e.g. event publisher) it wont be encrypted.
- ///
- [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field)]
- public class NonSensitiveAttribute : Attribute{}
-
-
-}
diff --git a/Gigya.ServiceContract/Attributes/HttpServiceAttribute.cs b/Gigya.ServiceContract/Attributes/HttpServiceAttribute.cs
deleted file mode 100644
index e2a7d842..00000000
--- a/Gigya.ServiceContract/Attributes/HttpServiceAttribute.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-
-namespace Gigya.Common.Contracts.HttpService
-{
- [AttributeUsage(AttributeTargets.Interface)]
- public class HttpServiceAttribute : Attribute
- {
- ///
- /// This is the port number that the service will listen to for incoming HTTP requests. Other ports (used for
- /// Orleans, Metrics.Net, etc) are opened at sequential numbers from this base offset.
- ///
- public int BasePort { get; set; }
-
- public bool UseHttps { get; set; }
-
- public HttpServiceAttribute(int basePort)
- {
- BasePort = basePort;
- }
-
- [Obsolete("This propery is no longer in use, and will be removed on Microdot version 2.0. Service name is now extracted from its interface's namespace.")]
- public string Name { get; set; }
- }
-}
diff --git a/Gigya.ServiceContract/Attributes/LogFieldsAttribute.cs b/Gigya.ServiceContract/Attributes/LogFieldsAttribute.cs
deleted file mode 100644
index bdf8f0b0..00000000
--- a/Gigya.ServiceContract/Attributes/LogFieldsAttribute.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-
-namespace Gigya.ServiceContract.Attributes
-{
- /// Mark the parameter as containing log field data
- /// by providing this attribute the class will be dissects into properties.
- ///
- [AttributeUsage(AttributeTargets.Parameter)]
- public class LogFieldsAttribute : Attribute { }
-}
\ No newline at end of file
diff --git a/Gigya.ServiceContract/Attributes/PublicEndpointAttribute.cs b/Gigya.ServiceContract/Attributes/PublicEndpointAttribute.cs
deleted file mode 100644
index 55de1724..00000000
--- a/Gigya.ServiceContract/Attributes/PublicEndpointAttribute.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-
-namespace Gigya.Common.Contracts.HttpService
-{
-
- ///
- /// Specifies that this method is exposed to the external world, and can be called via Gator.
- ///
- [AttributeUsage(AttributeTargets.Method)]
- public class PublicEndpointAttribute : Attribute
- {
- ///
- /// Full endpoint name (e.g. "accounts.getPolicies"). If is specified, should specify the a logical name in the same format, which will be used for logging and rate limit.
- ///
- public string EndpointName { get; set; }
-
- ///
- /// True if only HTTPS requests are allowed to call this endpoint, false if both HTTP and HTTPS requests are allowed.
- ///
- public bool RequireHTTPS { get; set; } = true;
-
- ///
- /// Defines how to map the response from this method to the response returned by Gator. If not specified, this
- /// method's response will be returned as-is to the outside world, along with Gigya's standard response fields
- /// (statusCode, errorCode, statusReason, callId, etc.), unless your response already includes them, or some of
- /// them. If you do specify a name, all of your response will be put under that json property name, and the
- /// standard response fields will be next to it.
- ///
- public string PropertyNameForResponseBody { get; set; } = null;
-
- ///
- /// Specifies the routing regex that determines which matching URLs will be routed to this method.
- /// Regex is matched against the path only, not the domain or query string.
- /// When specifying a value for this property, calls won't be routed to this method according to the command name.
- /// In this case, the command name is only used for logging and rate limit.
- ///
- public string UrlPathRegex { get; set; } = null;
-
- ///
- /// True if calls to this method should bypass authentication checks, otherwise false.
- ///
- public bool SkipPermissionChecks { get; set; } = false;
-
- ///
- /// True if calls to this method should bypass datacenter checks, otherwise false.
- ///
- public bool SkipDatacenterChecks { get; set; } = false;
-
- ///
- /// True if this method accepts a single parameter where the request parameters should be mapped to each of its properties,
- /// false if request parameters should be directly mapped to the method's parameters.
- ///
- public bool UsingRequestObject { get; set; } = false;
-
- /// Full endpoint name (e.g. "accounts.getPolicies"). If is specified, should specify the a logical name in the same format, which will be used for logging and rate limit.
- ///
- /// Whether Gator should reject requests from the outside world that were passed over http and not https, and
- /// not forward them to the service.
- ///
- ///
- /// Defines how to map the response from this method to the response returned by Gator. If not specified, this
- /// method's response will be returned as-is to the outside world, along with Gigya's standard response fields
- /// (statusCode, errorCode, statusReason, callId, etc.), unless your response already includes them, or some of
- /// them. If you do specify a name, all of your response will be put under that json property name, and the
- /// standard response fields will be next to it.
- ///
- [Obsolete("Please use the other constructor overload that accepts only an 'endpoint' parameter, and specify all other paramters with the attributes optional named parameter syntax (MyProp = 5)")]
- public PublicEndpointAttribute(string endpointName, bool requireHTTPS = true, string propertyNameForResponseBody = null)
- {
- EndpointName = endpointName;
- RequireHTTPS = requireHTTPS;
- PropertyNameForResponseBody = propertyNameForResponseBody;
- }
-
- /// Full endpoint name (e.g. "accounts.getPolicies"). If is specified, should specify the a logical name in the same format, which will be used for logging and rate limit.
- public PublicEndpointAttribute(string endpointName)
- {
- EndpointName = endpointName;
- }
-
- internal PublicEndpointAttribute()
- {
-
- }
- }
-}
diff --git a/Gigya.ServiceContract/Exceptions/Breadcrumb.cs b/Gigya.ServiceContract/Exceptions/Breadcrumb.cs
deleted file mode 100644
index feca6823..00000000
--- a/Gigya.ServiceContract/Exceptions/Breadcrumb.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-namespace Gigya.ServiceContract.Exceptions
-{
- [Serializable]
- public class Breadcrumb
- {
- public string ServiceName { get; set; }
- public string ServiceVersion { get; set; }
- public string HostName { get; set; }
- public string DataCenter { get; set; }
- public string DeploymentEnvironment { get; set; }
-
- public override string ToString()
- {
- return $"{ServiceName} v{ServiceVersion} on {HostName} in {DataCenter}-{DeploymentEnvironment}";
- }
- }
-}
diff --git a/Gigya.ServiceContract/Exceptions/EnvironmentException.cs b/Gigya.ServiceContract/Exceptions/EnvironmentException.cs
deleted file mode 100644
index 33c1e148..00000000
--- a/Gigya.ServiceContract/Exceptions/EnvironmentException.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Runtime.Serialization;
-
-namespace Gigya.Common.Contracts.Exceptions
-{
- ///
- /// This exception denotes a problem with the environment, such as a database that's down, an external service
- /// we rely on that's inaccessible, a missing or invalid configuration file, or even going out of memory. Exceptions of
- /// this type are sometimes recoverable, e.g. by retrying the DB operation. They're the same kind of errors that cause
- /// web servers to return HTTP 5xx errors. Exceptions of this type are routed by default to IT/Operations -- it's up to
- /// them to fix the problem in production environment. s, on the other hand, are
- /// routed to developers.
- ///
- [Serializable]
- public class EnvironmentException : SerializableException
- {
- ///
- /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
- ///
- /// The error message that explains the reason for the exception.
- /// Optional. The exception that is the cause of the current exception.
- /// Optional. A collection of type that contains additional data about the exception, which must be encrypted when stored.
- /// Optional. A collection of type that contains additional data about the exception, which needn't be encrypted when stored.
- public EnvironmentException(string message, Exception innerException = null, Tags encrypted = null, Tags unencrypted = null) : base(message, innerException, encrypted, unencrypted) { }
-
- /// Initializes a new instance of the class with serialized data.
- /// The that holds the serialized object data about the exception being thrown.
- /// The that contains contextual information about the source or destination.
- /// The parameter is null.
- /// The class name is null or is zero (0).
- protected EnvironmentException(SerializationInfo info, StreamingContext context) : base(info, context) { }
- }
-}
diff --git a/Gigya.ServiceContract/Exceptions/InvalidParameterValueException.cs b/Gigya.ServiceContract/Exceptions/InvalidParameterValueException.cs
deleted file mode 100644
index 727f3848..00000000
--- a/Gigya.ServiceContract/Exceptions/InvalidParameterValueException.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Runtime.Serialization;
-using Gigya.Common.Contracts.Exceptions;
-using Newtonsoft.Json;
-
-namespace Gigya.ServiceContract.Exceptions
-{
- ///
- /// This excpetion is thrown if a parameter contains an invalid value
- ///
- [Serializable]
- public class InvalidParameterValueException: RequestException
- {
- ///ErrorCode of Invalid_parameter_value
- public override int? ErrorCode => 400006;
-
- ///
- /// Name of the parameter which has an invalid value
- ///
- [JsonProperty]
- public string parameterName { get; set; }
-
- ///
- /// For parameters that contain data structures, the path inside the data structure pointing to the field/property that
- /// caused the deserialization or validation error.
- ///
- public string[] ErrorPath { get; set; }
-
- ///
- /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
- ///
- /// Name of the parameter which has an invalid value
- /// For parameters that contain data structures, the path inside the data structure pointing to the field/property that
- /// caused the deserialization or validation error.
- /// The error message that explains the reason for the exception.
- /// Optional. A collection of type that contains additional data about the exception, which must be encrypted when stored.
- /// Optional. A collection of type that contains additional data about the exception, which needn't be encrypted when stored.
- /// Optional. The exception that is the cause of the current exception.
- public InvalidParameterValueException(string paramName, string[] errorPath, string message, Exception innerException = null, Tags encrypted = null, Tags unencrypted = null) : base(message, innerException, encrypted, unencrypted)
- {
- parameterName = paramName;
- ErrorPath = errorPath;
- }
-
- /// Initializes a new instance of the class with serialized data.
- /// The that holds the serialized object data about the exception being thrown.
- /// The that contains contextual information about the source or destination.
- /// The parameter is null.
- /// The class name is null or is zero (0).
- public InvalidParameterValueException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
- }
-}
diff --git a/Gigya.ServiceContract/Exceptions/ProgrammaticException.cs b/Gigya.ServiceContract/Exceptions/ProgrammaticException.cs
deleted file mode 100644
index 4cee7d0c..00000000
--- a/Gigya.ServiceContract/Exceptions/ProgrammaticException.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Runtime.Serialization;
-
-namespace Gigya.Common.Contracts.Exceptions
-{
- ///
- /// This exception denotes a programmatic error, i.e. a bug we detected in our code at run time. For example,
- /// you can throw this when your method was called with a null pointer, or if someone attempts to use a static class
- /// you wrote before initializing it. Throw this when you detect you're in an invalid state (e.g. using assertions).
- /// Exceptions of this type are logged and (hopefully) routed to developers. s, on
- /// the other hand, are routed to IT/Operations.
- ///
- [Serializable]
- public class ProgrammaticException : SerializableException
- {
- ///
- /// Initializes a new instance of the class with a specified error message
- /// and a reference to the inner exception that is the cause of this exception.
- ///
- /// The error message that explains the reason for the exception.
- /// Optional. The exception that is the cause of the current exception.
- /// Optional. A collection of type that contains additional data
- /// about the exception, which must be encrypted when stored.
- /// Optional. A collection of type that contains additional data
- /// about the exception, which needn't be encrypted when stored.
- public ProgrammaticException(string message, Exception innerException = null, Tags encrypted = null, Tags unencrypted = null)
- : base(message, innerException, encrypted, unencrypted) { }
-
- ///
- /// Initializes a new instance of the class with serialized data.
- ///
- /// The that holds the serialized object data about the
- /// exception being thrown.
- /// The that contains contextual information about the
- /// source or destination.
- /// The parameter is null.
- /// The class name is null or is zero
- /// (0).
- protected ProgrammaticException(SerializationInfo info, StreamingContext context)
- : base(info, context) { }
- }
-
- ///
- /// This exception is thrown by services when they encounter any unhandled exception that doesn't derive from
- /// (e.g. ). It contains the original
- /// exception in its property. On the client-side, they are instead exposed
- /// as an RemoteServiceException, having an inner exception copied over. You should never throw this exception from
- /// your code.
- ///
- [Serializable, Obsolete("No longer used, preserved for backwards compatibility with older servers.")]
- public class UnhandledException : ProgrammaticException
- {
- ///
- /// Initializes a new instance of the class with the specified inner exception
- /// that is the cause of this exception.
- ///
- /// The exception that is the cause of the current exception.
- /// Optional. A collection of type that contains additional data
- /// about the exception, which must be encrypted when stored.
- /// Optional. A collection of type that contains additional data
- /// about the exception, which needn't be encrypted when stored.
- public UnhandledException(Exception innerException, Tags encrypted = null, Tags unencrypted = null)
- : base("An unhandled exception occurred when processing this request. See InnerException for details.", innerException, encrypted, unencrypted) { }
-
- ///
- /// Initializes a new instance of the class with serialized data.
- ///
- /// The that holds the serialized object data about the
- /// exception being thrown.
- /// The that contains contextual information about the
- /// source or destination.
- /// The parameter is null.
- /// The class name is null or is zero
- /// (0).
- protected UnhandledException(SerializationInfo info, StreamingContext context)
- : base(info, context) { }
- }
-}
diff --git a/Gigya.ServiceContract/Exceptions/RemoteServiceException.cs b/Gigya.ServiceContract/Exceptions/RemoteServiceException.cs
deleted file mode 100644
index 5b32b108..00000000
--- a/Gigya.ServiceContract/Exceptions/RemoteServiceException.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Runtime.Serialization;
-using Gigya.Common.Contracts.Exceptions;
-
-namespace Gigya.Common.Application.HttpService.Client
-{
- [Serializable]
- public class RemoteServiceException : EnvironmentException
- {
- public string RequestedUri { get; private set; }
-
- ///
- /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
- ///
- /// The error message that explains the reason for the exception.
- /// The URI requested when the remote service call failed.
- /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.
- /// Optional. A collection of type that contains additional data about the exception, which must be encrypted when stored.
- /// Optional. A collection of type that contains additional data about the exception, which needn't be encrypted when stored.
- /// Optional. Additional details about the exception.
- public RemoteServiceException(string message, string requestedUri, Exception innerException = null, Tags encrypted = null, Tags unencrypted = null, string details = null)
- : base(message, innerException, encrypted, unencrypted)
- {
- RequestedUri = requestedUri;
- }
-
- /// Initializes a new instance of the class with serialized data.
- /// The that holds the serialized object data about the exception being thrown.
- /// The that contains contextual information about the source or destination.
- /// The parameter is null.
- /// The class name is null or is zero (0).
- // ReSharper disable once UnusedMember.Global
- protected RemoteServiceException(SerializationInfo info, StreamingContext context) : base(info, context) { }
- }
-}
\ No newline at end of file
diff --git a/Gigya.ServiceContract/Exceptions/RequestException.cs b/Gigya.ServiceContract/Exceptions/RequestException.cs
deleted file mode 100644
index a35074e5..00000000
--- a/Gigya.ServiceContract/Exceptions/RequestException.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Runtime.Serialization;
-
-namespace Gigya.Common.Contracts.Exceptions
-{
- ///
- /// This exception denotes a problem in an incoming request. For example, a missing required parameter, bad
- /// format, no permissions, trying to act on an entity that was deleted (e.g. site, user), etc. It should NOT be thrown
- /// when the request is valid but we fail to process it due to some internal error;
- /// or should be thrown instead. Exceptions of this type are the same kind of errors
- /// that cause web servers to return HTTP 4xx errors. Note that clients to external systems should catch exceptions of
- /// this type and re-throw them as .
- ///
- [Serializable]
- public class RequestException : SerializableException
- {
- ///
- /// Represents custom error code for easily distinguish between different types of request exceptions.
- ///
- public virtual int? ErrorCode { get; private set; }
-
-
- ///
- /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
- ///
- /// The error message that explains the reason for the exception.
- /// Optional. A collection of type that contains additional data about the exception, which must be encrypted when stored.
- /// Optional. A collection of type that contains additional data about the exception, which needn't be encrypted when stored.
- /// Optional. The exception that is the cause of the current exception.
- public RequestException(string message, Exception innerException = null, Tags encrypted = null, Tags unencrypted = null): this(message, null, innerException, encrypted, unencrypted)
- {
- }
-
- /// The error message that explains the reason for the exception.
- /// Represents custom error code for easily distinguish between different types of request exceptions.
- /// Optional. The exception that is the cause of the current exception.
- /// Optional. A collection of type that contains additional data about the exception, which must be encrypted when stored.
- /// Optional. A collection of type that contains additional data about the exception, which needn't be encrypted when stored.
- ///
- /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
- ///
- public RequestException(string message, int? errorCode, Exception innerException = null, Tags encrypted = null, Tags unencrypted = null)
- : base(message, innerException, encrypted, unencrypted)
- {
- ErrorCode = errorCode;
- }
-
- /// Initializes a new instance of the class with serialized data.
- /// The that holds the serialized object data about the exception being thrown.
- /// The that contains contextual information about the source or destination.
- /// The parameter is null.
- /// The class name is null or is zero (0).
- protected RequestException(SerializationInfo info, StreamingContext context) : base(info, context) { }
- }
-
-
-
- [Serializable]
- public class SecureRequestException : RequestException
- {
-
- ///
- /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
- ///
- /// The error message that explains the reason for the exception.
- /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.
- /// Optional. A collection of type that contains additional data about the exception, which must be encrypted when stored.
- /// Optional. A collection of type that contains additional data about the exception, which needn't be encrypted when stored.
- public SecureRequestException(string message, Exception innerException = null, Tags encrypted = null, Tags unencrypted = null) : base(message, innerException, encrypted: encrypted, unencrypted: unencrypted) { }
-
- /// Initializes a new instance of the class with serialized data.
- /// The that holds the serialized object data about the exception being thrown.
- /// The that contains contextual information about the source or destination.
- /// The parameter is null.
- /// The class name is null or is zero (0).
- protected SecureRequestException(SerializationInfo info, StreamingContext context) : base(info, context) { }
-
- }
-}
diff --git a/Gigya.ServiceContract/Exceptions/SerializableException.cs b/Gigya.ServiceContract/Exceptions/SerializableException.cs
deleted file mode 100644
index 8046de60..00000000
--- a/Gigya.ServiceContract/Exceptions/SerializableException.cs
+++ /dev/null
@@ -1,329 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Text;
-using Gigya.ServiceContract.Exceptions;
-
-namespace Gigya.Common.Contracts.Exceptions
-{
- ///
- /// Abstract base class for all exceptions which support advanced serialization features, such as automatic property
- /// serialization and tags. When writing custom exceptions, please read the remarks section.
- ///
- ///
- ///
- /// When writing custom exceptions, make sure you do the following:
- ///
- /// -
- /// Mark the exception with the SerializableAttribute.
- ///
- /// -
- /// Do not inherit from SerializableException, but instead inherit from one of the three concrete
- /// implementations:
- /// , , .
- ///
- /// -
- /// Make sure to call the appropriate base constructor from your constructors.
- ///
- /// -
- /// Include a protected constructor with parameters (,
- /// ) which calls the base constructor with same parameters.
- ///
- ///
- ///
- /// Exception that correctly inherit as described above, have all their public properties that have a setter
- /// (including a non-public setter) serialized and deserialized automatically, in addition to tags (fields are not
- /// serialized). The values of those properties must be marked with a SerializableAttribute since the
- /// serialization is sometimes performed by (within Orleans). Also, the values of
- /// these properties should be immutable.
- ///
- /// If a getter of a property returns null or throws an exception during serialization, it will not be serialized.
- /// However, if a setter of a property throws an exception during deserialization, it will throw a
- /// .
- ///
- /// There is no need to override the GetObjectData method in your custom exception to have your properties
- /// automatically serialized.
- ///
- /// When an attempt is made to deserialize an exception, but the exact type of the exception is not available in
- /// that context (e.g. a derived exception type that only exists on the serializing side, not the deserializing
- /// side), then an attempt is made to deserialize that exception as it's base-type (the inheritance hierarchy is
- /// serialized together with the exception), and if that fails, with the base-base-type, etc. When deserializing an
- /// exception into a base type, there could be some properties that existed on the original derived type but do not
- /// exist on the base type. Those properties were serialized, but there is no corresponding property to deserialize
- /// them into. These values will be available in the the property. This can also
- /// occur when an exception class changes (e.g. a property is renamed or removed), but only the serializing side is
- /// using the new version, therefore there will be properties that will not match and will be accessible on the
- /// deserializing side via the property.
- ///
- /// Those differences can also mean that data could be missing for a certain property (if that property was removed
- /// from the class definition on the serializing side). In such a case, the property will be left uninitialized
- /// (with its default value), unless it is marked with a , in which case the
- /// deserialization will fail with a specifying which required property values
- /// are missing.
- ///
- ///
- ///
- /// The following is an example of a correctly implemented exception:
- ///
- ///
- [Serializable]
- public abstract class SerializableException : Exception
- {
- private const string EXTENDED_PROPERTIES_NAMES_KEY = "ExtendedPropertiesNames";
- private const string EXTENDED_PROPERTIES_VALUES_KEY = "ExtendedPropertiesValues";
- private const string BREADCRUMBS_KEY = "Breadcrumbs";
-
- private readonly Dictionary _extendedProperties;
- private Breadcrumb[] _breadcrumbs;
-
- ///
- /// A read-only dictionary of tags that must be encrypted when stored. They are, however, serialized (and
- /// therefore transmitted) without encryption.
- ///
- public IReadOnlyDictionary EncryptedTags { get; private set; }
- ///
- /// A read-only dictionary of tags that needn't be encrypted when stored.
- ///
- public IReadOnlyDictionary UnencryptedTags { get; private set; }
-
- ///
- /// A read-only dictionary of property values that failed to deserialize into a matching property (either
- /// because there was no property with a matching name, or the setter of the property threw an exception). Each
- /// key is the name of the serialized property and the value is the
- /// serialized property's value.
- ///
- public IReadOnlyDictionary ExtendedProperties => new ReadOnlyDictionary(_extendedProperties);
-
- public IReadOnlyList Breadcrumbs => new ReadOnlyCollection(_breadcrumbs);
-
- ///
- /// Initializes a new instance of the class with a specified error message
- /// and a reference to the inner exception that is the cause of this exception.
- ///
- /// The error message that explains the reason for the exception.
- /// Optional. The exception that is the cause of the current exception.
- /// Optional. A collection of type that contains additional data
- /// about the exception, which must be encrypted when stored.
- /// Optional. A collection of type that contains additional data
- /// about the exception, which needn't be encrypted when stored.
- protected SerializableException(string message, Exception innerException = null, Tags encrypted = null, Tags unencrypted = null) : base(message, innerException)
- {
- if (encrypted != null && encrypted.Any())
- EncryptedTags = new ReadOnlyDictionary(new Dictionary(encrypted));
-
- if (unencrypted != null && unencrypted.Any())
- UnencryptedTags = new ReadOnlyDictionary(new Dictionary(unencrypted));
-
- _extendedProperties = new Dictionary();
- _breadcrumbs = new Breadcrumb[0];
- }
-
- /// Initializes a new instance of the class with serialized
- /// data.
- /// The that holds the serialized object data about the
- /// exception being thrown.
- /// The that contains contextual information about the
- /// source or destination.
- /// The parameter is null.
- /// The class name is null, is zero (0)
- /// or deserialization of extended properties encountered an error.
- protected SerializableException(SerializationInfo info, StreamingContext context) : base(info, new StreamingContext(StreamingContextStates.CrossAppDomain, context.State))
- {
- _extendedProperties = new Dictionary();
-
- var extendedPropertiesNames = (string[])info.GetValue(EXTENDED_PROPERTIES_NAMES_KEY, typeof(string[]));
- var extendedPropertiesValues = (object[])info.GetValue(EXTENDED_PROPERTIES_VALUES_KEY, typeof(object[]));
-
- if (extendedPropertiesNames == null && extendedPropertiesValues == null)
- return;
-
- if (extendedPropertiesNames == null || extendedPropertiesValues == null || extendedPropertiesNames.Length != extendedPropertiesValues.Length)
- throw new SerializationException("Failed to deserialize exception - bad extended properties data.");
-
- for (int i = 0; i < extendedPropertiesNames.Length; i++)
- _extendedProperties.Add(extendedPropertiesNames[i], extendedPropertiesValues[i]);
-
- _extendedProperties.TryGetValue(nameof(EncryptedTags), out object tags);
- EncryptedTags = tags as IReadOnlyDictionary;
- _extendedProperties.Remove(nameof(EncryptedTags));
-
- _extendedProperties.TryGetValue(nameof(UnencryptedTags), out tags);
- UnencryptedTags = tags as IReadOnlyDictionary;
- _extendedProperties.Remove(nameof(UnencryptedTags));
-
- var properties = GetProperties().ToDictionary(p => p.Name);
-
- foreach (var extendedProperty in _extendedProperties.ToArray())
- {
-
- if (properties.TryGetValue(extendedProperty.Key, out PropertyInfo property))
- {
- try
- {
- property.SetValue(this, JsonHelper.ConvertWeaklyTypedValue(extendedProperty.Value, property.PropertyType));
- _extendedProperties.Remove(extendedProperty.Key);
- properties.Remove(extendedProperty.Key);
- }
- catch (Exception ex)
- {
- throw new SerializationException($"Failed to deserialize exception - failed to populate extended property '{property.Name}'. See InnerException for details.", ex);
- }
- }
- }
-
- try
- {
- _breadcrumbs = (Breadcrumb[])info.GetValue(BREADCRUMBS_KEY, typeof(Breadcrumb[]));
- }
- catch (SerializationException)
- {
- _breadcrumbs = new Breadcrumb[0];
- }
- }
-
-
- ///
- /// When overridden in a derived class, sets the
- /// with information about the exception.
- ///
- /// The that holds the
- /// serialized object data about the exception being thrown.
- /// The that contains
- /// contextual information about the source or destination.
- /// The parameter is a null reference
- /// (Nothing in Visual Basic).
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- info.AddValue("_Messages", string.Join(" --> ", GetAllExceptions(this).Reverse().Select(e => $"[{e.GetType().Name}] {e.Message}")));
-
- base.GetObjectData(info, context);
-
- var properties = GetCustomAndExtendedProperties();
- properties.Add(nameof(EncryptedTags), EncryptedTags);
- properties.Add(nameof(UnencryptedTags), UnencryptedTags);
-
- // Must split dictionary into keys and values because dictionary implements ISerializable itself and
- // different serializers (BinaryFormatter, JSON.NET) behave differently for non-root ISerializable
- // objects in the object graph. See http://stackoverflow.com/a/18379360/149265.
- info.AddValue(EXTENDED_PROPERTIES_NAMES_KEY, properties.Keys.ToArray());
- info.AddValue(EXTENDED_PROPERTIES_VALUES_KEY, properties.Values.ToArray());
-
- info.AddValue(BREADCRUMBS_KEY, _breadcrumbs);
- }
-
- private static IEnumerable GetAllExceptions(Exception ex)
- {
- while (ex != null)
- {
- yield return ex;
- ex = ex.InnerException;
- }
- }
-
-
- ///
- /// Returns a dictionary with all the custom properties and any values in .
- ///
- /// A where the key, of type , is the name of
- /// the property and the value, of type , is the property value.
- public Dictionary GetCustomAndExtendedProperties()
- {
- var properties = new Dictionary(_extendedProperties);
-
- foreach (var prop in GetProperties())
- {
- object value = null;
-
- try
- {
- value = prop.GetValue(this);
- }
- catch { }
-
- if (value != null)
- properties[prop.Name] = value;
- }
-
- return properties;
- }
-
- private IEnumerable GetProperties()
- {
- return GetType()
- .GetProperties()
- .Select(p => p.DeclaringType.GetProperty(p.Name))
- .Where(p => p.DeclaringType != typeof(Exception) && p.DeclaringType != typeof(SerializableException) && p.CanWrite);
- }
-
-
- public override string Message =>
- base.Message
- + GetCustomAndExtendedProperties().Select(_ => new KeyValuePair(_.Key, _.Value.ToString()))
- .Concat((EncryptedTags?.Keys ?? Enumerable.Empty()).Select(_ => new KeyValuePair(_, "")))
- .Concat(UnencryptedTags ?? Enumerable.Empty>())
- .Aggregate(new StringBuilder(), (sb, pair) => sb.Append($"{(sb.Length == 0 ? "; " : ", ")}{pair.Key}={pair.Value}"));
-
- public string RawMessage => base.Message;
-
- internal void AddBreadcrumb(Breadcrumb breadcrumb)
- {
- _breadcrumbs = _breadcrumbs.Concat(new[] { breadcrumb }).ToArray();
- }
- }
-
- [Serializable]
- public class Tags : Dictionary
- {
- public Tags()
- {
-
- }
-
- protected Tags(SerializationInfo info, StreamingContext context):base(info,context)
- {
-
- }
- }
-}
diff --git a/Gigya.ServiceContract/Gigya.ServiceContract.csproj b/Gigya.ServiceContract/Gigya.ServiceContract.csproj
deleted file mode 100644
index ef1a3fd7..00000000
--- a/Gigya.ServiceContract/Gigya.ServiceContract.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- netstandard2.0
- Gigya.ServiceContract
- Gigya
- Gigya.ServiceContract
- © 2017 Gigya Inc.
- 2.7.7
- 2.7.7
- 2.7.7
-
-
-
\ No newline at end of file
diff --git a/Gigya.ServiceContract/HttpService/IRevocable.cs b/Gigya.ServiceContract/HttpService/IRevocable.cs
deleted file mode 100644
index 09211c01..00000000
--- a/Gigya.ServiceContract/HttpService/IRevocable.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System.Collections.Generic;
-
-namespace Gigya.ServiceContract.HttpService
-{
- internal interface IRevocable
- {
- IEnumerable RevokeKeys { get; }
- }
-
- public class Revocable : IRevocable
- {
- public T Value { get; set; }
-
- public IEnumerable RevokeKeys { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Gigya.ServiceContract/HttpService/ServiceSchema.cs b/Gigya.ServiceContract/HttpService/ServiceSchema.cs
deleted file mode 100644
index 353a3c42..00000000
--- a/Gigya.ServiceContract/HttpService/ServiceSchema.cs
+++ /dev/null
@@ -1,278 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Security.Cryptography;
-using System.Threading.Tasks;
-using Gigya.ServiceContract.HttpService;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-namespace Gigya.Common.Contracts.HttpService
-{
-
- ///
- /// Contains a collection of Binterfaces, methods and method parameters, along with their attributes. Parameter types
- /// and attributes are both weakly and strongly deserialized, so clients can convenienetly work with real objects if
- /// they reference the needed assemblies, or work against strings/JObjects if they don't.
- ///
- public class ServiceSchema
- {
- public InterfaceSchema[] Interfaces { get; set; }
-
- public ServiceSchema() { }
-
- public ServiceSchema(Type[] interfaces)
- {
- Interfaces = interfaces.Select(_ => new InterfaceSchema(_)).ToArray();
- SetHashCode();
- }
-
- public string Hash { get; set; }
-
- private void SetHashCode()
- {
- var stream = new MemoryStream();
- using (var writer = new StreamWriter(stream) { AutoFlush = true })
- using (SHA1 sha = new SHA1CryptoServiceProvider())
- {
- JsonSerializer.Create().Serialize(writer, this);
- stream.Seek(0, SeekOrigin.Begin);
- Hash = Convert.ToBase64String(sha.ComputeHash(stream));
- }
- }
-
- }
-
- public class InterfaceSchema
- {
- public string Name { get; set; }
-
- public AttributeSchema[] Attributes { get; set; }
-
- public MethodSchema[] Methods { get; set; }
-
- public InterfaceSchema() { }
-
- public InterfaceSchema(Type iface)
- {
- if (!iface.IsInterface)
- throw new ArgumentException("Not an interface");
-
- Name = iface.FullName;
- Methods = iface.GetMethods().Select(m => new MethodSchema(m)).ToArray();
- Attributes = iface
- .GetCustomAttributes()
- .Where(AttributeSchema.FilterAttributes)
- .Select(a => new AttributeSchema(a))
- .ToArray();
- }
- }
-
- public class MethodSchema
- {
- public string Name { get; set; }
-
- public ParameterSchema[] Parameters { get; set; }
-
- public bool IsRevocable { get; set; }
-
- [Obsolete("Use Response.TypeName instead")]
- public string ResponseType { get; set; }
-
- public TypeSchema Response { get; set; }
-
- public AttributeSchema[] Attributes { get; set; }
-
- public MethodSchema() { }
-
- public MethodSchema(MethodInfo info)
- {
- Name = info.Name;
-
-
- if (info.ReturnType == typeof(Task))
- {
- Response = null;
-
- }
- else if (info.ReturnType.IsGenericType && info.ReturnType.GetGenericTypeDefinition() == typeof(Task<>))
- {
- var resultType = info.ReturnType.GetGenericArguments().Single();
- if (resultType.IsGenericType && resultType.GetGenericTypeDefinition() == typeof(Revocable<>))
- {
- IsRevocable = true;
- resultType = resultType.GetGenericArguments().Single();
- }
- Response = new TypeSchema(resultType, info.ReturnType.GetCustomAttributes());
- }
- else
- {
- Response = new TypeSchema(info.ReturnType, info.ReturnType.GetCustomAttributes());
- }
-
- ResponseType = Response?.TypeName;
- Parameters = info.GetParameters().Select(p => new ParameterSchema(p)).ToArray();
- Attributes = info
- .GetCustomAttributes()
- .Where(AttributeSchema.FilterAttributes)
- .Select(a => new AttributeSchema(a))
- .ToArray();
- }
- }
-
- public class SimpleTypeSchema
- {
- [JsonIgnore]
- public Type Type { get; set; }
-
- public string TypeName { get; set; }
-
- public AttributeSchema[] Attributes { get; set; }
-
- public SimpleTypeSchema() { }
-
- public SimpleTypeSchema(Type type, IEnumerable attributes)
- {
- Type = type;
- TypeName = type.AssemblyQualifiedName;
- Attributes = attributes
- .Where(AttributeSchema.FilterAttributes)
- .Select(a => new AttributeSchema(a))
- .ToArray();
- }
-
- [OnDeserialized]
- private void OnDeserialized(StreamingContext context)
- {
- try
- {
- Type = Type.GetType(TypeName);
- }
- catch { }
- }
- }
-
- public class TypeSchema : SimpleTypeSchema
- {
- public FieldSchema[] Fields { get; set; }
-
- public TypeSchema() { }
-
- public TypeSchema(Type type, IEnumerable attributes) : base(type, attributes)
- {
- if (IsCompositeType(type))
- Fields = GetFields(type).ToArray();
-
- }
-
- private IEnumerable GetFields(Type type)
- {
- var properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance).Select(_ => new FieldSchema(_));
- var fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance).Select(_ => new FieldSchema(_));
- return properties.Concat(fields);
- }
-
- private bool IsCompositeType(Type type)
- {
-
- return !type.IsValueType && !(type == typeof(string));
- }
- }
-
- public class ParameterSchema : TypeSchema
- {
- public string Name { get; set; }
-
- public ParameterSchema() { }
-
- public ParameterSchema(ParameterInfo param) : this(param.Name, param.ParameterType, param.GetCustomAttributes())
- {
- }
-
- protected ParameterSchema(string name, Type type, IEnumerable attributes) : base(type, attributes)
- {
- Name = name;
- }
- }
-
- public class FieldSchema : SimpleTypeSchema
- {
- public string Name { get; set; }
-
- public FieldSchema() { }
-
- public FieldSchema(FieldInfo field) : base(field.FieldType, field.GetCustomAttributes())
- {
- Name = field.Name;
- }
-
- public FieldSchema(PropertyInfo property) : base(property.PropertyType, property.GetCustomAttributes())
- {
- Name = property.Name;
- }
- }
-
-
- public class AttributeSchema
- {
- [JsonIgnore]
- public Attribute Attribute { get; set; }
-
- public string TypeName { get; set; }
-
- public JObject Data { get; set; }
-
- public AttributeSchema() { }
-
- public AttributeSchema(Attribute attribute)
- {
- Attribute = attribute;
- TypeName = attribute.GetType().AssemblyQualifiedName;
- Data = JObject.FromObject(attribute);
- }
-
- [OnDeserialized]
- private void OnDeserialized(StreamingContext context)
- {
- try
- {
- Type t = Type.GetType(TypeName);
-
- if (t != null)
- Attribute = (Attribute)Data.ToObject(t);
- }
- catch { }
- }
-
- internal static bool FilterAttributes(Attribute a)
- {
- return a.GetType().Namespace?.StartsWith("System.Diagnostics") == false && a.GetType().Namespace?.StartsWith("System.Security") == false;
- }
- }
-
-}
diff --git a/Gigya.ServiceContract/JsonHelper.cs b/Gigya.ServiceContract/JsonHelper.cs
deleted file mode 100644
index 56626491..00000000
--- a/Gigya.ServiceContract/JsonHelper.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Linq;
-using System.Text.RegularExpressions;
-using Gigya.ServiceContract.Exceptions;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-namespace Gigya.Common.Contracts
-{
- ///
- /// Utility class for converting between JSON and .NET values.
- ///
- public static class JsonHelper
- {
- private static JsonSerializer Serializer { get; } = new JsonSerializer { DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind };
-
- private const string ParamCaptureName = "param";
- private static readonly Regex ParamRegex = new Regex(@"Path\s'(?<" + ParamCaptureName + ">.*)'.$", RegexOptions.Compiled | RegexOptions.CultureInvariant);
-
-
- ///
- /// Converts values that were deserialized from JSON with weak typing (e.g. into ) back into
- /// their strong type, according to the specified target type.
- ///
- /// The value to convert.
- /// The type the value should be converted into.
- ///
- public static object ConvertWeaklyTypedValue(object value, Type targetType)
- {
- if (targetType == null)
- throw new ArgumentNullException(nameof(targetType));
-
- if (value == null || targetType.IsInstanceOfType(value))
- return value;
-
- var paramType = Nullable.GetUnderlyingType(targetType) ?? targetType;
-
- if (paramType == typeof(DateTime) && value is DateTimeOffset)
- {
- var dto = (DateTimeOffset)value;
-
- if (dto.Offset == TimeSpan.Zero)
- return dto.UtcDateTime;
- else
- return dto.LocalDateTime;
- }
-
- try
- {
- if (value is string && Type.GetTypeCode(paramType) == TypeCode.Object &&
- paramType != typeof(DateTimeOffset) && paramType != typeof(TimeSpan) && paramType != typeof(Guid) &&
- paramType != typeof(byte[]))
- return JsonConvert.DeserializeObject((string) value, paramType);
-
- return JToken.FromObject(value).ToObject(targetType, Serializer);
- }
- catch (JsonReaderException jsException)
- {
- var parameterPath = string.IsNullOrEmpty(jsException.Path) ? new string[0] : jsException.Path.Split('.');
- throw new InvalidParameterValueException(null, parameterPath, jsException.Message, innerException: jsException);
- }
- catch (JsonSerializationException serException)
- {
- string parameterPathStr = null;
- var match = ParamRegex.Match(serException.Message);
- if (match.Success)
- parameterPathStr = match.Groups[ParamCaptureName]?.Value;
-
- throw new InvalidParameterValueException(null, parameterPathStr?.Split('.') ?? new string[0], serException.Message, innerException: serException);
- }
- catch (Exception ex)
- {
- throw new InvalidParameterValueException(null, null, ex.Message, innerException: ex);
- }
-
- }
- }
-}
diff --git a/Gigya.ServiceContract/Properties/AssemblyInfo.cs b/Gigya.ServiceContract/Properties/AssemblyInfo.cs
deleted file mode 100644
index 4a12bbeb..00000000
--- a/Gigya.ServiceContract/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-[assembly: InternalsVisibleTo("Gigya.Microdot.ServiceProxy")]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("db6d3561-835e-40d5-b9d4-83951cf426df")]
-
-
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-[assembly: CLSCompliant(false)]
-
-[assembly: InternalsVisibleTo("Gigya.Microdot.SharedLogic")]
\ No newline at end of file
diff --git a/Gigya.ServiceContract/ServiceContract.sln b/Gigya.ServiceContract/ServiceContract.sln
deleted file mode 100644
index 47abaafb..00000000
--- a/Gigya.ServiceContract/ServiceContract.sln
+++ /dev/null
@@ -1,42 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27130.2027
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gigya.ServiceContract", "Gigya.ServiceContract.csproj", "{DB6D3561-835E-40D5-B9D4-83951CF426DF}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{E38B2044-FCF9-4FA7-A9AD-D3B4FDAA91CF}"
- ProjectSection(SolutionItems) = preProject
- paket.dependencies = paket.dependencies
- paket.lock = paket.lock
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gigya.Microdot.ServiceContract.UnitTests", "..\tests\Gigya.Microdot.ServiceContract.UnitTests\Gigya.Microdot.ServiceContract.UnitTests.csproj", "{C224F79A-EAB5-48B8-B587-65772B0966EF}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{6D04C065-F8ED-408D-BE23-722DA84AD2F5}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DB6D3561-835E-40D5-B9D4-83951CF426DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DB6D3561-835E-40D5-B9D4-83951CF426DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DB6D3561-835E-40D5-B9D4-83951CF426DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DB6D3561-835E-40D5-B9D4-83951CF426DF}.Release|Any CPU.Build.0 = Release|Any CPU
- {C224F79A-EAB5-48B8-B587-65772B0966EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C224F79A-EAB5-48B8-B587-65772B0966EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C224F79A-EAB5-48B8-B587-65772B0966EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C224F79A-EAB5-48B8-B587-65772B0966EF}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {C224F79A-EAB5-48B8-B587-65772B0966EF} = {6D04C065-F8ED-408D-BE23-722DA84AD2F5}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {7F592F51-0A62-4EA9-8FA8-4544B4888416}
- EndGlobalSection
-EndGlobal
diff --git a/Gigya.ServiceContract/paket.dependencies b/Gigya.ServiceContract/paket.dependencies
deleted file mode 100644
index 300f99f6..00000000
--- a/Gigya.ServiceContract/paket.dependencies
+++ /dev/null
@@ -1,8 +0,0 @@
-source https://api.nuget.org/v3/index.json
-
-framework: auto-detect
-redirects: off
-content: once
-copy_content_to_output_dir: always
-
-nuget Newtonsoft.Json >= 12
\ No newline at end of file
diff --git a/Gigya.ServiceContract/paket.lock b/Gigya.ServiceContract/paket.lock
deleted file mode 100644
index 9e52026e..00000000
--- a/Gigya.ServiceContract/paket.lock
+++ /dev/null
@@ -1,7 +0,0 @@
-REDIRECTS: OFF
-COPY-CONTENT-TO-OUTPUT-DIR: ALWAYS
-CONTENT: ONCE
-RESTRICTION: == netstandard2.0
-NUGET
- remote: https://api.nuget.org/v3/index.json
- Newtonsoft.Json (12.0.3)
diff --git a/Gigya.ServiceContract/paket.references b/Gigya.ServiceContract/paket.references
deleted file mode 100644
index 1063d003..00000000
--- a/Gigya.ServiceContract/paket.references
+++ /dev/null
@@ -1 +0,0 @@
-Newtonsoft.Json
\ No newline at end of file
diff --git a/Gigya.ServiceContract/paket.template b/Gigya.ServiceContract/paket.template
deleted file mode 100644
index 47705514..00000000
--- a/Gigya.ServiceContract/paket.template
+++ /dev/null
@@ -1,12 +0,0 @@
-type
- project
-description
- Referenced by microservice public-facing interfaces. Provides common
- facilities that are needed to define a service's contract. Part of the
- Microdot framework.
-projectUrl
- https://github.com/gigya/microdot
-licenseUrl
- https://github.com/gigya/microdot/blob/master/LICENSE.md
-tags
- gigya microdot microservice microservices contracts
\ No newline at end of file
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 00000000..87ebb866
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,14 @@
+@Library("pipeline-libs@microdot") _
+node('base-win'){
+ dotnetLibGitHubPipeline(
+ [
+ projectName: "microdot",
+ group: "gigya",
+ dotnetVersion: "5.0.403",
+ coveragePercentageThreshold: 1,
+ runTests: false,
+ coverageFilter: "-:*.Interface;-:*Tests*;-:type=*OrleansCodeGen*",
+ releaseNugetBranches: ['main', 'master']
+ ]
+ )
+}
diff --git a/Metrics/AdvancedMetricsContext.cs b/Metrics/AdvancedMetricsContext.cs
index 73349d12..08576399 100644
--- a/Metrics/AdvancedMetricsContext.cs
+++ b/Metrics/AdvancedMetricsContext.cs
@@ -1,7 +1,7 @@
-using System;
-using Metrics.Core;
+using Metrics.Core;
using Metrics.MetricData;
using Metrics.Sampling;
+using System;
namespace Metrics
{
diff --git a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicIntArray.cs b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicIntArray.cs
index 62eb83fd..b6288e87 100644
--- a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicIntArray.cs
+++ b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicIntArray.cs
@@ -29,7 +29,7 @@ namespace Metrics.ConcurrencyUtilities
#if CONCURRENCY_UTILS_PUBLIC
public
#else
-internal
+ internal
#endif
struct AtomicIntArray
{
diff --git a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicInteger.cs b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicInteger.cs
index e8eefdf3..b207b83f 100644
--- a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicInteger.cs
+++ b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicInteger.cs
@@ -34,7 +34,7 @@ namespace Metrics.ConcurrencyUtilities
#if CONCURRENCY_UTILS_PUBLIC
public
#else
-internal
+ internal
#endif
struct AtomicInteger
{
diff --git a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicLong.cs b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicLong.cs
index 15b8c10c..25340d17 100644
--- a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicLong.cs
+++ b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicLong.cs
@@ -34,7 +34,7 @@ namespace Metrics.ConcurrencyUtilities
#if CONCURRENCY_UTILS_PUBLIC
public
#else
-internal
+ internal
#endif
struct AtomicLong
{
diff --git a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicLongArray.cs b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicLongArray.cs
index 213240af..7f72f669 100644
--- a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicLongArray.cs
+++ b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/AtomicLongArray.cs
@@ -34,7 +34,7 @@ namespace Metrics.ConcurrencyUtilities
#if CONCURRENCY_UTILS_PUBLIC
public
#else
-internal
+ internal
#endif
struct AtomicLongArray
{
diff --git a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/Striped64.cs b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/Striped64.cs
index b2331998..212a2b9f 100644
--- a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/Striped64.cs
+++ b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/Striped64.cs
@@ -45,7 +45,7 @@ namespace Metrics.ConcurrencyUtilities
#if CONCURRENCY_UTILS_PUBLIC
public
#else
-internal
+ internal
#endif
abstract class Striped64
{
diff --git a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/StripedLongAdder.cs b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/StripedLongAdder.cs
index 337797af..d5d0fbe4 100644
--- a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/StripedLongAdder.cs
+++ b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/StripedLongAdder.cs
@@ -54,7 +54,7 @@ namespace Metrics.ConcurrencyUtilities
#if CONCURRENCY_UTILS_PUBLIC
public
#else
-internal
+ internal
#endif
sealed class StripedLongAdder : Striped64
{
diff --git a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/ThreadLocalLongAdder.cs b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/ThreadLocalLongAdder.cs
index 68b75e3a..6e20ed63 100644
--- a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/ThreadLocalLongAdder.cs
+++ b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/ThreadLocalLongAdder.cs
@@ -36,7 +36,7 @@ namespace Metrics.ConcurrencyUtilities
#if CONCURRENCY_UTILS_PUBLIC
public
#else
-internal
+ internal
#endif
sealed class ThreadLocalLongAdder
{
diff --git a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/ThreadLocalRandom.cs b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/ThreadLocalRandom.cs
index 3a5821d5..81679220 100644
--- a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/ThreadLocalRandom.cs
+++ b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/ThreadLocalRandom.cs
@@ -31,7 +31,7 @@ namespace Metrics.ConcurrencyUtilities
#if CONCURRENCY_UTILS_PUBLIC
public
#else
-internal
+ internal
#endif
static class ThreadLocalRandom
{
diff --git a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/VolatileDouble.cs b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/VolatileDouble.cs
index 209db7c4..4aade3a6 100644
--- a/Metrics/App_Packages/ConcurrencyUtils.0.1.4/VolatileDouble.cs
+++ b/Metrics/App_Packages/ConcurrencyUtils.0.1.4/VolatileDouble.cs
@@ -34,7 +34,7 @@ namespace Metrics.ConcurrencyUtilities
#if CONCURRENCY_UTILS_PUBLIC
public
#else
-internal
+ internal
#endif
struct VolatileDouble
{
diff --git a/Metrics/App_Packages/HdrHistogram/AbstractHistogram.cs b/Metrics/App_Packages/HdrHistogram/AbstractHistogram.cs
index 0e896852..307d1dc2 100644
--- a/Metrics/App_Packages/HdrHistogram/AbstractHistogram.cs
+++ b/Metrics/App_Packages/HdrHistogram/AbstractHistogram.cs
@@ -4,9 +4,9 @@
// Ported to .NET by Iulian Margarintescu under the same license and terms as the java version
// Java Version repo: https://github.com/HdrHistogram/HdrHistogram
// Latest ported version is available in the Java submodule in the root of the repo
+using Metrics.ConcurrencyUtilities;
using System;
using System.Diagnostics;
-using Metrics.ConcurrencyUtilities;
namespace HdrHistogram
{
diff --git a/Metrics/App_Packages/HdrHistogram/AbstractHistogramBase.cs b/Metrics/App_Packages/HdrHistogram/AbstractHistogramBase.cs
index 0e92c070..53b2e6d5 100644
--- a/Metrics/App_Packages/HdrHistogram/AbstractHistogramBase.cs
+++ b/Metrics/App_Packages/HdrHistogram/AbstractHistogramBase.cs
@@ -5,8 +5,8 @@
// Java Version repo: https://github.com/HdrHistogram/HdrHistogram
// Latest ported version is available in the Java submodule in the root of the repo
-using System;
using Metrics.ConcurrencyUtilities;
+using System;
namespace HdrHistogram
{
diff --git a/Metrics/App_Packages/HdrHistogram/Recorder.cs b/Metrics/App_Packages/HdrHistogram/Recorder.cs
index 6ffb208e..2830e948 100644
--- a/Metrics/App_Packages/HdrHistogram/Recorder.cs
+++ b/Metrics/App_Packages/HdrHistogram/Recorder.cs
@@ -4,10 +4,10 @@
// Ported to .NET by Iulian Margarintescu under the same license and terms as the java version
// Java Version repo: https://github.com/HdrHistogram/HdrHistogram
// Latest ported version is available in the Java submodule in the root of the repo
+using Metrics.ConcurrencyUtilities;
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
-using Metrics.ConcurrencyUtilities;
namespace HdrHistogram
{
diff --git a/Metrics/App_Packages/HdrHistogram/WriterReaderPhaser.cs b/Metrics/App_Packages/HdrHistogram/WriterReaderPhaser.cs
index f5cfbb9a..9e324999 100644
--- a/Metrics/App_Packages/HdrHistogram/WriterReaderPhaser.cs
+++ b/Metrics/App_Packages/HdrHistogram/WriterReaderPhaser.cs
@@ -4,9 +4,9 @@
// Ported to .NET by Iulian Margarintescu under the same license and terms as the java version
// Java Version repo: https://github.com/HdrHistogram/HdrHistogram
// Latest ported version is available in the Java submodule in the root of the repo
+using Metrics.ConcurrencyUtilities;
using System;
using System.Threading;
-using Metrics.ConcurrencyUtilities;
namespace HdrHistogram
{
diff --git a/Metrics/Core/CounterMetric.cs b/Metrics/Core/CounterMetric.cs
index c1f90cd8..3d17b27b 100644
--- a/Metrics/Core/CounterMetric.cs
+++ b/Metrics/Core/CounterMetric.cs
@@ -1,9 +1,9 @@
-using System;
+using Metrics.ConcurrencyUtilities;
+using Metrics.MetricData;
+using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Threading;
-using Metrics.ConcurrencyUtilities;
-using Metrics.MetricData;
namespace Metrics.Core
{
diff --git a/Metrics/Core/DefaultDataProvider.cs b/Metrics/Core/DefaultDataProvider.cs
index 3eaf96ab..ec5ceb4c 100644
--- a/Metrics/Core/DefaultDataProvider.cs
+++ b/Metrics/Core/DefaultDataProvider.cs
@@ -1,7 +1,7 @@
-using System;
+using Metrics.MetricData;
+using System;
using System.Collections.Generic;
using System.Linq;
-using Metrics.MetricData;
namespace Metrics.Core
{
diff --git a/Metrics/Core/DefaultMetricsBuilder.cs b/Metrics/Core/DefaultMetricsBuilder.cs
index 5fd795d7..4bcc9fd5 100644
--- a/Metrics/Core/DefaultMetricsBuilder.cs
+++ b/Metrics/Core/DefaultMetricsBuilder.cs
@@ -1,8 +1,8 @@
-using System;
using Metrics.MetricData;
using Metrics.PerfCounters;
using Metrics.Sampling;
+using System;
namespace Metrics.Core
{
public sealed class DefaultMetricsBuilder : MetricsBuilder
diff --git a/Metrics/Core/DefaultRegistryDataProvider.cs b/Metrics/Core/DefaultRegistryDataProvider.cs
index 617d99ab..104473ce 100644
--- a/Metrics/Core/DefaultRegistryDataProvider.cs
+++ b/Metrics/Core/DefaultRegistryDataProvider.cs
@@ -1,6 +1,6 @@
-using System;
+using Metrics.MetricData;
+using System;
using System.Collections.Generic;
-using Metrics.MetricData;
namespace Metrics.Core
{
diff --git a/Metrics/Core/GaugeMetric.cs b/Metrics/Core/GaugeMetric.cs
index c844ba95..adf3e815 100644
--- a/Metrics/Core/GaugeMetric.cs
+++ b/Metrics/Core/GaugeMetric.cs
@@ -1,6 +1,6 @@
-using System;
using Metrics.MetricData;
+using System;
namespace Metrics.Core
{
public interface GaugeImplementation : MetricValueProvider { }
diff --git a/Metrics/Core/HistogramMetric.cs b/Metrics/Core/HistogramMetric.cs
index 81064947..344dbeee 100644
--- a/Metrics/Core/HistogramMetric.cs
+++ b/Metrics/Core/HistogramMetric.cs
@@ -1,6 +1,6 @@
-using System;
-using Metrics.MetricData;
+using Metrics.MetricData;
using Metrics.Sampling;
+using System;
namespace Metrics.Core
{
diff --git a/Metrics/Core/MetricsBuilder.cs b/Metrics/Core/MetricsBuilder.cs
index f5b5fc40..271fc667 100644
--- a/Metrics/Core/MetricsBuilder.cs
+++ b/Metrics/Core/MetricsBuilder.cs
@@ -1,7 +1,7 @@
-using System;
using Metrics.MetricData;
using Metrics.Sampling;
+using System;
namespace Metrics.Core
{
diff --git a/Metrics/Core/MetricsRegistry.cs b/Metrics/Core/MetricsRegistry.cs
index 4d126280..646fb7c8 100644
--- a/Metrics/Core/MetricsRegistry.cs
+++ b/Metrics/Core/MetricsRegistry.cs
@@ -1,7 +1,7 @@
+using Metrics.MetricData;
using System;
using System.Collections.Generic;
-using Metrics.MetricData;
namespace Metrics.Core
{
public interface RegistryDataProvider
diff --git a/Metrics/Core/ReadOnlyMetricsContext.cs b/Metrics/Core/ReadOnlyMetricsContext.cs
index b658e45e..3282003f 100644
--- a/Metrics/Core/ReadOnlyMetricsContext.cs
+++ b/Metrics/Core/ReadOnlyMetricsContext.cs
@@ -1,5 +1,5 @@
-using System;
-using Metrics.MetricData;
+using Metrics.MetricData;
+using System;
namespace Metrics.Core
{
diff --git a/Metrics/Core/TimerMetric.cs b/Metrics/Core/TimerMetric.cs
index c1798efb..824a1c9a 100644
--- a/Metrics/Core/TimerMetric.cs
+++ b/Metrics/Core/TimerMetric.cs
@@ -1,8 +1,8 @@
-using System;
-using Metrics.ConcurrencyUtilities;
+using Metrics.ConcurrencyUtilities;
using Metrics.MetricData;
using Metrics.Sampling;
using Metrics.Utils;
+using System;
namespace Metrics.Core
{
diff --git a/Metrics/Endpoints/MetricsHttpListener.cs b/Metrics/Endpoints/MetricsHttpListener.cs
index 9af973dd..3da4b36d 100644
--- a/Metrics/Endpoints/MetricsHttpListener.cs
+++ b/Metrics/Endpoints/MetricsHttpListener.cs
@@ -1,4 +1,5 @@
-using System;
+using Metrics.Logging;
+using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
@@ -7,7 +8,6 @@
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
-using Metrics.Logging;
namespace Metrics.Endpoints
{
diff --git a/Metrics/EventCounters/CPU/CpuHelper.cs b/Metrics/EventCounters/CPU/CpuHelper.cs
new file mode 100644
index 00000000..1800eb0e
--- /dev/null
+++ b/Metrics/EventCounters/CPU/CpuHelper.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+#if NET6_0_OR_GREATER
+using System.Runtime.Versioning;
+#endif
+
+namespace Metrics.EventCounters.CPU
+{
+ public static class CpuHelper
+ {
+ public static ICpuUsageCalculator GetOSCpuUsageCalculator()
+ {
+ ICpuUsageCalculator calculator;
+
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ calculator = new WindowsCpuUsageCalculator();
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ calculator = new LinuxCpuUsageCalculator();
+ else
+ throw new NotSupportedException($"Platform '{RuntimeInformation.OSDescription}' not supported");
+
+ calculator.Init();
+
+ return calculator;
+ }
+
+#if NET6_0_OR_GREATER
+ [SupportedOSPlatformGuard("windows")]
+ [SupportedOSPlatformGuard("linux")]
+#endif
+ public static long GetNumberOfActiveCores(Process process)
+ {
+ try
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ return NumberOfSetBits(process.ProcessorAffinity.ToInt64());
+ else
+ throw new NotSupportedException($"Platform '{RuntimeInformation.OSDescription}' not supported");
+ }
+ catch (NotSupportedException)
+ {
+ return ProcessorInfo.ProcessorCount;
+ }
+ catch
+ {
+ return ProcessorInfo.ProcessorCount;
+ }
+ }
+ private static long NumberOfSetBits(long i)
+ {
+ i -= (i >> 1) & 0x5555555555555555;
+ i = (i & 0x3333333333333333) + ((i >> 2) & 0x3333333333333333);
+ return (((i + (i >> 4)) & 0xF0F0F0F0F0F0F0F) * 0x101010101010101) >> 56;
+ }
+ public static (long TotalProcessorTimeTicks, long TimeTicks) GetProcessTimes(Process process)
+ {
+ try
+ {
+ var timeTicks = SystemTime.UtcNow.Ticks;
+ var totalProcessorTime = process.TotalProcessorTime.Ticks;
+ return (TotalProcessorTimeTicks: totalProcessorTime, TimeTicks: timeTicks);
+ }
+ catch (NotSupportedException)
+ {
+ return (0, 0);
+ }
+ catch
+ {
+
+ return (0, 0);
+ }
+ }
+ }
+}
diff --git a/Metrics/EventCounters/CPU/CpuUsageCalculator.cs b/Metrics/EventCounters/CPU/CpuUsageCalculator.cs
new file mode 100644
index 00000000..89664540
--- /dev/null
+++ b/Metrics/EventCounters/CPU/CpuUsageCalculator.cs
@@ -0,0 +1,75 @@
+using System;
+
+namespace Metrics.EventCounters.CPU
+{
+ public abstract class CpuUsageCalculator : ICpuUsageCalculator where T : ProcessInfo
+ {
+ public readonly (double MachineCpuUsage, double ProcessCpuUsage, double? MachineIoWait) _emptyCpuUsage = (0, 0, null);
+ public readonly object _locker = new object();
+
+ public (double MachineCpuUsage, double ProcessCpuUsage, double? MachineIoWait)? LastCpuUsage;
+
+ public T PreviousInfo;
+
+ public void Init()
+ {
+ PreviousInfo = GetProcessInfo();
+ }
+
+ public abstract (double MachineCpuUsage, double? MachineIoWait) CalculateMachineCpuUsage(T processInfo);
+
+ public (double MachineCpuUsage, double ProcessCpuUsage, double? MachineIoWait) Calculate()
+ {
+ // this is a pretty quick method (sys call only), and shouldn't be
+ // called heavily, so it is easier to make sure that this is thread
+ // safe by just holding a lock.
+ lock (_locker)
+ {
+ if (PreviousInfo == null)
+ return _emptyCpuUsage;
+
+ var currentInfo = GetProcessInfo();
+ if (currentInfo == null)
+ return _emptyCpuUsage;
+
+ var machineCpuUsage = CalculateMachineCpuUsage(currentInfo);
+ var processCpuUsage = CalculateProcessCpuUsage(currentInfo, machineCpuUsage.MachineCpuUsage);
+
+ PreviousInfo = currentInfo;
+
+ LastCpuUsage = (machineCpuUsage.MachineCpuUsage, processCpuUsage, machineCpuUsage.MachineIoWait);
+ return (machineCpuUsage.MachineCpuUsage, processCpuUsage, machineCpuUsage.MachineIoWait);
+ }
+ }
+
+ public abstract T GetProcessInfo();
+
+ public double CalculateProcessCpuUsage(ProcessInfo currentInfo, double machineCpuUsage)
+ {
+ var processorTimeDiff = currentInfo.TotalProcessorTimeTicks - PreviousInfo.TotalProcessorTimeTicks;
+ var timeDiff = currentInfo.TimeTicks - PreviousInfo.TimeTicks;
+ if (timeDiff <= 0)
+ {
+ return LastCpuUsage?.ProcessCpuUsage ?? 0;
+ }
+
+ if (currentInfo.ActiveCores <= 0)
+ {
+ return LastCpuUsage?.ProcessCpuUsage ?? 0;
+ }
+
+ var processCpuUsage = (processorTimeDiff * 100.0) / timeDiff / currentInfo.ActiveCores;
+ if ((int)currentInfo.ActiveCores == ProcessorInfo.ProcessorCount)
+ {
+ // min as sometimes +-1% due to time sampling
+ processCpuUsage = Math.Min(processCpuUsage, machineCpuUsage);
+ }
+
+ return Math.Min(100, processCpuUsage);
+ }
+
+ public void Dispose()
+ {
+ }
+ }
+}
diff --git a/Metrics/EventCounters/CPU/ICpuUsageCalculator.cs b/Metrics/EventCounters/CPU/ICpuUsageCalculator.cs
new file mode 100644
index 00000000..3720a82d
--- /dev/null
+++ b/Metrics/EventCounters/CPU/ICpuUsageCalculator.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace Metrics.EventCounters.CPU
+{
+ public interface ICpuUsageCalculator : IDisposable
+ {
+ (double MachineCpuUsage, double ProcessCpuUsage, double? MachineIoWait) Calculate();
+
+ void Init();
+ }
+}
diff --git a/Metrics/EventCounters/CPU/LinuxCpuUsageCalculator.cs b/Metrics/EventCounters/CPU/LinuxCpuUsageCalculator.cs
new file mode 100644
index 00000000..13d69c6c
--- /dev/null
+++ b/Metrics/EventCounters/CPU/LinuxCpuUsageCalculator.cs
@@ -0,0 +1,67 @@
+using System;
+using System.IO;
+
+namespace Metrics.EventCounters.CPU
+{
+
+ public class LinuxCpuUsageCalculator : CpuUsageCalculator
+ {
+ private readonly char[] _separators = { ' ', '\t' };
+
+ public override (double MachineCpuUsage, double? MachineIoWait) CalculateMachineCpuUsage(LinuxInfo linuxInfo)
+ {
+ double machineCpuUsage = 0;
+ double? machineIoWait = 0;
+ if (linuxInfo.TotalIdle >= PreviousInfo.TotalIdle &&
+ linuxInfo.TotalWorkTime >= PreviousInfo.TotalWorkTime)
+ {
+ var idleDiff = linuxInfo.TotalIdle - PreviousInfo.TotalIdle;
+ var workDiff = linuxInfo.TotalWorkTime - PreviousInfo.TotalWorkTime;
+ var totalSystemWork = idleDiff + workDiff;
+ var ioWaitDiff = linuxInfo.TotalIoWait - PreviousInfo.TotalIoWait;
+
+ if (totalSystemWork > 0)
+ {
+ machineCpuUsage = (workDiff * 100.0) / totalSystemWork;
+ machineIoWait = (ioWaitDiff * 100.0) / totalSystemWork;
+ }
+ }
+ else if (LastCpuUsage != null)
+ {
+ // overflow
+ machineCpuUsage = LastCpuUsage.Value.MachineCpuUsage;
+ machineIoWait = LastCpuUsage.Value.MachineIoWait;
+ }
+
+ return (machineCpuUsage, machineIoWait);
+ }
+
+ public override LinuxInfo GetProcessInfo()
+ {
+ var lines = File.ReadLines("/proc/stat");
+ foreach (var line in lines)
+ {
+ if (line.StartsWith("cpu", StringComparison.OrdinalIgnoreCase) == false)
+ continue;
+
+ var items = line.Split(_separators, StringSplitOptions.RemoveEmptyEntries);
+ if (items.Length == 0 || items.Length < 9)
+ continue;
+
+ return new LinuxInfo
+ {
+ TotalUserTime = ulong.Parse(items[1]),
+ TotalUserLowTime = ulong.Parse(items[2]),
+ TotalSystemTime = ulong.Parse(items[3]),
+ TotalIdleTime = ulong.Parse(items[4]),
+ TotalIoWait = ulong.Parse(items[5]),
+ TotalIRQTime = ulong.Parse(items[6]),
+ TotalSoftIRQTime = ulong.Parse(items[7]),
+ TotalStealTime = ulong.Parse(items[8])
+ };
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/Metrics/EventCounters/CPU/LinuxInfo.cs b/Metrics/EventCounters/CPU/LinuxInfo.cs
new file mode 100644
index 00000000..ba8edf06
--- /dev/null
+++ b/Metrics/EventCounters/CPU/LinuxInfo.cs
@@ -0,0 +1,28 @@
+
+namespace Metrics.EventCounters.CPU
+{
+ public class LinuxInfo : ProcessInfo
+ {
+ public ulong TotalUserTime { private get; set; }
+
+ public ulong TotalUserLowTime { private get; set; }
+
+ public ulong TotalSystemTime { private get; set; }
+
+ public ulong TotalIdleTime { private get; set; }
+
+ public ulong TotalIoWait { get; set; }
+
+ public ulong TotalIRQTime { private get; set; }
+
+ public ulong TotalSoftIRQTime { private get; set; }
+
+ public ulong TotalStealTime { private get; set; }
+
+ public ulong TotalWorkTime => TotalUserTime + TotalUserLowTime + TotalSystemTime +
+ TotalIRQTime + TotalSoftIRQTime + TotalStealTime;
+
+ public ulong TotalIdle => TotalIdleTime + TotalIoWait;
+ }
+
+}
diff --git a/Metrics/EventCounters/CPU/ProcessInfo.cs b/Metrics/EventCounters/CPU/ProcessInfo.cs
new file mode 100644
index 00000000..1b6e6d83
--- /dev/null
+++ b/Metrics/EventCounters/CPU/ProcessInfo.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Diagnostics;
+
+namespace Metrics.EventCounters.CPU
+{
+ public class ProcessInfo
+ {
+ public ProcessInfo()
+ {
+ using (var process = Process.GetCurrentProcess())
+ {
+ var processTimes = CpuHelper.GetProcessTimes(process);
+ TotalProcessorTimeTicks = processTimes.TotalProcessorTimeTicks;
+ TimeTicks = processTimes.TimeTicks;
+
+ ActiveCores = CpuHelper.GetNumberOfActiveCores(process);
+ }
+ }
+
+ public long TotalProcessorTimeTicks { get; }
+
+ public long TimeTicks { get; }
+
+ public long ActiveCores { get; }
+ }
+
+ public class SystemTime
+ {
+ private static readonly SystemTime Instance = new SystemTime();
+
+ public Func UtcDateTime;
+
+ // public Action WaitCalled;
+
+ public DateTime GetUtcNow()
+ {
+ var temp = UtcDateTime;
+ return temp?.Invoke() ?? DateTime.UtcNow;
+ }
+
+ public static DateTime UtcNow => Instance.GetUtcNow();
+ }
+}
diff --git a/Metrics/EventCounters/CPU/ProcessorInfo.cs b/Metrics/EventCounters/CPU/ProcessorInfo.cs
new file mode 100644
index 00000000..67936f3a
--- /dev/null
+++ b/Metrics/EventCounters/CPU/ProcessorInfo.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace Metrics.EventCounters.CPU
+{
+ public class ProcessorInfo
+ {
+ public static readonly int ProcessorCount = GetProcessorCount();
+
+ public static int GetProcessorCount()
+ {
+ return Environment.ProcessorCount;
+ }
+ }
+
+}
diff --git a/Metrics/EventCounters/CPU/WindowsCpuUsageCalculator.cs b/Metrics/EventCounters/CPU/WindowsCpuUsageCalculator.cs
new file mode 100644
index 00000000..18bed0c8
--- /dev/null
+++ b/Metrics/EventCounters/CPU/WindowsCpuUsageCalculator.cs
@@ -0,0 +1,64 @@
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace Metrics.EventCounters.CPU
+{
+
+ public class WindowsCpuUsageCalculator : CpuUsageCalculator
+ {
+ public override (double MachineCpuUsage, double? MachineIoWait) CalculateMachineCpuUsage(WindowsInfo windowsInfo)
+ {
+ var systemIdleDiff = windowsInfo.SystemIdleTime - PreviousInfo.SystemIdleTime;
+ var systemKernelDiff = windowsInfo.SystemKernelTime - PreviousInfo.SystemKernelTime;
+ var systemUserDiff = windowsInfo.SystemUserTime - PreviousInfo.SystemUserTime;
+ var sysTotal = systemKernelDiff + systemUserDiff;
+
+ double machineCpuUsage = 0;
+ if (sysTotal > 0)
+ {
+ machineCpuUsage = (sysTotal - systemIdleDiff) * 100.00 / sysTotal;
+ }
+
+ return (machineCpuUsage, null);
+ }
+
+ public override WindowsInfo GetProcessInfo()
+ {
+ var systemIdleTime = new FileTime();
+ var systemKernelTime = new FileTime();
+ var systemUserTime = new FileTime();
+ if (GetSystemTimes(ref systemIdleTime, ref systemKernelTime, ref systemUserTime) == false)
+ {
+ return null;
+ }
+
+ return new WindowsInfo
+ {
+ SystemIdleTime = GetTime(systemIdleTime),
+ SystemKernelTime = GetTime(systemKernelTime),
+ SystemUserTime = GetTime(systemUserTime)
+ };
+ }
+
+ [return: MarshalAs(UnmanagedType.Bool)]
+ [DllImport("kernel32.dll", SetLastError = true)]
+ internal static extern bool GetSystemTimes(
+ ref FileTime lpIdleTime,
+ ref FileTime lpKernelTime,
+ ref FileTime lpUserTime);
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ internal static ulong GetTime(FileTime fileTime)
+ {
+ return ((ulong)fileTime.dwHighDateTime << 32) | (uint)fileTime.dwLowDateTime;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct FileTime
+ {
+ public int dwLowDateTime;
+ public int dwHighDateTime;
+ }
+ }
+
+}
diff --git a/Metrics/EventCounters/CPU/WindowsInfo.cs b/Metrics/EventCounters/CPU/WindowsInfo.cs
new file mode 100644
index 00000000..15074ea7
--- /dev/null
+++ b/Metrics/EventCounters/CPU/WindowsInfo.cs
@@ -0,0 +1,12 @@
+
+namespace Metrics.EventCounters.CPU
+{
+ public class WindowsInfo : ProcessInfo
+ {
+ public ulong SystemIdleTime { get; set; }
+
+ public ulong SystemKernelTime { get; set; }
+
+ public ulong SystemUserTime { get; set; }
+ }
+}
diff --git a/Metrics/HealthChecks.cs b/Metrics/HealthChecks.cs
index 15706e4e..c7d44c8f 100644
--- a/Metrics/HealthChecks.cs
+++ b/Metrics/HealthChecks.cs
@@ -1,8 +1,8 @@
-using System;
+using Metrics.Core;
+using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
-using Metrics.Core;
namespace Metrics
{
diff --git a/Metrics/Json/JsonBuilderV2.cs b/Metrics/Json/JsonBuilderV2.cs
index ddfa7e41..4bde90f2 100644
--- a/Metrics/Json/JsonBuilderV2.cs
+++ b/Metrics/Json/JsonBuilderV2.cs
@@ -1,7 +1,7 @@
-using System.Collections.Generic;
-using System.Globalization;
-using Metrics.MetricData;
+using Metrics.MetricData;
using Metrics.Utils;
+using System.Collections.Generic;
+using System.Globalization;
namespace Metrics.Json
{
diff --git a/Metrics/Json/JsonCounter.cs b/Metrics/Json/JsonCounter.cs
index ee7eaf95..400d452c 100644
--- a/Metrics/Json/JsonCounter.cs
+++ b/Metrics/Json/JsonCounter.cs
@@ -1,7 +1,7 @@
+using Metrics.MetricData;
using System.Collections.Generic;
using System.Linq;
-using Metrics.MetricData;
namespace Metrics.Json
{
public class JsonCounter : JsonMetric
diff --git a/Metrics/Json/JsonGauge.cs b/Metrics/Json/JsonGauge.cs
index 78d329c2..e30643cd 100644
--- a/Metrics/Json/JsonGauge.cs
+++ b/Metrics/Json/JsonGauge.cs
@@ -1,6 +1,6 @@
-using System.Collections.Generic;
using Metrics.MetricData;
+using System.Collections.Generic;
namespace Metrics.Json
{
diff --git a/Metrics/Json/JsonHealthChecks.cs b/Metrics/Json/JsonHealthChecks.cs
index 1272385f..8c9df574 100644
--- a/Metrics/Json/JsonHealthChecks.cs
+++ b/Metrics/Json/JsonHealthChecks.cs
@@ -1,7 +1,7 @@
-using System.Collections.Generic;
+using Metrics.Utils;
+using System.Collections.Generic;
using System.Globalization;
using System.Linq;
-using Metrics.Utils;
namespace Metrics.Json
{
diff --git a/Metrics/Json/JsonHistogram.cs b/Metrics/Json/JsonHistogram.cs
index 479ccfa5..68bde3f3 100644
--- a/Metrics/Json/JsonHistogram.cs
+++ b/Metrics/Json/JsonHistogram.cs
@@ -1,6 +1,6 @@
-using System.Collections.Generic;
using Metrics.MetricData;
+using System.Collections.Generic;
namespace Metrics.Json
{
public class JsonHistogram : JsonMetric
diff --git a/Metrics/Json/JsonMeter.cs b/Metrics/Json/JsonMeter.cs
index bd8ba73d..7ada390c 100644
--- a/Metrics/Json/JsonMeter.cs
+++ b/Metrics/Json/JsonMeter.cs
@@ -1,8 +1,8 @@
-using System.Collections.Generic;
-using System.Linq;
using Metrics.MetricData;
using Metrics.Utils;
+using System.Collections.Generic;
+using System.Linq;
namespace Metrics.Json
{
public class JsonMeter : JsonMetric
diff --git a/Metrics/Json/JsonMetricsContext.cs b/Metrics/Json/JsonMetricsContext.cs
index 81ef799f..e98b4360 100644
--- a/Metrics/Json/JsonMetricsContext.cs
+++ b/Metrics/Json/JsonMetricsContext.cs
@@ -1,8 +1,8 @@
-using System;
+using Metrics.MetricData;
+using Metrics.Utils;
+using System;
using System.Collections.Generic;
using System.Linq;
-using Metrics.MetricData;
-using Metrics.Utils;
namespace Metrics.Json
{
diff --git a/Metrics/Json/JsonTimer.cs b/Metrics/Json/JsonTimer.cs
index 802574d5..579f061a 100644
--- a/Metrics/Json/JsonTimer.cs
+++ b/Metrics/Json/JsonTimer.cs
@@ -1,7 +1,7 @@
-using System.Collections.Generic;
using Metrics.MetricData;
using Metrics.Utils;
+using System.Collections.Generic;
namespace Metrics.Json
{
diff --git a/Metrics/Metric.cs b/Metrics/Metric.cs
index a30a0113..ca5f308a 100644
--- a/Metrics/Metric.cs
+++ b/Metrics/Metric.cs
@@ -1,10 +1,10 @@
-using System;
+using Metrics.Logging;
+using Metrics.Utils;
+using System;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
-using Metrics.Logging;
-using Metrics.Utils;
namespace Metrics
{
diff --git a/Metrics/Metrics.csproj b/Metrics/Metrics.csproj
index 074b5f49..60606208 100644
--- a/Metrics/Metrics.csproj
+++ b/Metrics/Metrics.csproj
@@ -1,24 +1,22 @@
-
- netstandard2.0
- true
- true
- Metrics
- Metrics
-
-
-
-
-
- ..\..\bin\$(Configuration)\Metrics.XML
- 1591; 1570; 1587;
-
-
-
-
- Endpoints\metrics_32.png
-
-
-
+
+ Metrics
+ Gigya.Metrics
+ Infrastructure used for hosting Orleans Microdot services, part of the Microdot framework.
+
+
+
+
+
+
+
+ Endpoints\metrics_32.png
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Metrics/MetricsConfig.cs b/Metrics/MetricsConfig.cs
index f587c9d7..d32ccc4b 100644
--- a/Metrics/MetricsConfig.cs
+++ b/Metrics/MetricsConfig.cs
@@ -1,13 +1,13 @@
-using System;
+using Metrics.Endpoints;
+using Metrics.Logging;
+using Metrics.MetricData;
+using Metrics.Reports;
+using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
-using Metrics.Endpoints;
-using Metrics.Logging;
-using Metrics.MetricData;
-using Metrics.Reports;
namespace Metrics
{
diff --git a/Metrics/MetricsContext.cs b/Metrics/MetricsContext.cs
index 492396c9..ff7a2b69 100644
--- a/Metrics/MetricsContext.cs
+++ b/Metrics/MetricsContext.cs
@@ -1,5 +1,5 @@
-using System;
-using Metrics.MetricData;
+using Metrics.MetricData;
+using System;
namespace Metrics
{
///
diff --git a/Metrics/MetricsErrorHandler.cs b/Metrics/MetricsErrorHandler.cs
index c256d595..29b70c38 100644
--- a/Metrics/MetricsErrorHandler.cs
+++ b/Metrics/MetricsErrorHandler.cs
@@ -1,8 +1,8 @@
+using Metrics.Logging;
using System;
using System.Collections.Concurrent;
using System.Diagnostics;
-using Metrics.Logging;
namespace Metrics
{
public class MetricsErrorHandler
diff --git a/Metrics/PerfCounters/IPerformanceCounterGauge.cs b/Metrics/PerfCounters/IPerformanceCounterGauge.cs
new file mode 100644
index 00000000..0831ae67
--- /dev/null
+++ b/Metrics/PerfCounters/IPerformanceCounterGauge.cs
@@ -0,0 +1,8 @@
+namespace Metrics.PerfCounters
+{
+ public interface IPerformanceCounterGauge
+ {
+ double GetValue(bool resetMetric = false);
+ double Value { get; }
+ }
+}
diff --git a/Metrics/PerfCounters/PerformanceCounterGauge.cs b/Metrics/PerfCounters/PerformanceCounterGauge.cs
index 2ac59809..256631c1 100644
--- a/Metrics/PerfCounters/PerformanceCounterGauge.cs
+++ b/Metrics/PerfCounters/PerformanceCounterGauge.cs
@@ -1,13 +1,12 @@
using Metrics.MetricData;
using System;
-using System.Diagnostics;
-using System.Security.Principal;
+using System.Runtime.InteropServices;
namespace Metrics.PerfCounters
{
public class PerformanceCounterGauge : MetricValueProvider
{
- private readonly PerformanceCounter performanceCounter;
+ private readonly IPerformanceCounterGauge _performanceCounterGauge;
public PerformanceCounterGauge(string category, string counter)
: this(category, counter, instance: null)
@@ -15,54 +14,19 @@ public PerformanceCounterGauge(string category, string counter)
public PerformanceCounterGauge(string category, string counter, string instance)
{
- try
- {
- this.performanceCounter = instance == null ?
- new PerformanceCounter(category, counter, true) :
- new PerformanceCounter(category, counter, instance, true);
- Metric.Internal.Counter("Performance Counters", Unit.Custom("Perf Counters")).Increment();
- }
- catch (Exception x)
- {
- var message = "Error reading performance counter data. The application is currently running as user " + GetIdentity() +
- ". Make sure the user has access to the performance counters. The user needs to be either Admin or belong to Performance Monitor user group.";
- MetricsErrorHandler.Handle(x, message);
- }
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ _performanceCounterGauge = new PerformanceCounterGaugeWindows(category, counter, instance);
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ _performanceCounterGauge = new PerformanceCounterGaugeLinux(category, counter, instance);
+ else
+ throw new NotSupportedException($"Platform '{RuntimeInformation.OSDescription}' not supported");
}
-
- private static string GetIdentity()
- {
- try
- {
- return Environment.UserName;
- }
- catch (Exception x)
- {
- return "[Unknown user | " + x.Message + " ]";
- }
- }
-
+
public double GetValue(bool resetMetric = false)
{
- return this.Value;
+ return _performanceCounterGauge.GetValue(resetMetric);
}
- public double Value
- {
- get
- {
- try
- {
- return this.performanceCounter?.NextValue() ?? double.NaN;
- }
- catch (Exception x)
- {
- var message = "Error reading performance counter data. The application is currently running as user " + GetIdentity() +
- ". Make sure the user has access to the performance counters. The user needs to be either Admin or belong to Performance Monitor user group.";
- MetricsErrorHandler.Handle(x, message);
- return double.NaN;
- }
- }
- }
+ public double Value => _performanceCounterGauge.Value;
}
}
diff --git a/Metrics/PerfCounters/PerformanceCounterGaugeLinux.cs b/Metrics/PerfCounters/PerformanceCounterGaugeLinux.cs
new file mode 100644
index 00000000..caeb36ae
--- /dev/null
+++ b/Metrics/PerfCounters/PerformanceCounterGaugeLinux.cs
@@ -0,0 +1,31 @@
+using Metrics.MetricData;
+using System;
+
+namespace Metrics.PerfCounters
+{
+ public class PerformanceCounterGaugeLinux : MetricValueProvider, IPerformanceCounterGauge
+ {
+ public PerformanceCounterGaugeLinux(string category, string counter)
+ : this(category, counter, instance: null)
+ { }
+
+ public PerformanceCounterGaugeLinux(string category, string counter, string instance)
+ {
+ try
+ {
+ Metric.Internal.Counter("Performance Counters", Unit.Custom("Perf Counters")).Increment();
+ }
+ catch (Exception x)
+ {
+ MetricsErrorHandler.Handle(x);
+ }
+ }
+
+ public double GetValue(bool resetMetric = false)
+ {
+ return this.Value;
+ }
+
+ public double Value => double.NaN;
+ }
+}
diff --git a/Metrics/PerfCounters/PerformanceCounterGaugeWindows.cs b/Metrics/PerfCounters/PerformanceCounterGaugeWindows.cs
new file mode 100644
index 00000000..c20c0eba
--- /dev/null
+++ b/Metrics/PerfCounters/PerformanceCounterGaugeWindows.cs
@@ -0,0 +1,76 @@
+using Metrics.MetricData;
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace Metrics.PerfCounters
+{
+ public class PerformanceCounterGaugeWindows : MetricValueProvider, IPerformanceCounterGauge
+ {
+ private readonly PerformanceCounter _performanceCounter;
+ public PerformanceCounterGaugeWindows(string category, string counter)
+ : this(category, counter, instance: null)
+ { }
+
+ public PerformanceCounterGaugeWindows(string category, string counter, string instance)
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ try
+ {
+ _performanceCounter = new PerformanceCounter(category, counter, instance ?? "", true);
+ Metric.Internal.Counter("Performance Counters", Unit.Custom("Perf Counters")).Increment();
+ }
+ catch (Exception x)
+ {
+ var message =
+ "Error reading performance counter data. The application is currently running as user " +
+ GetIdentity() +
+ ". Make sure the user has access to the performance counters. The user needs to be either Admin or belong to Performance Monitor user group.";
+ MetricsErrorHandler.Handle(x, message);
+ }
+ }
+ }
+
+ private static string GetIdentity()
+ {
+ try
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ return System.Security.Principal.WindowsIdentity.GetCurrent().Name;
+
+ return Environment.UserName;
+ }
+ catch (Exception x)
+ {
+ return "[Unknown user | " + x.Message + " ]";
+ }
+ }
+
+ public double GetValue(bool resetMetric = false)
+ {
+ return Value;
+ }
+
+ public double Value
+ {
+ get
+ {
+ try
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ return _performanceCounter?.NextValue() ?? double.NaN;
+
+ return double.NaN;
+ }
+ catch (Exception x)
+ {
+ var message = "Error reading performance counter data. The application is currently running as user " + GetIdentity() +
+ ". Make sure the user has access to the performance counters. The user needs to be either Admin or belong to Performance Monitor user group.";
+ MetricsErrorHandler.Handle(x, message);
+ return double.NaN;
+ }
+ }
+ }
+ }
+}
diff --git a/Metrics/PerfCounters/PerformanceCounters.cs b/Metrics/PerfCounters/PerformanceCounters.cs
index 4f5bcbe1..93796a94 100644
--- a/Metrics/PerfCounters/PerformanceCounters.cs
+++ b/Metrics/PerfCounters/PerformanceCounters.cs
@@ -1,18 +1,15 @@
-
-using Metrics.Core;
+using Metrics.Core;
using Metrics.Logging;
using System;
using System.Diagnostics;
using System.Linq;
-using System.Security.Principal;
+using System.Runtime.InteropServices;
namespace Metrics.PerfCounters
{
internal static class PerformanceCounters
{
- private static readonly ILog log = LogProvider.GetCurrentClassLogger();
-
- private static readonly bool isMono = Type.GetType("Mono.Runtime") != null;
+ private static readonly ILog Log = LogProvider.GetCurrentClassLogger();
private const string TotalInstance = "_Total";
@@ -115,44 +112,38 @@ private static string GetIdentity()
{
try
{
- return WindowsIdentity.GetCurrent().Name;
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ return System.Security.Principal.WindowsIdentity.GetCurrent().Name;
}
catch (Exception x)
{
return "[Unknown user | " + x.Message + " ]";
}
+ return "[Unknown user]";
}
+
private static void WrappedRegister(MetricsContext context, string name, Unit unit,
string category, string counter, string instance = null,
Func derivate = null,
MetricTags tags = default(MetricTags))
{
- log.Debug(() => $"Registering performance counter [{counter}] in category [{category}] for instance [{instance ?? "none"}]");
+ Log.Debug(() => $"Registering performance counter [{counter}] in category [{category}] for instance [{instance ?? "none"}]");
- if (PerformanceCounterCategory.Exists(category))
+ if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !PerformanceCounterCategory.Exists(category))
+ return;
+
+ var counterTags = new MetricTags(tags.Tags.Concat(new[] { "PerfCounter" }));
+ if (derivate == null)
{
- if (instance == null || PerformanceCounterCategory.InstanceExists(instance, category))
- {
- if (PerformanceCounterCategory.CounterExists(counter, category))
- {
- var counterTags = new MetricTags(tags.Tags.Concat(new[] { "PerfCounter" }));
- if (derivate == null)
- {
- context.Advanced.Gauge(name, () => new PerformanceCounterGauge(category, counter, instance), unit, counterTags);
- }
- else
- {
- context.Advanced.Gauge(name, () => new DerivedGauge(new PerformanceCounterGauge(category, counter, instance), derivate), unit, counterTags);
- }
- return;
- }
- }
+ context.Advanced.Gauge(name,
+ () => new PerformanceCounterGauge(category, counter, instance), unit, counterTags);
}
-
- if (!isMono)
+ else
{
- log.ErrorFormat("Performance counter does not exist [{0}] in category [{1}] for instance [{2}]", counter, category, instance ?? "none");
+ context.Advanced.Gauge(name,
+ () => new DerivedGauge(new PerformanceCounterGauge(category, counter, instance),
+ derivate), unit, counterTags);
}
}
}
diff --git a/Metrics/Properties/AssemblyInfo.cs b/Metrics/Properties/AssemblyInfo.cs
index d76dd1f0..5f282702 100644
--- a/Metrics/Properties/AssemblyInfo.cs
+++ b/Metrics/Properties/AssemblyInfo.cs
@@ -1 +1 @@
-using System.Reflection;
+
\ No newline at end of file
diff --git a/Metrics/RemoteMetrics/HttpRemoteMetrics.cs b/Metrics/RemoteMetrics/HttpRemoteMetrics.cs
index 39e86d68..1b168429 100644
--- a/Metrics/RemoteMetrics/HttpRemoteMetrics.cs
+++ b/Metrics/RemoteMetrics/HttpRemoteMetrics.cs
@@ -1,8 +1,8 @@
-using System;
+using Metrics.Json;
+using System;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
-using Metrics.Json;
namespace Metrics.RemoteMetrics
{
diff --git a/Metrics/RemoteMetrics/RemoteMetricsContext.cs b/Metrics/RemoteMetrics/RemoteMetricsContext.cs
index 2bfde2a4..e3bffb86 100644
--- a/Metrics/RemoteMetrics/RemoteMetricsContext.cs
+++ b/Metrics/RemoteMetrics/RemoteMetricsContext.cs
@@ -1,5 +1,5 @@
using System;
-using System.Threading;
+using System.Net.Http;
using System.Threading.Tasks;
using Metrics.Core;
using Metrics.Json;
@@ -10,9 +10,9 @@ namespace Metrics.RemoteMetrics
{
public sealed class RemoteMetricsContext : ReadOnlyMetricsContext, MetricsDataProvider
{
- private readonly Scheduler scheduler;
-
- private MetricsData currentData = MetricsData.Empty;
+ private readonly Scheduler _scheduler;
+ private readonly HttpClient _httpClient;
+ private MetricsData _currentData = MetricsData.Empty;
public RemoteMetricsContext(Uri remoteUri, TimeSpan updateInterval, Func deserializer)
: this(new ActionScheduler(), remoteUri, updateInterval, deserializer)
@@ -20,36 +20,39 @@ public RemoteMetricsContext(Uri remoteUri, TimeSpan updateInterval, Func deserializer)
{
- this.scheduler = scheduler;
- this.scheduler.Start(updateInterval, c => UpdateMetrics(remoteUri, deserializer, c));
+ _scheduler = scheduler;
+ _scheduler.Start(updateInterval, c => UpdateMetrics(remoteUri, deserializer));
}
- private async Task UpdateMetrics(Uri remoteUri, Func deserializer, CancellationToken token)
+ private async Task UpdateMetrics(Uri remoteUri, Func deserializer)
{
try
{
- var remoteContext = await HttpRemoteMetrics.FetchRemoteMetrics(remoteUri, deserializer, token).ConfigureAwait(false);
+ string response = await _httpClient.GetStringAsync(remoteUri);
+ JsonMetricsContext remoteContext = deserializer(response);
remoteContext.Environment.Add("RemoteUri", remoteUri.ToString());
remoteContext.Environment.Add("RemoteVersion", remoteContext.Version);
remoteContext.Environment.Add("RemoteTimestamp", Clock.FormatTimestamp(remoteContext.Timestamp));
-
- this.currentData = remoteContext.ToMetricsData();
+
+ _currentData = remoteContext.ToMetricsData();
}
catch (Exception x)
{
MetricsErrorHandler.Handle(x, "Error updating metrics data from " + remoteUri);
- this.currentData = MetricsData.Empty;
+ _currentData = MetricsData.Empty;
}
}
- public override MetricsDataProvider DataProvider { get { return this; } }
- public MetricsData CurrentMetricsData { get { return this.currentData; } }
+ public override MetricsDataProvider DataProvider => this;
+ public MetricsData CurrentMetricsData => _currentData;
protected override void Dispose(bool disposing)
{
if (disposing)
{
- using (this.scheduler) { }
+ _httpClient?.Dispose();
+
+ using (_scheduler) { }
}
base.Dispose(disposing);
}
diff --git a/Metrics/RemoteMetrics/RemoteMetricsExtensions.cs b/Metrics/RemoteMetrics/RemoteMetricsExtensions.cs
index 6ca84e1c..f6b8573b 100644
--- a/Metrics/RemoteMetrics/RemoteMetricsExtensions.cs
+++ b/Metrics/RemoteMetrics/RemoteMetricsExtensions.cs
@@ -1,6 +1,6 @@
-using System;
-using Metrics.Json;
+using Metrics.Json;
using Metrics.RemoteMetrics;
+using System;
namespace Metrics
{
diff --git a/Metrics/Reporters/EndpointReporterConfig.cs b/Metrics/Reporters/EndpointReporterConfig.cs
index ef2f3743..8b4cc648 100644
--- a/Metrics/Reporters/EndpointReporterConfig.cs
+++ b/Metrics/Reporters/EndpointReporterConfig.cs
@@ -1,10 +1,10 @@
-using System;
-using System.Linq;
-using System.Text;
-using Metrics.Endpoints;
+using Metrics.Endpoints;
using Metrics.Json;
using Metrics.MetricData;
using Metrics.Reports;
+using System;
+using System.Linq;
+using System.Text;
namespace Metrics.Reporters
{
diff --git a/Metrics/Reporters/HumanReadableReport.cs b/Metrics/Reporters/HumanReadableReport.cs
index f079e864..365e40db 100644
--- a/Metrics/Reporters/HumanReadableReport.cs
+++ b/Metrics/Reporters/HumanReadableReport.cs
@@ -1,6 +1,6 @@
-using System.Linq;
-using Metrics.MetricData;
+using Metrics.MetricData;
using Metrics.Utils;
+using System.Linq;
namespace Metrics.Reporters
{
diff --git a/Metrics/Reporters/MetricsEndpointReports.cs b/Metrics/Reporters/MetricsEndpointReports.cs
index 7a57e5cb..b84e35a7 100644
--- a/Metrics/Reporters/MetricsEndpointReports.cs
+++ b/Metrics/Reporters/MetricsEndpointReports.cs
@@ -1,8 +1,8 @@
-using System;
-using System.Collections.Generic;
-using Metrics.Endpoints;
+using Metrics.Endpoints;
using Metrics.MetricData;
using Metrics.Reporters;
+using System;
+using System.Collections.Generic;
namespace Metrics.Reports
{
diff --git a/Metrics/Reporters/MetricsReport.cs b/Metrics/Reporters/MetricsReport.cs
index c86b5872..09069d18 100644
--- a/Metrics/Reporters/MetricsReport.cs
+++ b/Metrics/Reporters/MetricsReport.cs
@@ -1,6 +1,6 @@
-using System;
+using Metrics.MetricData;
+using System;
using System.Threading;
-using Metrics.MetricData;
namespace Metrics.Reporters
{
diff --git a/Metrics/Reporters/MetricsReports.cs b/Metrics/Reporters/MetricsReports.cs
index d22b5354..55066274 100644
--- a/Metrics/Reporters/MetricsReports.cs
+++ b/Metrics/Reporters/MetricsReports.cs
@@ -1,9 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using Metrics.MetricData;
+using Metrics.MetricData;
using Metrics.Reporters;
using Metrics.Utils;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
namespace Metrics.Reports
{
diff --git a/Metrics/Reporters/ScheduledReporter.cs b/Metrics/Reporters/ScheduledReporter.cs
index 74775835..08e4d3db 100644
--- a/Metrics/Reporters/ScheduledReporter.cs
+++ b/Metrics/Reporters/ScheduledReporter.cs
@@ -1,7 +1,7 @@
-using System;
-using System.Threading;
-using Metrics.MetricData;
+using Metrics.MetricData;
using Metrics.Utils;
+using System;
+using System.Threading;
namespace Metrics.Reporters
{
diff --git a/Metrics/Sampling/ExponentiallyDecayingReservoir.cs b/Metrics/Sampling/ExponentiallyDecayingReservoir.cs
index 54057ca4..8e473544 100644
--- a/Metrics/Sampling/ExponentiallyDecayingReservoir.cs
+++ b/Metrics/Sampling/ExponentiallyDecayingReservoir.cs
@@ -1,8 +1,8 @@
-using System;
+using Metrics.ConcurrencyUtilities;
+using Metrics.Utils;
+using System;
using System.Collections.Generic;
using System.Threading;
-using Metrics.ConcurrencyUtilities;
-using Metrics.Utils;
namespace Metrics.Sampling
{
diff --git a/Metrics/Sampling/HdrSnapshot.cs b/Metrics/Sampling/HdrSnapshot.cs
index 3f93534e..2ed7bd0f 100644
--- a/Metrics/Sampling/HdrSnapshot.cs
+++ b/Metrics/Sampling/HdrSnapshot.cs
@@ -1,6 +1,6 @@
-using System.Collections.Generic;
+using HdrHistogram;
+using System.Collections.Generic;
using System.Linq;
-using HdrHistogram;
namespace Metrics.Sampling
{
diff --git a/Metrics/Sampling/SlidingWindowReservoir.cs b/Metrics/Sampling/SlidingWindowReservoir.cs
index c08fe280..f3c14062 100644
--- a/Metrics/Sampling/SlidingWindowReservoir.cs
+++ b/Metrics/Sampling/SlidingWindowReservoir.cs
@@ -1,6 +1,6 @@
-using System;
+using Metrics.ConcurrencyUtilities;
+using System;
using System.Linq;
-using Metrics.ConcurrencyUtilities;
namespace Metrics.Sampling
{
diff --git a/Metrics/Timer.cs b/Metrics/Timer.cs
index 18131ed4..3b29dca8 100644
--- a/Metrics/Timer.cs
+++ b/Metrics/Timer.cs
@@ -1,5 +1,5 @@
-using System;
-using Metrics.Utils;
+using Metrics.Utils;
+using System;
namespace Metrics
{
diff --git a/Metrics/Unit.cs b/Metrics/Unit.cs
index 5809d837..87dbe1a6 100644
--- a/Metrics/Unit.cs
+++ b/Metrics/Unit.cs
@@ -1,8 +1,8 @@
+using Metrics.Utils;
using System;
using System.Diagnostics;
using System.Globalization;
-using Metrics.Utils;
namespace Metrics
{
[DebuggerDisplay("{Name}")]
diff --git a/Metrics/Utils/AppEnvironment.cs b/Metrics/Utils/AppEnvironment.cs
index 7adfbe9c..435fc69e 100644
--- a/Metrics/Utils/AppEnvironment.cs
+++ b/Metrics/Utils/AppEnvironment.cs
@@ -1,12 +1,12 @@
-using System;
+using Metrics.Logging;
+using Metrics.MetricData;
+using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
-using Metrics.Logging;
-using Metrics.MetricData;
namespace Metrics.Utils
{
diff --git a/Metrics/Utils/EWMA.cs b/Metrics/Utils/EWMA.cs
index 3d08a080..a1e21a3b 100644
--- a/Metrics/Utils/EWMA.cs
+++ b/Metrics/Utils/EWMA.cs
@@ -1,7 +1,7 @@
+using Metrics.ConcurrencyUtilities;
using System;
using System.Diagnostics;
-using Metrics.ConcurrencyUtilities;
namespace Metrics.Utils
{
diff --git a/Metrics/paket.references b/Metrics/paket.references
deleted file mode 100644
index bedc83c3..00000000
--- a/Metrics/paket.references
+++ /dev/null
@@ -1,4 +0,0 @@
-System.Diagnostics.PerformanceCounter
-LibLog
-Microsoft.CSharp
-System.Configuration.ConfigurationManager
\ No newline at end of file
diff --git a/Metrics/paket.template b/Metrics/paket.template
deleted file mode 100644
index 7a49aa11..00000000
--- a/Metrics/paket.template
+++ /dev/null
@@ -1,13 +0,0 @@
-type
- project
-description
- Infrastructure used for hosting Orleans Microdot services, part of the
- Microdot framework.
-projectUrl
- https://github.com/gigya/microdot
-licenseUrl
- https://github.com/gigya/microdot/blob/master/LICENSE.md
-tags
- gigya microdot microservice microservices
-authors
- metrics.net
\ No newline at end of file
diff --git a/Microdot.sln b/Microdot.sln
index f09b2b07..a6063296 100644
--- a/Microdot.sln
+++ b/Microdot.sln
@@ -9,12 +9,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".Solution Items", ".Solutio
ProjectSection(SolutionItems) = preProject
Changelog.md = Changelog.md
Directory.Build.props = Directory.Build.props
+ Directory.Build.targets = Directory.Build.targets
+ global.json = global.json
LICENSE.md = LICENSE.md
main.ruleset = main.ruleset
- paket.dependencies = paket.dependencies
- paket.lock = paket.lock
README.md = README.md
- SolutionVersion.cs = SolutionVersion.cs
+ test.runsettings = test.runsettings
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gigya.Microdot.Fakes", "Gigya.Microdot.Fakes\Gigya.Microdot.Fakes.csproj", "{2865F69B-D847-4901-8945-4941E463F94E}"
@@ -41,8 +41,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gigya.Microdot.Testing.Shar
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gigya.Microdot.ServiceDiscovery", "Gigya.Microdot.ServiceDiscovery\Gigya.Microdot.ServiceDiscovery.csproj", "{37E6909E-51E2-4BBA-8EFC-DBDF086D860E}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gigya.Microdot.ServiceContract.UnitTests", "tests\Gigya.Microdot.ServiceContract.UnitTests\Gigya.Microdot.ServiceContract.UnitTests.csproj", "{C224F79A-EAB5-48B8-B587-65772B0966EF}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gigya.Microdot.Logging.NLog", "Gigya.Microdot.Logging.NLog\Gigya.Microdot.Logging.NLog.csproj", "{06E45085-5A54-4BFE-BD24-E9C3983A2689}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gigya.Microdot.Orleans.Hosting.UnitTests", "tests\Gigya.Microdot.Orleans.Hosting.UnitTests\Gigya.Microdot.Orleans.Hosting.UnitTests.csproj", "{8E548D57-5880-4283-BDF5-7386886D481D}"
@@ -65,21 +63,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CalculatorService.Orleans",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gigya.Microdot.Common.Tests", "Gigya.Microdot.Common.Tests\Gigya.Microdot.Common.Tests.csproj", "{47CBF637-AB8F-4568-86D6-EAB6EF08B9CE}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ServiceContract", "ServiceContract", "{A14C7201-FAAC-487C-AED3-8A0CA86A8A88}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gigya.ServiceContract", "Gigya.ServiceContract\Gigya.ServiceContract.csproj", "{DB6D3561-835E-40D5-B9D4-83951CF426DF}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gigya.Microdot.LanguageExtensions", "Gigya.Microdot.LanguageExtensions\Gigya.Microdot.LanguageExtensions.csproj", "{54F30C07-4D6C-4E8F-8C38-BCD8B0ECEE43}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9E13FD47-A463-4D69-A078-59EECAEC294F}"
- ProjectSection(SolutionItems) = preProject
- Changelog.md = Changelog.md
- Directory.Build.props = Directory.Build.props
- paket.dependencies = paket.dependencies
- README.md = README.md
- test.runsettings = test.runsettings
- EndProjectSection
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Metrics", "Metrics\Metrics.csproj", "{C4AB90EF-198B-47E8-B5EE-0B517C7250D6}"
EndProject
Global
@@ -136,10 +121,6 @@ Global
{37E6909E-51E2-4BBA-8EFC-DBDF086D860E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37E6909E-51E2-4BBA-8EFC-DBDF086D860E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37E6909E-51E2-4BBA-8EFC-DBDF086D860E}.Release|Any CPU.Build.0 = Release|Any CPU
- {C224F79A-EAB5-48B8-B587-65772B0966EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C224F79A-EAB5-48B8-B587-65772B0966EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C224F79A-EAB5-48B8-B587-65772B0966EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C224F79A-EAB5-48B8-B587-65772B0966EF}.Release|Any CPU.Build.0 = Release|Any CPU
{06E45085-5A54-4BFE-BD24-E9C3983A2689}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06E45085-5A54-4BFE-BD24-E9C3983A2689}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06E45085-5A54-4BFE-BD24-E9C3983A2689}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -180,10 +161,6 @@ Global
{47CBF637-AB8F-4568-86D6-EAB6EF08B9CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47CBF637-AB8F-4568-86D6-EAB6EF08B9CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47CBF637-AB8F-4568-86D6-EAB6EF08B9CE}.Release|Any CPU.Build.0 = Release|Any CPU
- {DB6D3561-835E-40D5-B9D4-83951CF426DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DB6D3561-835E-40D5-B9D4-83951CF426DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DB6D3561-835E-40D5-B9D4-83951CF426DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DB6D3561-835E-40D5-B9D4-83951CF426DF}.Release|Any CPU.Build.0 = Release|Any CPU
{54F30C07-4D6C-4E8F-8C38-BCD8B0ECEE43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54F30C07-4D6C-4E8F-8C38-BCD8B0ECEE43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54F30C07-4D6C-4E8F-8C38-BCD8B0ECEE43}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -197,7 +174,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {C224F79A-EAB5-48B8-B587-65772B0966EF} = {F8A1B754-3C63-4051-A1A5-C51E916F90EB}
{8E548D57-5880-4283-BDF5-7386886D481D} = {F8A1B754-3C63-4051-A1A5-C51E916F90EB}
{0A24AE97-EE88-4E8B-8B92-092884D41399} = {F8A1B754-3C63-4051-A1A5-C51E916F90EB}
{A17C9A6D-317D-441C-B33A-3807B67B4FA2} = {F8A1B754-3C63-4051-A1A5-C51E916F90EB}
@@ -206,7 +182,6 @@ Global
{BCD894C2-29B3-4C76-8E5D-5781A5A10C67} = {79538186-DFAD-463C-B4D1-CD0917CF5954}
{10E10FDE-8A2C-4D5D-8FC1-15FACF844E80} = {79538186-DFAD-463C-B4D1-CD0917CF5954}
{47CBF637-AB8F-4568-86D6-EAB6EF08B9CE} = {F8A1B754-3C63-4051-A1A5-C51E916F90EB}
- {DB6D3561-835E-40D5-B9D4-83951CF426DF} = {A14C7201-FAAC-487C-AED3-8A0CA86A8A88}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EnterpriseLibraryConfigurationToolBinariesPathV6 = packages\EnterpriseLibrary.TransientFaultHandling.6.0.1304.0\lib\portable-net45+win+wp8
diff --git a/Sample/CalculatorService.Client/App.config b/Sample/CalculatorService.Client/App.config
deleted file mode 100644
index e5a96187..00000000
--- a/Sample/CalculatorService.Client/App.config
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Sample/CalculatorService.Client/CalculatorService.Client.csproj b/Sample/CalculatorService.Client/CalculatorService.Client.csproj
index 1ddfc7c3..444f019d 100644
--- a/Sample/CalculatorService.Client/CalculatorService.Client.csproj
+++ b/Sample/CalculatorService.Client/CalculatorService.Client.csproj
@@ -1,26 +1,28 @@
-
- Exe
- net472
- true
- true
- 1591
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ CalculatorService.Client
+ Exe
+ false
+ true
+ net472;net5.0;net6.0
+ false
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Sample/CalculatorService.Client/Program.cs b/Sample/CalculatorService.Client/Program.cs
index b87e0ede..95973a15 100644
--- a/Sample/CalculatorService.Client/Program.cs
+++ b/Sample/CalculatorService.Client/Program.cs
@@ -1,75 +1,68 @@
-using System;
-using System.Diagnostics;
-using System.Net;
-using System.Threading.Tasks;
-using CalculatorService.Interface;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Environment;
-using Gigya.Microdot.Interfaces;
-using Gigya.Microdot.Interfaces.Configuration;
-using Gigya.Microdot.Logging.NLog;
-using Gigya.Microdot.Ninject;
-using Gigya.Microdot.ServiceProxy.Caching;
-using Gigya.Microdot.SharedLogic.Events;
-using Gigya.Microdot.SharedLogic.SystemWrappers;
-using Gigya.Microdot.UnitTests.Caching;
-using Ninject;
-
-namespace CalculatorService.Client
-{
- class Program
- {
- static FakeRevokingManager _fakeRevokingManager = new FakeRevokingManager();
-
- static async Task Main(string[] args)
- {
- try
- {
- using (var microdotInitializer = new MicrodotInitializer("test-client", new NLogModule(), k =>
- {
- k.Rebind().ToConstant(_fakeRevokingManager);
- }))
- {
- //NLog.LogManager.GlobalThreshold = NLog.LogLevel.Info;
- var calculatorService = microdotInitializer.Kernel.Get();
-
- Task.Factory.StartNew(() => ListenToRevokes());
-
- while (true)
- {
- try
- {
- var result = await calculatorService.Add(1, 2);
- Console.WriteLine($"Value: {result}");
- }
- catch (Exception e)
- {
- Console.WriteLine($"Error: {e.Message}");
- // throw;
- }
-
- await Task.Delay(1000);
-
+using CalculatorService.Interface;
+using Gigya.Microdot.Logging.NLog;
+using Gigya.Microdot.Ninject;
+using Gigya.Microdot.ServiceProxy.Caching;
+using Gigya.Microdot.UnitTests.Caching;
+using Ninject;
+using System;
+using System.Threading.Tasks;
+
+namespace CalculatorService.Client
+{
+ class Program
+ {
+ static FakeRevokingManager _fakeRevokingManager = new FakeRevokingManager();
+
+ static async Task Main(string[] args)
+ {
+ try
+ {
+ Random rnd = new Random(Guid.NewGuid().GetHashCode());
+ using (var microdotInitializer = new MicrodotInitializer("test-client", new NLogModule(), k =>
+ {
+ k.Rebind().ToConstant(_fakeRevokingManager);
+ }))
+ {
+ //NLog.LogManager.GlobalThreshold = NLog.LogLevel.Info;
+ var calculatorService = microdotInitializer.Kernel.Get();
+
+ Task.Factory.StartNew(() => ListenToRevokes());
+
+ while (true)
+ {
+ try
+ {
+ int a = rnd.Next(100);
+ int b = rnd.Next(100);
+ var result = await calculatorService.Add(a, b);
+ Console.WriteLine($"{a}+{b}={result}");
+ await Task.Delay(1000);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine($"Error: {e.Message}");
+ throw;
+ }
}
- }
- }
- catch (Exception ex)
- {
- Console.Error.WriteLine(ex);
- }
- }
-
- private static async Task ListenToRevokes()
- {
+ }
+ }
+ catch (Exception ex)
+ {
+ Console.Error.WriteLine(ex);
+ }
+ }
+
+ private static async Task ListenToRevokes()
+ {
while (true)
- {
- var revokeKey = Console.ReadLine();
-
+ {
+ var revokeKey = Console.ReadLine();
+
Console.WriteLine($"Before revoke of {revokeKey}");
- await _fakeRevokingManager.Revoke(revokeKey);
- Console.WriteLine($"After revoke of {revokeKey}");
+ await _fakeRevokingManager.Revoke(revokeKey);
+ Console.WriteLine($"After revoke of {revokeKey}");
}
- }
- }
-}
+ }
+ }
+}
diff --git a/Sample/CalculatorService.Client/Properties/AssemblyInfo.cs b/Sample/CalculatorService.Client/Properties/AssemblyInfo.cs
index de64a2e5..13b32751 100644
--- a/Sample/CalculatorService.Client/Properties/AssemblyInfo.cs
+++ b/Sample/CalculatorService.Client/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
+using System.Runtime.InteropServices;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
diff --git a/Sample/CalculatorService.Client/paket.references b/Sample/CalculatorService.Client/paket.references
deleted file mode 100644
index b156c01a..00000000
--- a/Sample/CalculatorService.Client/paket.references
+++ /dev/null
@@ -1,2 +0,0 @@
-Ninject
-Ninject.Extensions.Factory
diff --git a/Sample/CalculatorService.Interface/CalculatorService.Interface.csproj b/Sample/CalculatorService.Interface/CalculatorService.Interface.csproj
index f490d31f..46785158 100644
--- a/Sample/CalculatorService.Interface/CalculatorService.Interface.csproj
+++ b/Sample/CalculatorService.Interface/CalculatorService.Interface.csproj
@@ -1,26 +1,9 @@
-
- {1FB8E464-6A36-44A2-A343-8E95B51B4542}
- net472
- Gigya.Microdot.Sample.CalculatorService.Interface
- Gigya.Microdot.Sample.CalculatorService.Interface
- Copyright © 2018
- false
- bin\$(Configuration)\
- $(SolutionDir)main.ruleset
-
-
- full
- 3
-
-
- pdbonly
-
-
-
- Designer
-
-
-
+
+ Gigya.Microdot.Sample.CalculatorService.Interface
+
+
+
+
\ No newline at end of file
diff --git a/Sample/CalculatorService.Interface/ICalculatorService.cs b/Sample/CalculatorService.Interface/ICalculatorService.cs
index d630734e..08b8d2e4 100644
--- a/Sample/CalculatorService.Interface/ICalculatorService.cs
+++ b/Sample/CalculatorService.Interface/ICalculatorService.cs
@@ -20,10 +20,10 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Threading.Tasks;
using Gigya.Common.Contracts.Attributes;
using Gigya.Common.Contracts.HttpService;
using Gigya.ServiceContract.HttpService;
+using System.Threading.Tasks;
namespace CalculatorService.Interface
{
diff --git a/Sample/CalculatorService.Interface/Properties/AssemblyInfo.cs b/Sample/CalculatorService.Interface/Properties/AssemblyInfo.cs
index d431ae21..db33ea10 100644
--- a/Sample/CalculatorService.Interface/Properties/AssemblyInfo.cs
+++ b/Sample/CalculatorService.Interface/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
+using System.Runtime.InteropServices;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
diff --git a/Sample/CalculatorService.Interface/paket.references b/Sample/CalculatorService.Interface/paket.references
deleted file mode 100644
index d94f2433..00000000
--- a/Sample/CalculatorService.Interface/paket.references
+++ /dev/null
@@ -1 +0,0 @@
-Gigya.ServiceContract
\ No newline at end of file
diff --git a/Sample/CalculatorService.Orleans/App.config b/Sample/CalculatorService.Orleans/App.config
deleted file mode 100644
index 18cc2f61..00000000
--- a/Sample/CalculatorService.Orleans/App.config
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Sample/CalculatorService.Orleans/CalculatorService.Orleans.csproj b/Sample/CalculatorService.Orleans/CalculatorService.Orleans.csproj
index 0bd85344..bcf5856c 100644
--- a/Sample/CalculatorService.Orleans/CalculatorService.Orleans.csproj
+++ b/Sample/CalculatorService.Orleans/CalculatorService.Orleans.csproj
@@ -1,26 +1,27 @@
-
- Exe
- net472
- true
- false
- $(SolutionDir)main.ruleset
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ CalculatorService.Orleans
+ Exe
+ false
+ true
+ net472;net5.0;net6.0
+ Linux
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
\ No newline at end of file
diff --git a/Sample/CalculatorService.Orleans/CalculatorService.cs b/Sample/CalculatorService.Orleans/CalculatorService.cs
index 514d87dd..610b1417 100644
--- a/Sample/CalculatorService.Orleans/CalculatorService.cs
+++ b/Sample/CalculatorService.Orleans/CalculatorService.cs
@@ -1,11 +1,9 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using CalculatorService.Interface;
-using Gigya.Microdot.SharedLogic.Security;
+using CalculatorService.Interface;
using Gigya.ServiceContract.HttpService;
using Orleans;
using Orleans.Concurrency;
+using System.Threading;
+using System.Threading.Tasks;
namespace CalculatorService.Orleans
{
@@ -17,15 +15,12 @@ public interface ICalculatorServiceGrain : ICalculatorService, IGrainWithInteger
[StatelessWorker, Reentrant]
public class CalculatorService : Grain, ICalculatorServiceGrain
{
- private readonly IMicrodotTypePolicySerializationBinder _binder;
-
- public CalculatorService(IMicrodotTypePolicySerializationBinder binder)
+ public CalculatorService()
{
- _binder = binder;
+
}
public Task Add(int a, int b)
{
- _binder.BindToType("foo","bar");
return Task.FromResult((a + b).ToString());
}
diff --git a/Sample/CalculatorService.Orleans/CalculatorServiceHost.cs b/Sample/CalculatorService.Orleans/CalculatorServiceHost.cs
index ac7ac4cd..f7dbe269 100644
--- a/Sample/CalculatorService.Orleans/CalculatorServiceHost.cs
+++ b/Sample/CalculatorService.Orleans/CalculatorServiceHost.cs
@@ -1,9 +1,9 @@
-using System;
-using Gigya.Microdot.Logging.NLog;
+using Gigya.Microdot.Logging.NLog;
using Gigya.Microdot.Ninject;
using Gigya.Microdot.Orleans.Ninject.Host;
-using System.Threading.Tasks;
using Orleans;
+using System;
+using System.Threading.Tasks;
namespace CalculatorService.Orleans
{
diff --git a/Sample/CalculatorService.Orleans/Dockerfile b/Sample/CalculatorService.Orleans/Dockerfile
new file mode 100644
index 00000000..4c22383e
--- /dev/null
+++ b/Sample/CalculatorService.Orleans/Dockerfile
@@ -0,0 +1,20 @@
+#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
+
+FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
+WORKDIR /app
+
+FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
+WORKDIR /src
+COPY ["CalculatorService.Orleans/CalculatorService.Orleans.csproj", "CalculatorService.Orleans/"]
+RUN dotnet restore "CalculatorService.Orleans/CalculatorService.Orleans.csproj"
+COPY . .
+ WORKDIR "/src/CalculatorService.Orleans"
+RUN dotnet build "CalculatorService.Orleans.csproj" -c Release -o /app/build
+
+FROM build AS publish
+RUN dotnet publish "CalculatorService.Orleans.csproj" -c Release -o /app/publish
+
+FROM base AS final
+WORKDIR /app
+COPY --from=publish /app/publish .
+ ENTRYPOINT ["dotnet", "CalculatorService.Orleans.dll"]
\ No newline at end of file
diff --git a/Sample/CalculatorService.Orleans/Properties/AssemblyInfo.cs b/Sample/CalculatorService.Orleans/Properties/AssemblyInfo.cs
index 9941fcbd..576eefd2 100644
--- a/Sample/CalculatorService.Orleans/Properties/AssemblyInfo.cs
+++ b/Sample/CalculatorService.Orleans/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
+using System.Runtime.InteropServices;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
diff --git a/Sample/CalculatorService.Orleans/Properties/launchSettings.json b/Sample/CalculatorService.Orleans/Properties/launchSettings.json
new file mode 100644
index 00000000..376591af
--- /dev/null
+++ b/Sample/CalculatorService.Orleans/Properties/launchSettings.json
@@ -0,0 +1,16 @@
+{
+ "profiles": {
+ "CalculatorService": {
+ "commandName": "Project",
+ "commandLineArgs": "--ServiceStartupMode:CommandLineInteractive --ConsoleOutputMode:Color"
+ },
+ "Docker": {
+ "commandName": "Docker",
+ "commandLineArgs": "--ServiceStartupMode:CommandLineInteractive --ConsoleOutputMode:Color",
+ "environmentVariables": {
+ "GIGYA_ENVVARS_FILE": "/gigya/environmentVariablesLinux.json"
+ },
+ "DockerfileRunArguments": "-v C:\\Gigya:/gigya -p 12323:12323 -p 12324:12324 -p 12325:12325 -p 12326:12326 -p 12327:12327 -p 12328:12328 -e ENV=st11 -e DC=il1 -e region=il1 -e GIGYA_BASE_PATH=/gigya -e GIGYA_CONFIG_PATHS_FILE=/gigya/config/loadPathsWithLocal.json -e GIGYA_CONFIG_ROOT=/gigya/config -e CONSUL=consul.service.il1.gigya.io:8500 -e GIGYA_SERVICE_INSTANCE_NAME=A"
+ }
+ }
+}
\ No newline at end of file
diff --git a/Sample/CalculatorService.Orleans/docker-entrypoint.sh b/Sample/CalculatorService.Orleans/docker-entrypoint.sh
new file mode 100644
index 00000000..60fd6944
--- /dev/null
+++ b/Sample/CalculatorService.Orleans/docker-entrypoint.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+usage()
+{
+ echo "Please enter the following arguments: \
+ --cert_filepath: pfx certificate file path. \
+ --cert_password: pfx certificate password."
+}
+
+cert_filepath=""
+cert_password=""
+
+while [[ "$1" != "" ]]; do
+ case $1 in
+ --cert_filepath ) shift
+ cert_filepath=$1
+ ;;
+ --cert_password ) shift
+ cert_password=$1
+ ;;
+ -h | --help ) usage
+ exit
+ ;;
+ * ) usage
+ exit 1
+ esac
+ shift
+done
+
+
+# Install certificate and run application
+./certificate-tool add -f ${cert_filepath} -p ${cert_password}
+dotnet ./CalculatorService.Orleans.dll
\ No newline at end of file
diff --git a/Sample/CalculatorService.Orleans/paket.references b/Sample/CalculatorService.Orleans/paket.references
deleted file mode 100644
index d9b3f90f..00000000
--- a/Sample/CalculatorService.Orleans/paket.references
+++ /dev/null
@@ -1,5 +0,0 @@
-Ninject
-Microsoft.Orleans.CodeGenerator.MsBuild
-Microsoft.Orleans.Core
-
-# Solve binding redirect issue, related to project vs nuget references. OrleansDashboard depends on.
diff --git a/Sample/CalculatorService/App.config b/Sample/CalculatorService/App.config
deleted file mode 100644
index ce399b0e..00000000
--- a/Sample/CalculatorService/App.config
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Sample/CalculatorService/CalculatorService.cs b/Sample/CalculatorService/CalculatorService.cs
index f3592864..df503df4 100644
--- a/Sample/CalculatorService/CalculatorService.cs
+++ b/Sample/CalculatorService/CalculatorService.cs
@@ -1,7 +1,7 @@
-using System.Threading;
-using System.Threading.Tasks;
-using CalculatorService.Interface;
+using CalculatorService.Interface;
using Gigya.ServiceContract.HttpService;
+using System.Threading;
+using System.Threading.Tasks;
namespace CalculatorService
{
diff --git a/Sample/CalculatorService/CalculatorService.csproj b/Sample/CalculatorService/CalculatorService.csproj
index 7d54ae08..0677168c 100644
--- a/Sample/CalculatorService/CalculatorService.csproj
+++ b/Sample/CalculatorService/CalculatorService.csproj
@@ -1,62 +1,24 @@
-
- {5B1BA713-F5BA-466B-B79E-95261DB27FA9}
- Exe
- net472
- true
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
- 1591
- CalculatorService
- CalculatorService
- Copyright © 2018
- false
- bin\$(Configuration)\
-
-
- full
- 3
-
-
- pdbonly
-
-
-
- ..\..\packages\System.Threading.Tasks.Dataflow\lib\netstandard1.1\System.Threading.Tasks.Dataflow.dll
- False
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ CalculatorService
+ Exe
+ false
+ true
+ net472;net5.0;net6.0
+ Linux
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Sample/CalculatorService/CalculatorServiceHost.cs b/Sample/CalculatorService/CalculatorServiceHost.cs
index 043d16c6..0c6fedf7 100644
--- a/Sample/CalculatorService/CalculatorServiceHost.cs
+++ b/Sample/CalculatorService/CalculatorServiceHost.cs
@@ -1,15 +1,10 @@
-using System;
-using CalculatorService.Interface;
-using Gigya.Microdot.Configuration;
-using Gigya.Microdot.Hosting.Environment;
-using Gigya.Microdot.Interfaces.Configuration;
-using Gigya.Microdot.Interfaces.SystemWrappers;
+using CalculatorService.Interface;
using Gigya.Microdot.Logging.NLog;
using Gigya.Microdot.Ninject;
using Gigya.Microdot.Ninject.Host;
using Gigya.Microdot.SharedLogic;
-using Gigya.Microdot.SharedLogic.SystemWrappers;
using Ninject;
+using System;
namespace CalculatorService
{
diff --git a/Sample/CalculatorService/Dockerfile b/Sample/CalculatorService/Dockerfile
new file mode 100644
index 00000000..296007e7
--- /dev/null
+++ b/Sample/CalculatorService/Dockerfile
@@ -0,0 +1,20 @@
+#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
+
+FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
+WORKDIR /app
+
+FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
+WORKDIR /src
+COPY ["CalculatorService/CalculatorService.csproj", "CalculatorService/"]
+RUN dotnet restore "CalculatorService/CalculatorService.csproj"
+COPY . .
+ WORKDIR "/src/CalculatorService"
+RUN dotnet build "CalculatorService.csproj" -c Release -o /app/build
+
+FROM build AS publish
+RUN dotnet publish "CalculatorService.csproj" -c Release -o /app/publish
+
+FROM base AS final
+WORKDIR /app
+COPY --from=publish /app/publish .
+ ENTRYPOINT ["dotnet", "CalculatorService.dll"]
\ No newline at end of file
diff --git a/Sample/CalculatorService/Properties/AssemblyInfo.cs b/Sample/CalculatorService/Properties/AssemblyInfo.cs
index 2999f545..9fca098f 100644
--- a/Sample/CalculatorService/Properties/AssemblyInfo.cs
+++ b/Sample/CalculatorService/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
+using System.Runtime.InteropServices;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
diff --git a/Sample/CalculatorService/Properties/launchSettings.json b/Sample/CalculatorService/Properties/launchSettings.json
new file mode 100644
index 00000000..376591af
--- /dev/null
+++ b/Sample/CalculatorService/Properties/launchSettings.json
@@ -0,0 +1,16 @@
+{
+ "profiles": {
+ "CalculatorService": {
+ "commandName": "Project",
+ "commandLineArgs": "--ServiceStartupMode:CommandLineInteractive --ConsoleOutputMode:Color"
+ },
+ "Docker": {
+ "commandName": "Docker",
+ "commandLineArgs": "--ServiceStartupMode:CommandLineInteractive --ConsoleOutputMode:Color",
+ "environmentVariables": {
+ "GIGYA_ENVVARS_FILE": "/gigya/environmentVariablesLinux.json"
+ },
+ "DockerfileRunArguments": "-v C:\\Gigya:/gigya -p 12323:12323 -p 12324:12324 -p 12325:12325 -p 12326:12326 -p 12327:12327 -p 12328:12328 -e ENV=st11 -e DC=il1 -e region=il1 -e GIGYA_BASE_PATH=/gigya -e GIGYA_CONFIG_PATHS_FILE=/gigya/config/loadPathsWithLocal.json -e GIGYA_CONFIG_ROOT=/gigya/config -e CONSUL=consul.service.il1.gigya.io:8500 -e GIGYA_SERVICE_INSTANCE_NAME=A"
+ }
+ }
+}
\ No newline at end of file
diff --git a/Sample/CalculatorService/paket.references b/Sample/CalculatorService/paket.references
deleted file mode 100644
index bb61dec0..00000000
--- a/Sample/CalculatorService/paket.references
+++ /dev/null
@@ -1 +0,0 @@
-Ninject
diff --git a/SolutionVersion.cs b/SolutionVersion.cs
deleted file mode 100644
index dace78f3..00000000
--- a/SolutionVersion.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyCompany("Gigya Inc.")]
-[assembly: AssemblyCopyright("© 2018 Gigya Inc.")]
-[assembly: AssemblyDescription("Microdot Framework")]
-
-[assembly: AssemblyVersion("2.3.0.0")]
-[assembly: AssemblyFileVersion("2.3.0.0")]
-[assembly: AssemblyInformationalVersion("2.3.0.0")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-[assembly: CLSCompliant(false)]
-
diff --git a/global.json b/global.json
new file mode 100644
index 00000000..32de063a
--- /dev/null
+++ b/global.json
@@ -0,0 +1,5 @@
+{
+ "sdk": {
+ "version": "6.0.102"
+ }
+}
\ No newline at end of file
diff --git a/paket.dependencies b/paket.dependencies
deleted file mode 100644
index f8f498f5..00000000
--- a/paket.dependencies
+++ /dev/null
@@ -1,106 +0,0 @@
-source https://api.nuget.org/v3/index.json
-source http://nuget.gigya.net/nugetForVS/nuget/
-
-framework: auto-detect
-redirects: off
-content: once
-copy_content_to_output_dir: always
-
-# Pinning to 3.1.17 as 5.0.0+ are net5 nugets
-nuget Microsoft.AspNetCore.Http.Features == 3.1.17
-nuget Microsoft.AspNetCore.Connections.Abstractions == 3.1.17
-nuget Microsoft.Extensions.Primitives == 3.1.17
-nuget Microsoft.Extensions.Configuration.Abstractions == 3.1.17
-nuget Microsoft.Extensions.Options == 3.1.17
-nuget Microsoft.Extensions.DependencyInjection.Abstractions == 3.1.17
-nuget Microsoft.Extensions.Logging == 3.1.17
-nuget Microsoft.Extensions.Logging.Abstractions == 3.1.17
-nuget Microsoft.Extensions.Configuration == 3.1.17
-nuget Microsoft.Extensions.Configuration.Binder == 3.1.17
-nuget Microsoft.Extensions.Configuration.EnvironmentVariables == 3.1.17
-nuget Microsoft.Extensions.Configuration.FileExtensions == 3.1.17
-nuget Microsoft.Extensions.DependencyInjection == 3.1.17
-nuget Microsoft.Extensions.DependencyModel == 3.1.6
-nuget Microsoft.Extensions.FileProviders.Abstractions == 3.1.17
-nuget Microsoft.Extensions.FileProviders.Physical == 3.1.17
-nuget Microsoft.Extensions.FileSystemGlobbing == 3.1.17
-nuget Microsoft.Extensions.Hosting.Abstractions == 3.1.17
-nuget Microsoft.Extensions.Logging.Configuration == 3.1.17
-nuget Microsoft.Extensions.Logging.Console == 3.1.17
-nuget Microsoft.Extensions.ObjectPool == 3.1.17
-nuget Microsoft.Extensions.Options.ConfigurationExtensions == 3.1.17
-
-
-
-nuget Gigya.ServiceContract ~> 2.7.7
-
-# .Net
-# Pinning to 4.7.0 as 5.0.0+ are net5 nugets
-nuget Microsoft.CSharp ~> 4.7
-nuget System.ComponentModel.Annotations ~> 4.7
-nuget System.Diagnostics.PerformanceCounter ~> 4.7
-nuget System.Runtime.Caching ~> 4.7
-nuget System.ServiceProcess.ServiceController ~> 4.7
-nuget System.Reflection.Emit ~> 4.7
-nuget System.Configuration.ConfigurationManager ~> 4.7
-
-nuget System.Data.DataSetExtensions
-nuget System.Net.Http
-nuget System.ValueTuple
-
-
-#
-nuget Newtonsoft.Json ~> 12
-nuget Nito.AsyncEx ~> 5.0
-nuget System.Threading.Tasks.Dataflow ~> 4.0
-nuget ZooKeeperNetEx ~> 3.0
-
-# Orleans
-nuget Microsoft.Orleans.Core == 3.4.1
-nuget Microsoft.Orleans.OrleansRuntime == 3.4.1
-nuget Microsoft.Orleans.OrleansProviders == 3.4.1
-nuget Microsoft.Orleans.OrleansZooKeeperUtils == 3.4.1
-nuget Microsoft.Orleans.OrleansCodeGenerator == 3.4.1
-nuget Microsoft.Orleans.CodeGenerator.MSBuild == 3.4.1
-nuget Microsoft.Orleans.Client == 3.4.1
-nuget Microsoft.Orleans.OrleansTelemetryConsumers.Counters == 3.4.1
-nuget Microsoft.Orleans.Server == 3.4.1
-nuget Microsoft.Orleans.Core.Abstractions == 3.4.1
-nuget Microsoft.Orleans.Connections.Security == 3.4.1
-nuget Microsoft.Orleans.Clustering.AdoNet == 3.4.1
-nuget Microsoft.Orleans.Persistence.AdoNet == 3.4.1
-nuget Microsoft.Orleans.Reminders.AdoNet == 3.4.1
-
-nuget Microsoft.Orleans.Runtime.Abstractions == 3.4.1
-nuget Microsoft.Orleans.OrleansSqlUtils ~> 2.4
-
-nuget Microsoft.AspNetCore.Hosting ~> 2.2
-nuget Microsoft.AspNetCore.Server.Kestrel ~> 2.2
-nuget Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets == 2.2.1
-
-
-
-# TODO: remove this dependency once we move to dotnet core and go back to using the original dashboard
-nuget Gigya.OrleansDashboard.NetStandard ~> 3
-
-nuget LibLog ~> 4.2.3
-
-nuget Microsoft.CodeAnalysis.CSharp ~> 3
-nuget Microsoft.CodeAnalysis.Common ~> 3
-
-# Ninject
-nuget Ninject ~> 3.3
-nuget Ninject.Extensions.Factory ~> 3.3
-nuget Ninject.Extensions.Conventions ~> 3.3
-nuget Castle.Core ~> 4
-
-# Tests only dependencies
-nuget NUnit ~> 3
-nuget NUnit3TestAdapter ~> 3
-nuget RichardSzalay.MockHttp ~> 5
-nuget NSubstitute ~> 4
-nuget FluentAssertions ~> 5
-nuget Nuget.CommandLine ~> 5
-nuget Shouldly ~> 3
-nuget NLog ~> 4
-nuget Microsoft.NET.Test.Sdk ~> 16
diff --git a/paket.lock b/paket.lock
deleted file mode 100644
index efa5ee2c..00000000
--- a/paket.lock
+++ /dev/null
@@ -1,795 +0,0 @@
-REDIRECTS: OFF
-COPY-CONTENT-TO-OUTPUT-DIR: ALWAYS
-CONTENT: ONCE
-RESTRICTION: || (== net472) (== netstandard2.0)
-NUGET
- remote: https://api.nuget.org/v3/index.json
- Castle.Core (4.4.1)
- NETStandard.Library (>= 1.6.1) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Collections.Specialized (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.ComponentModel (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.ComponentModel.TypeConverter (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Diagnostics.TraceSource (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Dynamic.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Reflection (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Reflection.Emit (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Reflection.TypeExtensions (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Xml.XmlDocument (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- FluentAssertions (5.10.3)
- System.Configuration.ConfigurationManager (>= 4.4) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (>= netcoreapp2.0)) (&& (== net472) (>= netcoreapp2.1)) (&& (== net472) (>= netstandard2.1)) (== netstandard2.0)
- LibLog (4.2.6)
- Microsoft.AspNetCore.Connections.Abstractions (3.1.17)
- Microsoft.AspNetCore.Http.Features (>= 3.1.17)
- Microsoft.Bcl.AsyncInterfaces (>= 1.1.1)
- System.IO.Pipelines (>= 4.7.4)
- Microsoft.AspNetCore.Hosting (2.2.7)
- Microsoft.AspNetCore.Hosting.Abstractions (>= 2.2)
- Microsoft.AspNetCore.Http (>= 2.2)
- Microsoft.AspNetCore.Http.Extensions (>= 2.2)
- Microsoft.Extensions.Configuration (>= 2.2)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 2.2.4)
- Microsoft.Extensions.Configuration.FileExtensions (>= 2.2)
- Microsoft.Extensions.DependencyInjection (>= 2.2)
- Microsoft.Extensions.FileProviders.Physical (>= 2.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 2.2)
- Microsoft.Extensions.Logging (>= 2.2)
- Microsoft.Extensions.Options (>= 2.2)
- System.Diagnostics.DiagnosticSource (>= 4.5.1)
- System.Reflection.Metadata (>= 1.6)
- Microsoft.AspNetCore.Hosting.Abstractions (2.2)
- Microsoft.AspNetCore.Hosting.Server.Abstractions (>= 2.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 2.2)
- Microsoft.AspNetCore.Hosting.Server.Abstractions (2.2)
- Microsoft.AspNetCore.Http.Features (>= 2.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 2.2)
- Microsoft.AspNetCore.Http (2.2.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2)
- Microsoft.AspNetCore.WebUtilities (>= 2.2)
- Microsoft.Extensions.ObjectPool (>= 2.2)
- Microsoft.Extensions.Options (>= 2.2)
- Microsoft.Net.Http.Headers (>= 2.2)
- Microsoft.AspNetCore.Http.Abstractions (2.2)
- Microsoft.AspNetCore.Http.Features (>= 2.2)
- System.Text.Encodings.Web (>= 4.5)
- Microsoft.AspNetCore.Http.Extensions (2.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2)
- Microsoft.Extensions.FileProviders.Abstractions (>= 2.2)
- Microsoft.Net.Http.Headers (>= 2.2)
- System.Buffers (>= 4.5)
- Microsoft.AspNetCore.Http.Features (3.1.17)
- Microsoft.Extensions.Primitives (>= 3.1.17)
- System.IO.Pipelines (>= 4.7.4)
- Microsoft.AspNetCore.Server.Kestrel (2.2)
- Microsoft.AspNetCore.Hosting (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel.Core (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel.Https (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel.Core (2.2)
- Microsoft.AspNetCore.Hosting.Abstractions (>= 2.2)
- Microsoft.AspNetCore.Http (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (>= 2.2)
- Microsoft.AspNetCore.WebUtilities (>= 2.2)
- Microsoft.Extensions.Configuration.Binder (>= 2.2)
- Microsoft.Extensions.Logging.Abstractions (>= 2.2)
- Microsoft.Extensions.Options (>= 2.2)
- Microsoft.Net.Http.Headers (>= 2.2)
- System.Memory (>= 4.5.1)
- System.Numerics.Vectors (>= 4.5)
- System.Runtime.CompilerServices.Unsafe (>= 4.5.1)
- System.Security.Cryptography.Cng (>= 4.5)
- System.Threading.Tasks.Extensions (>= 4.5.1)
- Microsoft.AspNetCore.Server.Kestrel.Https (2.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel.Core (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (2.2)
- Microsoft.AspNetCore.Connections.Abstractions (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2.2.1)
- Microsoft.AspNetCore.Hosting.Abstractions (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (>= 2.2)
- Microsoft.Extensions.Options (>= 2.2)
- Microsoft.AspNetCore.WebUtilities (2.2)
- Microsoft.Net.Http.Headers (>= 2.2)
- System.Text.Encodings.Web (>= 4.5)
- Microsoft.Bcl.AsyncInterfaces (5.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- Microsoft.CodeAnalysis.Analyzers (3.3.2)
- Microsoft.CodeAnalysis.Common (3.10)
- Microsoft.CodeAnalysis.Analyzers (>= 3.3.2)
- System.Collections.Immutable (>= 5.0)
- System.Memory (>= 4.5.4)
- System.Reflection.Metadata (>= 5.0)
- System.Runtime.CompilerServices.Unsafe (>= 5.0)
- System.Text.Encoding.CodePages (>= 4.5.1)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- Microsoft.CodeAnalysis.CSharp (3.10)
- Microsoft.CodeAnalysis.Common (3.10)
- Microsoft.CodeCoverage (16.10) - restriction: || (== net472) (&& (== netstandard2.0) (>= net45)) (&& (== netstandard2.0) (>= netcoreapp1.0))
- Microsoft.CSharp (4.7)
- Microsoft.Extensions.Configuration (3.1.17)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.1.17)
- Microsoft.Extensions.Configuration.Abstractions (3.1.17)
- Microsoft.Extensions.Primitives (>= 3.1.17)
- Microsoft.Extensions.Configuration.Binder (3.1.17)
- Microsoft.Extensions.Configuration (>= 3.1.17)
- Microsoft.Extensions.Configuration.EnvironmentVariables (3.1.17)
- Microsoft.Extensions.Configuration (>= 3.1.17)
- Microsoft.Extensions.Configuration.FileExtensions (3.1.17)
- Microsoft.Extensions.Configuration (>= 3.1.17)
- Microsoft.Extensions.FileProviders.Physical (>= 3.1.17)
- Microsoft.Extensions.DependencyInjection (3.1.17)
- Microsoft.Bcl.AsyncInterfaces (>= 1.1.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 3.1.17)
- Microsoft.Extensions.DependencyInjection.Abstractions (3.1.17)
- Microsoft.Extensions.DependencyModel (3.1.6)
- Newtonsoft.Json (>= 9.0.1) - restriction: || (== net472) (&& (== netstandard2.0) (>= net451)) (&& (== netstandard2.0) (< netstandard1.6))
- System.Runtime.InteropServices.RuntimeInformation (>= 4.0) - restriction: || (== net472) (&& (== netstandard2.0) (>= net451)) (&& (== netstandard2.0) (< netstandard1.6))
- System.Text.Json (>= 4.7.2) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- Microsoft.Extensions.FileProviders.Abstractions (3.1.17)
- Microsoft.Extensions.Primitives (>= 3.1.17)
- Microsoft.Extensions.FileProviders.Physical (3.1.17)
- Microsoft.Extensions.FileProviders.Abstractions (>= 3.1.17)
- Microsoft.Extensions.FileSystemGlobbing (>= 3.1.17)
- Microsoft.Extensions.FileSystemGlobbing (3.1.17)
- Microsoft.Extensions.Hosting.Abstractions (3.1.17)
- Microsoft.Bcl.AsyncInterfaces (>= 1.1.1)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.1.17)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 3.1.17)
- Microsoft.Extensions.FileProviders.Abstractions (>= 3.1.17)
- Microsoft.Extensions.Logging.Abstractions (>= 3.1.17)
- Microsoft.Extensions.Logging (3.1.17)
- Microsoft.Extensions.Configuration.Binder (>= 3.1.17)
- Microsoft.Extensions.DependencyInjection (>= 3.1.17)
- Microsoft.Extensions.Logging.Abstractions (>= 3.1.17)
- Microsoft.Extensions.Options (>= 3.1.17)
- Microsoft.Extensions.Logging.Abstractions (3.1.17)
- Microsoft.Extensions.Logging.Configuration (3.1.17)
- Microsoft.Extensions.Logging (>= 3.1.17)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 3.1.17)
- Microsoft.Extensions.Logging.Console (3.1.17)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.1.17)
- Microsoft.Extensions.Logging (>= 3.1.17)
- Microsoft.Extensions.Logging.Configuration (>= 3.1.17)
- Microsoft.Extensions.ObjectPool (3.1.17)
- Microsoft.Extensions.Options (3.1.17)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 3.1.17)
- Microsoft.Extensions.Primitives (>= 3.1.17)
- System.ComponentModel.Annotations (>= 4.7)
- Microsoft.Extensions.Options.ConfigurationExtensions (3.1.17)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.1.17)
- Microsoft.Extensions.Configuration.Binder (>= 3.1.17)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 3.1.17)
- Microsoft.Extensions.Options (>= 3.1.17)
- Microsoft.Extensions.Primitives (3.1.17)
- System.Memory (>= 4.5.2)
- System.Runtime.CompilerServices.Unsafe (>= 4.7.1)
- Microsoft.Net.Http.Headers (2.2.8)
- Microsoft.Extensions.Primitives (>= 2.2)
- System.Buffers (>= 4.5)
- Microsoft.NET.Test.Sdk (16.10)
- Microsoft.CodeCoverage (>= 16.10) - restriction: || (== net472) (&& (== netstandard2.0) (>= net45)) (&& (== netstandard2.0) (>= netcoreapp1.0))
- Microsoft.NETCore.Platforms (5.0.2) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (5.0) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.Orleans.Client (3.4.1)
- Microsoft.Orleans.OrleansProviders (>= 3.4.1)
- Microsoft.Orleans.Clustering.AdoNet (3.4.1)
- Microsoft.Orleans.OrleansProviders (>= 3.4.1)
- Microsoft.Orleans.Runtime.Abstractions (>= 3.4.1)
- System.Data.Common (>= 4.3)
- Microsoft.Orleans.CodeGenerator.MSBuild (3.4.1)
- Microsoft.Orleans.Connections.Security (3.4.1)
- Microsoft.AspNetCore.Connections.Abstractions (>= 3.0)
- Microsoft.Extensions.Configuration (>= 3.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 3.0)
- Microsoft.Extensions.Logging (>= 3.0)
- Microsoft.Orleans.Core (>= 3.4.1)
- Microsoft.Orleans.Runtime.Abstractions (>= 3.4.1)
- System.Buffers (>= 4.5)
- System.Diagnostics.EventLog (>= 4.7)
- System.IO.Pipelines (>= 4.7)
- System.Memory (>= 4.5.3)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- Microsoft.Orleans.Core (3.4.1)
- Microsoft.AspNetCore.Connections.Abstractions (>= 3.0)
- Microsoft.Bcl.AsyncInterfaces (>= 1.1.1)
- Microsoft.Extensions.Configuration (>= 3.0)
- Microsoft.Extensions.DependencyInjection (>= 3.0)
- Microsoft.Extensions.DependencyModel (>= 3.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 3.0)
- Microsoft.Extensions.Logging (>= 3.0)
- Microsoft.Extensions.ObjectPool (>= 3.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 3.0)
- Microsoft.Orleans.Core.Abstractions (>= 3.4.1)
- Newtonsoft.Json (>= 10.0.3)
- System.Buffers (>= 4.5)
- System.Collections.Immutable (>= 1.7)
- System.Diagnostics.DiagnosticSource (>= 4.7)
- System.IO.Pipelines (>= 4.7)
- System.Memory (>= 4.5.3)
- System.Reflection.Emit (>= 4.7)
- System.Reflection.Emit.Lightweight (>= 4.7)
- System.Reflection.Metadata (>= 1.8)
- System.Runtime (>= 4.3.1)
- System.Threading.Channels (>= 4.7)
- System.ValueTuple (>= 4.5)
- Microsoft.Orleans.Core.Abstractions (3.4.1)
- System.Memory (>= 4.5.3)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- Microsoft.Orleans.OrleansCodeGenerator (3.4.1)
- Microsoft.CodeAnalysis.CSharp (>= 3.4)
- Microsoft.Orleans.Core (>= 3.4.1)
- System.Runtime (>= 4.3.1)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- Microsoft.Orleans.OrleansProviders (3.4.1)
- Microsoft.Orleans.Core (>= 3.4.1)
- Microsoft.Orleans.Runtime.Abstractions (>= 3.4.1)
- Microsoft.Orleans.OrleansRuntime (3.4.1)
- Microsoft.AspNetCore.Connections.Abstractions (>= 3.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 3.0)
- Microsoft.Extensions.Options (>= 3.0)
- Microsoft.Orleans.Core (>= 3.4.1)
- Microsoft.Orleans.Runtime.Abstractions (>= 3.4.1)
- System.Buffers (>= 4.5)
- System.Memory (>= 4.5.3)
- System.Threading.Channels (>= 4.7)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- Microsoft.Orleans.OrleansSQLUtils (2.4.5)
- Microsoft.Orleans.Clustering.AdoNet (>= 2.4.5)
- Microsoft.Orleans.OrleansProviders (>= 2.4.5)
- Microsoft.Orleans.Persistence.AdoNet (>= 2.4.5)
- Microsoft.Orleans.Reminders.AdoNet (>= 2.4.5)
- Microsoft.Orleans.Runtime.Abstractions (>= 2.4.5)
- Microsoft.Orleans.OrleansTelemetryConsumers.Counters (3.4.1)
- Microsoft.Extensions.Logging.Console (>= 3.0)
- Microsoft.Orleans.Core (>= 3.4.1)
- Microsoft.Orleans.Runtime.Abstractions (>= 3.4.1)
- System.Diagnostics.PerformanceCounter (>= 4.7)
- System.Management (>= 4.7)
- Microsoft.Orleans.OrleansZooKeeperUtils (3.4.1)
- Microsoft.Orleans.Runtime.Abstractions (>= 3.4.1)
- ZooKeeperNetEx (>= 3.4.12.1)
- Microsoft.Orleans.Persistence.AdoNet (3.4.1)
- Microsoft.Orleans.OrleansProviders (>= 3.4.1)
- Microsoft.Orleans.Runtime.Abstractions (>= 3.4.1)
- System.Data.Common (>= 4.3)
- Microsoft.Orleans.Reminders.AdoNet (3.4.1)
- Microsoft.Orleans.OrleansProviders (>= 3.4.1)
- Microsoft.Orleans.Runtime.Abstractions (>= 3.4.1)
- System.Data.Common (>= 4.3)
- System.Memory (>= 4.5.3)
- Microsoft.Orleans.Runtime.Abstractions (3.4.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 3.0)
- Microsoft.Extensions.Options (>= 3.0)
- Microsoft.Orleans.Core (>= 3.4.1)
- Microsoft.Orleans.Server (3.4.1)
- Microsoft.Orleans.OrleansProviders (>= 3.4.1)
- Microsoft.Orleans.OrleansRuntime (>= 3.4.1)
- NETStandard.Library (2.0.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1)
- Newtonsoft.Json (12.0.3)
- Ninject (3.3.4)
- System.Reflection.Emit.ILGeneration (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Emit.Lightweight (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Ninject.Extensions.Conventions (3.3)
- Ninject.Extensions.Factory (>= 3.3.2)
- Ninject.Extensions.Factory (3.3.3)
- Castle.Core (>= 4.2)
- Ninject (>= 3.3.3)
- Nito.AsyncEx (5.1)
- Nito.AsyncEx.Context (>= 5.1)
- Nito.AsyncEx.Coordination (>= 5.1)
- Nito.AsyncEx.Interop.WaitHandles (>= 5.1)
- Nito.AsyncEx.Oop (>= 5.1)
- Nito.AsyncEx.Tasks (>= 5.1)
- Nito.Cancellation (>= 1.1)
- Nito.AsyncEx.Context (5.1)
- Nito.AsyncEx.Tasks (>= 5.1)
- Nito.AsyncEx.Coordination (5.1)
- Nito.AsyncEx.Tasks (>= 5.1)
- Nito.Collections.Deque (>= 1.1)
- Nito.AsyncEx.Interop.WaitHandles (5.1)
- Nito.AsyncEx.Tasks (>= 5.1)
- Nito.AsyncEx.Oop (5.1)
- Nito.AsyncEx.Coordination (>= 5.1)
- Nito.AsyncEx.Tasks (5.1)
- Nito.Disposables (>= 2.2)
- Nito.Cancellation (1.1)
- Nito.Disposables (>= 2.2)
- Nito.Collections.Deque (1.1)
- Nito.Disposables (2.2)
- System.Collections.Immutable (>= 1.4)
- NLog (4.7.10)
- NSubstitute (4.2.2)
- Castle.Core (>= 4.4)
- System.Threading.Tasks.Extensions (>= 4.3)
- NuGet.CommandLine (5.9.1)
- NUnit (3.13.2)
- NETStandard.Library (>= 2.0) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- NUnit3TestAdapter (3.17)
- RichardSzalay.MockHttp (5.0)
- runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.fedora.27-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.fedora.28-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.native.System (4.3.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1.1)
- Microsoft.NETCore.Targets (>= 1.1.3)
- runtime.native.System.Net.Http (4.3.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1.1)
- Microsoft.NETCore.Targets (>= 1.1.3)
- runtime.native.System.Security.Cryptography.Apple (4.3.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (>= 4.3.1)
- runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.fedora.27-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.fedora.28-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.opensuse.42.3-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.opensuse.42.3-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (4.3.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Shouldly (3.0.2)
- Microsoft.CSharp (>= 4.3) - restriction: || (&& (== net472) (< net40)) (== netstandard2.0)
- System.Dynamic.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net40)) (== netstandard2.0)
- System.Reflection.TypeExtensions (>= 4.3) - restriction: || (&& (== net472) (< net40)) (== netstandard2.0)
- System.Buffers (4.5.1)
- System.CodeDom (5.0) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (>= netcoreapp2.0)) (== netstandard2.0)
- System.Collections (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Collections.Concurrent (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Tracing (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading.Tasks (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Collections.Immutable (5.0)
- System.Memory (>= 4.5.4)
- System.Collections.NonGeneric (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Collections.Specialized (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Collections.NonGeneric (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.ComponentModel (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.ComponentModel.Annotations (4.7)
- System.ComponentModel.Primitives (4.3) - restriction: || (&& (== net472) (< net35)) (&& (== net472) (< netstandard1.0) (>= win8)) (&& (== net472) (>= wp8)) (&& (== net472) (>= wpa81)) (== netstandard2.0)
- System.ComponentModel (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.ComponentModel.TypeConverter (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Collections.NonGeneric (>= 4.3)
- System.Collections.Specialized (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.ComponentModel (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.ComponentModel.Primitives (>= 4.3)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Linq (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.TypeExtensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Configuration.ConfigurationManager (4.7)
- System.Security.Cryptography.ProtectedData (>= 4.7) - restriction: || (&& (== net472) (< net461)) (== netstandard2.0)
- System.Security.Permissions (>= 4.7)
- System.Data.Common (4.3)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- System.Text.RegularExpressions (>= 4.3) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- System.Threading.Tasks (>= 4.3) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- System.Data.DataSetExtensions (4.5)
- System.Diagnostics.Debug (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.DiagnosticSource (5.0.1)
- System.Memory (>= 4.5.4)
- System.Runtime.CompilerServices.Unsafe (>= 5.0)
- System.Diagnostics.EventLog (5.0.1)
- System.Security.Principal.Windows (>= 5.0)
- System.Diagnostics.PerformanceCounter (4.7)
- System.Diagnostics.TraceSource (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- runtime.native.System (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Diagnostics.Tracing (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Dynamic.Runtime (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Linq (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Linq.Expressions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.ObjectModel (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Emit (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Emit.ILGeneration (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.TypeExtensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization.Calendars (4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization.Extensions (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading.Tasks (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.IO.FileSystem (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO.FileSystem.Primitives (>= 4.3)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Handles (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Threading.Tasks (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO.FileSystem.Primitives (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO.Pipelines (5.0.1)
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.4)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Linq (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Linq.Expressions (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Linq (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.ObjectModel (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Emit (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Emit.ILGeneration (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Emit.Lightweight (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.TypeExtensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Management (5.0)
- System.CodeDom (>= 5.0) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (>= netcoreapp2.0)) (== netstandard2.0)
- System.Memory (4.5.4)
- System.Buffers (>= 4.5.1)
- System.Numerics.Vectors (>= 4.4) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Numerics.Vectors (>= 4.5) - restriction: || (== net472) (&& (== netstandard2.0) (>= net461))
- System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
- System.Net.Http (4.3.4)
- Microsoft.NETCore.Platforms (>= 1.1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.native.System (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.native.System.Net.Http (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.DiagnosticSource (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Tracing (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.IO.FileSystem (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Net.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Handles (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Security.Cryptography.Algorithms (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Security.Cryptography.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Security.Cryptography.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Security.Cryptography.X509Certificates (>= 4.3)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading.Tasks (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Net.Primitives (4.3.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1.1) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (< netstandard1.1)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1.3) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (< netstandard1.1)) (== netstandard2.0)
- System.Runtime (>= 4.3.1) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (< netstandard1.1)) (== netstandard2.0)
- System.Runtime.Handles (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Numerics.Vectors (4.5)
- System.ObjectModel (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Emit (4.7)
- System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (< netstandard1.1)) (&& (== net472) (< netstandard2.0) (>= wpa81)) (&& (== net472) (>= uap10.1)) (== netstandard2.0)
- System.Reflection.Emit.ILGeneration (4.7) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (< netstandard1.1)) (&& (== net472) (< netstandard2.0) (>= wpa81)) (&& (== net472) (>= uap10.1)) (== netstandard2.0)
- System.Reflection.Emit.Lightweight (4.7)
- System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (< netstandard2.0) (>= wpa81)) (&& (== net472) (< portable-net45+wp8)) (&& (== net472) (>= uap10.1)) (== netstandard2.0)
- System.Reflection.Extensions (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.Metadata (5.0)
- System.Collections.Immutable (>= 5.0)
- System.Reflection.Primitives (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection.TypeExtensions (4.7) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Resources.ResourceManager (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Reflection (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (4.3.1)
- Microsoft.NETCore.Platforms (>= 1.1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Caching (4.7)
- System.Configuration.ConfigurationManager (>= 4.7) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.CompilerServices.Unsafe (5.0)
- System.Runtime.Extensions (4.3.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Handles (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.InteropServices (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (>= netcoreapp1.1)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (>= netcoreapp1.1)) (== netstandard2.0)
- System.Reflection (>= 4.3) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (>= netcoreapp1.1)) (== netstandard2.0)
- System.Reflection.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (>= netcoreapp1.1)) (== netstandard2.0)
- System.Runtime (>= 4.3)
- System.Runtime.Handles (>= 4.3) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (>= netcoreapp1.1)) (== netstandard2.0)
- System.Runtime.InteropServices.RuntimeInformation (4.3) - restriction: || (== net472) (&& (== netstandard2.0) (>= net451)) (&& (== netstandard2.0) (< netstandard1.6))
- System.Runtime.Numerics (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Security.AccessControl (5.0)
- System.Security.Principal.Windows (>= 5.0)
- System.Security.Cryptography.Algorithms (4.3.1)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- runtime.native.System.Security.Cryptography.Apple (>= 4.3.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO (>= 4.3)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Handles (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Numerics (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Encoding (>= 4.3)
- System.Security.Cryptography.Primitives (>= 4.3)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Cng (5.0)
- System.Security.Cryptography.Algorithms (>= 4.3.1) - restriction: || (== net472) (&& (== netstandard2.0) (>= net47)) (&& (== netstandard2.0) (< netstandard1.4)) (&& (== netstandard2.0) (< netstandard1.6))
- System.Security.Cryptography.Csp (4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Reflection (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Handles (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Algorithms (>= 4.3)
- System.Security.Cryptography.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Primitives (>= 4.3)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Encoding (4.3)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Collections.Concurrent (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Linq (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Handles (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.OpenSsl (5.0) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Security.Cryptography.Primitives (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Threading.Tasks (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.ProtectedData (5.0) - restriction: || (&& (== net472) (< net461)) (== netstandard2.0)
- System.Memory (>= 4.5.4) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.X509Certificates (4.3.2)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- runtime.native.System (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- runtime.native.System.Net.Http (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization.Calendars (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO.FileSystem (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO.FileSystem.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Handles (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Numerics (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Algorithms (>= 4.3)
- System.Security.Cryptography.Cng (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Csp (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Encoding (>= 4.3)
- System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Cryptography.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Security.Permissions (5.0)
- System.Security.AccessControl (>= 5.0)
- System.Security.Principal.Windows (5.0)
- System.ServiceProcess.ServiceController (4.7)
- System.Buffers (>= 4.5) - restriction: || (&& (== net472) (>= monoandroid)) (&& (== net472) (>= monotouch)) (&& (== net472) (< net461)) (&& (== net472) (>= xamarinios)) (&& (== net472) (>= xamarinmac)) (&& (== net472) (>= xamarintvos)) (&& (== net472) (>= xamarinwatchos)) (== netstandard2.0)
- System.Diagnostics.EventLog (>= 4.7)
- System.Memory (>= 4.5.3) - restriction: || (&& (== net472) (< net461)) (&& (== net472) (>= netcoreapp2.0)) (&& (== net472) (>= uap10.1)) (== netstandard2.0)
- System.Text.Encoding (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Text.Encoding.CodePages (5.0)
- System.Runtime.CompilerServices.Unsafe (>= 5.0)
- System.Text.Encoding.Extensions (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Text.Encodings.Web (5.0.1)
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.4)
- System.Text.Json (5.0.2) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- Microsoft.Bcl.AsyncInterfaces (>= 5.0)
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.4)
- System.Numerics.Vectors (>= 4.5)
- System.Runtime.CompilerServices.Unsafe (>= 5.0)
- System.Text.Encodings.Web (>= 5.0.1)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Text.RegularExpressions (4.3.1) - restriction: || (&& (== net472) (< net451)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3.1) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (>= netcoreapp1.1)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading.Tasks (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading.Channels (5.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.Threading.Tasks (4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading.Tasks.Dataflow (4.11.1)
- System.Threading.Tasks.Extensions (4.5.4)
- System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
- System.ValueTuple (4.5)
- System.Xml.ReaderWriter (4.3.1) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.IO.FileSystem (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.IO.FileSystem.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Text.Encoding.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Text.RegularExpressions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading.Tasks (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Threading.Tasks.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== netstandard2.0)
- System.Xml.XmlDocument (4.3) - restriction: || (&& (== net472) (< net35)) (== netstandard2.0)
- System.Collections (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Globalization (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.IO (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Runtime.Extensions (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Text.Encoding (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- System.Xml.ReaderWriter (>= 4.3) - restriction: || (&& (== net472) (< net46)) (== netstandard2.0)
- ZooKeeperNetEx (3.4.12.4)
- remote: http://nuget.gigya.net/nugetForVS/nuget
- Gigya.OrleansDashboard.NetStandard (3.0.8)
- Microsoft.AspNetCore.Hosting (>= 2.2)
- Microsoft.AspNetCore.Http (>= 2.2)
- Microsoft.AspNetCore.Server.Kestrel (>= 2.2)
- Microsoft.Orleans.Core (>= 3.2.2)
- Microsoft.Orleans.OrleansRuntime (>= 3.2.2)
- System.Collections.Immutable (>= 1.7.1)
- Gigya.ServiceContract (2.7.7)
- Newtonsoft.Json (>= 12.0)
diff --git a/test.runsettings b/test.runsettings
index 5b0f540f..e11cc6dd 100644
--- a/test.runsettings
+++ b/test.runsettings
@@ -1,7 +1,8 @@
-
-
- x64
-
+
+
+
+ x64
+
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/EquatableWeakReferenceTests.cs b/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/EquatableWeakReferenceTests.cs
index 40dfa245..8c48e06b 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/EquatableWeakReferenceTests.cs
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/EquatableWeakReferenceTests.cs
@@ -1,5 +1,4 @@
using Gigya.Microdot.ServiceProxy.Caching.RevokeNotifier;
-using NSubstitute;
using NUnit.Framework;
using System;
using System.Collections.Concurrent;
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/RevokeContextConcurrentCollectionTests.cs b/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/RevokeContextConcurrentCollectionTests.cs
index 85198161..c8879194 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/RevokeContextConcurrentCollectionTests.cs
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/RevokeContextConcurrentCollectionTests.cs
@@ -1,5 +1,4 @@
using Gigya.Microdot.ServiceProxy.Caching.RevokeNotifier;
-using NSubstitute;
using NUnit.Framework;
using System;
using System.Collections.Concurrent;
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/RevokeNotifierTests.cs b/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/RevokeNotifierTests.cs
index f4e45208..8c8c681d 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/RevokeNotifierTests.cs
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/Caching/RevokeNotifier/RevokeNotifierTests.cs
@@ -1,19 +1,15 @@
-using Gigya.Microdot.Interfaces.Logging;
-using Gigya.Microdot.ServiceProxy.Caching.RevokeNotifier;
-using Metrics;
-using NSubstitute;
-using NUnit.Framework;
-using System;
-using System.ServiceModel;
-using System.Threading;
-using System.Threading.Tasks;
-using Gigya.Microdot.Fakes;
+using Gigya.Microdot.Fakes;
+using Gigya.Microdot.Interfaces.Logging;
using Gigya.Microdot.Ninject;
using Gigya.Microdot.ServiceProxy.Caching;
+using Gigya.Microdot.ServiceProxy.Caching.RevokeNotifier;
using Gigya.Microdot.UnitTests.Caching;
using Ninject;
-using Ninject.Extensions.Factory;
using Ninject.Parameters;
+using NSubstitute;
+using NUnit.Framework;
+using System;
+using System.Threading;
namespace Gigya.Microdot.Hosting.UnitTests.Caching.RevokeNotifier
{
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/Gigya.Microdot.Hosting.UnitTests.csproj b/tests/Gigya.Microdot.Hosting.UnitTests/Gigya.Microdot.Hosting.UnitTests.csproj
index 967a3e4c..aad74bf5 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/Gigya.Microdot.Hosting.UnitTests.csproj
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/Gigya.Microdot.Hosting.UnitTests.csproj
@@ -1,34 +1,22 @@
-
- net472
- true
- true
- 1591
- Gigya.Microdot.Orleans.Hosting.FunctionalTests
- Gigya.Microdot.Orleans.Hosting.FunctionalTests
- Copyright © 2017
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
-
+
+ Gigya.Microdot.Orleans.Hosting.FunctionalTests
+ false
+ net472;net5.0;net6.0
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/CalculatorServiceHost.cs b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/CalculatorServiceHost.cs
index dec55e30..9dac64ef 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/CalculatorServiceHost.cs
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/CalculatorServiceHost.cs
@@ -1,4 +1,3 @@
-using System.Collections.Generic;
using Gigya.Microdot.Common.Tests;
using Gigya.Microdot.Hosting.Environment;
using Gigya.Microdot.Hosting.Validators;
@@ -8,12 +7,12 @@
using Gigya.Microdot.SharedLogic;
using Gigya.Microdot.SharedLogic.HttpService;
using Ninject;
+using System.Collections.Generic;
namespace Gigya.Microdot.Hosting.UnitTests.NonOrleansMicroService
{
public class CalculatorServiceHost : MicrodotServiceHost
{
- public IKernel Kernel;
private readonly HostEnvironment environment;
public override string ServiceName => "ICalculatorService";
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/ClientCallEventTests.cs b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/ClientCallEventTests.cs
index 25d0d326..4d8c1eb8 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/ClientCallEventTests.cs
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/ClientCallEventTests.cs
@@ -1,16 +1,4 @@
-using System;
-using System.Linq;
-using Gigya.Microdot.SharedLogic.Events;
-using NUnit.Framework;
-using System.Threading.Tasks;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Events;
-using Gigya.Microdot.Hosting.UnitTests.NonOrleansMicroService;
-using Gigya.Microdot.Interfaces.Events;
-using Gigya.Microdot.Testing.Shared.Service;
-using Ninject;
-
-namespace Gigya.Common.OrleansInfra.FunctionalTests.Events
+namespace Gigya.Common.OrleansInfra.FunctionalTests.Events
{/*
[TestFixture, Parallelizable(ParallelScope.Fixtures)]
public class ClientCallEventTests
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/ICalculatorService.cs b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/ICalculatorService.cs
index 0f512c87..a67f1d9a 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/ICalculatorService.cs
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/ICalculatorService.cs
@@ -20,8 +20,8 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Threading.Tasks;
using Gigya.Common.Contracts.HttpService;
+using System.Threading.Tasks;
namespace Gigya.Microdot.Hosting.UnitTests.NonOrleansMicroService
{
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/MicroServiceTests.cs b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/MicroServiceTests.cs
index 6f892753..aadabb78 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/MicroServiceTests.cs
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/MicroServiceTests.cs
@@ -1,7 +1,5 @@
-using Gigya.Microdot.Common.Tests;
using Gigya.Microdot.Hosting.Environment;
using Gigya.Microdot.Hosting.Metrics;
-using Gigya.Microdot.Ninject.Host;
using Gigya.Microdot.SharedLogic;
using NUnit.Framework;
using Shouldly;
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/Properties/AssemblyInfo.cs b/tests/Gigya.Microdot.Hosting.UnitTests/Properties/AssemblyInfo.cs
index a2e3daf0..1728db55 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/Properties/AssemblyInfo.cs
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/Properties/AssemblyInfo.cs
@@ -20,7 +20,6 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System.Reflection;
using System.Runtime.InteropServices;
// Setting ComVisible to false makes the types in this assembly not visible
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/ServerCallEventTests.cs b/tests/Gigya.Microdot.Hosting.UnitTests/ServerCallEventTests.cs
index e82f0b50..4e0bda00 100644
--- a/tests/Gigya.Microdot.Hosting.UnitTests/ServerCallEventTests.cs
+++ b/tests/Gigya.Microdot.Hosting.UnitTests/ServerCallEventTests.cs
@@ -1,20 +1,19 @@
-using System;
-using System.Linq;
-using Gigya.Microdot.SharedLogic.Events;
-using NUnit.Framework;
-using System.Threading.Tasks;
using Gigya.Microdot.Common.Tests;
using Gigya.Microdot.Hosting.Events;
using Gigya.Microdot.Hosting.UnitTests.NonOrleansMicroService;
using Gigya.Microdot.Interfaces.Events;
+using Gigya.Microdot.SharedLogic.Events;
using Gigya.Microdot.SharedLogic.HttpService;
using Gigya.Microdot.Testing.Shared.Service;
using Ninject;
-using Gigya.Microdot.Hosting.Environment;
+using NUnit.Framework;
+using System;
+using System.Linq;
+using System.Threading.Tasks;
namespace Gigya.Common.OrleansInfra.FunctionalTests.Events
{
- [TestFixture, Parallelizable(ParallelScope.Fixtures)]
+ [TestFixture, NonParallelizable]
public class ServerCallEventTests
{
private const int REPEAT = 1;
@@ -26,14 +25,6 @@ public class ServerCallEventTests
[OneTimeSetUp]
public void TestFixtureSetUp()
{
- //Environment.SetEnvironmentVariable("ZONE", "zone");
- //Environment.SetEnvironmentVariable("ENV", "env");
-
- var config = new HostEnvironment(new TestHostEnvironmentSource(
- zone: "zone",
- deploymentEnvironment: "env",
- appName: "ICalculatorService"));
-
_serviceTester = new NonOrleansServiceTester();
_serviceTester.CommunicationKernel.Rebind().To();
@@ -46,14 +37,10 @@ public void TestFixtureSetUp()
[OneTimeTearDown]
public void TestFixtureTearDown()
{
- _serviceTester?.Dispose();
-
- //Environment.SetEnvironmentVariable("ZONE", null);
- //Environment.SetEnvironmentVariable("ENV", null);
+ _serviceTester?.Dispose();
}
[Test]
- [Repeat(REPEAT)]
public async Task SingleServerCall_CallSucceeds_PublishesEvent()
{
_flumeQueue.Clear();
@@ -71,55 +58,6 @@ public async Task SingleServerCall_CallSucceeds_PublishesEvent()
Assert.AreEqual(nameof(ICalculatorService), serverReq.ServiceName);
Assert.AreEqual("Add", serverReq.ServiceMethod);
Assert.AreEqual(requestId, serverReq.RequestId);
- }
-
- /*
- [Test]
- [Repeat(REPEAT)]
- public async Task SingleServerCall_CallSucceeds_PublishesEvent_WithTags()
- {
- _flumeQueue.Clear();
-
- var requestId = nameof(SingleServerCall_CallSucceeds_PublishesEvent_WithTags) + Guid.NewGuid();
-
- TracingContext.SetRequestID(requestId);
- TracingContext.TryGetRequestID();
-
- using (var tag = TracingContext.Tags.TagUnencrypted("outsideOfScope", "IAmTag", true))
- {
-
- }
-
-
- using (var tag = TracingContext.Tags.TagUnencrypted("scopedTag", "IAmTag", true))
- {
- TracingContext.Tags.TagUnencrypted("int", 1, true);
- TracingContext.Tags.TagUnencrypted("encrypted", "IAmEncryptedTag", encryptedLog: true);
- await _serviceProxy.Add(5, 3);
- }
-
- await Task.Delay(100);
-
-
- var events = _flumeQueue.Events;
- var serverReq = (ServiceCallEvent)events.Single();
-
- Assert.Multiple(() =>
- {
- var tags = serverReq.ContextTags.ToDictionary(x => x.Key, x => x.Value);
- var encryptedTags = serverReq.ContextTagsEncrypted.ToDictionary(x => x.Key, x => x.Value);
-
- CollectionAssert.DoesNotContain(tags.Keys, "outsideOfScope");
- CollectionAssert.Contains(tags.Keys, "scopedTag");
- CollectionAssert.Contains(tags.Keys, "int");
- CollectionAssert.Contains(encryptedTags.Keys, "encrypted");
-
- Assert.AreEqual("IAmTag", tags["scopedTag"]);
- Assert.AreEqual(1, tags["int"]);
- Assert.AreEqual("IAmEncryptedTag", encryptedTags["encrypted"]);
-
- });
-
- }*/
+ }
}
}
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/app.config b/tests/Gigya.Microdot.Hosting.UnitTests/app.config
deleted file mode 100644
index e23fc2a3..00000000
--- a/tests/Gigya.Microdot.Hosting.UnitTests/app.config
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
- True
-
-
-
-
diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/paket.references b/tests/Gigya.Microdot.Hosting.UnitTests/paket.references
deleted file mode 100644
index d0466305..00000000
--- a/tests/Gigya.Microdot.Hosting.UnitTests/paket.references
+++ /dev/null
@@ -1,19 +0,0 @@
-Gigya.ServiceContract
-Microsoft.Extensions.DependencyInjection
-Microsoft.Orleans.OrleansCodeGenerator
-Microsoft.Orleans.CodeGenerator.MsBuild
-NSubstitute
-NUnit
-NUnit3TestAdapter
-Ninject
-Shouldly
-Castle.Core
-ZooKeeperNetEx
-System.Threading.Tasks.Dataflow
-Microsoft.AspNetCore.Hosting # Solve binding redirect issue, related to project vs nuget references. OrleansDashboard depends on.
-Microsoft.CSharp
-System.Net.Http
-Microsoft.NET.Test.Sdk
-
-# Remove after the transition to netcore completed
-System.ServiceProcess.ServiceController
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/CalculatorServiceTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/CalculatorServiceTests.cs
index d61cf27e..bfc467f7 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/CalculatorServiceTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/CalculatorServiceTests.cs
@@ -23,12 +23,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Net;
using System.Threading.Tasks;
using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Environment;
using Gigya.Microdot.Interfaces;
-using Gigya.Microdot.Interfaces.Configuration;
using Gigya.Microdot.Ninject;
using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice;
using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService;
@@ -40,7 +37,6 @@
using Gigya.ServiceContract.Attributes;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-using Ninject;
using NUnit.Framework;
using Shouldly;
@@ -373,13 +369,6 @@ public async Task LogGrainId()
await Service.LogGrainId();
}
- [Test,Ignore("This silo need to run on separate app domain from nunit it should set default before any Regex is called")]
- public async Task RegexTestWithTimeout()
- {
- //This silo need to run on separate app domain from nunit it should set default before any Regex is called
- await Service.RegexTestWithDefaultTimeoutDefault(10);
- }
-
#region MockData
public class Person
{
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Gigya.Microdot.Orleans.Hosting.UnitTests.csproj b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Gigya.Microdot.Orleans.Hosting.UnitTests.csproj
index 093874ac..706cb53d 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Gigya.Microdot.Orleans.Hosting.UnitTests.csproj
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Gigya.Microdot.Orleans.Hosting.UnitTests.csproj
@@ -1,36 +1,25 @@
-
- net472
- true
- true
- Gigya.Microdot.Orleans.Hosting.FunctionalTests
- Copyright © 2017
- $(SolutionDir)main.ruleset
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
-
+
+ Gigya.Microdot.Orleans.Hosting.FunctionalTests
+ false
+ net472;net5.0;net6.0
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/GrainAgeLimitServiceTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/GrainAgeLimitServiceTests.cs
deleted file mode 100644
index fa951a4b..00000000
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/GrainAgeLimitServiceTests.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-
-namespace Gigya.Microdot.Orleans.Hosting.UnitTests
-{
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
- public class GrainAgeLimitServiceTests
- {
-
- //TODO
- [Ignore("should be implement ")]
- [Test]
- public async Task WithNoneAgeLimitTest()
- {
- //should test builder to our config
- }
- [Ignore("should be implement ")]
-
- [Test]
- public async Task WithAgeLimitTest()
- {
-
- }
-
-
-
- }
-}
-
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/GrainCallEventTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/GrainCallEventTests.cs
index 1c460873..0be6cdd2 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/GrainCallEventTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/GrainCallEventTests.cs
@@ -9,11 +9,10 @@
using Gigya.Microdot.Orleans.Hosting.Events;
using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService;
using Ninject;
-using Gigya.Microdot.Hosting.Environment;
namespace Gigya.Common.OrleansInfra.FunctionalTests.Events
{
- [TestFixture, Parallelizable(ParallelScope.Fixtures)]
+ [TestFixture, NonParallelizable]
public class GrainCallEventTests
{
private const int REPEAT = 1;
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs
index f8036fd4..4a18cf02 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs
@@ -24,8 +24,6 @@
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Environment;
using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice;
using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService;
using Gigya.Microdot.SharedLogic;
@@ -36,11 +34,11 @@
namespace Gigya.Microdot.Orleans.Hosting.UnitTests
{
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
+ [TestFixture, Parallelizable(ParallelScope.Fixtures)]
public class HealthCheckTests
{
private ServiceTester _tester;
- private int BasePort => _tester.Host.Arguments.BasePortOverride.Value;
+ private int BasePort => _tester.Host.Arguments.BasePortOverride ?? 0;
[OneTimeSetUp]
public void SetUp()
@@ -51,51 +49,65 @@ public void SetUp()
[OneTimeTearDown]
public void TearDown()
{
- _tester.Dispose();
+ try
+ {
+ _tester.Dispose();
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex);
+ }
}
[Test]
- public async Task HealthCheck_ServcieDrain_StatueShouldBe521()
+ public async Task HealthCheck_ServiceDrain_StatueShouldBe521()
{
- int port = DisposablePort.GetPort().Port;
-
- //serviceDrainTimeSec:
+ int port = DisposablePort.GetPort().Port;
+
+ //serviceDrainTimeSec:
var serviceArguments = new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive,
ConsoleOutputMode.Disabled,
- SiloClusterMode.PrimaryNode, port, serviceDrainTimeSec: 1, instanceName: "test", initTimeOutSec: 10);
+ SiloClusterMode.PrimaryNode, port, serviceDrainTimeSec: 10, instanceName: "test", initTimeOutSec: 10, onStopWaitTimeSec: 30);
- var customServiceTester = new ServiceTester(
- serviceArguments: serviceArguments);
+ var customServiceTester = new ServiceTester(serviceArguments);
var dispose = Task.Run(() => customServiceTester.Dispose());
await Task.Delay(200);
var httpResponseMessage = await new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{port}/{nameof(IProgrammableHealth).Substring(1)}.status"));
httpResponseMessage.StatusCode.ShouldBe((HttpStatusCode)521);
- await dispose;
+ try
+ {
+ await dispose;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+ }
+
}
[Test]
- public void HealthCheck_NotHealthy_ShouldReturn500()
+ public async Task HealthCheck_NotHealthy_ShouldReturn500()
{
- _tester.GrainClient.GetGrain(0).SetHealth(false);
- var httpResponseMessage = new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{BasePort}/{nameof(IProgrammableHealth).Substring(1)}.status")).Result;
+ await _tester.GrainClient.GetGrain(0).SetHealth(false);
+ var httpResponseMessage = await new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{BasePort}/{nameof(IProgrammableHealth).Substring(1)}.status"));
httpResponseMessage.StatusCode.ShouldBe(HttpStatusCode.InternalServerError);
}
[Test]
- public void HealthCheck_Healthy_ShouldReturn200()
+ public async Task HealthCheck_Healthy_ShouldReturn200()
{
- _tester.GrainClient.GetGrain(0).SetHealth(true);
- var httpResponseMessage = new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{BasePort}/{nameof(IProgrammableHealth).Substring(1)}.status")).Result;
+ await _tester.GrainClient.GetGrain(0).SetHealth(true);
+ var httpResponseMessage = await new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{BasePort}/{nameof(IProgrammableHealth).Substring(1)}.status"));
httpResponseMessage.StatusCode.ShouldBe(HttpStatusCode.OK);
}
[Test]
- public void HealthCheck_NotImplemented_ShouldReturn200()
+ public async Task HealthCheck_NotImplemented_ShouldReturn200()
{
- var httpResponseMessage = new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{BasePort}/{nameof(ICalculatorService).Substring(1)}.status")).Result;
+ var httpResponseMessage = await new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{BasePort}/{nameof(ICalculatorService).Substring(1)}.status"));
httpResponseMessage.StatusCode.ShouldBe(HttpStatusCode.OK);
httpResponseMessage.Content.ShouldNotBeNull();
}
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HostTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HostTests.cs
index 4f4d7d7d..6b678136 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HostTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HostTests.cs
@@ -16,31 +16,36 @@
using Gigya.Microdot.Interfaces.SystemWrappers;
namespace Gigya.Microdot.Orleans.Hosting.UnitTests
-{
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
- internal class HostTests
- {
- private static int _counter = 0;
-
- [Test, Repeat(5)]
- public void HostShouldStartAndStopMultipleTimes()
- {
- _counter++;
- Stopwatch sw = Stopwatch.StartNew();
- Console.WriteLine($"-----------------------------Start run {_counter} time---------------");
- try
- {
- var host = new ServiceTester();
- host.GetServiceProxy();
- Console.WriteLine($"-----------------------------Silo Is running {_counter} time took, {sw.ElapsedMilliseconds}ms---------------");
- host.Dispose();
- }
- finally
- {
- Console.WriteLine(
- $"-----------------------------End run {_counter} time, took {sw.ElapsedMilliseconds}ms ---------------");
- }
- }
+{
+ [TestFixture, Parallelizable(ParallelScope.Fixtures)]
+ internal class HostTests
+ {
+ private static int _counter;
+
+ [Test, Repeat(5)]
+ public void HostShouldStartAndStopMultipleTimes()
+ {
+ _counter++;
+ Stopwatch sw = Stopwatch.StartNew();
+ Console.WriteLine($"-----------------------------Start run {_counter} time---------------");
+ try
+ {
+ var host = new ServiceTester();
+ host.GetServiceProxy();
+ Console.WriteLine(
+ $"-----------------------------Silo Is running {_counter} time took, {sw.ElapsedMilliseconds}ms---------------");
+ host.Dispose();
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex);
+ }
+ finally
+ {
+ Console.WriteLine(
+ $"-----------------------------End run {_counter} time, took {sw.ElapsedMilliseconds}ms ---------------");
+ }
+ }
}
internal class TestHost : MicrodotOrleansServiceHost
@@ -52,13 +57,13 @@ public override ILoggingModule GetLoggingModule()
return new FakesLoggersModules();
}
- protected override void PreConfigure(IKernel kernel, ServiceArguments Arguments)
+ protected override void PreConfigure(IKernel kernel, ServiceArguments arguments)
{
var env = new HostEnvironment(new TestHostEnvironmentSource());
kernel.Rebind().ToConstant(env).InSingletonScope();
kernel.Rebind().ToConstant(env.ApplicationInfo).InSingletonScope();
- base.PreConfigure(kernel, Arguments);
+ base.PreConfigure(kernel, arguments);
Console.WriteLine($"-----------------------------Silo is RebindForTests");
kernel.Rebind().To().InSingletonScope();
kernel.Rebind().To().InSingletonScope();
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/CalculatorServiceGrain.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/CalculatorServiceGrain.cs
index 0549e734..32fe7c05 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/CalculatorServiceGrain.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/CalculatorServiceGrain.cs
@@ -130,7 +130,7 @@ public Task> GetVersion(string id)
public Task LogData(string message)
{
_log.Warn(x => x(message));
- return TaskDone.Done;
+ return Task.CompletedTask;
}
public Task LogPram(string sensitive, string notSensitive, string notExists, string @default)
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/CalculatorServiceHost.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/CalculatorServiceHost.cs
index 4efa27f7..b24ca3fd 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/CalculatorServiceHost.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/CalculatorServiceHost.cs
@@ -46,9 +46,7 @@ public override ILoggingModule GetLoggingModule()
{
return new FakesLoggersModules();
}
-
- public IKernel Kernel;
-
+
protected override void PreConfigure(IKernel kernel, ServiceArguments Arguments)
{
var env = new HostEnvironment(new TestHostEnvironmentSource());
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/IGarinAgeLimitService.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/IGarinAgeLimitService.cs
index 6590f355..e6b6d3d5 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/IGarinAgeLimitService.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/CalculatorService/IGarinAgeLimitService.cs
@@ -21,11 +21,8 @@
#endregion
-using System;
-using System.Diagnostics;
using System.Threading.Tasks;
using Gigya.Common.Contracts.HttpService;
-using Gigya.Microdot.Fakes;
using Gigya.Microdot.Interfaces.Logging;
using Orleans;
using Orleans.Concurrency;
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/GCEndpointTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/GCEndpointTests.cs
new file mode 100644
index 00000000..246ea4ca
--- /dev/null
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/GCEndpointTests.cs
@@ -0,0 +1,649 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Net;
+using System.Threading.Tasks;
+using Gigya.Microdot.Fakes;
+using Gigya.Microdot.Hosting.HttpService.Endpoints.GCEndpoint;
+using Gigya.Microdot.Hosting.Service;
+using Gigya.Microdot.Interfaces.Logging;
+using Gigya.Microdot.Interfaces.SystemWrappers;
+using Newtonsoft.Json;
+using NSubstitute;
+using NSubstitute.ClearExtensions;
+using NUnit.Framework;
+
+namespace Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice
+{
+ [TestFixture]
+ [NonParallelizable]
+ public class GCEndpointTests
+ {
+ private IGCEndpointHandler _gcEndpointHandler;
+ private ILog _logger;
+ private IDateTime _dateTime;
+ private IGCEndpointHandlerUtils _gcEndpointHandlerUtils;
+ private IGCTokenContainer _gcTokenContainer;
+
+ [OneTimeSetUp]
+ public void OneTimeSetup()
+ {
+ _gcEndpointHandler = Substitute.For();
+ _logger = Substitute.For();
+ _dateTime = Substitute.For();
+ _gcEndpointHandlerUtils = Substitute.For();
+ _gcTokenContainer = Substitute.For();
+ }
+
+ [SetUp]
+ public void Setup()
+ {
+ _gcEndpointHandler.ClearSubstitute();
+ _logger.ClearSubstitute();
+ _dateTime.ClearSubstitute();
+ _gcEndpointHandlerUtils.ClearSubstitute();
+ _gcEndpointHandlerUtils.ClearSubstitute();
+ }
+
+ [Test]
+ public async Task HandledGcEndpointTest()
+ {
+ var gcCollectionResult = new GCCollectionResult(100, 10, 55);
+ var gcHandlingResult =
+ new GCHandlingResult(true, "foo bar", gcCollectionResult);
+
+ _gcEndpointHandler
+ .Handle(Arg.Any(), Arg.Any(), Arg.Any())
+ .Returns(Task.FromResult(gcHandlingResult));
+
+ var responses = new List<(string, HttpStatusCode, string)>();
+
+ var gcEndpoint = new GCCustomEndpoint(_gcEndpointHandler);
+ var tryHandleResult = await gcEndpoint.TryHandle(null, async (data, status, type) => responses.Add((data, status, type)));
+
+ var receivedCalls = _gcEndpointHandler
+ .Received(1)
+ .Handle(Arg.Any(), Arg.Any(), Arg.Any());
+
+ Assert.AreEqual(true, tryHandleResult);
+ Assert.AreEqual(1, responses.Count());
+
+ var deserializedResult = JsonConvert.DeserializeObject(responses.First().Item1);
+ Assert.AreEqual(gcHandlingResult.Message, deserializedResult.Message);
+ Assert.AreEqual(gcHandlingResult.GcCollectionResult.TotalMemoryAfterGC, deserializedResult.GcCollectionResult.TotalMemoryAfterGC);
+ Assert.AreEqual(gcHandlingResult.GcCollectionResult.TotalMemoryBeforeGC, deserializedResult.GcCollectionResult.TotalMemoryBeforeGC);
+ }
+
+ [Test]
+ public async Task NotHandledGcEndpointTest()
+ {
+ _gcEndpointHandler
+ .Handle(Arg.Any(), Arg.Any(), Arg.Any())
+ .Returns(Task.FromResult(new GCHandlingResult(false)));
+
+ var responses = new List<(string, HttpStatusCode, string)>();
+
+ var gcEndpoint = new GCCustomEndpoint(_gcEndpointHandler);
+ var tryHandleResult = await gcEndpoint.TryHandle(null, async (data, status, type) => responses.Add((data, status, type)));
+
+ var receivedCalls = _gcEndpointHandler
+ .Received(1)
+ .Handle(Arg.Any(), Arg.Any(), Arg.Any());
+
+ Assert.AreEqual(false, tryHandleResult);
+ Assert.AreEqual(0, responses.Count());
+ }
+
+ [Test]
+ public async Task GCEndpointHandlerTest_Config_Off_Matching_Path()
+ {
+ var gcEndpointHandler = new GCEndpointHandler(() => new MicrodotHostingConfig()
+ {
+ GCEndpointEnabled = false
+ }, _logger, _gcEndpointHandlerUtils);
+
+ var gcHandlingResult = await gcEndpointHandler
+ .Handle(new Uri("http://my-host-name/force-traffic-affecting-gc"), new NameValueCollection()
+ {
+ { "gcType", "gen0" }
+ },IPAddress.Parse("20.30.40.50"));
+
+ Assert.IsFalse(gcHandlingResult.Successful);
+ Assert.IsNull(gcHandlingResult.Message);
+ Assert.IsNull(gcHandlingResult.GcCollectionResult);
+ }
+
+ [Test]
+ public async Task GCEndpointHandlerTest_Config_On_Not_Matching_Path()
+ {
+ var gcEndpointHandler = new GCEndpointHandler(() => new MicrodotHostingConfig()
+ {
+ GCEndpointEnabled = true
+ },
+ _logger, _gcEndpointHandlerUtils);
+
+ var gcHandlingResult = await gcEndpointHandler
+ .Handle(new Uri("http://my-host-name/not-matching-path"), new NameValueCollection()
+ {
+ { "gcType", "someGcType" }
+ },IPAddress.Parse("20.30.40.50"));
+
+ Assert.IsFalse(gcHandlingResult.Successful);
+ Assert.IsNull(gcHandlingResult.Message);
+ Assert.IsNull(gcHandlingResult.GcCollectionResult);
+ }
+
+ [Test]
+ public async Task GCEndpointHandlerTest_Config_On_Token_Generation_Failed()
+ {
+ var expectedMessage = "Some Token Generation Failed Message";
+ _gcEndpointHandlerUtils.TryProcessAsTokenGenerationRequest(
+ Arg.Any(),
+ Arg.Any(),
+ out Arg.Any())
+ .Returns(x =>
+ {
+ x[2] = expectedMessage;
+ return false;
+ });
+
+ var gcEndpointHandler = new GCEndpointHandler(() => new MicrodotHostingConfig()
+ {
+ GCEndpointEnabled = true
+ }, _logger, _gcEndpointHandlerUtils);
+
+ var gcHandlingResult = await gcEndpointHandler
+ .Handle(
+ new Uri("http://my-host-name/force-traffic-affecting-gc"),
+ new NameValueCollection(),
+ IPAddress.Parse("20.30.40.50"));
+
+ Assert.IsTrue(gcHandlingResult.Successful);
+ Assert.AreEqual(expectedMessage,gcHandlingResult.Message);
+ Assert.IsNull(gcHandlingResult.GcCollectionResult);
+ }
+
+ [Test]
+ public async Task GCEndpointHandlerTest_Config_On_Token_Validation_Failed()
+ {
+ var expectedMessage = "Some Token Validation Failed Message";
+ _gcEndpointHandlerUtils.TryProcessAsTokenGenerationRequest(
+ Arg.Any(),
+ Arg.Any(),
+ out Arg.Any())
+ .Returns(false);
+
+ _gcEndpointHandlerUtils.ValidateToken(Arg.Any(),
+ out Arg.Any()).Returns(x =>
+ {
+ x[1] = expectedMessage;
+ return false;
+ });
+
+ var gcEndpointHandler = new GCEndpointHandler(() => new MicrodotHostingConfig()
+ {
+ GCEndpointEnabled = true
+ }, _logger, _gcEndpointHandlerUtils);
+
+ var gcHandlingResult = await gcEndpointHandler
+ .Handle(new Uri("http://my-host-name/force-traffic-affecting-gc"),
+ new NameValueCollection(),
+ IPAddress.Parse("20.30.40.50"));
+
+ Assert.IsTrue(gcHandlingResult.Successful);
+ Assert.AreEqual(expectedMessage,gcHandlingResult.Message);
+ Assert.IsNull(gcHandlingResult.GcCollectionResult);
+ }
+
+ [Test]
+ public async Task GCEndpointHandlerTest_Config_On_GcType_Validation_Failed()
+ {
+ var expectedMessage = "Some GcType Validation Failed Message";
+
+ _gcEndpointHandlerUtils.TryProcessAsTokenGenerationRequest(Arg.Any(),
+ Arg.Any(),
+ out Arg.Any()).Returns(false);
+
+ _gcEndpointHandlerUtils.ValidateGcType(
+ Arg.Any(),
+ out Arg.Any(),
+ out Arg.Any())
+ .Returns(x =>
+ {
+ x[1] = expectedMessage;
+ return false;
+ });
+
+ _gcEndpointHandlerUtils.ValidateToken(Arg.Any(),
+ out Arg.Any()).Returns(true);
+
+ var gcEndpointHandler = new GCEndpointHandler(() => new MicrodotHostingConfig()
+ {
+ GCEndpointEnabled = true
+ }, _logger, _gcEndpointHandlerUtils);
+
+ var gcHandlingResult = await gcEndpointHandler
+ .Handle(
+ new Uri("http://my-host-name/force-traffic-affecting-gc"),
+ new NameValueCollection(),
+ IPAddress.Parse("20.30.40.50"));
+
+ Assert.IsTrue(gcHandlingResult.Successful);
+ Assert.AreEqual(expectedMessage,gcHandlingResult.Message);
+ Assert.IsNull(gcHandlingResult.GcCollectionResult);
+ }
+
+ [Test]
+ public async Task GCTokenHandlerTest_No_GcType()
+ {
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig(),
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var validationResult =
+ gcTokenHandler.ValidateGcType(
+ new NameValueCollection(),
+ out var additionalInfo,
+ out var gcType);
+
+ Assert.IsFalse(validationResult);
+ Assert.AreEqual("GCEndpoint called with unsupported GCType", additionalInfo);
+ }
+
+ [Test]
+ public async Task GCTokenHandlerTest_Wrong_GcType()
+ {
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig(),
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var nameValueCollection = new NameValueCollection();
+ nameValueCollection.Add("gcType", "fooBar");
+
+ var validationResult =
+ gcTokenHandler.ValidateGcType(
+ nameValueCollection,
+ out var additionalInfo,
+ out var gcType);
+
+ Assert.IsFalse(validationResult);
+ Assert.AreEqual("GCEndpoint called with unsupported GCType", additionalInfo);
+ }
+
+ [Test]
+ [TestCase("Gen0")]
+ [TestCase("Gen1")]
+ [TestCase("Gen2")]
+ [TestCase("LOHCompaction")]
+ [TestCase("BlockingLohCompaction")]
+ public async Task GCTokenHandlerTest_Valid_GcType(string gcTypeString)
+ {
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig(),
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var nameValueCollection = new NameValueCollection();
+ nameValueCollection.Add("gcType", gcTypeString);
+
+ var validationResult =
+ gcTokenHandler.ValidateGcType(
+ nameValueCollection,
+ out var additionalInfo,
+ out var gcType);
+
+ Assert.IsTrue(validationResult);
+ Assert.AreEqual(gcType, Enum.Parse(typeof(GCType),gcTypeString));
+ }
+
+ [Test]
+ public async Task GCTokenHandlerTest_ValidateToken_No_Param()
+ {
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig(),
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var nameValueCollection = new NameValueCollection();
+
+
+ var validateTokenResult =
+ gcTokenHandler.ValidateToken(
+ nameValueCollection,
+ out var additionalInfo);
+
+ Assert.IsFalse(validateTokenResult);
+ Assert.AreEqual("Illegal request", additionalInfo);
+ }
+
+ [Test]
+ public async Task GCTokenHandlerTest_ValidateToken_UnrecognizedToken()
+ {
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig(),
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var nameValueCollection = new NameValueCollection();
+ nameValueCollection.Add("token", Guid.NewGuid().ToString());
+
+ var validateTokenResult =
+ gcTokenHandler.ValidateToken(
+ nameValueCollection,
+ out var additionalInfo);
+
+ Assert.IsFalse(validateTokenResult);
+ Assert.AreEqual("Illegal request", additionalInfo);
+ }
+
+ [Test]
+ public async Task GCTokenHandlerTest_ValidateToken_Illegal_Token()
+ {
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig(),
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var nameValueCollection = new NameValueCollection();
+ nameValueCollection.Add("token", "foo_bar_buzz");
+
+ var validateTokenResult =
+ gcTokenHandler.ValidateToken(
+ nameValueCollection,
+ out var additionalInfo);
+
+ Assert.IsFalse(validateTokenResult);
+ Assert.AreEqual("Illegal request", additionalInfo);
+ }
+
+ [Test]
+ public async Task GCTokenHandlerTest_ValidateToken_RecognizedToken()
+ {
+ var expectedToken = Guid.NewGuid();
+ _gcTokenContainer.ValidateToken(Arg.Is(expectedToken)).Returns(true);
+
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig(),
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var nameValueCollection = new NameValueCollection();
+ nameValueCollection.Add("token", expectedToken.ToString());
+
+ var validateTokenResult =
+ gcTokenHandler.ValidateToken(
+ nameValueCollection,
+ out var additionalInfo);
+
+ Assert.IsTrue(validateTokenResult);
+ }
+
+ [Test]
+ public async Task GCTokenHandlerTest_Generate_Token()
+ {
+ var now = DateTime.UtcNow;
+ var generatedToken = Guid.NewGuid();
+ _dateTime.UtcNow.Returns(now);
+ var ipAddress = IPAddress.Parse("40.30.40.80");
+
+ _gcTokenContainer.GenerateToken().Returns(generatedToken);
+ _gcTokenContainer.ValidateToken(Arg.Is(x => x == generatedToken)).Returns(true);
+
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig()
+ {
+ GCGetTokenCooldown = null
+ },
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var nameValueCollection = new NameValueCollection();
+ nameValueCollection.Add("getToken", null);
+
+ var generateTokenResult =
+ gcTokenHandler.TryProcessAsTokenGenerationRequest(
+ nameValueCollection,
+ ipAddress,
+ out var additionalInfo);
+
+ Assert.IsTrue(generateTokenResult);
+
+ var logCalls = _logger.ReceivedCalls().Select(callback =>
+ {
+ var logOperation = callback.GetArguments()[0] as Action;
+
+ (string message, object encryptedTags, object unencryptedTags, Exception exception, bool
+ includeStack) callDetails = (null, null, null, null, false);
+ logOperation.Invoke((string message, object encryptedTags , object unencryptedTags , Exception exception , bool includeStack )=>
+ {
+ callDetails = (message, encryptedTags, unencryptedTags, exception, includeStack);
+ });
+
+ return callDetails;
+
+ }).ToList();
+
+ Assert.IsTrue(logCalls.Count == 1);
+
+ var tags = logCalls.First().unencryptedTags;
+ var loggedToken = tags.GetType().GetProperty("Token").GetValue(tags);
+ Assert.AreEqual(generatedToken, loggedToken);
+ var loggedIP = tags.GetType().GetProperty("IPAddress").GetValue(tags);
+ Assert.AreEqual(ipAddress.ToString(), loggedIP);
+
+ }
+
+ [Test]
+ public async Task GCTokenHandlerTest_Empty_No_GetToken()
+ {
+ var now = DateTime.UtcNow;
+ var generatedToken = Guid.NewGuid();
+ _dateTime.UtcNow.Returns(now);
+
+ _gcTokenContainer.GenerateToken().Returns(generatedToken);
+ _gcTokenContainer.ValidateToken(Arg.Is(x => x == generatedToken)).Returns(true);
+
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig()
+ {
+ GCGetTokenCooldown = null
+ },
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var nameValueCollection = new NameValueCollection();
+
+ var generateTokenResult =
+ gcTokenHandler.TryProcessAsTokenGenerationRequest(
+ nameValueCollection,
+ IPAddress.Parse("40.33.78.111"),
+ out var additionalInfo);
+
+ Assert.IsFalse(generateTokenResult);
+ _logger.Received(0).Info(Arg.Any>());
+ }
+
+ [Test]
+ public async Task GCTokenHandlerTest_CoolDown_Test()
+ {
+ var now = DateTime.UtcNow;
+ var generatedToken = Guid.NewGuid();
+ _dateTime.UtcNow.Returns(now);
+
+ _gcTokenContainer.GenerateToken().Returns(generatedToken);
+ _gcTokenContainer.ValidateToken(Arg.Is(x => x == generatedToken)).Returns(true);
+
+ var gcTokenHandler =
+ new GCEndpointHandlerUtils(
+ () => new MicrodotHostingConfig()
+ {
+ GCGetTokenCooldown = TimeSpan.FromMinutes(10)
+ },
+ _logger,
+ _dateTime,
+ _gcTokenContainer);
+
+ var nameValueCollection = new NameValueCollection();
+ nameValueCollection.Add("getToken", null);
+
+ var generateTokenResult =
+ gcTokenHandler.TryProcessAsTokenGenerationRequest(
+ nameValueCollection,
+ IPAddress.Parse("40.33.78.111"),
+ out var additionalInfo);
+
+ Assert.IsTrue(generateTokenResult);
+ Assert.AreEqual("GC token generated", additionalInfo);
+
+ _dateTime.UtcNow.Returns(now.AddMinutes(1));
+
+ generateTokenResult =
+ gcTokenHandler.TryProcessAsTokenGenerationRequest(
+ nameValueCollection,
+ IPAddress.Parse("40.33.78.111"),
+ out additionalInfo);
+
+ Assert.IsTrue(generateTokenResult);
+ Assert.AreEqual($"GC getToken cooldown in effect, will be ready in {TimeSpan.FromMinutes(9)}",
+ additionalInfo);
+
+ _dateTime.UtcNow.Returns(now.AddMinutes(11));
+ generateTokenResult =
+ gcTokenHandler.TryProcessAsTokenGenerationRequest(
+ nameValueCollection,
+ IPAddress.Parse("40.33.78.111"),
+ out additionalInfo);
+
+ Assert.IsTrue(generateTokenResult);
+ Assert.AreEqual("GC token generated", additionalInfo);
+ Assert.AreEqual(2,_logger.ReceivedCalls().Count());
+ }
+
+ [Test]
+ public async Task GCTokenContainer_Generate_And_Validate_Test()
+ {
+ var now = DateTime.Now;
+ _dateTime.UtcNow.Returns(now);
+ var gcTokenContainer = new GCTokenContainer(_dateTime);
+ var generatedToken = gcTokenContainer.GenerateToken();
+ Assert.AreNotEqual(generatedToken, Guid.Empty);
+ Assert.IsTrue(gcTokenContainer.ValidateToken(generatedToken));
+ }
+
+ [Test]
+ public async Task GCTokenContainer_Generate_And_Validate_Test_Test_Cleanup()
+ {
+ var now = DateTime.Now;
+ _dateTime.UtcNow.Returns(now);
+ var gcTokenContainer = new GCTokenContainer(_dateTime);
+ var generatedToken = gcTokenContainer.GenerateToken();
+ Assert.AreNotEqual(generatedToken, Guid.Empty);
+ Assert.IsTrue(gcTokenContainer.ValidateToken(generatedToken));
+ _dateTime.UtcNow.Returns(now.AddMinutes(1));
+ Assert.IsTrue(gcTokenContainer.ValidateToken(generatedToken));
+ _dateTime.UtcNow.Returns(now.AddMinutes(31));
+ Assert.IsFalse(gcTokenContainer.ValidateToken(generatedToken));
+ }
+
+ [Test]
+ [TestCase(GCType.Gen0)]
+ [TestCase(GCType.Gen1)]
+ [TestCase(GCType.Gen2)]
+ [TestCase(GCType.LOHCompaction)]
+ [TestCase(GCType.BlockingLohCompaction)]
+ public async Task GCEndpointHandlerTest_On_Matching_Path_Right_GcType(GCType gcType)
+ {
+ var totalMemoryBeforeGc = 500;
+ var totalMemoryAfterGc = 70;
+ var elapsedMilliseconds = 33;
+ var ipAddress = IPAddress.Parse("40.33.78.111");
+ var logSpy = new LogSpy();
+
+
+ _gcEndpointHandlerUtils.ValidateToken(Arg.Any(), out Arg.Any())
+ .Returns(true);
+ _gcEndpointHandlerUtils.TryProcessAsTokenGenerationRequest(
+ Arg.Any(),
+ Arg.Any(),
+ out Arg.Any())
+ .Returns(false);
+ _gcEndpointHandlerUtils.ValidateGcType(
+ Arg.Any(),
+ out Arg.Any(),
+ out Arg.Any())
+ .Returns(x=>
+ {
+ x[2] = gcType;
+ return true;
+ });
+
+ _gcEndpointHandlerUtils.Collect(Arg.Any()).Returns(
+ new GCCollectionResult(
+ totalMemoryBeforeGc,
+ totalMemoryAfterGc,
+ elapsedMilliseconds)
+ );
+
+ var gcEndpointHandler = new GCEndpointHandler(() => new MicrodotHostingConfig()
+ {
+ GCEndpointEnabled = true,
+ }, logSpy, _gcEndpointHandlerUtils);
+
+ var gcHandlingResult = await gcEndpointHandler
+ .Handle(new Uri("http://my-host-name/force-traffic-affecting-gc"), new NameValueCollection()
+ {
+ { "gcType", gcType.ToString() }
+ },
+ ipAddress
+ );
+
+ Assert.IsTrue(gcHandlingResult.Successful);
+ Assert.AreEqual("GC ran successfully",gcHandlingResult.Message);
+ Assert.NotNull(gcHandlingResult.GcCollectionResult);
+ Assert.AreEqual(totalMemoryBeforeGc, gcHandlingResult.GcCollectionResult.TotalMemoryBeforeGC);
+ Assert.AreEqual(totalMemoryAfterGc, gcHandlingResult.GcCollectionResult.TotalMemoryAfterGC);
+ Assert.AreEqual(elapsedMilliseconds, gcHandlingResult.GcCollectionResult.ElapsedMilliseconds);
+ Assert.AreEqual(1, logSpy.LogEntries.Count());
+ var logEntry = logSpy.LogEntries.Single();
+ Assert.AreEqual(gcType.ToString(), logEntry.UnencryptedTags["tags.GcType"]);
+ Assert.AreEqual(ipAddress.ToString(), logEntry.UnencryptedTags["tags.IPAddress"]);
+ Assert.AreEqual(totalMemoryAfterGc.ToString(), logEntry.UnencryptedTags["tags.TotalMemoryAfterGC_i"]);
+ Assert.AreEqual(totalMemoryBeforeGc.ToString(), logEntry.UnencryptedTags["tags.TotalMemoryBeforeGC_i"]);
+ Assert.NotNull(logEntry.UnencryptedTags["tags.GCDuration_i"]);
+ }
+
+ [Test]
+ [TestCase(GCType.Gen0)]
+ [TestCase(GCType.Gen1)]
+ [TestCase(GCType.Gen2)]
+ [TestCase(GCType.LOHCompaction)]
+ [TestCase(GCType.BlockingLohCompaction)]
+ public async Task GCCollectionRunner_Sanity(GCType genType)
+ {
+ var gcCollectionRunner = new GCEndpointHandlerUtils(() => new MicrodotHostingConfig(),
+ _logger, _dateTime, _gcTokenContainer);
+ Assert.DoesNotThrow(()=>gcCollectionRunner.Collect(genType));
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/GrainAgeLimitTestService/GrainAgeLimitTestServiceHost.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/GrainAgeLimitTestService/GrainAgeLimitTestServiceHost.cs
deleted file mode 100644
index a2fc78ba..00000000
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/GrainAgeLimitTestService/GrainAgeLimitTestServiceHost.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Fakes.KernelUtils;
-using Gigya.Microdot.Hosting.Validators;
-using Gigya.Microdot.Ninject;
-using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.WarmupTestService;
-using Gigya.Microdot.Orleans.Ninject.Host;
-using Ninject;
-using Orleans;
-
-namespace Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService
-{
- public class GrainAgeLimitTestServiceHost : MicrodotOrleansServiceHost
- {
- public GrainAgeLimitTestServiceHost()
- { }
-
- public override string ServiceName => "TestService";
-
- public override ILoggingModule GetLoggingModule()
- {
- return new FakesLoggersModules();
- }
-
- public IKernel Kernel;
- protected override void PreConfigure(IKernel kernel)
- {
- base.PreConfigure(kernel);
- kernel.Rebind().To().InSingletonScope();
- kernel.Rebind().To().InSingletonScope();
- Func writeGrainLog = () => new GrainLoggingConfig{LogMicrodotGrains = true, LogRatio = 1, LogServiceGrains = true, LogOrleansGrains = true};
- kernel.Rebind>().ToConstant(writeGrainLog);
- kernel.RebindForTests();
- Kernel = kernel;
-
- }
-
- protected override Task AfterOrleansStartup(IGrainFactory grainFactory)
- {
- if (grainFactory == null) throw new NullReferenceException("AfterOrleansStartup no grainFactory");
- return base.AfterOrleansStartup(grainFactory);
- }
-
- public class MockServiceValidator : ServiceValidator
- {
-
- public MockServiceValidator()
- : base(new List().ToArray())
- {
-
- }
- }
- }
-}
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/Account.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/Account.cs
index cb06ae16..577d1ad2 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/Account.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/Account.cs
@@ -1,16 +1,4 @@
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Fakes.KernelUtils;
-using Gigya.Microdot.Ninject;
-using Gigya.Microdot.Orleans.Hosting;
-using Gigya.Microdot.Orleans.Ninject.Host;
-using Ninject;
-using Ninject.Syntax;
-using Orleans;
-using Orleans.Hosting;
-using Orleans.Providers;
-using System.Threading.Tasks;
-
-namespace Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.StorageProviderTest
+namespace Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.StorageProviderTest
{
public class Account
{
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/AccountGrain.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/AccountGrain.cs
index b647cad3..9b2d0453 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/AccountGrain.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/AccountGrain.cs
@@ -1,12 +1,4 @@
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Fakes.KernelUtils;
-using Gigya.Microdot.Ninject;
-using Gigya.Microdot.Orleans.Hosting;
-using Gigya.Microdot.Orleans.Ninject.Host;
-using Ninject;
-using Ninject.Syntax;
-using Orleans;
-using Orleans.Hosting;
+using Orleans;
using Orleans.Providers;
using System.Threading.Tasks;
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/BindStorageTest.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/BindStorageTest.cs
index b1dd6024..abca111d 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/BindStorageTest.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/BindStorageTest.cs
@@ -1,9 +1,4 @@
-using Gigya;
-using Gigya.Common;
-using Gigya.Common.OrleansInfra;
-using Gigya.Common.OrleansInfra.FunctionalTests;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Environment;
+using System;
using Gigya.Microdot.Testing.Service;
using NUnit.Framework;
using System.Threading.Tasks;
@@ -21,8 +16,16 @@ public async Task CanBindStorage()
var accountGrain = selfHostService.GrainClient.GetGrain(0);
await accountGrain.Save(new Account() { Name = "test" });
- var accunt = await accountGrain.Get();
- Assert.AreEqual("test", accunt.Name);
+ var account = await accountGrain.Get();
+ Assert.AreEqual("test", account.Name);
+ try
+ {
+ selfHostService.Dispose();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+ }
}
}
}
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/IAccountGrain.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/IAccountGrain.cs
index 83889caa..59ed378a 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/IAccountGrain.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/IAccountGrain.cs
@@ -1,13 +1,4 @@
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Fakes.KernelUtils;
-using Gigya.Microdot.Ninject;
-using Gigya.Microdot.Orleans.Hosting;
-using Gigya.Microdot.Orleans.Ninject.Host;
-using Ninject;
-using Ninject.Syntax;
-using Orleans;
-using Orleans.Hosting;
-using Orleans.Providers;
+using Orleans;
using System.Threading.Tasks;
namespace Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.StorageProviderTest
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/MemoryServiceHost.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/MemoryServiceHost.cs
index 92707211..2dfbb800 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/MemoryServiceHost.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/StorageProviderTest/MemoryServiceHost.cs
@@ -4,15 +4,10 @@
using Gigya.Microdot.Hosting.Validators;
using Gigya.Microdot.Interfaces.SystemWrappers;
using Gigya.Microdot.Ninject;
-using Gigya.Microdot.Orleans.Hosting;
using Gigya.Microdot.Orleans.Ninject.Host;
using Gigya.Microdot.SharedLogic;
using Ninject;
-using Ninject.Syntax;
-using Orleans;
using Orleans.Hosting;
-using Orleans.Providers;
-using System.Threading.Tasks;
using static Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService.CalculatorServiceHost;
namespace Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.StorageProviderTest
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/WarmupTestService/WarmupTestServiceHostWithSiloHostFake.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/WarmupTestService/WarmupTestServiceHostWithSiloHostFake.cs
index ae7c5a9d..0bbf2f82 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/WarmupTestService/WarmupTestServiceHostWithSiloHostFake.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Microservice/WarmupTestService/WarmupTestServiceHostWithSiloHostFake.cs
@@ -1,6 +1,4 @@
-using Gigya.Microdot.Fakes;
-using Gigya.Microdot.Interfaces;
-using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService;
+using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService;
using Gigya.Microdot.SharedLogic;
using Ninject;
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/OrleansHostHooksTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/OrleansHostHooksTests.cs
index 9a73d369..88989672 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/OrleansHostHooksTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/OrleansHostHooksTests.cs
@@ -12,11 +12,7 @@
using NUnit.Framework;
using Orleans;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
-using Gigya.Microdot.SharedLogic.Security;
namespace Gigya.Microdot.Orleans.Hosting.UnitTests
{
@@ -58,6 +54,8 @@ public void AfterOrleansStartup_ShouldBeCalled()
var tester = new ServiceTester();
Assert.IsTrue(tester.Host.AfterOrleansCalled, "AfterOrleansStartup hasn't been called.");
+
+ //tester.Dispose();
}
}
}
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/OrleansToNinjectBinding/OrleansToNinjectBindingTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/OrleansToNinjectBinding/OrleansToNinjectBindingTests.cs
index 81716521..476e5062 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/OrleansToNinjectBinding/OrleansToNinjectBindingTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/OrleansToNinjectBinding/OrleansToNinjectBindingTests.cs
@@ -1,21 +1,19 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
-using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Gigya.Microdot.Orleans.Ninject.Host.NinjectOrleansBinding;
using Microsoft.Extensions.DependencyInjection;
using Ninject;
-using Ninject.Extensions.Factory;
using Ninject.Syntax;
using NUnit.Framework;
using Orleans.Runtime;
namespace Gigya.Microdot.Orleans.Hosting.UnitTests.OrleansToNinjectBinding
{
- [TestFixture, Parallelizable(ParallelScope.All)]
+ [TestFixture, Parallelizable(ParallelScope.None)]
public class OrleansToNinjectBindingTests
{
public enum ServiceProviderType
@@ -108,34 +106,6 @@ public void When_request_same_scopeDepency_on_scope_run_parallel_Should_create_o
Assert.AreEqual(1, groups.Count());
}
-
- [Ignore("manual")]
- //Convert to benchmark dot nets
- [TestCase(ServiceProviderType.microdot)]
- [TestCase(ServiceProviderType.microsoft)]
- public void SimpleSantyForPreforamce(ServiceProviderType serviceProviderType)
- {
- var binding = new ServiceCollection().AddScoped();
-
- var serviceProvider = CreateServiceProvider(binding, serviceProviderType);
- var sw = Stopwatch.StartNew();
- Parallel.For(0, 10000, (i) =>
- {
- var serviceScopeFactory = (IServiceScopeFactory)serviceProvider.GetService(typeof(IServiceScopeFactory));
- var serviceScope = serviceScopeFactory.CreateScope();
- ConcurrentBag dependencies = new ConcurrentBag();
-
- Parallel.For(0, 5, (j) =>
- {
- var object1 = (Dependency)serviceScope.ServiceProvider.GetService(typeof(Dependency));
- dependencies.Add(object1);
- });
-
- var groups = dependencies.ToArray().GroupBy(x => x);
- Assert.AreEqual(1, groups.Count());
- });
- Assert.Greater(1000, sw.ElapsedMilliseconds);
- }
[TestCase(ServiceProviderType.microsoft)]
[TestCase(ServiceProviderType.microdot)]
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Properties/AssemblyInfo.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Properties/AssemblyInfo.cs
index 5663dbbe..e8479793 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Properties/AssemblyInfo.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Properties/AssemblyInfo.cs
@@ -21,7 +21,6 @@
#endregion
using Gigya.Microdot.Orleans.Hosting.UnitTests;
-using System.Reflection;
using System.Runtime.InteropServices;
// Setting ComVisible to false makes the types in this assembly not visible
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/SchemaEndpointTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/SchemaEndpointTests.cs
index b6a3e1ff..f9c6affa 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/SchemaEndpointTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/SchemaEndpointTests.cs
@@ -1,93 +1,109 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Gigya.Common.Contracts.HttpService;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Environment;
-using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService;
-using Gigya.Microdot.ServiceProxy;
-using Gigya.Microdot.Testing.Service;
-using NUnit.Framework;
-
-namespace Gigya.Microdot.Orleans.Hosting.UnitTests
-{
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
- public class SchemaEndpointTests
- {
- private IServiceProxyProvider _serviceProxyProvider;
- private ServiceTester _tester;
-
-
- [OneTimeSetUp]
- public void SetUp()
- {
- try
- {
- _tester = new ServiceTester();
- _serviceProxyProvider = _tester.GetServiceProxyProvider("CalculatorService");
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- throw;
- }
- }
-
- [OneTimeTearDown]
- public void TearDown()
- {
- _tester.Dispose();
- }
-
-
- [Test]
- public async Task MethodTypeName()
- {
- var schema = await _serviceProxyProvider.GetSchema();
- var iface = schema.Interfaces.First(_ => _.Name == typeof(ICalculatorService).FullName);
- var schemaTestMethod = iface.Methods.FirstOrDefault(_ => _.Name == nameof(ICalculatorService.Add));
- Assert.IsNotNull(schemaTestMethod, "Service schema did not return the method Add");
- Assert.AreEqual(typeof(ICalculatorService).FullName, iface.Name);
- }
-
-
- [Test]
- public async Task ReturnPublicEndpointAttribute()
- {
- var schema = await _serviceProxyProvider.GetSchema();
- var iface = schema.Interfaces.First(_ => _.Name == typeof(ICalculatorService).FullName);
- var schemaTestMethod = iface.Methods.FirstOrDefault(_ => _.Name == nameof(ICalculatorService.GetAppDomainChain));
- Assert.IsNotNull(schemaTestMethod, "Service schema did not return the method GetAppDomainChain");
- var attribute = schemaTestMethod.Attributes.Select(x => x.Attribute).OfType().Single();
- Assert.IsNotNull(attribute, "method GetAppDomainChain should include attribute of type PublicEndpoint");
- Assert.IsTrue(attribute.EndpointName != null, $"PublicEndpoint attribute of SchemaTestMethod should include '{nameof(PublicEndpointAttribute.EndpointName)}' property");
- Assert.AreEqual("test.calculator.getAppDomainChain", attribute.EndpointName);
- Assert.AreEqual(false, attribute.RequireHTTPS);
- Assert.AreEqual("something", attribute.PropertyNameForResponseBody);
- }
-
- }
-
-}
+#region Copyright
+// Copyright 2017 Gigya Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+#endregion
+
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using Gigya.Common.Contracts.HttpService;
+using Gigya.Microdot.Hosting.HttpService.Endpoints;
+using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService;
+using Gigya.Microdot.ServiceProxy;
+using Gigya.Microdot.SharedLogic.HttpService;
+using Gigya.Microdot.Testing.Service;
+using NSubstitute;
+using NSubstitute.ReceivedExtensions;
+using NUnit.Framework;
+
+namespace Gigya.Microdot.Orleans.Hosting.UnitTests
+{
+ [TestFixture,Parallelizable(ParallelScope.Fixtures)]
+ public class SchemaEndpointTests
+ {
+ private IServiceProxyProvider _serviceProxyProvider;
+ private ServiceTester _tester;
+
+
+ [OneTimeSetUp]
+ public void SetUp()
+ {
+ try
+ {
+ _tester = new ServiceTester();
+
+ _serviceProxyProvider = _tester.GetServiceProxyProvider("CalculatorService");
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+ throw;
+ }
+ }
+
+ [OneTimeTearDown]
+ public void TearDown()
+ {
+ _tester.Dispose();
+ }
+
+
+ [Test]
+ public async Task MethodTypeName()
+ {
+ var schema = await _serviceProxyProvider.GetSchema();
+ var iface = schema.Interfaces.First(_ => _.Name == typeof(ICalculatorService).FullName);
+ var schemaTestMethod = iface.Methods.FirstOrDefault(_ => _.Name == nameof(ICalculatorService.Add));
+ Assert.IsNotNull(schemaTestMethod, "Service schema did not return the method Add");
+ Assert.AreEqual(typeof(ICalculatorService).FullName, iface.Name);
+ }
+
+
+ [Test]
+ public async Task ReturnPublicEndpointAttribute()
+ {
+ var schema = await _serviceProxyProvider.GetSchema();
+ var iface = schema.Interfaces.First(_ => _.Name == typeof(ICalculatorService).FullName);
+ var schemaTestMethod = iface.Methods.FirstOrDefault(_ => _.Name == nameof(ICalculatorService.GetAppDomainChain));
+ Assert.IsNotNull(schemaTestMethod, "Service schema did not return the method GetAppDomainChain");
+ var attribute = schemaTestMethod.Attributes.Select(x => x.Attribute).OfType().Single();
+ Assert.IsNotNull(attribute, "method GetAppDomainChain should include attribute of type PublicEndpoint");
+ Assert.IsTrue(attribute.EndpointName != null, $"PublicEndpoint attribute of SchemaTestMethod should include '{nameof(PublicEndpointAttribute.EndpointName)}' property");
+ Assert.AreEqual("test.calculator.getAppDomainChain", attribute.EndpointName);
+ Assert.AreEqual(false, attribute.RequireHTTPS);
+ Assert.AreEqual("something", attribute.PropertyNameForResponseBody);
+ }
+
+
+ [Test]
+ public async Task SchemaEndpointUsesBinder()
+ {
+ var serviceSchemaPostProcessor = Substitute.For();
+
+ var schemaProvider = new ServiceSchema(new[] { typeof(ICalculatorService) });
+ var serviceSchema = new SchemaEndpoint(schemaProvider,
+ serviceSchemaPostProcessor);
+
+ serviceSchemaPostProcessor.Received(1).PostProcessServiceSchema(schemaProvider);
+ }
+
+ }
+
+}
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Serialization/ExceptionSerializationTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Serialization/ExceptionSerializationTests.cs
index 07c53b06..e38e37eb 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Serialization/ExceptionSerializationTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Serialization/ExceptionSerializationTests.cs
@@ -1,51 +1,26 @@
using System;
-using System.Collections.Generic;
using System.Net.Http;
-using System.Threading.Tasks;
using Gigya.Common.Contracts.Exceptions;
using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Fakes;
-using Gigya.Microdot.Hosting.Environment;
-using Gigya.Microdot.Hosting.HttpService;
-using Gigya.Microdot.Interfaces;
-using Gigya.Microdot.Interfaces.Events;
-using Gigya.Microdot.Interfaces.Logging;
-using Gigya.Microdot.Interfaces.SystemWrappers;
using Gigya.Microdot.Ninject;
-using Gigya.Microdot.Orleans.Hosting.Logging;
-using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice;
-using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService;
-using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.StorageProviderTest;
using Gigya.Microdot.Orleans.Ninject.Host;
using Gigya.Microdot.Orleans.Ninject.Host.NinjectOrleansBinding;
-using Gigya.Microdot.ServiceProxy.Caching;
using Gigya.Microdot.SharedLogic;
-using Gigya.Microdot.SharedLogic.Configurations.Serialization;
-using Gigya.Microdot.SharedLogic.HttpService;
-using Gigya.Microdot.SharedLogic.Security;
-using Gigya.Microdot.Testing.Service;
-using Gigya.Microdot.Testing.Shared;
using Gigya.Microdot.UnitTests;
-using Gigya.Microdot.UnitTests.Caching.Host;
using Gigya.Microdot.UnitTests.Serialization;
-using Gigya.Microdot.UnitTests.ServiceProxyTests;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Options;
using Ninject;
using Ninject.Syntax;
-using NSubstitute;
using NUnit.Framework;
using Orleans;
using Orleans.Configuration;
-using Orleans.Runtime;
using Orleans.Serialization;
using Shouldly;
namespace Gigya.Microdot.Orleans.Hosting.UnitTests.Serialization
{
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
+ [TestFixture,Parallelizable(ParallelScope.Fixtures)]
public class ExceptionSerializationTests
{
class MicrodotServiceProviderWithScope2 : IServiceProvider, IServiceScope, IGlobalServiceProvider
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/ServiceTesterTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/ServiceTesterTests.cs
index c37b36b5..dd797a51 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/ServiceTesterTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/ServiceTesterTests.cs
@@ -21,13 +21,7 @@
#endregion
using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Gigya.Common.Contracts.HttpService;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Environment;
using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService;
-using Gigya.Microdot.ServiceProxy;
using Gigya.Microdot.SharedLogic;
using Gigya.Microdot.Testing.Service;
using Gigya.Microdot.Testing.Shared.Service;
@@ -36,20 +30,20 @@
namespace Gigya.Microdot.Orleans.Hosting.UnitTests
{
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
+ [TestFixture, Parallelizable(ParallelScope.Fixtures)]
public class ServiceTesterTests
{
private ServiceTester _tester;
[Test]
- public async Task ServiceTesterWhenServiceFailedToGracefullyShutdownShouldThrow()
+ public void ServiceTesterWhenServiceFailedToGracefullyShutdownShouldThrow()
{
// shutdownWaitTimeSec: 0
var serviceArguments = new ServiceArguments(
- ServiceStartupMode.CommandLineNonInteractive,
+ ServiceStartupMode.CommandLineNonInteractive,
ConsoleOutputMode.Disabled,
- SiloClusterMode.PrimaryNode,
- DisposablePort.GetPort().Port,
+ SiloClusterMode.PrimaryNode,
+ DisposablePort.GetPort().Port,
onStopWaitTimeSec: 0);
_tester = new ServiceTester(
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/TestContextAttribute.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/TestContextAttribute.cs
index 876a3215..436a49c6 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/TestContextAttribute.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/TestContextAttribute.cs
@@ -1,11 +1,6 @@
-using NUnit.Framework;
-using NUnit.Framework.Interfaces;
+using NUnit.Framework.Interfaces;
using NUnit.Framework.Internal;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Gigya.Microdot.Orleans.Hosting.UnitTests
{
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Validation/ConfigObjectTypeValidatorTest.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Validation/ConfigObjectTypeValidatorTest.cs
index 2249881d..5e9122d1 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Validation/ConfigObjectTypeValidatorTest.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Validation/ConfigObjectTypeValidatorTest.cs
@@ -1,12 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-using Gigya.Common.Contracts.Exceptions;
+using Gigya.Common.Contracts.Exceptions;
using Gigya.Microdot.Hosting.Validators;
using Gigya.Microdot.Interfaces;
using Gigya.Microdot.Interfaces.Configuration;
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Validation/SensitivityAttributesValidatorTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Validation/SensitivityAttributesValidatorTests.cs
index c49e1a3e..a4347256 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Validation/SensitivityAttributesValidatorTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/Validation/SensitivityAttributesValidatorTests.cs
@@ -21,19 +21,12 @@
#endregion
using System;
-using System.Net;
-using System.Threading;
using System.Threading.Tasks;
using Gigya.Common.Contracts.Exceptions;
using Gigya.Common.Contracts.HttpService;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Fakes;
-using Gigya.Microdot.Hosting.Environment;
using Gigya.Microdot.Hosting.HttpService;
using Gigya.Microdot.Hosting.Validators;
-using Gigya.Microdot.Interfaces.Configuration;
using Gigya.Microdot.Ninject;
-using Gigya.Microdot.Testing.Shared;
using Gigya.Microdot.UnitTests.Caching.Host;
using Gigya.ServiceContract.Attributes;
using Newtonsoft.Json.Linq;
@@ -43,7 +36,7 @@
namespace Gigya.Common.Application.UnitTests.Validation
{
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
+ [TestFixture, NonParallelizable]
public class SensitivityAttributesValidatorTests
{
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/WarmupTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/WarmupTests.cs
index 9f322f17..d658884a 100644
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/WarmupTests.cs
+++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/WarmupTests.cs
@@ -1,8 +1,5 @@
-
-using System;
+using System;
using System.Threading.Tasks;
-using Gigya.Microdot.Common.Tests;
-using Gigya.Microdot.Hosting.Environment;
using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.WarmupTestService;
using Gigya.Microdot.Testing.Service;
using NUnit.Framework;
@@ -25,8 +22,14 @@ public async Task InstanceReadyBeforeCallingMethod_Warmup()
Assert.Greater(beforeGrainCreated, dependencyCreateDate, "dependencyCreateDate should create before grain is created");
- tester.Dispose();
+ try
+ {
+ tester.Dispose();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+ }
}
-
}
}
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/app.config b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/app.config
deleted file mode 100644
index 75152f70..00000000
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/app.config
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/paket.references b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/paket.references
deleted file mode 100644
index db56ad51..00000000
--- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/paket.references
+++ /dev/null
@@ -1,23 +0,0 @@
-Gigya.ServiceContract
-Microsoft.Extensions.DependencyInjection
-Microsoft.Orleans.OrleansCodeGenerator
-Microsoft.Orleans.CodeGenerator.MsBuild
-Microsoft.Orleans.OrleansProviders
-NSubstitute
-NUnit
-NUnit3TestAdapter
-Ninject
-Shouldly
-Castle.Core
-ZooKeeperNetEx
-System.Threading.Tasks.Dataflow
-System.ValueTuple
-# Solve binding redirect issue, related to project vs nuget references. OrleansDashboard depends on.
-Microsoft.AspNetCore.Hosting
-Microsoft.AspNetCore.Server.Kestrel
-Microsoft.CSharp
-System.Net.Http
-Microsoft.NET.Test.Sdk
-
-# Remove after the transition to netcore completed
-System.ServiceProcess.ServiceController
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.ServiceContract.UnitTests/Gigya.Microdot.ServiceContract.UnitTests.csproj b/tests/Gigya.Microdot.ServiceContract.UnitTests/Gigya.Microdot.ServiceContract.UnitTests.csproj
deleted file mode 100644
index 19b12c0d..00000000
--- a/tests/Gigya.Microdot.ServiceContract.UnitTests/Gigya.Microdot.ServiceContract.UnitTests.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- net472
- true
- true
- $(SolutionDir)main.ruleset
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.ServiceContract.UnitTests/JsonHelperTests.cs b/tests/Gigya.Microdot.ServiceContract.UnitTests/JsonHelperTests.cs
deleted file mode 100644
index 8cef32a8..00000000
--- a/tests/Gigya.Microdot.ServiceContract.UnitTests/JsonHelperTests.cs
+++ /dev/null
@@ -1,399 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Linq;
-using System.Numerics;
-using Gigya.ServiceContract.Exceptions;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using NUnit.Framework;
-using Shouldly;
-
-namespace Gigya.Common.Contracts.UnitTests
-{
- public enum MyEnum { Zero, One, Two }
- public class SomeClass { public int A; public long B; public ushort? C; [JsonProperty] SomeClass Inner; }
- public struct SomeStruct { public int A; public long B; public ushort? C; }
-
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
- public class JsonHelperTests
- {
- [Test]
- public void ConvertWeaklyTypedValue_NullTargetType_ShouldThrow()
- {
- Should.Throw(() => JsonHelper.ConvertWeaklyTypedValue(5, null));
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_Null_ShouldReturnNull()
- {
- object actual = JsonHelper.ConvertWeaklyTypedValue(null, typeof(MyEnum));
- actual.ShouldBe(null);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_EnumAsNumeric_ShouldConvert()
- {
- object actual = JsonHelper.ConvertWeaklyTypedValue((long)MyEnum.Two, typeof(MyEnum));
- actual.ShouldBe(MyEnum.Two);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_EnumAsInvalidNumeric_ShouldConvert()
- {
- object actual = JsonHelper.ConvertWeaklyTypedValue((long)5, typeof(MyEnum));
- actual.ShouldBe((MyEnum)5);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_EnumAsNullableNumeric_ShouldConvert()
- {
- object actual = JsonHelper.ConvertWeaklyTypedValue((long)MyEnum.Two, typeof(MyEnum?));
- actual.ShouldBe(MyEnum.Two);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_EnumAsInvalidNullableNumeric_ShouldConvert()
- {
- object actual = JsonHelper.ConvertWeaklyTypedValue((long)5, typeof(MyEnum?));
- actual.ShouldBe((MyEnum)5);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_EnumAsString_ShouldConvert()
- {
- object actual = JsonHelper.ConvertWeaklyTypedValue("Two", typeof(MyEnum));
- actual.ShouldBe(MyEnum.Two);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_EnumAsInvalidString_ShouldThrow()
- {
- Should.Throw(() => JsonHelper.ConvertWeaklyTypedValue("INVALID", typeof(MyEnum)));
- }
-
-
- [TestCase("N"), TestCase("D"), TestCase("B"), TestCase("P")]
- public void ConvertWeaklyTypedValue_GuidAsString_ShouldConvert(string format)
- {
- var expected = Guid.NewGuid();
- object actual = JsonHelper.ConvertWeaklyTypedValue(expected.ToString(format), typeof(Guid));
- actual.ShouldBe(expected);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_LargeUInt64AsBigInteger_ShouldConvert()
- {
- object actual = JsonHelper.ConvertWeaklyTypedValue(new BigInteger(ulong.MaxValue), typeof(ulong));
- actual.ShouldBeOfType();
- actual.ShouldBe(ulong.MaxValue);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_LocalDateTimeAsString_ShouldConvert()
- {
- var expected = DateTime.Now;
- DateTime actual = (DateTime)JsonHelper.ConvertWeaklyTypedValue(expected.ToString("O"), typeof(DateTime));
- actual.ShouldBe(expected);
- actual.Kind.ShouldBe(DateTimeKind.Local);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_LocalDateTimeAsDateTimeOffset_ShouldConvert()
- {
- var expected = DateTime.Now;
- DateTime actual = (DateTime)JsonHelper.ConvertWeaklyTypedValue(new DateTimeOffset(expected), typeof(DateTime));
- actual.ShouldBe(expected);
- actual.Kind.ShouldBe(DateTimeKind.Local);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_UtcDateTimeAsString_ShouldConvert()
- {
- var expected = DateTime.UtcNow;
- DateTime actual = (DateTime)JsonHelper.ConvertWeaklyTypedValue(expected.ToString("O"), typeof(DateTime));
- actual.ShouldBe(expected);
- actual.Kind.ShouldBe(DateTimeKind.Utc);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_UtcDateTimeAsDateTimeOffset_ShouldConvert()
- {
- var expected = DateTime.UtcNow;
- DateTime actual = (DateTime)JsonHelper.ConvertWeaklyTypedValue(new DateTimeOffset(expected), typeof(DateTime));
- actual.ShouldBe(expected);
- actual.Kind.ShouldBe(DateTimeKind.Utc);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_DateTimeAsInt_ShouldThrow()
- {
- Should.Throw(() => JsonHelper.ConvertWeaklyTypedValue(5, typeof(DateTime)));
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_LocalDateTimeOffsetAsString_ShouldConvert()
- {
- var expected = DateTimeOffset.Now;
- DateTimeOffset actual = (DateTimeOffset)JsonHelper.ConvertWeaklyTypedValue(expected.ToString("O"), typeof(DateTimeOffset));
- actual.ShouldBe(expected);
- actual.Offset.ShouldBe(expected.Offset);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_LocalDateTimeOffsetAsDateTime_ShouldConvert()
- {
- var expected = DateTimeOffset.Now;
- DateTimeOffset actual = (DateTimeOffset)JsonHelper.ConvertWeaklyTypedValue(expected.LocalDateTime, typeof(DateTimeOffset));
- actual.ShouldBe(expected);
- actual.Offset.ShouldBe(expected.Offset);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_UtcDateTimeOffsetAsString_ShouldConvert()
- {
- var expected = DateTimeOffset.UtcNow;
- DateTimeOffset actual = (DateTimeOffset)JsonHelper.ConvertWeaklyTypedValue(expected.ToString("O"), typeof(DateTimeOffset));
- actual.ShouldBe(expected);
- actual.Offset.ShouldBe(expected.Offset);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_UtcDateTimeOffsetAsDateTime_ShouldConvert()
- {
- var expected = DateTimeOffset.UtcNow;
- DateTimeOffset actual = (DateTimeOffset)JsonHelper.ConvertWeaklyTypedValue(expected.UtcDateTime, typeof(DateTimeOffset));
- actual.ShouldBe(expected);
- actual.Offset.ShouldBe(expected.Offset);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_ForeignDateTimeOffsetAsString_ShouldConvert()
- {
- var expected = new DateTimeOffset(DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Unspecified), TimeSpan.FromHours(6));
- DateTimeOffset actual = (DateTimeOffset)JsonHelper.ConvertWeaklyTypedValue(expected.ToString("O"), typeof(DateTimeOffset));
- actual.ShouldBe(expected);
- actual.Offset.ShouldBe(expected.Offset);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_DateTimeOffsetAsInt_ShouldThrow()
- {
- Should.Throw(() => JsonHelper.ConvertWeaklyTypedValue(5, typeof(DateTimeOffset)));
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_TimeSpanAsString_ShouldConvert()
- {
- var expected = new TimeSpan(11, 12, 13, 14, 15);
- object actual = JsonHelper.ConvertWeaklyTypedValue(expected.ToString(), typeof(TimeSpan));
- actual.ShouldBe(expected);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_TimeSpanAsInvalidString_ShouldConvert()
- {
- Should.Throw(() => JsonHelper.ConvertWeaklyTypedValue("INVALID", typeof(TimeSpan)));
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_SomeClassAsJson_ShouldConvert()
- {
- var expected = new SomeClass { A = 5, B = 109 };
- var actual = JsonHelper
- .ConvertWeaklyTypedValue(JsonConvert.SerializeObject(expected), typeof(SomeClass))
- .ShouldBeOfType();
- actual.A.ShouldBe(expected.A);
- actual.B.ShouldBe(expected.B);
- actual.C.ShouldBe(expected.C);
- }
-
-
- [Test]
- public void ConvertWeaklyTypedValue_SomeStructAsJson_ShouldConvert()
- {
- var expected = new SomeStruct { A = 5, B = 109 };
- var actual = JsonHelper
- .ConvertWeaklyTypedValue(JsonConvert.SerializeObject(expected), typeof(SomeClass))
- .ShouldBeOfType();
- actual.A.ShouldBe(expected.A);
- actual.B.ShouldBe(expected.B);
- actual.C.ShouldBe(expected.C);
- }
- }
-
-
-
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
- public class JsonHelperNumericTests
- {
- [DatapointSource]
- private Type[] GetTypes() => new[]
- {
- typeof(byte),
- typeof(sbyte),
- typeof(short),
- typeof(ushort),
- typeof(int),
- typeof(uint),
- typeof(long),
- typeof(ulong),
- typeof(float),
- typeof(double),
- typeof(decimal)
- };
-
-
- [DatapointSource]
- private object[] GetValues() => GetTypes().SelectMany(t => new[]
- {
- Convert.ChangeType(42, t),
- t.GetField("MinValue").GetValue(null),
- t.GetField("MaxValue").GetValue(null),
- null
- }).ToArray();
-
-
- [Theory]
- public void ConvertWeaklyTypedValue_NumericValue(object value, Type targetType)
- {
- if (value == null || (value is double && targetType == typeof(float)))
- return;
-
- try
- {
- object actual = JsonHelper.ConvertWeaklyTypedValue(value, targetType);
- actual.ShouldBeOfType(Nullable.GetUnderlyingType(targetType) ?? targetType);
- actual.ShouldBe(value);
- }
- catch (InvalidParameterValueException) { }
- }
-
-
- [Theory]
- public void ConvertWeaklyTypedValue_NullableNumericValue(object value, Type targetType)
- {
- if (value is double && targetType == typeof(float))
- return;
-
- try
- {
- targetType = typeof(Nullable<>).MakeGenericType(targetType);
- object actual = JsonHelper.ConvertWeaklyTypedValue(value, targetType);
-
- if (value != null)
- actual.ShouldBeOfType(Nullable.GetUnderlyingType(targetType) ?? targetType);
-
- actual.ShouldBe(value);
- }
- catch (InvalidParameterValueException) { }
- }
-
- [Test]
- public void ComplexObjectWithNullValue_ThrowException()
- {
- var json = JObject.Parse(@"{A:null}");
- try
- {
- JsonHelper.ConvertWeaklyTypedValue(json, typeof(SomeClass));
- Assert.Fail("Should throw exception because field 'A' is null");
- }
- catch (InvalidParameterValueException ex)
- {
- ex.parameterName.ShouldBeNull();
- ex.ErrorPath.SequenceEqual(new[] {"A"});
- }
- }
-
- [Test]
- public void ComplexObjectWithWrongValue_ThrowException()
- {
- var json = JObject.Parse(@"{A:""abcd""}");
- try
- {
- JsonHelper.ConvertWeaklyTypedValue(json, typeof(SomeClass));
- Assert.Fail("Should throw exception because field 'A' has invalid value");
- }
- catch (InvalidParameterValueException ex)
- {
- ex.parameterName.ShouldBeNull();
- ex.ErrorPath.SequenceEqual(new[] { "A" });
- }
- }
-
- [Test]
- public void ComplexObjectWithComplexObjectWithNullValue_ThrowException()
- {
- var json = JObject.Parse(@"{Inner: {A:null}}");
- try
- {
- JsonHelper.ConvertWeaklyTypedValue(json, typeof(SomeClass));
- Assert.Fail("Should throw exception because field 'Inner.A' is null");
- }
- catch (InvalidParameterValueException ex)
- {
- ex.parameterName.ShouldBeNull();
- ex.ErrorPath.SequenceEqual(new[] { "Inner", "A" });
- }
- }
-
- [Test]
- public void ComplexObjectWithComplexObjectWithWrongValue_ThrowException()
- {
- var json = JObject.Parse(@"{Inner: {A:""abcd""}}");
- try
- {
- JsonHelper.ConvertWeaklyTypedValue(json, typeof(SomeClass));
- Assert.Fail("Should throw exception because field 'Inner.A' has invalid value");
- }
- catch (InvalidParameterValueException ex)
- {
- ex.parameterName.ShouldBeNull();
- ex.ErrorPath.SequenceEqual(new[] { "Inner","A" });
- }
- }
-
- }
-}
diff --git a/tests/Gigya.Microdot.ServiceContract.UnitTests/Properties/AssemblyInfo.cs b/tests/Gigya.Microdot.ServiceContract.UnitTests/Properties/AssemblyInfo.cs
deleted file mode 100644
index f9ecbc46..00000000
--- a/tests/Gigya.Microdot.ServiceContract.UnitTests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("9fce184a-f17a-4d9b-a1dc-471d8f58685e")]
diff --git a/tests/Gigya.Microdot.ServiceContract.UnitTests/ServiceSchemaTests.cs b/tests/Gigya.Microdot.ServiceContract.UnitTests/ServiceSchemaTests.cs
deleted file mode 100644
index 003b0efb..00000000
--- a/tests/Gigya.Microdot.ServiceContract.UnitTests/ServiceSchemaTests.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-#region Copyright
-// Copyright 2017 Gigya Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Threading.Tasks;
-using Gigya.Common.Contracts.HttpService;
-using Newtonsoft.Json;
-using NUnit.Framework;
-#pragma warning disable 169
-
-namespace Gigya.Common.Contracts.UnitTests
-{
- class DataParamBase
- {
- [Sensitive]
- public int BaseField;
- }
- class Data: DataParamBase
- {
- public string s;
- public Nested n;
- }
-
- class Nested
- {
- public DateTime time;
- }
-
- class ResponseData
- {
- public string a;
- public int b;
- }
-
- public class SensitiveAttribute : Attribute {}
-
- [HttpService(100)]
- internal interface ITestInterface
- {
- [PublicEndpoint("demo.doSomething")]
- Task DoSomething(int i, double? nd, string s, [Sensitive] Data data);
- }
-
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
- public class ServiceSchemaTests
- {
-
- [Test]
- public void TestSerialization()
- {
- ServiceSchema schema = new ServiceSchema(new[] { typeof(ITestInterface) });
- string serialized = JsonConvert.SerializeObject(schema, new JsonSerializerSettings { Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore });
- schema = JsonConvert.DeserializeObject(serialized);
-
- Assert.IsTrue(schema.Interfaces.Length == 1);
- Assert.IsTrue(schema.Interfaces[0].Name == typeof(ITestInterface).FullName);
- Assert.IsTrue(schema.Interfaces[0].Attributes.Length == 1);
- Assert.IsTrue(schema.Interfaces[0].Attributes[0].Attribute is HttpServiceAttribute);
- Assert.IsTrue(schema.Interfaces[0].Attributes[0].TypeName == typeof(HttpServiceAttribute).AssemblyQualifiedName);
- Assert.IsTrue((schema.Interfaces[0].Attributes[0].Attribute as HttpServiceAttribute).BasePort == 100);
- Assert.IsTrue(schema.Interfaces[0].Methods.Length == 1);
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Name == nameof(ITestInterface.DoSomething));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Attributes.Length == 1);
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Attributes[0].Attribute is PublicEndpointAttribute);
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Attributes[0].TypeName == typeof(PublicEndpointAttribute).AssemblyQualifiedName);
- Assert.IsTrue((schema.Interfaces[0].Methods[0].Attributes[0].Attribute as PublicEndpointAttribute).EndpointName == "demo.doSomething");
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters.Length == 4);
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[0].Attributes.Length == 0);
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[0].Name == "i");
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[0].Type == typeof(int));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[0].TypeName == typeof(int).AssemblyQualifiedName);
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[1].Name == "nd");
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[1].Type == typeof(double?));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[2].Name == "s");
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[3].Attributes.Length == 1);
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[3].Attributes[0].Attribute is SensitiveAttribute);
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[3].Fields[2].Name == nameof(DataParamBase.BaseField));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[3].Fields[2].Attributes[0].Attribute is SensitiveAttribute);
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[3].Fields[2].Type == typeof(int));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[3].Fields[1].Name == nameof(Data.n));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[3].Fields[1].Type == typeof(Nested));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[3].Fields[0].Name == nameof(Data.s));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Parameters[3].Fields[0].Type == typeof(string));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Response.Type == typeof(ResponseData));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Response.Fields[0].Name == nameof(ResponseData.a));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Response.Fields[0].Type == typeof(string));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Response.Fields[1].Name == nameof(ResponseData.b));
- Assert.IsTrue(schema.Interfaces[0].Methods[0].Response.Fields[1].Type == typeof(int));
- }
-
-
- [Test]
- public void TestUnknownAttribute()
- {
- var typeFullName = typeof(SensitiveAttribute).AssemblyQualifiedName;
- string json = @"
- {
- ""TypeName"": """ + typeFullName + @""",
- ""Data"": {
- ""TypeId"": """ + typeFullName + @"""
- }
- }";
- AttributeSchema attr = JsonConvert.DeserializeObject(json);
- Assert.IsNotNull(attr.Attribute);
-
- json = @"
- {
- ""TypeName"": ""Gigya.Microdot.ServiceContract.UnitTests.HttpService.SensitiveAttribute2, Gigya.Microdot.ServiceContract.UnitTests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"",
- ""Data"": {
- ""TypeId"": """ + typeFullName + @"""
- }
- }";
- attr = JsonConvert.DeserializeObject(json);
- Assert.IsNull(attr.Attribute);
- Assert.IsTrue(attr.TypeName == "Gigya.Microdot.ServiceContract.UnitTests.HttpService.SensitiveAttribute2, Gigya.Microdot.ServiceContract.UnitTests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");
- }
-
-
- [Test]
- public void TestUnknownParamType()
- {
- string json = @"
- {
- ""Name"": ""i"",
- ""TypeName"": ""System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"",
- ""Attributes"": []
- }";
- ParameterSchema param = JsonConvert.DeserializeObject(json);
- Assert.IsNotNull(param.Type);
-
- json = @"
- {
- ""Name"": ""i"",
- ""TypeName"": ""System.Int33, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"",
- ""Attributes"": []
- }";
- param = JsonConvert.DeserializeObject(json);
- Assert.IsNull(param.Type);
- Assert.IsTrue(param.TypeName == "System.Int33, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
- }
- }
-}
diff --git a/tests/Gigya.Microdot.ServiceContract.UnitTests/app.config b/tests/Gigya.Microdot.ServiceContract.UnitTests/app.config
deleted file mode 100644
index 535fdb59..00000000
--- a/tests/Gigya.Microdot.ServiceContract.UnitTests/app.config
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- True
-
-
-
-
diff --git a/tests/Gigya.Microdot.ServiceContract.UnitTests/paket.references b/tests/Gigya.Microdot.ServiceContract.UnitTests/paket.references
deleted file mode 100644
index 0f2c45d9..00000000
--- a/tests/Gigya.Microdot.ServiceContract.UnitTests/paket.references
+++ /dev/null
@@ -1,7 +0,0 @@
-Gigya.ServiceContract
-Newtonsoft.Json
-NUnit
-NUnit3TestAdapter
-Shouldly
-System.ComponentModel.Annotations
-Microsoft.NET.Test.Sdk
\ No newline at end of file
diff --git a/tests/Gigya.Microdot.UnitTests/AdditionalDataSerializationTests.cs b/tests/Gigya.Microdot.UnitTests/AdditionalDataSerializationTests.cs
index e893e21b..d13a88a5 100644
--- a/tests/Gigya.Microdot.UnitTests/AdditionalDataSerializationTests.cs
+++ b/tests/Gigya.Microdot.UnitTests/AdditionalDataSerializationTests.cs
@@ -1,10 +1,10 @@
-using System.Linq;
-using Gigya.Microdot.SharedLogic.Events;
+using Gigya.Microdot.SharedLogic.Events;
using Gigya.Microdot.SharedLogic.HttpService;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using Shouldly;
+using System.Linq;
namespace Gigya.Microdot.UnitTests
{
diff --git a/tests/Gigya.Microdot.UnitTests/AssemblyInitialize.cs b/tests/Gigya.Microdot.UnitTests/AssemblyInitialize.cs
index 46e57fba..f2e8c3b3 100644
--- a/tests/Gigya.Microdot.UnitTests/AssemblyInitialize.cs
+++ b/tests/Gigya.Microdot.UnitTests/AssemblyInitialize.cs
@@ -20,8 +20,8 @@
// POSSIBILITY OF SUCH DAMAGE.
#endregion
-using System;
using NUnit.Framework;
+using System;
[SetUpFixture]
[NonParallelizable]
diff --git a/tests/Gigya.Microdot.UnitTests/Caching/AsyncMemoizerRevokesTests.cs b/tests/Gigya.Microdot.UnitTests/Caching/AsyncMemoizerRevokesTests.cs
index 5115eef5..02cdac89 100644
--- a/tests/Gigya.Microdot.UnitTests/Caching/AsyncMemoizerRevokesTests.cs
+++ b/tests/Gigya.Microdot.UnitTests/Caching/AsyncMemoizerRevokesTests.cs
@@ -1,11 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Caching;
-using System.Threading.Tasks;
-using System.Threading.Tasks.Dataflow;
-using Gigya.Common.Contracts.Attributes;
+using Gigya.Common.Contracts.Attributes;
using Gigya.Microdot.Fakes;
using Gigya.Microdot.ServiceDiscovery.Config;
using Gigya.Microdot.ServiceProxy.Caching;
@@ -16,11 +9,17 @@
using NSubstitute;
using NUnit.Framework;
using Shouldly;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using System.Threading.Tasks.Dataflow;
// ReSharper disable ConsiderUsingConfigureAwait (not relevant for tests)
namespace Gigya.Microdot.UnitTests.Caching
{
- [TestFixture,Parallelizable(ParallelScope.Fixtures)]
+ [TestFixture,Parallelizable(ParallelScope.None)]
public class AsyncMemoizerRevokesTests
{
private const string cacheContextName = "AsyncCache";
@@ -47,8 +46,7 @@ private IMethodCachingSettings GetCachingSettings(double ttlSeconds = 60 * 60 *
double refreshTimeSeconds = 60,
RevokedResponseBehavior revokedResponseBehavior = RevokedResponseBehavior.FetchNewValueNextTime,
ResponseKinds responseKindsToCache = ResponseKinds.NonNullResponse | ResponseKinds.NullResponse,
- ResponseKinds responseKindsToIgnore = ResponseKinds.EnvironmentException | ResponseKinds.OtherExceptions | ResponseKinds.RequestException | ResponseKinds.TimeoutException,
- RefreshBehavior refreshBehavior = RefreshBehavior.UseOldAndFetchNewValueInBackground) =>
+ ResponseKinds responseKindsToIgnore = ResponseKinds.EnvironmentException | ResponseKinds.OtherExceptions | ResponseKinds.RequestException | ResponseKinds.TimeoutException) =>
new MethodCachingPolicyConfig
{
ExpirationTime = TimeSpan.FromSeconds(ttlSeconds),
@@ -59,7 +57,7 @@ private IMethodCachingSettings GetCachingSettings(double ttlSeconds = 60 * 60 *
ResponseKindsToCache = responseKindsToCache,
ResponseKindsToIgnore = responseKindsToIgnore,
RequestGroupingBehavior = RequestGroupingBehavior.Enabled,
- RefreshBehavior = refreshBehavior,
+ RefreshBehavior = RefreshBehavior.UseOldAndFetchNewValueInBackground,
RevokedResponseBehavior = revokedResponseBehavior,
CacheResponsesWhenSupressedBehavior = CacheResponsesWhenSupressedBehavior.Enabled,
RefreshMode = RefreshMode.UseRefreshes,
@@ -67,7 +65,7 @@ private IMethodCachingSettings GetCachingSettings(double ttlSeconds = 60 * 60 *
NotIgnoredResponseBehavior = NotIgnoredResponseBehavior.KeepCachedResponse
};
- private MethodInfo ThingifyTaskRevokabkle { get; } = typeof(IThingFrobber).GetMethod(nameof(IThingFrobber.ThingifyTaskRevokable));
+ private MethodInfo ThingifyTaskRevokable { get; } = typeof(IThingFrobber).GetMethod(nameof(IThingFrobber.ThingifyTaskRevokable));
private IThingFrobber CreateRevokableDataSource(string[] revokeKeys, params object[] results)
{
@@ -106,6 +104,7 @@ public void SetUp()
}
[Test]
+ [Retry(5)] //Sometime fails on build server because of timing issues
public async Task MemoizeAsync_RevokeBeforeRetrivalTaskCompletedCaused_NoIssues()
{
var completionSource = new TaskCompletionSource>();
@@ -115,7 +114,7 @@ public async Task MemoizeAsync_RevokeBeforeRetrivalTaskCompletedCaused_NoIssues(
var memoizer = CreateMemoizer(cache);
string firstValue = "first Value";
//Call method to get results
- var resultTask = (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ var resultTask = (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings());
//Post revoke message while results had not arrived
revokesSource.PostMessageSynced("revokeKey");
@@ -130,7 +129,7 @@ public async Task MemoizeAsync_RevokeBeforeRetrivalTaskCompletedCaused_NoIssues(
});
//Wait before sending results
- await Task.Delay(100);
+ await Task.Delay(200);
completionSource.SetResult(new Revocable { Value = new Thing { Id = firstValue }, RevokeKeys = new[] { "revokeKey" } });
//Results should arive now
@@ -152,17 +151,17 @@ public async Task MemoizeAsync_ExistingItemWasRefreshedByTtlAndReciviedRevoke_Af
var cache = CreateCache(revokesSource);
var memoizer = CreateMemoizer(cache);
//To cause refresh in next call
- await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings(refreshTimeSeconds:0));
+ await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings(refreshTimeSeconds:0));
dataSource.Received(1).ThingifyTaskRevokable("someString"); //New item - fetch from datasource
- await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings());
dataSource.Received(2).ThingifyTaskRevokable("someString"); //Refresh task - fetch from datasource
//Post revoke message
revokesSource.PostMessageSynced("revokeKey");
//We want to test that item was removed from cache after revoke and that new item is fetched from datasource
- await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings());
dataSource.Received(3).ThingifyTaskRevokable("someString"); //Revoke received and item removed from cache - fetch from datasource
}
@@ -175,7 +174,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndSettingIsKeepUsingRe
var cache = CreateCache(revokesSource);
var memoizer = CreateMemoizer(cache);
- var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings());
result.Value.Id.ShouldBe(firstResult);
dataSource.Received(1).ThingifyTaskRevokable("someString"); //New item - fetch from datasource
@@ -183,7 +182,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndSettingIsKeepUsingRe
revokesSource.PostMessageSynced("revokeKey");
//We want to test that revoked item is still in cache and returned
- result = await(Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" },
+ result = await(Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" },
GetCachingSettings(revokedResponseBehavior: RevokedResponseBehavior.KeepUsingRevokedResponse));
result.Value.Id.ShouldBe(firstResult);
dataSource.Received(1).ThingifyTaskRevokable("someString"); //Revoke received and item was not removed from cache - do not fetch from datasource
@@ -199,7 +198,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndSettingIsTryFetchNew
var cache = CreateCache(revokesSource);
var memoizer = CreateMemoizer(cache);
- var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings());
result.Value.Id.ShouldBe(firstResult);
dataSource.Received(1).ThingifyTaskRevokable("someString"); //New item - fetch from datasource
@@ -207,7 +206,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndSettingIsTryFetchNew
revokesSource.PostMessageSynced("revokeKey");
//We want to test that revoked item is ignored and we fetch a new item from data source
- result = await(Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" },
+ result = await(Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" },
GetCachingSettings(revokedResponseBehavior: RevokedResponseBehavior.TryFetchNewValueNextTimeOrUseOld));
result.Value.Id.ShouldBe(secondResult);
dataSource.Received(2).ThingifyTaskRevokable("someString");
@@ -223,7 +222,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndCallAfterRevokeRetur
var cache = CreateCache(revokesSource);
var memoizer = CreateMemoizer(cache);
- var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings());
result.Value.Id.ShouldBe(firstResult);
dataSource.Received(1).ThingifyTaskRevokable("someString"); //New item - fetch from datasource
@@ -231,7 +230,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndCallAfterRevokeRetur
revokesSource.PostMessageSynced("revokeKey");
//We want to test that revoked item is returned (because data source response should be ignored)
- result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" },
+ result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" },
GetCachingSettings(revokedResponseBehavior: RevokedResponseBehavior.TryFetchNewValueNextTimeOrUseOld,
responseKindsToCache: ResponseKinds.NonNullResponse,
responseKindsToIgnore: ResponseKinds.NullResponse));
@@ -239,7 +238,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndCallAfterRevokeRetur
dataSource.Received(2).ThingifyTaskRevokable("someString"); //tried to fetch from data source (and ignored)
//Cached item is still revoked, so we do another call to data source and get a new valid response
- result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" },
+ result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" },
GetCachingSettings(revokedResponseBehavior: RevokedResponseBehavior.TryFetchNewValueNextTimeOrUseOld));
result.Value.Id.ShouldBe(secondResult); //get new value
dataSource.Received(3).ThingifyTaskRevokable("someString");
@@ -255,7 +254,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndSettingIsTryFetchNew
var cache = CreateCache(revokesSource);
var memoizer = CreateMemoizer(cache);
- var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings());
result.Value.Id.ShouldBe(firstResult);
dataSource.Received(1).ThingifyTaskRevokable("someString"); //New item - fetch from datasource
@@ -263,13 +262,13 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndSettingIsTryFetchNew
revokesSource.PostMessageSynced("revokeKey");
//We want to test that revoked item is used and we fetch a new item from data source in the backround
- result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" },
+ result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" },
GetCachingSettings(revokedResponseBehavior: RevokedResponseBehavior.TryFetchNewValueInBackgroundNextTime));
result.Value.Id.ShouldBe(firstResult); //Use old cached value
dataSource.Received(2).ThingifyTaskRevokable("someString"); //A backround call to the data source is made
//After backround call is done, we should get new result
- result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" },
+ result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" },
GetCachingSettings(revokedResponseBehavior: RevokedResponseBehavior.TryFetchNewValueInBackgroundNextTime));
result.Value.Id.ShouldBe(secondResult);
dataSource.Received(2).ThingifyTaskRevokable("someString"); //No additional data source call
@@ -285,7 +284,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndCallAfterRevokeRetur
var cache = CreateCache(revokesSource);
var memoizer = CreateMemoizer(cache);
- var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ var result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings());
result.Value.Id.ShouldBe(firstResult);
dataSource.Received(1).ThingifyTaskRevokable("someString"); //New item - fetch from datasource
@@ -293,7 +292,7 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndCallAfterRevokeRetur
revokesSource.PostMessageSynced("revokeKey");
//We want to test that revoked item is used and we fetch a new item from data source in the backround
- result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" },
+ result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" },
GetCachingSettings(revokedResponseBehavior: RevokedResponseBehavior.TryFetchNewValueInBackgroundNextTime,
responseKindsToCache: ResponseKinds.NonNullResponse,
responseKindsToIgnore: ResponseKinds.NullResponse));
@@ -301,13 +300,13 @@ public async Task MemoizeAsync_ExistingItemReceivedRevokeAndCallAfterRevokeRetur
dataSource.Received(2).ThingifyTaskRevokable("someString"); //A backround call to the data source is made
//Backround call returned an ignored response, so we should get old cached value an issue another data source call (old item is still revoked)
- result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" },
+ result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" },
GetCachingSettings(revokedResponseBehavior: RevokedResponseBehavior.TryFetchNewValueInBackgroundNextTime));
result.Value.Id.ShouldBe(firstResult);
dataSource.Received(3).ThingifyTaskRevokable("someString"); //Second backround call
//Second backround call returned a new valid response and cached it. We should get cached value
- result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" },
+ result = await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" },
GetCachingSettings(revokedResponseBehavior: RevokedResponseBehavior.TryFetchNewValueInBackgroundNextTime));
result.Value.Id.ShouldBe(secondResult);
dataSource.Received(3).ThingifyTaskRevokable("someString"); //No additional data source call
@@ -383,11 +382,11 @@ public async Task MemoizeAsync_AfterRefreshRevokeKeysAreAddedToReverseIndexCorre
var result2 = new Revocable { Value = new Thing { Id = "result2" }, RevokeKeys = new List{"x", "y"} };
dataSource.ThingifyTaskRevokable("someString").Returns(result1, result2);
- await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings(refreshTimeSeconds: 0));//refresh in next call
+ await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings(refreshTimeSeconds: 0));//refresh in next call
cache.RevokeKeysCount.ShouldBe(1);
cache.CacheKeyCount.ShouldBe(1);
- await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings());
cache.CacheKeyCount.ShouldBe(2);
cache.RevokeKeysCount.ShouldBe(2);
}
@@ -404,11 +403,11 @@ public async Task MemoizeAsync_AfterRefreshRevokeKeysAreRemovedFromReverseIndexC
var result2 = new Revocable { Value = new Thing { Id = "result2" }, RevokeKeys = new List { "x" } };
dataSource.ThingifyTaskRevokable("someString").Returns(result1, result2);
- await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings(refreshTimeSeconds: 0));//refresh in next call
+ await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokable, new object[] { "someString" }, GetCachingSettings(refreshTimeSeconds: 0));//refresh in next call
cache.RevokeKeysCount.ShouldBe(2);
cache.CacheKeyCount.ShouldBe(2);
- await (Task>)memoizer.Memoize(dataSource, ThingifyTaskRevokabkle, new object[] { "someString" }, GetCachingSettings());
+ await (Task