SlideShare a Scribd company logo
Photo by kc7fys




TEST JIRA PLUGINS SMARTER
          JIRA TestKit
ORIGINAL PROBLEMS

•a lot of functional tests - their execution is really time
 consuming (JIRA CI env uses 60+ remote agents and builds
 still may take hours)

• opaque     test fixtures - tons of XML dumps difficult to maintain

• most
    of time spent by JWebUnit/HtmlUnit/Selenium/
 WebDriver in UI not under test

• JUnit   3.x is 12 years old...
PROBLEM AMPLIFICATION

• With WebDriver    and PageObjects writing functional tests got
 too easy (at least superficially) and the number of them
 exploded

• JIRA
     is now developed by multiple teams and consists of
 bundled plugins built and tested separately, but ... jira-func-tests
 were not easily reusable easily outside JIRA core src tree -
 especially against various JIRA versions.
THE SOLUTION: REST-DRIVEN
TEST FIXTURES AND ASSERTIONS

• order    of magnitude faster than driven by UI

• less   fragile (races, changes in UI)

• clear
     and readable test fixture set-ups (no more opaque XML
 dumps)

• stricter, more   powerful and less fragile assertions
JIRA REST API

• Awesome     (as of JIRA 5.0), but ... still limited

• Almost   non-existent for administrative operations

• Use    whenever you can

• JRJC(JIRA REST Java Client) makes using REST API from Java
 very easy
BACKDOOR

• Unofficial dev-only JIRA REST API providing missing
 functionalities

• Originally   part of JIRA source tree (unavailable for mortals)

• Veryeasy to extend and consume: very lightweight lifecycle, no
 need to care too much about long-term commitments,
 security, ideal shape of representations, HTTP return codes, etc.

• Comes   with *Control classes, which allow to easily do remote
 calls from Java
JIRA TESTKIT

•   Backdoor for the Ecosystem

•   Consists of two parts:

      •   JIRA Plugin deployed only during tests and exposing additional
          REST resources

      •   Java client library talking remotely to JIRA and using these
          additional REST resources

•   We hope promote most useful resources from Backdoor to the
    official JIRA REST API
HOW TO - SETUP
<plugin>
    <groupId>com.atlassian.maven.plugins</groupId>
    <artifactId>maven-jira-plugin</artifactId>
    <configuration>
         <pluginArtifacts>
             <pluginArtifact>
                 <groupId>com.atlassian.jira.tests</groupId>
                 <artifactId>jira-testkit-plugin</artifactId>
                 <version>${testkit.version}</version>
             </pluginArtifact>
         </pluginArtifacts>
    </configuration>
<plugin>
HOWTO - SETUP CONT.

<dependency>
    <groupId>com.atlassian.jira.tests</groupId>
    <artifactId>jira-testkit-client</artifactId>
    <version>${testkit.version}</version>
    <scope>test</scope>
</dependency>
HOWTO - USING IN TEST
public class MyPluginTest extends FuncTestCase {
     @Override
     protected void setUpTest() {
         super.setUpTest();
         Backdoor testKit = new Backdoor(
                new TestKitLocalEnvironmentData());
         testKit.restoreBlankInstance(
                TimeBombLicence.LICENCE_FOR_TESTING);
         testKit.usersAndGroups().addUser("test-user");
         testKit.websudo().disable();
         testKit.subtask().enable();
         // ...
     }

     // ...
 }
public class TestBugzillaImporter extends TestBase {

    private JiraRestClient restClient;

    @Before
    public void setUpTest() {
        backdoor().restoreBlankInstance();
        backdoor().attachments().enable();
        backdoor().timeTracking().enable("8", "5", TimeTracking.Format.PRETTY,
               TimeTracking.Unit.HOUR, TimeTracking.Mode.MODERN);
        restClient = ITUtils.createRestClient(jira().environmentData());
    }

    @Test
    public void someTest() {
        // execute your test using Page Objects / WebDriver
        // ...
        // maybe you need some special license
        assertTrue(backdoor().license().switchToPersonalLicense());
        // ...
       // maybe it should create a user and put it into an appropriate group
        assertTrue(backdoor().usersAndGroups().userExists("mytestuser"));
        assertTrue(backdoor().usersAndGroups().isUserInGroup("mytestuser", "jira-users"));

        // maybe it creates a JIRA issue

        final Issue issue = restClient.getIssueClient().getIssue("TES-19",
               new NullProgressMonitor());
        assertEquals("expectedreporter", issue.getReporter().getName());
        assertEquals("expectedassignee", issue.getAssignee().getName());
    }
}
HOW CAN I USE IT
•   It's hot and bleeding edge, still changing shape (right as I am speaking)

•   https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter
    +integration+testing+with+TestKit

•   https://bitbucket.org/atlassian/jira-testkit/ (planning to open-source it)

•   https://bitbucket.org/atlassian/jira-testkit-example

•   https://marketplace.atlassian.com/plugins/com.atlassian.jira.tests.jira-testkit-
    plugin

•   JIRA Importers Plugin source code (bundled with JIRA src distro)
DON'T USE IN PRODUCTION!

More Related Content

KEY
Better Front-end Development in Atlassian Plugins
PDF
Better front-end development in Atlassian plugins
PDF
Web application development using Play Framework (with Java)
PPTX
Preparing for java 9 modules upload
PPTX
Node.js Development with Apache NetBeans
PPTX
Spring boot Introduction
PDF
Play vs Grails Smackdown - Devoxx France 2013
PPTX
Testing Java EE apps with Arquillian
Better Front-end Development in Atlassian Plugins
Better front-end development in Atlassian plugins
Web application development using Play Framework (with Java)
Preparing for java 9 modules upload
Node.js Development with Apache NetBeans
Spring boot Introduction
Play vs Grails Smackdown - Devoxx France 2013
Testing Java EE apps with Arquillian

What's hot (20)

PPTX
Why jakarta ee matters (ConFoo 2021)
PPTX
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
PPTX
Why Play Framework is fast
PDF
20151010 my sq-landjavav2a
PPTX
JavaFX Versus HTML5 - JavaOne 2014
PPTX
Play! Framework for JavaEE Developers
PDF
Play Framework workshop: full stack java web app
PPTX
Jenkins Evolutions - JEEConf 2012
PDF
Introduction in the play framework
PDF
Apache DeltaSpike the CDI toolbox
PDF
Introduction to Spring Boot
PDF
Apache Lucene for Java EE Developers
PPTX
Java 9 Functionality and Tooling
PPTX
WebLogic authentication debugging
PPTX
Java EE 8
PPTX
Faster java ee builds with gradle [con4921]
PPTX
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
PDF
Real World Java 9
PPTX
Spring Boot
PPTX
Java EE 8 Update
Why jakarta ee matters (ConFoo 2021)
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
Why Play Framework is fast
20151010 my sq-landjavav2a
JavaFX Versus HTML5 - JavaOne 2014
Play! Framework for JavaEE Developers
Play Framework workshop: full stack java web app
Jenkins Evolutions - JEEConf 2012
Introduction in the play framework
Apache DeltaSpike the CDI toolbox
Introduction to Spring Boot
Apache Lucene for Java EE Developers
Java 9 Functionality and Tooling
WebLogic authentication debugging
Java EE 8
Faster java ee builds with gradle [con4921]
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
Real World Java 9
Spring Boot
Java EE 8 Update
Ad

Viewers also liked (15)

PDF
InfoShare 2012 efektywne przeglądy kodu w zespołach agile [Polish]
PDF
Escaping Automated Test Hell - One Year Later
PDF
Developer plantations - colonialism of XXI century (GeeCON 2017)
PDF
Spartez Open Day March 13th 2015
PDF
Social Hacking
PDF
Escaping Test Hell - ACCU 2014
PDF
Ten lessons I painfully learnt while moving from software developer
to entrep...
PDF
10 bezcennych lekcji dla software developera stającego się szefem firmy
PDF
Software Developer Career Unplugged - GeeCon 2013
PDF
Innowacja w praktyce - Infoshare 2014
PDF
SFI 2017 Plantacje Programistów (Developers Plantations) - Colonialism in XXI...
PDF
Ten lessons I painfully learnt while moving from software developer to entrep...
PDF
Software Development Innovation in Practice - 33rd Degree 2014
PDF
How to be Awesome at a Java Developer Job Interview (Confitura 2012, Polish)
PDF
5-10-15 years of Java developer career - Warszawa JUG 2015
InfoShare 2012 efektywne przeglądy kodu w zespołach agile [Polish]
Escaping Automated Test Hell - One Year Later
Developer plantations - colonialism of XXI century (GeeCON 2017)
Spartez Open Day March 13th 2015
Social Hacking
Escaping Test Hell - ACCU 2014
Ten lessons I painfully learnt while moving from software developer
to entrep...
10 bezcennych lekcji dla software developera stającego się szefem firmy
Software Developer Career Unplugged - GeeCon 2013
Innowacja w praktyce - Infoshare 2014
SFI 2017 Plantacje Programistów (Developers Plantations) - Colonialism in XXI...
Ten lessons I painfully learnt while moving from software developer to entrep...
Software Development Innovation in Practice - 33rd Degree 2014
How to be Awesome at a Java Developer Job Interview (Confitura 2012, Polish)
5-10-15 years of Java developer career - Warszawa JUG 2015
Ad

Similar to AtlasCamp 2012 - Testing JIRA plugins smarter with TestKit (20)

PDF
Exploring the JIRA 5 REST API - AtlasCamp 2011
PPTX
Developing for the Atlassian Ecosystem
PPTX
Jira_as_a_Software_Testing_Tool1234.pptx
PPT
Automated Testing Of Web Applications Using XML
PPTX
DaKiRY_BAQ2016_QADay_Денис Геращенко "How we use Zephyr for Jira in e-commerce"
PDF
The Best Postman Alternatives to Streamline API Testing.pdf
PDF
Alien driven-development
PDF
Deep dive into SoapUI
PPTX
Android developer's toolbox
PDF
JIRA Performance Testing in Pictures - Edward Bukoski Michael March
PPTX
GeeCon.cz - Integration Testing from the Trenches Rebooted
KEY
EcoSystem Tools for Admins - AtlasCamp 2011
PDF
JIRA 7 for Developers - Bartek Gatz Filip Rogaczewski Ian Grunert
PDF
XRAY for Jira
PPTX
API Testing with Open Source Code and Cucumber
PPT
XML2Selenium Technical Presentation
KEY
33rd degree
PPTX
Jakarta EE Test Strategies (2022)
PDF
Top 11 API testing tools for 2022
PPTX
Building trust within the organization, first steps towards DevOps
Exploring the JIRA 5 REST API - AtlasCamp 2011
Developing for the Atlassian Ecosystem
Jira_as_a_Software_Testing_Tool1234.pptx
Automated Testing Of Web Applications Using XML
DaKiRY_BAQ2016_QADay_Денис Геращенко "How we use Zephyr for Jira in e-commerce"
The Best Postman Alternatives to Streamline API Testing.pdf
Alien driven-development
Deep dive into SoapUI
Android developer's toolbox
JIRA Performance Testing in Pictures - Edward Bukoski Michael March
GeeCon.cz - Integration Testing from the Trenches Rebooted
EcoSystem Tools for Admins - AtlasCamp 2011
JIRA 7 for Developers - Bartek Gatz Filip Rogaczewski Ian Grunert
XRAY for Jira
API Testing with Open Source Code and Cucumber
XML2Selenium Technical Presentation
33rd degree
Jakarta EE Test Strategies (2022)
Top 11 API testing tools for 2022
Building trust within the organization, first steps towards DevOps

More from Wojciech Seliga (8)

PDF
Sprzedawanie własnego biznesu IT - Confitura 2023.pdf
PDF
Jak być zarąbistym developerem w oczach szefa i ... klienta
PDF
How to impress your boss and your customer in a modern software development c...
PDF
Devoxx Poland 2015: 5-10-15 years with Java
PDF
Escaping Test Hell - Our Journey - XPDays Ukraine 2013
PDF
Confitura 2013 Software Developer Career Unplugged
ODP
Bringing Effectiveness and Sanity to Highly Distributed Agile Teams
PDF
JDD Effective Code Review In Agile Teams
Sprzedawanie własnego biznesu IT - Confitura 2023.pdf
Jak być zarąbistym developerem w oczach szefa i ... klienta
How to impress your boss and your customer in a modern software development c...
Devoxx Poland 2015: 5-10-15 years with Java
Escaping Test Hell - Our Journey - XPDays Ukraine 2013
Confitura 2013 Software Developer Career Unplugged
Bringing Effectiveness and Sanity to Highly Distributed Agile Teams
JDD Effective Code Review In Agile Teams

Recently uploaded (20)

PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Encapsulation theory and applications.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
20250228 LYD VKU AI Blended-Learning.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Machine learning based COVID-19 study performance prediction
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.

AtlasCamp 2012 - Testing JIRA plugins smarter with TestKit

  • 1. Photo by kc7fys TEST JIRA PLUGINS SMARTER JIRA TestKit
  • 2. ORIGINAL PROBLEMS •a lot of functional tests - their execution is really time consuming (JIRA CI env uses 60+ remote agents and builds still may take hours) • opaque test fixtures - tons of XML dumps difficult to maintain • most of time spent by JWebUnit/HtmlUnit/Selenium/ WebDriver in UI not under test • JUnit 3.x is 12 years old...
  • 3. PROBLEM AMPLIFICATION • With WebDriver and PageObjects writing functional tests got too easy (at least superficially) and the number of them exploded • JIRA is now developed by multiple teams and consists of bundled plugins built and tested separately, but ... jira-func-tests were not easily reusable easily outside JIRA core src tree - especially against various JIRA versions.
  • 4. THE SOLUTION: REST-DRIVEN TEST FIXTURES AND ASSERTIONS • order of magnitude faster than driven by UI • less fragile (races, changes in UI) • clear and readable test fixture set-ups (no more opaque XML dumps) • stricter, more powerful and less fragile assertions
  • 5. JIRA REST API • Awesome (as of JIRA 5.0), but ... still limited • Almost non-existent for administrative operations • Use whenever you can • JRJC(JIRA REST Java Client) makes using REST API from Java very easy
  • 6. BACKDOOR • Unofficial dev-only JIRA REST API providing missing functionalities • Originally part of JIRA source tree (unavailable for mortals) • Veryeasy to extend and consume: very lightweight lifecycle, no need to care too much about long-term commitments, security, ideal shape of representations, HTTP return codes, etc. • Comes with *Control classes, which allow to easily do remote calls from Java
  • 7. JIRA TESTKIT • Backdoor for the Ecosystem • Consists of two parts: • JIRA Plugin deployed only during tests and exposing additional REST resources • Java client library talking remotely to JIRA and using these additional REST resources • We hope promote most useful resources from Backdoor to the official JIRA REST API
  • 8. HOW TO - SETUP <plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-jira-plugin</artifactId> <configuration> <pluginArtifacts> <pluginArtifact> <groupId>com.atlassian.jira.tests</groupId> <artifactId>jira-testkit-plugin</artifactId> <version>${testkit.version}</version> </pluginArtifact> </pluginArtifacts> </configuration> <plugin>
  • 9. HOWTO - SETUP CONT. <dependency> <groupId>com.atlassian.jira.tests</groupId> <artifactId>jira-testkit-client</artifactId> <version>${testkit.version}</version> <scope>test</scope> </dependency>
  • 10. HOWTO - USING IN TEST public class MyPluginTest extends FuncTestCase { @Override protected void setUpTest() { super.setUpTest(); Backdoor testKit = new Backdoor( new TestKitLocalEnvironmentData()); testKit.restoreBlankInstance( TimeBombLicence.LICENCE_FOR_TESTING); testKit.usersAndGroups().addUser("test-user"); testKit.websudo().disable(); testKit.subtask().enable(); // ... } // ... }
  • 11. public class TestBugzillaImporter extends TestBase { private JiraRestClient restClient; @Before public void setUpTest() { backdoor().restoreBlankInstance(); backdoor().attachments().enable(); backdoor().timeTracking().enable("8", "5", TimeTracking.Format.PRETTY, TimeTracking.Unit.HOUR, TimeTracking.Mode.MODERN); restClient = ITUtils.createRestClient(jira().environmentData()); } @Test public void someTest() { // execute your test using Page Objects / WebDriver // ... // maybe you need some special license assertTrue(backdoor().license().switchToPersonalLicense()); // ... // maybe it should create a user and put it into an appropriate group assertTrue(backdoor().usersAndGroups().userExists("mytestuser")); assertTrue(backdoor().usersAndGroups().isUserInGroup("mytestuser", "jira-users")); // maybe it creates a JIRA issue final Issue issue = restClient.getIssueClient().getIssue("TES-19", new NullProgressMonitor()); assertEquals("expectedreporter", issue.getReporter().getName()); assertEquals("expectedassignee", issue.getAssignee().getName()); } }
  • 12. HOW CAN I USE IT • It's hot and bleeding edge, still changing shape (right as I am speaking) • https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter +integration+testing+with+TestKit • https://bitbucket.org/atlassian/jira-testkit/ (planning to open-source it) • https://bitbucket.org/atlassian/jira-testkit-example • https://marketplace.atlassian.com/plugins/com.atlassian.jira.tests.jira-testkit- plugin • JIRA Importers Plugin source code (bundled with JIRA src distro)
  • 13. DON'T USE IN PRODUCTION!