예제 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ThreadException += OnThreadException;
            AppDomain.CurrentDomain.UnhandledException += OnDomainException;

            NetworkSettings.EnableAllSecurityProtocols();
            NetworkSettings.IgnoreServerCertificateValidation();
            Application.Run(new MainForm());
        }
예제 #2
0
        public static void AssemblyInitialize(TestContext context)
        {
            // Check if .runsettings is configured properly
            EnsurePropertiesSet(context.Properties,
                                "ignoreServerCertificateValidation",
                                "webAppUrl",
                                "userName",
                                "password",
                                "sharedSpaceId",
                                "workspaceId");

            var ignoreServerCertificateValidation = context.Properties["ignoreServerCertificateValidation"].ToString();

            if (ignoreServerCertificateValidation != null && ignoreServerCertificateValidation.ToLower().Equals("true"))
            {
                NetworkSettings.IgnoreServerCertificateValidation();
            }
            NetworkSettings.EnableAllSecurityProtocols();

            OctaneConfiguration.Url      = context.Properties["webAppUrl"].ToString();
            OctaneConfiguration.Username = context.Properties["userName"].ToString();
            OctaneConfiguration.Password = context.Properties["password"].ToString();

            var connectionInfo = new UserPassConnectionInfo(OctaneConfiguration.Username, OctaneConfiguration.Password);

            RestConnector.Connect(OctaneConfiguration.Url, connectionInfo);

            var sharedSpaceId = int.Parse(context.Properties["sharedSpaceId"].ToString());
            var workspaceId   = int.Parse(context.Properties["workspaceId"].ToString());

            WorkspaceContext = new WorkspaceContext(sharedSpaceId, workspaceId);
            OctaneConfiguration.WorkSpaceId = WorkspaceContext.WorkspaceId;

            var sharedSpaceContext = new SharedSpaceContext(sharedSpaceId);

            OctaneConfiguration.SharedSpaceId = sharedSpaceContext.SharedSpaceId;

            OctaneConfiguration.SsoLogin        = bool.Parse(context.Properties["ssoLogin"].ToString());
            OctaneConfiguration.CredentialLogin = bool.Parse(context.Properties["credentialLogin"].ToString());

            User = GetWorkspaceUser();

            CurrentRelease = ReleaseUtilities.CreateRelease();

            // create the octaneservices object to be used by the tests
            OctaneServices.Create(OctaneConfiguration.Url,
                                  OctaneConfiguration.SharedSpaceId,
                                  OctaneConfiguration.WorkSpaceId);

            OctaneServices.GetInstance().Connect();
        }
        public static void InitConnection(TestContext context)
        {
            if (!restConnector.IsConnected())
            {
                string ignoreServerCertificateValidation = ConfigurationManager.AppSettings["ignoreServerCertificateValidation"];
                if (ignoreServerCertificateValidation != null && ignoreServerCertificateValidation.ToLower().Equals("true"))
                {
                    NetworkSettings.IgnoreServerCertificateValidation();
                }
                NetworkSettings.EnableAllSecurityProtocols();

                host = ConfigurationManager.AppSettings["webAppUrl"];

                // If webAppUrl is empty we do not try to connect.
                if (string.IsNullOrWhiteSpace(host))
                {
                    return;
                }

                ConnectionInfo connectionInfo;
                string         clientId = ConfigurationManager.AppSettings["clientId"];
                if (clientId != null)
                {
                    userName       = clientId;
                    connectionInfo = new APIKeyConnectionInfo(clientId, ConfigurationManager.AppSettings["clientSecret"]);
                }
                else
                {
                    userName       = ConfigurationManager.AppSettings["userName"];
                    password       = ConfigurationManager.AppSettings["password"];
                    connectionInfo = new UserPassConnectionInfo(userName, password);
                }

                lwssoAuthenticationStrategy = new LwssoAuthenticationStrategy(connectionInfo);
                restConnector.Connect(host, lwssoAuthenticationStrategy);


                var sharedSpaceId = int.Parse(ConfigurationManager.AppSettings["sharedSpaceId"]);
                var workspaceId   = int.Parse(ConfigurationManager.AppSettings["workspaceId"]);

                workspaceContext   = new WorkspaceContext(sharedSpaceId, workspaceId);
                sharedSpaceContext = new SharedSpaceContext(sharedSpaceId);
            }
        }
예제 #4
0
        public ALMOctaneConnection(string host, string userName, string password, string sharedSpaceId, string workspaceId)
        {
            RestConnector = new RestConnector();
            EntityService = new EntityService(RestConnector);
            SharedspaceId = sharedSpaceId;
            WorkspaceId   = workspaceId;

            LwssoAuthenticationStrategy lwssoAuthenticationStrategy;

            //WorkspaceContext workspaceContext;
            //SharedSpaceContext sharedSpaceContext;

            NetworkSettings.IgnoreServerCertificateValidation();
            NetworkSettings.EnableAllSecurityProtocols();

            ConnectionInfo connectionInfo;

            connectionInfo = new UserPassConnectionInfo(userName, password);
            lwssoAuthenticationStrategy = new LwssoAuthenticationStrategy(connectionInfo);
            RestConnector.Connect(host, lwssoAuthenticationStrategy);
            //workspaceContext = new WorkspaceContext(sharedSpaceId, workspaceId);
            //sharedSpaceContext = new SharedSpaceContext(sharedSpaceId);
        }
예제 #5
0
        private void TestConnectionButton_OnClick(object sender, RoutedEventArgs e)
        {
            NetworkSettings.EnableAllSecurityProtocols();
            NetworkSettings.IgnoreServerCertificateValidation();
            RestConnector.AwaitContinueOnCapturedContext = false;

            ReadFields();
            try
            {
                ConnectionCreator.CheckMissingValues(_conDetails);
                ConnectionCreator.CreateOctaneConnection(_conDetails);
                ConnectionCreator.CreateTfsConnection(_conDetails);
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message, "ALM Octane", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                ErrorMessageWindow.Show("ALM Octane", ex.Message);
                return;
            }

            Helper.CheckedConnection = true;

            MessageBox.Show("Connection successfull", "ALM Octane", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
        }
예제 #6
0
 private static void InitRestConnector()
 {
     NetworkSettings.EnableAllSecurityProtocols();
     NetworkSettings.IgnoreServerCertificateValidation();
     RestConnector.AwaitContinueOnCapturedContext = false;
 }
예제 #7
0
 private void ThisAddIn_Startup(object sender, System.EventArgs e)
 {
     NetworkSettings.EnableAllSecurityProtocols();
     NetworkSettings.IgnoreServerCertificateValidation();
     RestConnector.AwaitContinueOnCapturedContext = false;
 }