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

Howto write integration test for gadgets

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2014

Hi,

Is there any tricks for writing integration tests for gadgets.

I am using FuncTestcase WebTester for getting html dumps and checking values in it.

However, I suppose, writing integ tests for pages like gadgets that has AJAX calls is tricky.

Anyone has succeeded gadget integration tests?

Thanks in advance

Tuncay

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
William Crighton _CCC_
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.
August 23, 2014

Alright...here we go....


3718                 TestProjectGadgetResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestProjectGadgetResource.java
            7410                      TestPieChartResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestPieChartResource.java
            5033                   TestAdminGadgetResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestAdminGadgetResource.java
           22635                    TestIssueTableResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestIssueTableResource.java
            3702                             TestTimeChart.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestTimeChart.java
            6007                       TestHeatMapResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestHeatMapResource.java
            5545              TestBugzillaIdSearchResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestBugzillaIdSearchResource.java
           14682          TestRecentlyCreatedChartResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestRecentlyCreatedChartResource.java
            6723    TestDefaultProjectsAndCategoriesHelper.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/util/TestDefaultProjectsAndCategoriesHelper.java
            7777                 TestResourceDateValidator.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/util/TestResourceDateValidator.java
           11896                TestResolutionTimeResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestResolutionTimeResource.java
           27628              TestStatHeadingMarkupBuilder.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestStatHeadingMarkupBuilder.java
           10094                    TestQuickLinksResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestQuickLinksResource.java
           33598           TestTwoDimensionalStatsResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestTwoDimensionalStatsResource.java
           12528                        TestStatsResources.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestStatsResources.java
            4740           TestDefaultStatsSeachUrlBuilder.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestDefaultStatsSeachUrlBuilder.java
            3873            TestFiltersAndProjectsResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestFiltersAndProjectsResource.java
           12883             TestSearchQueryBackedResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestSearchQueryBackedResource.java
            9251                TestTimeSinceChartResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestTimeSinceChartResource.java
           17833             TestCreatedVsResolvedResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestCreatedVsResolvedResource.java
            4381              TestFavouriteFiltersResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestFavouriteFiltersResource.java
            5250                              ResourceTest.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/ResourceTest.java
           14578               TestAverageAgeChartResource.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/system/TestAverageAgeChartResource.java
            4578               TestDefaultWhitelistManager.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/whitelist/TestDefaultWhitelistManager.java
            2319                  TestUpgradeTask_Build611.java  ./jira-project/jira-components/jira-plugins/jira-gadgets-plugin/src/test/java/com/atlassian/jira/gadgets/whitelist/TestUpgradeTask_Build611.java

That's the quick and dirty result set showing test code in the jira-gadgets-plugin with JIRA Source v6.3. The ./jira-project/ on each line is a directory created underneath the atlassian-jira-<ver>-source directory generated when you unzip/untar the source ball.

Hope that helps get you going.

-wc

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 23, 2014

Thanks, that helped a lot.

Tuncay Senturk

William Crighton _CCC_
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.
August 24, 2014

You are welcome man, enjoy!

1 vote
William Crighton _CCC_
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.
August 22, 2014

In the image below notice how on the right column under license key there are actions available to download the source - and notice how in the left hand column this option is available starting with the lowest commercial license tier.

If you cannot see the license under the 'Your Licenses' tab option after logging into my.atlassian.comthen you need the license's 'Technical Contact' to add your email to the Technical Contact 'alternates' list.

Still working on that path once you get the source downloaded...

0 votes
William Crighton _CCC_
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.
August 22, 2014

Tuncay Senturk,

My first thought would be to see what atlassian does - there are a few bundled gadgets with the standard JIRA install. If for some reason you don't have the source just purchase a $10 room to read license.

Let me know how it works out for you

-wc

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 22, 2014

Hi William,

Thanks for your response

I could not get your point. Source is not open, is there any way to see source codes (I mean test codes, src/test/java).

I alredy have JIRA license, but the gadget plugins are just jar files. I need to decompile them to see codes, and I suppose distribution jar files do not include test source.

Tuncay Senturk

John Bowyer August 22, 2014

Hi again,

I did not know that we have rights to see source codes when we have commercial license.

By the way, I could not see test codes

Tuncay

TAGS
AUG Leaders

Atlassian Community Events