TRAP/J 2.2 User Manual

Running the TRAP/J Test Application

  1. Follow the directions under "Installing TRAP/J 2.2" to install the TRAP/J Eclipse Plugin.
  2. Download the test application by clicking here.
  3. Unpack the application's contents into an Eclipse workspace.
  4. Import the project into Eclipse.
  5. Right click on the project in Eclipse and click on "Add TRAP/J Nature."
  6. Select the "lib" directory in the prompt and click "OK."
  7. Annotate the following methods with the @AdaptReady tag:
    Note: Press "Ctrl+Shift+O" after adding the annotation to add the necessary imports.
    • int computeMaxSum(int[]) in the MaxSumAlg class
    • Matrix multiply(Matrix, Matrix) in the MatrixMultiplyAlg class
  8. Build the project by either saving each file or selecting "Build Project" in Eclipse.
  9. Run the application. The original functionality should have a slow algorithm for both examples. Play around with the application to see this in action.
  10. With the application still running, look for the delegates folder in the "TRAPJ 2.2 Test" directory.
    Copy the file "MatrixMultiplyDelegate.java" into the com.testcompany.testapp.matrixmultiply package and
    copy the remaining three files into the com.testcompany.testapp.maxsum package.
    These four delegates were developed for use with this test application.
  11. Rebuild the project in Eclipse without closing the running application.
  12. Right-click on the "TJ" icon in the system tray and click on the "Manage Delegates" option.
  13. Load the four delegates by navigating to their .class files within the respective folder (either "maxsum" or "matrixmultiply")
    off of the "TRAPJ 2.2 Test/TRAPJ Test Application/deliverables/com/testcompany/testapp/" directory after clicking on "Load Delegate."
  14. To adapt a delegate and see new functionality select the "Adapt Method" option from the TRAP/J system tray icon
    and select a method and a corresponding delegate, and then press "Adapt."
  15. To revert to the original functionality, follow the above procedure except only select a method and then click "Unadapt."
  Table of Contents
TRAP/J Home