Ejemplo n.º 1
0
        public TimeSpan ExecutionDelay = new TimeSpan(0, 0, 10);    // Delay between checking queue and attempting to run items

        /// <summary>
        /// Custom SQL Query Retrieves Scheduling Information for the scheduler...
        /// </summary>
        /// <returns></returns>
        public ArrayList RetrieveTestScheduleInformation( )
        {
            ArrayList runItems = new ArrayList( );

            string testCommand = "SELECT TestID,RunFrequency FROM " + dbConnection.TestTable;

            SqlCommand cmd = new SqlCommand(testCommand, dbConnection.SqlDataConnection);

            SqlDataReader dataReader = cmd.ExecuteReader( );

            // Read all items matching the criteria...
            while (dataReader.Read( ))
            {
                RunItem runItem = new RunItem( );

                runItem.TestID    = dataReader["TestID"].ToString( );
                runItem.Frequency = dataReader["RunFrequency"].ToString( );

                runItems.Add(runItem);
            }

            dataReader.Close( );

            return(runItems);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Determines if a RunItem is in the execution queue...
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private bool IsRunItemInQueue(RunItem item)
        {
            foreach (QueueEntry entry in ExecutionQueue)
            {
                if (entry.TestInformation.ID == item.TestID)
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        private void SendEmail(RunItem item, bool bSuccess)
        {
            // Perform a query on the Test ID to get the Test object back...
            Test testInfo = dbConnection.RetrieveTest(item.TestID);

            String successString;

            User testOwner = dbConnection.RetrieveUser(testInfo.OwnerID);

            if (bSuccess)
            {
                successString = "SUCCESS";
            }
            else
            {
                successString = "FAILURE";
            }

            String emailSubject = "TEST CASE \"" + testInfo.Name + "\" " + successString;

            String emailMessage = emailSubject + "\n\n";

            emailMessage += "DETAILS:\n";
            emailMessage += "RUNTIME: " + DateTime.Now.ToString( ) + "\n";
            emailMessage += "ID: " + testInfo.ID + "\n";
            emailMessage += "NAME: " + testInfo.Name + "\n";
            emailMessage += "OWNER: " + testOwner.Name + "\n";

            emailMessage += "\n\nPlease check any failing tests at the following server: \n";
            emailMessage += "\t" + Environment.MachineName;

            SendMailMessage(testOwner.Name + "@" + EmailSuffix,
                            "testtracker@" + Environment.MachineName,
                            emailSubject,
                            emailMessage,
                            EmailSMTP);
        }
Ejemplo n.º 4
0
        private void SendEmail( RunItem item, bool bSuccess )
        {
            // Perform a query on the Test ID to get the Test object back...
            Test testInfo = dbConnection.RetrieveTest( item.TestID );

            String successString;

            User testOwner = dbConnection.RetrieveUser( testInfo.OwnerID );

            if ( bSuccess )
                successString = "SUCCESS";
            else
                successString = "FAILURE";

            String emailSubject = "TEST CASE \"" + testInfo.Name + "\" " + successString;

            String emailMessage = emailSubject + "\n\n";

            emailMessage += "DETAILS:\n";
            emailMessage += "RUNTIME: " + DateTime.Now.ToString( ) + "\n";
            emailMessage += "ID: " + testInfo.ID + "\n";
            emailMessage += "NAME: " + testInfo.Name + "\n";
            emailMessage += "OWNER: " + testOwner.Name + "\n";

            emailMessage += "\n\nPlease check any failing tests at the following server: \n";
            emailMessage += "\t" + Environment.MachineName;

            SendMailMessage( testOwner.Name + "@" + EmailSuffix,
                "testtracker@" + Environment.MachineName,
                emailSubject,
                emailMessage,
                EmailSMTP );
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Determines if a RunItem is in the execution queue...
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private bool IsRunItemInQueue( RunItem item )
        {
            foreach( QueueEntry entry in ExecutionQueue )
            {
                if ( entry.TestInformation.ID == item.TestID )
                    return true;
            }

            return false;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Custom SQL Query Retrieves Scheduling Information for the scheduler...
        /// </summary>
        /// <returns></returns>
        public ArrayList RetrieveTestScheduleInformation( )
        {
            ArrayList runItems = new ArrayList( );

            string testCommand = "SELECT TestID,RunFrequency FROM " + dbConnection.TestTable;

            SqlCommand cmd = new SqlCommand( testCommand, dbConnection.SqlDataConnection );

            SqlDataReader dataReader = cmd.ExecuteReader( );

            // Read all items matching the criteria...
            while ( dataReader.Read( ) )
            {
                RunItem runItem = new RunItem( );

                runItem.TestID = dataReader["TestID"].ToString( );
                runItem.Frequency = dataReader["RunFrequency"].ToString( );

                runItems.Add( runItem );
            }

            dataReader.Close( );

            return runItems;
        }