To illustrate the use of the Failure Emulator profiler, we will use the Failure Emulator sample application.
The application resides in the following folders:
<AQTime Samples>\Unmanaged\FailureEmulator\BCB - Borland C++Builder
<AQTime Samples>\Unmanaged\FailureEmulator\Delphi - Borland Delphi
<AQTime Samples>\Unmanaged\FailureEmulator\VC2005 - Microsoft Visual C++ 2005 (Visual Studio 2005 project)
<AQTime Samples>\Unmanaged\FailureEmulator\VC2013 - Microsoft Visual C++ 2013 (Visual Studio 2013 project)
Note: | You can also open Visual Studio samples in later versions of Visual Studio. |
On Windows Vista and later, AQTime samples are located in the <Users>\Public\Documents\AQTime 8 Samples folder. On other operating systems, the samples reside in the <Documents and Settings>\All Users\Documents\AQTime 8 Samples folder. |
To profile this example with AQTime, do the following:
-
Open the application in AQTime.
-
Select Failure Emulator Profiler from the Profilers drop-down list on the Standard toolbar.
Select Failure Emulator Profiler from the Profilers drop-down list displayed in the AQTime menu of Microsoft Visual Studio.
Select Failure Emulator Profiler from the Current Profiler submenu displayed in the AQTime menu of Embarcadero RAD Studio.
-
Select Normal from the Profiling Mode drop-down list box that is displayed on AQTime’s Standard toolbar.
Select Normal from the Profiling Mode drop-down list box that is displayed on Visual Studio’s AQTime toolbar.
Click the Normal button on RAD Studio’s AQTime Profiling Modes toolbar.
-
Switch to the Collect Stack Information Pane shown to the middle right of the Setup panel and make sure that both the All Project Modules check box and the corresponding Collect info about lines radio button are selected.
-
Press Run on the Standard toolbar.
Select Run from Visual Studio’s AQTime menu, or press Visual Studio’s Run button while any of AQTime panels is active.
Select Run With Profiling from Embarcadero RAD Studio’s AQTime menu.
-
Depending on the Show Again Flags options, AQTime may call the Profiler Options dialog.
-
Now, you need to add the failures to be simulated for the profiler. For this purpose, do the following:
-
Click Add in the Profiler Options dialog.
-
Select the Disk category on the left and then select the Access denied emulation type on the right.
-
Click Next in the Add New Failure Emulation wizard.
-
Specify the *AQTime_FailureEmulator_Sample.txt file name.
Note: You can either specify the fully-qualified file name or use a wildcard to specify the needed name. -
Click Finish in the wizard.
-
-
After that, add one more emulation to the Profiler Options dialog:
-
Click Add.
-
Select the Registry category on the left and then select the Absent key emulation type on the right.
-
Click Next in the Add New Failure Emulation wizard.
-
Specify the HKEY_CLASSES_ROOT\* regular expression for key names.
-
Click Finish in the wizard.
-
-
Press Run in the Profiler Options dialog to start profiling.
-
AQTime will launch the profiled application. Wait until the application window is displayed on the screen.
-
Clear the HKEY_CURRENT_USER check box and click Start.
-
Click OK in the message informing that the application cannot open the registry key.
-
Click OK in the message informing that the application cannot open the specified file.
Click OK once more. The second message appears due to the fact that the application works in two threads. So, when the second thread tries to write information to the file, the application shows this message again.
-
Press Exit. The application will be closed and AQTime will generate test results.