/// <summary> /// Loads the configuration and initializes the form. /// </summary> public MainForm() { InitializeComponent(); this.Icon = ClientUtils.GetAppIcon(); m_configuration = GuiUtils.DoStartupChecks("Opc.Ua.ServerTestTool", ApplicationType.Client, null, true); if (m_configuration != null) { GuiUtils.OverrideUaTcpImplementation(m_configuration); GuiUtils.DisplayUaTcpImplementation(this, m_configuration); } m_configuration.CertificateValidator.CertificateValidation += new CertificateValidationEventHandler(CertificateValidator_CertificateValidation); m_testConfiguration = ServerTestConfiguration.Load(m_configuration.Extensions); // allow UA servers to use the same certificate for HTTPS validation. ApplicationInstance.SetUaValidationForHttps(m_configuration.CertificateValidator); TestCasesCTRL.Initialize(m_testConfiguration); // get list of cached endpoints. m_endpoints = m_configuration.LoadCachedEndpoints(true); EndpointsCTRL.Initialize(m_endpoints, m_configuration); // create the test client. m_testClient = new ServerTestClient(m_configuration); m_testClient.ReportResult += new EventHandler <ServerTestClient.ReportResultEventArgs>(TestClient_ReportTestResult); m_testClient.ReportProgress += new EventHandler <ServerTestClient.ReportProgressEventArgs>(TestClient_ReportTestProgress); }
public MainForm() { InitializeComponent(); this.Icon = ClientUtils.GetAppIcon(); CreateClient(false, 1024); TestCancelMI.Enabled = false; TestCasesCTRL.Initialize(m_client.SequenceToExecute); m_endpoints = new ConfiguredEndpointCollection(m_configuration); m_endpointsToTest = new Queue <ConfiguredEndpoint>(); m_clientsToTest = new Queue <ClientOptions>(); CreateCertificate(false, 1024); CreateCertificate(true, 1024); CreateCertificate(false, 2048); CreateCertificate(true, 2048); AddTcpEndpoint(12001, MessageSecurityMode.None, SecurityPolicies.None, 2048, true); AddTcpEndpoint(12001, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic128Rsa15, 2048, true); AddTcpEndpoint(12001, MessageSecurityMode.Sign, SecurityPolicies.Basic128Rsa15, 2048, true); AddTcpEndpoint(12001, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic256, 2048, true); AddTcpEndpoint(12001, MessageSecurityMode.Sign, SecurityPolicies.Basic256, 2048, true); AddHttpEndpoint(10000, MessageSecurityMode.None, SecurityPolicies.None, false, 1024); AddHttpEndpoint(10000, MessageSecurityMode.None, SecurityPolicies.None, true, 1024); AddHttpEndpoint(10000, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic128Rsa15, false, 1024); AddHttpEndpoint(10000, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic128Rsa15, true, 1024); AddHttpEndpoint(10000, MessageSecurityMode.Sign, SecurityPolicies.Basic128Rsa15, false, 1024); AddHttpEndpoint(10000, MessageSecurityMode.Sign, SecurityPolicies.Basic128Rsa15, true, 1024); AddHttpEndpoint(10000, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic256, false, 1024); AddHttpEndpoint(10000, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic256, true, 1024); AddHttpEndpoint(10000, MessageSecurityMode.Sign, SecurityPolicies.Basic256, false, 1024); AddHttpEndpoint(10000, MessageSecurityMode.Sign, SecurityPolicies.Basic256, true, 1024); AddTcpEndpoint(12000, MessageSecurityMode.None, SecurityPolicies.None, 1024, true); AddTcpEndpoint(12000, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic128Rsa15, 1024, true); AddTcpEndpoint(12000, MessageSecurityMode.Sign, SecurityPolicies.Basic128Rsa15, 1024, true); AddTcpEndpoint(12000, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic256, 1024, true); AddTcpEndpoint(12000, MessageSecurityMode.Sign, SecurityPolicies.Basic256, 1024, true); AddTcpEndpoint(11000, MessageSecurityMode.None, SecurityPolicies.None, 1024, false); AddTcpEndpoint(11000, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic128Rsa15, 1024, false); AddTcpEndpoint(11000, MessageSecurityMode.Sign, SecurityPolicies.Basic128Rsa15, 1024, false); AddTcpEndpoint(11000, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic256, 1024, false); AddTcpEndpoint(11000, MessageSecurityMode.Sign, SecurityPolicies.Basic256, 1024, false); AddTcpEndpoint(11001, MessageSecurityMode.None, SecurityPolicies.None, 2048, false); AddTcpEndpoint(11001, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic128Rsa15, 2048, false); AddTcpEndpoint(11001, MessageSecurityMode.Sign, SecurityPolicies.Basic128Rsa15, 2048, false); AddTcpEndpoint(11001, MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic256, 2048, false); AddTcpEndpoint(11001, MessageSecurityMode.Sign, SecurityPolicies.Basic256, 2048, false); EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration); }
/// <summary> /// Loads the test configuration from a file. /// </summary> private void LoadConfiguration(string filePath) { // load the new configuration. m_testConfiguration = ServerTestConfiguration.Load(filePath, m_testConfiguration); // update the file list. Utils.UpdateRecentFileList("Server Test Client", filePath, 4); // update the control. TestCasesCTRL.Initialize(m_testConfiguration); }