5

I am developing a plugin for IBM Rational Rhapsody using this Java API.

This plugin is registered in the help file and is working fine as long as I can tell. In order to have more confidence about its stability I created a JUnit test suite that I can run through my IDE.

However that's just a mocking solution and I was wondering if there is any way to create an integration test suite that starts from Rhapsody.

What I would really like could be automate the execution of my plugin on a list of test models assessing its good behaviour

I can't find any reference to this on the internet so also other ideas are welcome.

rakwaht
  • 3,666
  • 3
  • 28
  • 45

1 Answers1

4

That's how I implemented the integration test suite:

What I did was to create a Rhapsody model containing N components. Then in Java using JUnit I implemented a base test case that given a model name it does start up a new Rhapsody application and opens it.

Once Rhapsody is open I can use Java APIs to select the correct component simulating a mouse click on its name and then I can run my plugin functions exactly like it was fired for a right click event on the element.

This approach is the only way I found to test my plugin programmatically so that I can use to detect regression. However this is not the perfect solution since it's quite slow (for example 10secs just to startup Rhapsody).

rakwaht
  • 3,666
  • 3
  • 28
  • 45
  • As your plugins are called by a helper, you can select on the browser a model element by `yourModelElementObj.locateInBrowser()` and then running the helper for that model element by `yourActiveRhapsodyApp.runHelper("Your Helper Name");` where yourModelElementObj is of the type of the model element you have chosen the helper to run, yourActiveRhapsodyApp is your active Rhapsody instance and "Your Helper Name" is the name of the helper that you written on its *.hep I've tried this on Rhapsody9.0.1x64 for the Ada Developer for populating flowcharts programatically through the API successfully – Albatros23 Dec 13 '21 at 13:35