UnitTesting plugins?

Hello

I am developing a plugin for Visual Paradigm and I would like to develop some tests for it. I had in mind tests that would load a saved *.vpp file and unittest (with JUnit) some model transformations that I’m doing.

Is there a way to load a project using OpenAPI? I didn’t find a method to do that?

Regards,
Adam

Hi Adam,

Please try:
ApplicationManager.getProjectManager().openProject()
or
ApplicationManager.getProjectManager().openProject(File file);

The first one will show a filechooser. It returns true if the user selected a valid project file and the project is opened.

The second one will return true if the project is opened.

Best regards,
Jick

Thanks for the reply

Yes but…
Is it possible, in a junit, to start an ApplicationManager: at this stage I can get it through ApplicationManager.instance() and this method returns NULL, wich is the expected behavior as I’m in a junit.
Regards
Joao