osate / alisa

Old Alisa repository, kept for reference
4 stars 2 forks source link

ALISA fails to execute JUnit test with plugin dependencies #45

Open smithdtyler opened 6 years ago

smithdtyler commented 6 years ago

I defined a JUnit verification method with MANIFEST.MF dependencies on a custom plugin. The JUnit test can run successfully using Run As -> JUnit Plugin Test but an assurance case using the same test case fails with what appears to be a classloader error, however nothing appears in the log.

I copied the source code of the depended-on plugin into my JUnit test project and then the assurance case completed normally.

lwrage commented 6 years ago

That is to be expected. The code in the unit test is run in the context of the assure plugin. That plugin doesn't depend on your custom plugin, so it can't load classes from it.

smithdtyler commented 6 years ago

This significantly limits the usefulness of ALISA. I want to be able to write my own verification plugin that uses my tools.

lwrage commented 6 years ago

Just for clarification: Is your unit test in a plugin or in a Java project in the OSATE workspace? How is it registered in the method registry? The limitation above applies only to projects in the workspace but not to installed plugins. When we call to a Java method in a workspace project we don't have the OSGI class loader machinery available.

smithdtyler commented 6 years ago

@lwrage I copied https://github.com/osate/alisa-examples/tree/master/SimpleControlSystem/JUnitTest

lwrage commented 6 years ago

So this would work if the plugin dependencies in the workspace project are added at run-time to the plugin dependencies of the assure plugin. Is this even possible in Equinox/OSGI?

smithdtyler commented 6 years ago

Couldn't the assure plugin just declare an extension point for model verification?

lwrage commented 6 years ago

I don't see any other possibility. Ideally the extension point would completely replace the method registry for analysis plugins.