<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Unit Testing of plugin code</title><link>https://community.appian.com/discussions/f/plug-ins/8966/unit-testing-of-plugin-code</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Unit Testing of plugin code</title><link>https://community.appian.com/thread/65263?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 06:29:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:187e7dd5-cb19-4c73-98c0-bb14e94b269b</guid><dc:creator>Justin Scott</dc:creator><description>As a senior developer responsible for creating a plugin standard across all projects, I struggle with this.&lt;br /&gt;
Some developers will use and pass Appian specific services into nearly every important or critical method in most classes.&lt;br /&gt;
&lt;br /&gt;
When asked to rebrand an altered plugin, it&amp;#39;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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing of plugin code</title><link>https://community.appian.com/thread/51647?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2018 14:58:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6d4a3edc-472c-4953-9afa-0998844567d1</guid><dc:creator>Philip Snyman</dc:creator><description>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.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing of plugin code</title><link>https://community.appian.com/thread/51631?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2018 13:47:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fb013f88-d788-4a74-9ad5-a321d8ec4582</guid><dc:creator>Carlos Santander</dc:creator><description>Ok, I thought you were still asking about unit testing, whereas you&amp;#39;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&amp;#39;t depend on Appian services. Alternatively, you could create mocks for the Appian services that you would use in the tests.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing of plugin code</title><link>https://community.appian.com/thread/51627?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2018 13:09:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:96f45ec4-5a75-40dd-83db-feb1a950ef4d</guid><dc:creator>Philip Snyman</dc:creator><description>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!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing of plugin code</title><link>https://community.appian.com/thread/51436?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2018 14:45:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f110ab89-9612-4bbe-949d-505266eb33bc</guid><dc:creator>Carlos Santander</dc:creator><description>This might not be sufficient for your case, but one way to think about a plugin is as a two-piece component: the actual functionality and an integration layer. You can create jUnit tests for the functionality piece of the plugin (for example, communicating with an external service), but the integration layer would be tested by writing test rules/test process models in Appian.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing of plugin code</title><link>https://community.appian.com/thread/51435?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2018 14:11:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0b629ed6-5351-44e8-8e59-bf1fb2fab2d2</guid><dc:creator>Philip Snyman</dc:creator><description>Hi Eduardo,&lt;br /&gt;
Is there are a recommended alternative to the approach you described? The ConfigurationLoader.initializeConfigurations() method is currently marked as Deprecated.&lt;br /&gt;
Regards,&lt;br /&gt;
Philip&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing of plugin code</title><link>https://community.appian.com/thread/39920?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2016 11:40:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:42bfe5d5-efae-4dbc-9c1b-de2142f2d255</guid><dc:creator>chetany</dc:creator><description>Thanks Eduardo. Will try it out.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing of plugin code</title><link>https://community.appian.com/thread/39919?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2016 11:02:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:371aea0b-ee43-469d-9c95-549349c0cd61</guid><dc:creator>Eduardo Fuentes</dc:creator><description>You can do that the same way you test any plug-in, all you need is:&lt;br /&gt;&lt;br /&gt;1. A local Appian installation&lt;br /&gt;2. Add &amp;lt;APPIAN_HOME&amp;gt;\\_admin\\_scripts\\classpath.jar to the build path&lt;br /&gt;3. When initializing the unit testing  invoke &lt;br /&gt;&lt;br /&gt;ConfigurationLoader.initializeConfigurations();&lt;br /&gt;&lt;br /&gt;For example&lt;br /&gt;&lt;br /&gt;@Before&lt;br /&gt;  public void setUp() throws Exception {&lt;br /&gt;ConfigurationLoader.initializeConfigurations();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;then start from there.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>