Ejemplo n.º 1
0
        public void AdapterGetVersionTest()
        {
            var settings = new Mock <ISettings>();

            settings.Setup(x => x.EventStateFilePath).Returns(".");

            var streamListenerManager = new StreamListenerManager(settings.Object);

            streamListenerManager.StateManager = _state.Object;
            var service = new Mock <IServiceFacade>();

            service.Setup(x => x.IsConnected).Returns(true);
            var connector = new Mock <IAdapterPlugin>();
            var listener  = new Mock <IListener>();

            settings.Setup(s => s.FixtureCheckerFrequency).Returns(10000);
            service.Setup(s => s.Connect());

            var adapter = new Adapter(
                settings.Object,
                service.Object,
                connector.Object,
                streamListenerManager);

            adapter.Start();
            adapter.Stop();

            var adapterVersionInfo = AdapterVersionInfo.GetAdapterVersionInfo();

            adapterVersionInfo.AdapterVersion.Should().NotBeNullOrEmpty();
            adapterVersionInfo.UdapiSDKVersion.Should().NotBeNullOrEmpty();
        }
Ejemplo n.º 2
0
        private ServiceModelInterface.IAdapterStatus GetAdapterStatus()
        {
            var adapterVersionInfo = AdapterVersionInfo.GetAdapterVersionInfo();

            return(new ServiceModel.AdapterStatus
            {
                AdapterVersion = adapterVersionInfo.AdapterVersion,
                PluginName = adapterVersionInfo.PluginName,
                PluginVersion = adapterVersionInfo.PluginVersion,
                UdapiSDKVersion = adapterVersionInfo.UdapiSDKVersion,
                MemoryUsage = GC.GetTotalMemory(false).ToString(),
                RunningThreads = Process.GetCurrentProcess().Threads.Count.ToString()
            });
        }
Ejemplo n.º 3
0
        private void PopuplateAdapterVersionInfo()
        {
            var adapterVersionInfo = AdapterVersionInfo.GetAdapterVersionInfo() as AdapterVersionInfo;

            var executingAssembly      = Assembly.GetExecutingAssembly();
            var version                = executingAssembly.GetName().Version;
            var adapterAssemblyVersion = version.ToString();

            adapterVersionInfo.AdapterVersion = adapterAssemblyVersion;

            var sdkAssembly      = Assembly.GetAssembly(typeof(ISession));
            var sdkVersion       = sdkAssembly.GetName().Version;
            var sdkVersionString = sdkVersion.ToString();

            adapterVersionInfo.UdapiSDKVersion = sdkVersionString;

            if (_platformConnector != null)
            {
                var pluginAssembly = Assembly.GetAssembly(_platformConnector.GetType());
                adapterVersionInfo.PluginName    = pluginAssembly.GetName().Name;
                adapterVersionInfo.PluginVersion = pluginAssembly.GetName().Version.ToString();
            }
        }
Ejemplo n.º 4
0
        private void LogVersions()
        {
            var adapterVersionInfo = AdapterVersionInfo.GetAdapterVersionInfo();

            _logger.InfoFormat("Sporting Solutions Adapter version={0} using Sporting Solutions SDK version={1}, with plugin={2} pluginVersion={3}", adapterVersionInfo.AdapterVersion, adapterVersionInfo.UdapiSDKVersion, adapterVersionInfo.PluginName, adapterVersionInfo.PluginVersion);
        }
Ejemplo n.º 5
0
 public IAdapterVersion GetAdapterVersion()
 {
     return(AdapterVersionInfo.GetAdapterVersionInfo());
 }