Beispiel #1
0
        public void SecuritySymmetricEncryptionEventTest()
        {
            string eventName = "SecurityCryptoSymmetricEncryptionEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecuritySymmetricEncryptionEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
Beispiel #2
0
        public void SecurityProfileLoadEventTest()
        {
            string eventName = "SecurityProfileLoadEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecurityProfileLoadEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
Beispiel #3
0
        public void SecurityCryptoHashFailureEventTest()
        {
            string           eventName = "SecurityCryptoHashCheckFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecurityCryptoHashFailureEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
Beispiel #4
0
        public void SecurityAuthenticationCheckEventTest()
        {
            string           eventName = "SecurityAuthenticationCheckEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecurityAuthenticationCheckEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
Beispiel #5
0
        public void SecurityCryptoHashFailureEventTest()
        {
            string eventName = "SecurityCryptoHashCheckFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecurityCryptoHashFailureEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
Beispiel #6
0
        public void SecurityAuthenticationCheckEventTest()
        {
            string eventName = "SecurityAuthenticationCheckEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecurityAuthenticationCheckEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
Beispiel #7
0
        public void SecurityAuthorizationFailedEventTest()
        {
            string           eventName = "SecurityAuthorizationFailedEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecurityAuthorizationFailedEvent);

            base.FireMessageToWMI(eventName, action, "Message = \"" + testMessage + ":" + "action" + "\"");
        }
Beispiel #8
0
        public void SecurityAuthorizationFailedEventTest()
        {
            string eventName = "SecurityAuthorizationFailedEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecurityAuthorizationFailedEvent);

            base.FireMessageToWMI(eventName, action, "Message = \"" + testMessage + ":" + "action" + "\"");
        }
Beispiel #9
0
        public void LoggingServiceFailureEventTest()
        {
            string           eventName = "LoggingServiceFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireLoggingServiceFailureEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
        public void LoggingServiceFailureEventTest()
        {
            string eventName = "LoggingServiceFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireLoggingServiceFailureEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
Beispiel #11
0
        public void SecuritySymmetricDecryptionEventTest()
        {
            string           eventName = "SecurityCryptoSymmetricDecryptionEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecuritySymmetricDecryptionEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
Beispiel #12
0
        public void SecurityProfileLoadEventTest()
        {
            string           eventName = "SecurityProfileLoadEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecurityProfileLoadEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
Beispiel #13
0
        public void ConfigFailureTest()
        {
            string eventName = "ExceptionHandlingConfigFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireExceptionHandlingConfigFailureEvent);

            string expected = "Message = \"\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #14
0
        public void CachingServiceInternalFailureEventTestWithException()
        {
            string eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceInternalFailureEventWithException);

            string expected = "ExceptionMessage = \"System.Exception: test exception\";\n\tExceptionStackTrace = NULL;\n\tMessage = \"test\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #15
0
        public void CachingServiceCacheScavengedEventTest()
        {
            string eventName = "CachingServiceCacheScavengedEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceCacheScavengedEvent);

            string expected = "ConfiguredSizeLimit = \"1\";\n\tMessage = \"\";\n\tNumberOfItemRemoved = \"1\";\n\tScavengingRange = 1;\n\t";
            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #16
0
        public void CachingServiceInternalFailureEventTest()
        {
            string eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceInternalFailureEvent);

            string expected = "Message = \"test\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
        public void DataServiceFailureEventTest()
        {
            string eventName = "DataServiceFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireDataServiceFailureEvent);

            string expected = "ExceptionMessage = \"System.Exception: test\";\n\tExceptionStackTrace = NULL;";
            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #18
0
        public void CachingServiceCacheFlushedEventTest()
        {
            string eventName = "CachingServiceCacheFlushedEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceCacheFlushedEvent);

            string expected = "Message = \"\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
        public void DataConnectionOpenedEventTest()
        {
            string eventName = "DataConnectionOpenedEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireDataConnectionOpenedEvent);

            string expected = "Message = \"Data Connection opened: test connection\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
        public void DataServiceConfigFailureEventTest()
        {
            string eventName = "DataServiceConfigFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireDataServiceConfigFailureEvent);

            string expected = "ExceptionMessage = \"System.Exception: test\";\n\tExceptionStackTrace = NULL;\n\tFailedConfigurationFile = \"ConnectionSettings.config\";\n\tMessage = \"test\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #21
0
        public void DataConnectionFailedEventTest()
        {
            string           eventName = "DataConnectionFailedEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireDataConnectionFailedEvent);

            string expected = "Message = \"Data connection failed to open: test connection\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #22
0
        public void ConfigFailureTest()
        {
            string           eventName = "ExceptionHandlingConfigFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireExceptionHandlingConfigFailureEvent);

            string expected = "Message = \"\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #23
0
        public void CachingServiceCacheFlushedEventTest()
        {
            string           eventName = "CachingServiceCacheFlushedEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireCachingServiceCacheFlushedEvent);

            string expected = "Message = \"\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #24
0
        public void CachingServiceCacheScavengedEventTest()
        {
            string           eventName = "CachingServiceCacheScavengedEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireCachingServiceCacheScavengedEvent);

            string expected = "ConfiguredSizeLimit = \"1\";\n\tMessage = \"\";\n\tNumberOfItemRemoved = \"1\";\n\tScavengingRange = 1;\n\t";

            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #25
0
        public void DataTransactionRolledBackEventTest()
        {
            string           eventName = "DataTransactionRolledBackEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireDataTransactionRolledBackEvent);

            string expected = "Message = \"Connection: test connection\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #26
0
        public void DataServiceFailureEventTest()
        {
            string           eventName = "DataServiceFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireDataServiceFailureEvent);

            string expected = "ExceptionMessage = \"System.Exception: test\";\n\tExceptionStackTrace = NULL;";

            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #27
0
        public void CachingServiceInternalFailureEventTest()
        {
            string           eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireCachingServiceInternalFailureEvent);

            string expected = "Message = \"test\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #28
0
        public void CachingServiceInternalFailureEventTestWithException()
        {
            string           eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireCachingServiceInternalFailureEventWithException);

            string expected = "ExceptionMessage = \"System.Exception: test exception\";\n\tExceptionStackTrace = NULL;\n\tMessage = \"test\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #29
0
        public void DataServiceConfigFailureEventTest()
        {
            string           eventName = "DataServiceConfigFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireDataServiceConfigFailureEvent);

            string expected = "ExceptionMessage = \"System.Exception: test\";\n\tExceptionStackTrace = NULL;\n\tFailedConfigurationFile = \"ConnectionSettings.config\";\n\tMessage = \"test\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
Beispiel #30
0
        public void FireMessageToWMI(string eventName, WmiEventDelegate action, string expected)
        {
            ManagementScope scope = new ManagementScope(@"\\." + WmiPath);
            scope.Options.EnablePrivileges = true;

            EventQuery eq = new EventQuery("SELECT * FROM " + eventName);

            using (ManagementEventWatcher watcher = new ManagementEventWatcher(scope, eq))
            {
                watcher.EventArrived += new EventArrivedEventHandler(WatcherEventArrived);
                watcher.Start();

                action();

                WaiUntilWMIEventArrives();
                watcher.Stop();
            }

            Assert.IsTrue(this.wmiLogged);
            Assert.IsTrue(this.wmiResult.IndexOf(expected) > -1);
        }
        public void FireMessageToWMI(string eventName, WmiEventDelegate action, string expected)
        {
            ManagementScope scope = new ManagementScope(@"\\." + WmiPath);

            scope.Options.EnablePrivileges = true;

            EventQuery eq = new EventQuery("SELECT * FROM " + eventName);

            using (ManagementEventWatcher watcher = new ManagementEventWatcher(scope, eq))
            {
                watcher.EventArrived += new EventArrivedEventHandler(WatcherEventArrived);
                watcher.Start();

                action();

                WaiUntilWMIEventArrives();
                watcher.Stop();
            }

            Assert.IsTrue(this.wmiLogged);
            Assert.IsTrue(this.wmiResult.IndexOf(expected) > -1);
        }
        public void DataTransactionRolledBackEventTest()
        {
            string eventName = "DataTransactionRolledBackEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireDataTransactionRolledBackEvent);

            string expected = "Message = \"Connection: test connection\"";
            base.FireMessageToWMI(eventName, action, expected);
        }