Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to do integration-testing of one class inside a running instance of Jira?

José Marañón [Awnaba Software S.L.]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 10, 2012

While developing a plugin for Jira, I have created some classes that act as a facade to the underlying Jira. I am interested in testing that these classes work as expected and I would like to test them inside Jira.

Unit-testing is not an option as the main purpose of these classes is interacting with the Jira API and their inner logic is quite simple. Mocking the API objects is not good either as my intent is not recording the interactions (API calls) but making sure that the class does what it has to do.

The SDK documentation refers to "integration tests", but it refers to funtional tests executed from the client side that execute user visible operations of the plugin.

Is there any way to test a single class inside Jira?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 14, 2012

Yes, its not straight forward to write server side integration tests that aren't UI driven or have a UI response. I have integration tests for JEMH, for which I need to inject data for testing, and assert the result. In order to do that I actually have a REST testing api through which I can post data. The server side agent is then responsible for performing the particular action. Its a little heavy on development but works, and is actually the basis of how JEMH runs TestCases in the UI.

FYI, for admin type functions the Backdoor/TestKit API is great for speedier setup.

You could create your test suite as server side REST methods, which are asserted in clientside unit tests via a Backdoor type api? Alternatively, I have thought that a generic REST service for running in-process server side scripts might be a useful TestKit extension, providing a generic ability to execute integration tests on the server, but haven't gone there yet.

José Marañón [Awnaba Software S.L.]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2012

I can see this is a solution to the problem of server side integration testing , but I find it a bit complicated. It would imply creating an API (REST, SOAP or of other type), calling that API from the client side tests, and verifying results. Certainly, the API would need some means of transferring objects back and forth to supply input data and get results.

I find the idea of the generic script more interesting.

0 votes
José Marañón [Awnaba Software S.L.]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 14, 2012
TAGS
AUG Leaders

Atlassian Community Events