07.11.2014 Views

Enterprise Library Test Guide - Willy .Net

Enterprise Library Test Guide - Willy .Net

Enterprise Library Test Guide - Willy .Net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Test</strong>ing the Security Application Block 111<br />

Code test case Implemented? Feature that is implemented<br />

The SecurityCacheInstrumentationProvider class raises the<br />

securityCacheReadPerformed event. The SecurityCacheReadPerformed<br />

method consumes this event, notifies WMI, and<br />

increments the performance counters. This is shown in the<br />

following code example.<br />

[InstrumentationConsumer("SecurityCacheReadPerform<br />

ed")]<br />

public void SecurityCacheReadPerformed(…)<br />

{<br />

if (PerformanceCountersEnabled) securityCacheRead-<br />

PerformedCounter.Increment();<br />

if (WmiEnabled) ManagementInstrumentation.Fire(newS<br />

ecurityCacheReadPerformedEvent(…));<br />

}<br />

Verify that the<br />

performance<br />

counters and<br />

the event<br />

log that are<br />

required by<br />

the application<br />

block are installed<br />

during<br />

installation.<br />

Yes<br />

For example, the SecurityCacheProviderInstrumentationListener<br />

class contains the installer attribute type [HasInstallableResourcesAttribute].<br />

The EventLogInstallerBuilder and the PerformanceCounterInstallerBuilder<br />

installer classes identify the attribute and install<br />

the event logs and performance counters.<br />

To learn how the test teams tested the application blocks to see if they conformed<br />

to security best practices, see <strong>Test</strong>ing for Security Best Practices. To learn how the test<br />

teams tested the application blocks to see if they conformed to globalization best<br />

practices, see <strong>Test</strong>ing for Globalization Best Practices. To learn how the test teams tested<br />

the application blocks to see if they met the performance and scalability requirements,<br />

see <strong>Test</strong>ing for Performance and Scalability.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!