aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/Properties/Settings.Designer.cs
blob: fb4440018a51e4d813f97b20488e5d0638c4b1d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Tango.PPC.Power.Properties {
    
    
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
        
        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
        
        public static Settings Default {
            get {
                return defaultInstance;
            }
        }
    }
}
span> { [TestClass] [TestCategory("Remote Runner")] public class RemoteRunner_TST { [TestMethod] public void Run_Remote_Runner_Connect_Upload_And_Execute_Process() { Process runner = Process.Start(Path.Combine(Helper.GetBuildPath(), "Tango.RemoteRunner.UI.exe")); runner.WaitForInputIdle(); Thread.Sleep(2000); UdpDiscoveryClient<BasicDiscoveryMessage> discoveryClient = new UdpDiscoveryClient<BasicDiscoveryMessage>(2018); var discoveryResponse = discoveryClient.Discover().Result; ITransportAdapter adapter = new TcpTransportAdapter(discoveryResponse.Address, discoveryResponse.Message.Port); ITransporter transporter = new BasicTransporter(adapter); transporter.Connect().Wait(); Thread.Sleep(1000); String uploadFileName = "RemoteRunnerExeTest.zip"; String executeFileName = "RemoteRunnerExeTest.exe"; System.IO.FileInfo exeFile = new System.IO.FileInfo(Helper.GetResourcePath(uploadFileName)); var uploadResponse = transporter.SendRequest<FileUploadRequest, FileUploadResponse>(new FileUploadRequest() { Path = uploadFileName, Length = exeFile.Length, }).Result.Message; int currentFilePosition = 0; do { using (FileStream fs = new FileStream(exeFile.FullName, FileMode.Open)) { fs.Position = currentFilePosition; FileChunkUploadRequest chunkRequest = new FileChunkUploadRequest(); chunkRequest.UploadID = uploadResponse.UploadID; long remaining = exeFile.Length - currentFilePosition; byte[] buffer = new byte[uploadResponse.MaxChunkLength < remaining ? uploadResponse.MaxChunkLength : remaining]; fs.Read(buffer, 0, buffer.Length); chunkRequest.Buffer = ByteString.CopyFrom(buffer); transporter.SendRequest<FileChunkUploadRequest, FileChunkUploadResponse>(chunkRequest).Wait(); currentFilePosition += buffer.Length; } } while (currentFilePosition < exeFile.Length); Thread.Sleep(1000); var response = transporter.SendRequest<ExecuteProcessRequest, ExecuteProcessResponse>(new ExecuteProcessRequest() { UploadID = uploadResponse.UploadID, FileName = executeFileName, }, TimeSpan.FromSeconds(30)).Result.Message; Thread.Sleep(5000); transporter.SendRequest<KillProcessRequest, KillProcessResponse>(new KillProcessRequest() { ProcessID = response.ProcessID, }).Wait(); transporter.Disconnect().Wait(); runner.Kill(); } } }