Exemplo n.º 1
0
        public void SecuritySymmetricEncryptionEventTest()
        {
            string eventName = "SecurityCryptoSymmetricEncryptionEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecuritySymmetricEncryptionEvent);

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

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

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

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

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

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

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

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

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

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

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

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

            string expected = "Message = \"\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 16
0
        public void CachingServiceInternalFailureEventTest()
        {
            string eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceInternalFailureEvent);

            string expected = "Message = \"test\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
Exemplo n.º 17
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);
        }
Exemplo n.º 18
0
        public void CachingServiceCacheFlushedEventTest()
        {
            string eventName = "CachingServiceCacheFlushedEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceCacheFlushedEvent);

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

            string expected = "Message = \"Data Connection opened: test connection\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
Exemplo n.º 20
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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 22
0
        public void ConfigFailureTest()
        {
            string           eventName = "ExceptionHandlingConfigFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireExceptionHandlingConfigFailureEvent);

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

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

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

            base.FireMessageToWMI(eventName, action, expected);
        }
Exemplo n.º 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);
        }
Exemplo n.º 25
0
        public void DataTransactionRolledBackEventTest()
        {
            string           eventName = "DataTransactionRolledBackEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireDataTransactionRolledBackEvent);

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

            base.FireMessageToWMI(eventName, action, expected);
        }
Exemplo n.º 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);
        }
Exemplo n.º 27
0
        public void CachingServiceInternalFailureEventTest()
        {
            string           eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireCachingServiceInternalFailureEvent);

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

            base.FireMessageToWMI(eventName, action, expected);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 31
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);
        }
Exemplo n.º 32
0
        public void DataTransactionRolledBackEventTest()
        {
            string eventName = "DataTransactionRolledBackEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireDataTransactionRolledBackEvent);

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