How to: Install a Host Adapter

After you build your host adapter, you must install and register it.

As described in How to: Create a Host Adapter, you implement two sets of functionality when you create a host adapter:

  • test-execution functionality. This has no UI.

  • test-run-configuration functionality. This supplies a UI, namely a page in the test run configuration editor that lets testers select and configure the host adapter to use in test runs.

You can choose to create your host adapter in either of two ways:

  • Create a single assembly that contains both sets of functionality. If you build the host adapter in a single assembly, install this assembly into two locations:

    • the client computer. This is the computer that is used to start test runs and view test results.

    • the computer that executes the tests

  • Create two assemblies in which you separate execution code from UI code. If you build the host adapter into two assemblies, install them as follows:

    • Install the assembly that contains UI onto the client computer.

    • Install the assembly that contains execution code into the computer that executes the tests.

Accordingly, in each of the following procedures, the term host adapter assembly refers to the assembly that contains the implementation meant for the specified location.

To install and register a host adapter in the test environment

  1. Copy the host adapter assembly that contains the execution implementation to the location of the execution framework on the computer that executes the tests.

    If you are running tests locally, copy the assembly to Common7\IDE\PrivateAssemblies.

  2. Register the host adapter on the computer that executes the tests.

    To do this, first create a registry key. In the following key name, replace "MyHost" with the name of your host adapter:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\EnterpriseTools\QualityTools\HostAdapters\MyHost

  3. Create two values under that key:

    • Type (REG_SZ). This value has the format class,assembly. It refers to the an implementation of ITestAdapter.

    • Editor Type (REG_SZ). This value has the format class,assembly. It refers to the implementation of IRunConfigurationCustomHostEditor.

To install and register a host adapter on the client computer

  1. Copy the host adapter assembly that contains your UI implementation to Common7\IDE\PrivateAssemblies on the client computer.

  2. Register the host adapter on the client computer.

    To do this, first add code such as the following to any public class.

    [RegisterHostAdapter(MyHostAdapter.Name, typeof(MyHostAdapter), typeof(MyHostAdapterRunConfigControl))]

  3. To add these entries to registry, run the RegPkg.exe utility on the client computer, passing it the name of the assembly that contains your UI implementation.

See Also

Concepts

How to: Create a Host Adapter

Creating and Using Host Adapters