コード例 #1
0
 public VirtualArsenalFilesLocatorService(IConfigurationService configurationService, IDirectoryWrapper directoryWrapper, IEnvironmentWrapper environmentWrapper, IFileWrapper fileWrapper)
 {
     _configurationService = configurationService;
     _directoryWrapper     = directoryWrapper;
     _environmentWrapper   = environmentWrapper;
     _fileWrapper          = fileWrapper;
 }
コード例 #2
0
 public WebConfigTransformBuildpack(
     IEnvironmentWrapper environmentWrapper,
     IConfigurationFactory configurationFactory,
     IFileWrapper fileWrapper,
     IXmlDocumentWrapper xmlDocumentWrapper)
 {
     _environmentWrapper   = environmentWrapper;
     _configurationFactory = configurationFactory;
     _fileWrapper          = fileWrapper;
     _xmlDocumentWrapper   = xmlDocumentWrapper;
 }
コード例 #3
0
 public LambdaService(IEnvironmentWrapper env,
                      IResponseWrapper responseWrapper,
                      IDynamoDbContextWrapper dynamoDbContext,
                      IAmazonApiGatewayManagementApi apiGatewayManagementApi,
                      IAmazonIotData amazonIotData)
 {
     _env                     = env;
     _responseWrapper         = responseWrapper;
     _dynamoDbContext         = dynamoDbContext;
     _apiGatewayManagementApi = apiGatewayManagementApi;
     _amazonIotData           = amazonIotData;
 }
コード例 #4
0
 public ConnectionParamProvider(IEnvironmentWrapper env)
 {
     HostName = env.GetValue("hostname", "localhost");
     if (!int.TryParse(env.GetValue("port", ""), out int port))
     {
         port = 1;
     }
     Port         = port;
     VirtualHost  = env.GetValue("virtualhost", "/");
     ExchangeName = env.GetValue("exchangename", "DefaultExchange");
     QueueName    = env.GetValue("queuename", "DefaultQueue");;
     RoutingKey   = env.GetValue("RoutingKey", "");
 }
コード例 #5
0
ファイル: Program.cs プロジェクト: kapiya/Warewolf
            public Implementation(IArgs options, Config implConfig)
            {
                _options     = options;
                _logger      = implConfig.ExecutionLoggerFactory.New(new JsonSerializer(), new WebSocketPool());
                _writer      = implConfig.Writer;
                _filePath    = implConfig.FilePath;
                _environment = implConfig.EnvironmentWrapper;

                _serverProxyFactory               = implConfig.ServerProxyFactory;
                _resourceCatalogProxyFactory      = implConfig.ResourceCatalogProxyFactory;
                _workerContextFactory             = implConfig.WorkerContextFactory;
                _triggersCatalogFactory           = implConfig.TriggersCatalogFactory;
                _fileSystemWatcherFactory         = implConfig.FileSystemWatcherFactory;
                _queueWorkerImplementationFactory = implConfig.QueueWorkerImplementationFactory;
            }
        public void ApplyXmlTransformation(string buildPath, IEnvironmentWrapper environmentWrapper, IWebConfigWriter webConfigWriter)
        {
            if (webConfigWriter == null)
            {
                throw new ArgumentNullException(nameof(webConfigWriter), "WebConfig writer is required");
            }

            var transformationKey = environmentWrapper.GetEnvironmentVariable(Constants.XML_TRANSFORM_KEY_NM) ?? "Release";

            var transformFilePath = Path.Combine(buildPath, $"web.{transformationKey}.config");

            if (File.Exists(transformFilePath))
            {
                webConfigWriter.ExecuteXmlTransformation(transformFilePath);
            }
        }
コード例 #7
0
        internal Option <string> ParseURI(string uri, IEnvironmentWrapper env)
        {
            Option <string> parsedURI = Option.None <string>();

            Match matchHost = ImageUpstreamRegex.Match(uri);

            if (matchHost.Success &&
                (matchHost.Groups["post"]?.Length > 0))
            {
                string hostAddress = env.GetVariable(Core.Constants.GatewayHostnameVariableName).
                                     Expect(() => new InvalidOperationException($"Could not find environment variable: {Core.Constants.GatewayHostnameVariableName}"));

                parsedURI = Option.Some(matchHost.Groups["pre"].Value + hostAddress + matchHost.Groups["post"].Value);
            }

            return(parsedURI);
        }
コード例 #8
0
        internal static string ValidateAndGetImage(string image, IEnvironmentWrapper env)
        {
            image = Preconditions.CheckNonWhiteSpace(image, nameof(image)).Trim();

            if (image[0] == '$')
            {
                Match matchHost = ImageUpstreamRegex.Match(image);
                if (matchHost.Success &&
                    (matchHost.Groups["path"]?.Length > 0))
                {
                    string hostAddress = env.GetVariable(Core.Constants.GatewayHostnameVariableName).
                                         Expect(() => new InvalidOperationException($"Could not find environment variable: {Core.Constants.GatewayHostnameVariableName}"));

                    image = hostAddress + matchHost.Groups["path"].Value;
                }
                else
                {
                    throw new ArgumentException($"Image {image} is not in the right format.If your intention is to use an environment variable, check the port is specified.");
                }
            }

            Match match = ImageRegex.Match(image);

            if (match.Success)
            {
                if (match.Groups["tag"]?.Length > 0)
                {
                    return(image);
                }
                else
                {
                    return(Invariant($"{image}:{Constants.DefaultTag}"));
                }
            }
            else
            {
                throw new ArgumentException($"Image {image} is not in the right format");
            }
        }
コード例 #9
0
 public FieldValueProvider(IEnvironmentWrapper environmentWrapper, IClock clock, IPickleIdStore pickleIdStore)
 {
     _environmentWrapper = environmentWrapper;
     _clock         = clock;
     _pickleIdStore = pickleIdStore;
 }
コード例 #10
0
 public ConfigurationTracer(IEnvironmentWrapper environmentWrapper, IConfigurationFactory configurationFactory, ILogger logger)
 {
     _configuration          = configurationFactory.GetConfiguration(environmentWrapper.GetEnvironmentVariable(Constants.ASPNETCORE_ENVIRONMENT_NM) ?? "Release");
     this.environmentWrapper = environmentWrapper;
     _logger = logger;
 }
コード例 #11
0
 public AnalyticsEventProvider(IUserUniqueIdStore userUniqueIdStore, UnitTestProviderConfiguration unitTestProviderConfiguration, IEnvironmentWrapper environmentWrapper)
 {
     _userUniqueIdStore  = userUniqueIdStore;
     _environmentWrapper = environmentWrapper;
     _unitTestProvider   = unitTestProviderConfiguration.UnitTestProvider;
 }
コード例 #12
0
 public SqlStreamReaderBuilder(IEnvironmentWrapper environmentWrapper)
 {
     this.environmentWrapper = environmentWrapper;
 }
コード例 #13
0
 public ProtobufFileNameResolver(ITestRunContext testRunContext, IEnvironmentWrapper environmentWrapper)
 {
     _testRunContext     = testRunContext;
     _environmentWrapper = environmentWrapper;
 }
コード例 #14
0
 public Function(IEnvironmentWrapper env, IAuthorizerFacade authorizerFacade)
 {
     _env = env;
     _authorizerFacade = authorizerFacade;
 }
コード例 #15
0
 public FileProbe(IEnvironmentWrapper environment, IFileSystemWrapper fileSystem, IHasher hasher)
 {
     this.environment = environment;
     this.fileSystem  = fileSystem;
     this.hasher      = hasher;
 }
コード例 #16
0
 public LambdaService(IEnvironmentWrapper env, IDynamoDBContext dynamoDbContext)
 {
     _env             = env;
     _dynamoDbContext = dynamoDbContext;
 }
コード例 #17
0
 public ConfigReader(IReporter reporter, IFileSystem fileSystem, IEnvironmentWrapper environmentWrapper)
 {
     this.reporter           = reporter;
     this.fileSystem         = fileSystem;
     this.environmentWrapper = environmentWrapper;
 }
コード例 #18
0
        private Implementation.Config SetupQueueWorkerImplementationConfings(out Mock <IWriter> mockWriter, out Mock <IExecutionLogPublisher> mockExecutionLogPublisher,
                                                                             IEnvironmentConnection environmentConnection, IResourceCatalogProxy resourceCatalogProxy, IWorkerContextFactory workerContextFactory, ITriggersCatalog triggersCatalog,
                                                                             IFilePath filePath, IFileSystemWatcherFactory fileSystemWatcherFactory, IQueueWorkerImplementationFactory queueWorkerImplementationFactory, IEnvironmentWrapper environmentWrapper)
        {
            mockWriter = new Mock <IWriter>();

            mockExecutionLogPublisher = new Mock <IExecutionLogPublisher>();
            var mockExecutionLoggerFactory = new Mock <IExecutionLoggerFactory>();

            mockExecutionLoggerFactory.Setup(o => o.New(It.IsAny <ISerializer>(), It.IsAny <IWebSocketPool>())).Returns(mockExecutionLogPublisher.Object);

            var mockResourceCatalogProxyFactory = new Mock <IResourceCatalogProxyFactory>();

            mockResourceCatalogProxyFactory.Setup(o => o.New(environmentConnection)).Returns(resourceCatalogProxy);

            var mockServerProxyFactory = new Mock <IServerProxyFactory>();

            mockServerProxyFactory.Setup(o => o.New(new Uri("https://localhost:3143/"))).Returns(environmentConnection);

            var mockTriggersCatalogFactory = new Mock <ITriggersCatalogFactory>();

            mockTriggersCatalogFactory.Setup(o => o.New()).Returns(triggersCatalog);

            var implConfig = new Implementation.Config
            {
                EnvironmentWrapper     = environmentWrapper,
                ExecutionLoggerFactory = mockExecutionLoggerFactory.Object,
                FilePath = filePath,
                FileSystemWatcherFactory         = fileSystemWatcherFactory,
                QueueWorkerImplementationFactory = queueWorkerImplementationFactory,
                ResourceCatalogProxyFactory      = mockResourceCatalogProxyFactory.Object,
                ServerProxyFactory     = mockServerProxyFactory.Object,
                TriggersCatalogFactory = mockTriggersCatalogFactory.Object,
                WorkerContextFactory   = workerContextFactory,
                Writer = mockWriter.Object
            };

            return(implConfig);
        }
コード例 #19
0
 private Logger(string name)
 {
     _environmentWrapper = EnvironmentWrapper.Instance;
     _name = name;
 }
コード例 #20
0
 public LambdaService(IEnvironmentWrapper env, IResponseWrapper responseWrapper)
 {
     _env             = env;
     _responseWrapper = responseWrapper;
 }
コード例 #21
0
ファイル: PathWrapper.cs プロジェクト: Korthax/Cake.Path
 internal PathWrapper(ICakeLog log, IEnvironmentWrapper environmentWrapper)
 {
     _log = log;
     _environmentWrapper = environmentWrapper;
 }
コード例 #22
0
 public FunctionTests()
 {
     _env = EnvironmentWrapper.Instance;
     _authorizerFacade = new Mock <IAuthorizerFacade>();
     _testObject       = new Function(_env, _authorizerFacade.Object);
 }
コード例 #23
0
 public FileProbe(IEnvironmentWrapper environment, IFileSystemWrapper fileSystem)
 {
     this.environment = environment;
     this.fileSystem  = fileSystem;
 }
コード例 #24
0
 public DefaultTestRunContext(IEnvironmentWrapper environmentWrapper)
 {
     _environmentWrapper = environmentWrapper;
 }
コード例 #25
0
ファイル: FileProbe.cs プロジェクト: miparnisari/chutzpah
 public FileProbe(IEnvironmentWrapper environment, IFileSystemWrapper fileSystem)
 {
     this.environment = environment;
     this.fileSystem = fileSystem;
 }
コード例 #26
0
 public TokenConfigService(IEnvironmentWrapper env, IJsonWebKeyService jwkService, IJsonWebKeyClient jwkClient)
 {
     _env        = env;
     _jwkService = jwkService;
     _jwkClient  = jwkClient;
 }