Unit Testing of plugin code

Has anyone used JUnit for writing automated unit test cases in Appian plugin code? I am aware of remote-debugging where we can connect Eclipse to JBoss for debugging purpose. But, it would be better if we could use JUnit to write some testcases.

Let me know if anyone has done so.

OriginalPostID-250251

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to Carlos Santander
    Hi Carlos. Thank you for the reply but that is not going to achieve what I have in mind. I will continue my search. Thanks!
  • Ok, I thought you were still asking about unit testing, whereas you're now asking about a different approach to using the deprecated initializeConfigurations. The documentation states that using the service API from a standalone application is no longer supported, so you could still create unittests for logic that doesn't depend on Appian services. Alternatively, you could create mocks for the Appian services that you would use in the tests.
  • 0
    Certified Lead Developer
    in reply to Carlos Santander
    Yes, I am actually looking for a way to run automated regression testing for the Appian plugins we are implementing. Integration testing with other systems is not an issue at this point. Thanks.
  • As a senior developer responsible for creating a plugin standard across all projects, I struggle with this.
    Some developers will use and pass Appian specific services into nearly every important or critical method in most classes.

    When asked to rebrand an altered plugin, it's practically impossible, within a reasonable amount of time, to decouple the Appian specific code and the actual workhorses of the plugin. This is generally due to downloaded plugins and plugins developed in-house due, specifically, to the lack of standards.

    Carlos is right, plugins are a two piece project. The plugin code itself, the pom, and you should be using Maven, would call a separate library to do the actual heavy lifting and the Plugin project is simply an integration wrapper.

    With ConfigurationLoader.initializeConfiguration being deprecated, we need a way to mock Appian services to support legacy or upgraded plugins without the need to spend an inordinate amount of time trying to split it apart.