internal void CreatePackage(string rootPath) { Debug.Assert(!string.IsNullOrEmpty(rootPath), "rootPath cannot be null or empty."); Debug.Assert(Directory.Exists(rootPath), "rootPath does not exist."); _azureService = new AzureService(rootPath, null); string unused = null; _azureService.CreatePackage(DevEnv.Cloud, out unused, out unused); Debug.Assert(File.Exists(Path.Combine(rootPath, Resources.CloudPackageFileName))); }
public void CreateLocalPackageWithWorkerRoleTest() { using (FileSystemHelper files = new FileSystemHelper(this)) { string standardOutput; string standardError; AzureService service = new AzureService(files.RootPath, serviceName, null); service.AddWorkerRole(); service.CreatePackage(DevEnv.Local, out standardOutput, out standardError); AzureAssert.ScaffoldingExists(Path.Combine(service.Paths.LocalPackage, @"roles\WorkerRole1\approot"), Path.Combine(Resources.NodeScaffolding, Resources.WorkerRole)); } }
public string StartAzureEmulatorProcess(string rootPath) { string standardOutput; string standardError; StringBuilder message = new StringBuilder(); AzureService service = new AzureService(rootPath ,null); SafeWriteObject(string.Format(Resources.CreatingPackageMessage, "local")); service.CreatePackage(DevEnv.Local, out standardOutput, out standardError); SafeWriteObject(Resources.StartingEmulator); service.StartEmulator(Launch.ToBool(), out standardOutput, out standardError); SafeWriteObject(standardOutput); SafeWriteObject(Resources.StartedEmulator); return message.ToString(); }
public void CreateLocalPackageWithOneWebRoleTest() { using (FileSystemHelper files = new FileSystemHelper(this)) { string standardOutput; string standardError; AzureService service = new AzureService(files.RootPath, serviceName, null); RoleInfo webRoleInfo = service.AddWebRole(); string logsDir = Path.Combine(service.Paths.RootPath, webRoleInfo.Name, "server.js.logs"); string logFile = Path.Combine(logsDir, "0.txt"); string targetLogsFile = Path.Combine(service.Paths.LocalPackage, "roles", webRoleInfo.Name, @"approot\server.js.logs\0.txt"); files.CreateDirectory(logsDir); files.CreateEmptyFile(logFile); service.CreatePackage(DevEnv.Local, out standardOutput, out standardError); AzureAssert.ScaffoldingExists(Path.Combine(service.Paths.LocalPackage, @"roles\WebRole1\approot"), Path.Combine(Resources.NodeScaffolding, Resources.WebRole)); Assert.IsTrue(File.Exists(targetLogsFile)); } }