Principles for Running Tests

Before XJIntegration's methods and events can be used, two steps must be performed: an XJLink instance needs to be created, and the relevant project must be opened. The process for running a sequence of tests using XJRunner Integration is therefore as follows:

  1. Create an XJLink instance to initialise a JTAG controller, and open a project by creating an instance of the RunnerProject class.
  2. For each unit to be tested, repeat this 3-step cycle:
    1. Create a fresh instance of the Runner class to provide access to the methods that run that project's tests.
    2. Run all the tests on the unit being tested.
    3. Dispose the Runner object after all the tests on that particular unit have been completed.
  3. When all units that use that project and XJLink have been tested, Dispose the RunnerProject and XJLink objects.
  4. When all testing is complete, use XjtagSystem.Close() to release all system resources.

To use XJAnalyser Integration, the sequence is very similar:

  1. Create an XJLink instance to initialise a JTAG controller, and open a project by creating an instance of the AnalyserProject class.
  2. For each Unit Under Test (UUT), repeat this 3-step cycle:
    1. Create an instance of the ChainRunner class to access methods for controlling the JTAG chain.
    2. Manipulate and/or read pins on that one UUT.
    3. Dispose the ChainRunner object after work on that particular UUT is complete.
  3. When all boards that use that project and XJLink have been tested, Dispose the AnalyserProject and XJLink objects.
  4. When all testing is complete, use XjtagSystem.Close() to release all system resources.

Initialising the XJLink and opening the project can be done in any order because there are no dependencies between the instances that are created.

Changing Projects

When it's necessary to change the project being used, follow this process:

  1. Dispose the Runner or ChainRunner.
  2. Dispose the old project.
  3. Open the new project.
  4. Create a new Runner instance (if using a RunnerProject) or a new ChainRunner instance (if using an AnalyserProject).
  • Note that there is no need to dispose the XJLink object or to perform a system close when just changing projects.

If switching between a RunnerProject and an AnalyserProject, a faster process can be used: rather than disposing the project, it is possible to convert the project to the alternative type. For example, to switch from XJRunner Integration to XJAnalyser Integration, the user disposes the Runner object as before, but can then convert the RunnerProject to an AnalyserProject, after which a ChainRunner object can be created.

Converting the project in this way is very fast because a wrapper is simply added around the existing project, rather than closing and opening the projects.

Example code to perform the switch is as follows:

	//Free the XJLink:
	runner.Dispose();
	//convert project:
	var analyserProj = AnalyserProject.CreateFromRunnerProject(runnerProj);
	//Create ChainRunner instance:						
	var chainRunner = analyserProj.GetChainRunner(xjlink);
  

The CreateFromAnalyserProject() method provides the equivalent conversion from an AnalyserProject to a RunnerProject.

  • If a project was originally created in XJAnalyser, it will not contain the information about the circuit and the tests that a RunnerProject requires. It therefore cannot be converted to a RunnerProject and attempting to do so will cause a ProjectException to be thrown stating that the file is not a valid project file. An AnalyserProject can only be converted to a RunnerProject if it contains all the necessary data, i.e. it was originally created in XJDeveloper (a project file created in XJDeveloper can be opened as either a RunnerProject or an AnalyserProject).