SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
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!

Más contenido relacionado

La actualidad más candente

Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
Anton Arhipov
 

La actualidad más candente (20)

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

Destacado

Destacado (15)

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

Similar a AtlasCamp 2012 - Testing JIRA plugins smarter with TestKit

Apache DeltaSpike
Apache DeltaSpikeApache DeltaSpike
Apache DeltaSpike
os890
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejug
robbiev
 
Storage Plug-ins
Storage Plug-ins Storage Plug-ins
Storage Plug-ins
buildacloud
 
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
telestax
 

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

Apache DeltaSpike
Apache DeltaSpikeApache DeltaSpike
Apache DeltaSpike
 
Struts2 - 101
Struts2 - 101Struts2 - 101
Struts2 - 101
 
Docker & ECS: Secure Nearline Execution
Docker & ECS: Secure Nearline ExecutionDocker & ECS: Secure Nearline Execution
Docker & ECS: Secure Nearline Execution
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
 
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-JupiterToolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejug
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard Introduction
 
Development of Java tools using SWT and WALA af Hans Søndergaard, ViaUC
Development of Java tools using SWT and WALA af Hans Søndergaard, ViaUCDevelopment of Java tools using SWT and WALA af Hans Søndergaard, ViaUC
Development of Java tools using SWT and WALA af Hans Søndergaard, ViaUC
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Preview
 
Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
 
CloudStack Meetup Santa Clara
CloudStack Meetup Santa Clara CloudStack Meetup Santa Clara
CloudStack Meetup Santa Clara
 
Storage Plug-ins
Storage Plug-ins Storage Plug-ins
Storage Plug-ins
 
Spring into rails
Spring into railsSpring into rails
Spring into rails
 
Level Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With TestcontainersLevel Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With Testcontainers
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
 
JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0
 
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
 
Testing basics for developers
Testing basics for developersTesting basics for developers
Testing basics for developers
 

Más de Wojciech Seliga

Más de Wojciech Seliga (8)

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

Último

Último (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

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!