Exemplo n.º 1
0
        public void AssertThatApplicationIsNotRunning(AppIdentity appIdentity)
        {
            IApplicationPool applicationPool = _yamsDiModule.Container.Resolve <IApplicationPool>();

            Assert.False(applicationPool.HasApplication(appIdentity), $"App {appIdentity} should not be running!");
            Assert.False(Directory.Exists(Path.Combine(_applicationsInstallPath, ApplicationUtils.GetApplicationRelativePath(appIdentity))));
        }
Exemplo n.º 2
0
        public void AssertThatApplicationIsNotRunning(AppIdentity appIdentity)
        {
            IApplicationPool applicationPool = _diContainer.Resolve <IApplicationPool>();

            Assert.IsFalse(applicationPool.HasApplication(appIdentity), string.Format("App {0} should not be running!", appIdentity));
            Assert.IsFalse(Directory.Exists(Path.Combine(_applicationsInstallPath, ApplicationUtils.GetApplicationRelativePath(appIdentity))));
        }
Exemplo n.º 3
0
 public async Task DownloadApplication(AppIdentity appIdentity)
 {
     try
     {
         string destPath = Path.Combine(_applicationRootPath,
                                        ApplicationUtils.GetApplicationRelativePath(appIdentity));
         await
         _deploymentRepository.DownloadApplicationBinaries(appIdentity, destPath,
                                                           ConflictResolutionMode.OverwriteExistingBinaries);
     }
     catch (BinariesNotFoundException)
     {
         Trace.TraceError(
             $"{appIdentity} could not be downloaded because it was not found in the Yams repository");
     }
 }
Exemplo n.º 4
0
        public async Task DownloadApplication(AppIdentity appIdentity)
        {
            IRemoteDirectory appDeploymentDir =
                await _deploymentsRootDirectory.GetDirectory(appIdentity.Id);

            if (await appDeploymentDir.Exists())
            {
                IRemoteDirectory versionDir = await appDeploymentDir.GetDirectory(appIdentity.Version.ToString());

                if (await versionDir.Exists())
                {
                    await
                    versionDir.Download(Path.Combine(_applicationRootPath,
                                                     ApplicationUtils.GetApplicationRelativePath(appIdentity)));
                }
                return;
            }
            Trace.TraceError("{0} could not be downloaded because it was not found in the blob storage", appIdentity);
        }
Exemplo n.º 5
0
        public static string GetTestApplicationOutput(string applicationRootPath, AppIdentity appIdentity,
                                                      string exeName)
        {
            string processOutputPath = Path.Combine(Path.Combine(applicationRootPath,
                                                                 ApplicationUtils.GetApplicationRelativePath(appIdentity)), $"{exeName}.exe.out");

            int maxRetry = 10;

            while (maxRetry-- > 0)
            {
                Thread.Sleep(100);
                if (File.Exists(processOutputPath))
                {
                    break;
                }
            }

            using (StreamReader reader = new StreamReader(processOutputPath))
            {
                return(reader.ReadToEnd());
            }
        }
Exemplo n.º 6
0
 private string GetApplicationAbsolutePath(AppIdentity appIdentity)
 {
     return(Path.Combine(_applicationsRootPath, ApplicationUtils.GetApplicationRelativePath(appIdentity)));
 }