Commits

Fabian Kraemer committed 8bdf048

CONFDEV-11549: Fix tests against master / 5.0-SNAPSHOT.

Comments (0)

Files changed (5)

 \.settings
 \.project
 \.classpath
+src/test/resources/generated-resources/
         <dependency>
             <groupId>com.atlassian.confluence.plugin</groupId>
             <artifactId>func-test-package</artifactId>
-            <version>${atlassian.product.test-lib.version}</version> <!-- Version 2.2 of the test library contains fixes that make it to work with SDK more seamlessly. Please also note the change of artifact ID (from func-test to func-test-package) -->
+            <version>${atlassian.product.test-lib.version}</version>
             <scope>test</scope>
         </dependency>     
         <dependency>
 			<groupId>com.atlassian.selenium</groupId>
 			<artifactId>atlassian-selenium-browsers-auto</artifactId>
-			<version>2.0.0-m10</version>
+			<version>2.1-m21</version>
 			<scope>test</scope>
         </dependency>
         <dependency>
             <plugin>
                 <groupId>com.atlassian.maven.plugins</groupId>
                 <artifactId>maven-confluence-plugin</artifactId>
-                <version>3.5-m1</version>
+                <version>4.1</version>
                 <extensions>true</extensions>
                <configuration>
                     <systemPropertyVariables>
                         <baseurl>http://localhost:1990/confluence</baseurl>
                         <xvfb.enable>${xvfb.enable}</xvfb.enable>
+                        <selenium.browser>${selenium.browser}</selenium.browser>
                     </systemPropertyVariables>
                    <productVersion>${atlassian.product.version}</productVersion>
                    <testResourcesVersion>${atlassian.product.data.version}</testResourcesVersion>
                         <product>
                             <id>confluence</id>
                             <instanceId>conf1</instanceId>
+                            <!-- if you change this, also change the value in it.com.atlassian.confluence.plugins.jira.selenium.AbstractJiraDialogTestCase -->
                             <httpPort>1990</httpPort>
                             <version>${confluence.version}</version>
                             <dataPath>${basedir}/src/test/resources/confluence-test-resources.zip</dataPath>
+                            <jvmArgs>${confluence.jvmargs}</jvmArgs>
                         </product>
                         <product>
                             <id>jira</id>
                             <instanceId>jira1</instanceId>
+                            <!-- if you change this, also change the value in it.com.atlassian.confluence.plugins.jira.selenium.AbstractJiraDialogTestCase.setupJiraWebTester() -->
                             <httpPort>11990</httpPort>
-                            <version>5.0.4</version>
+                            <version>${jira.version}</version>
                             <dataPath>${basedir}/src/test/resources/jira-test-resources.zip</dataPath>
                             <installPlugin>false</installPlugin>
+                            <jvmArgs>${jira.jvmargs}</jvmArgs>
                         </product>
                     </products>
                     <wait>true</wait>
         <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
         <atlassian.product.version>${confluence.version}</atlassian.product.version>
         <atlassian.product.data.version>${confluence.data.version}</atlassian.product.data.version>
-        <confluence.version>4.2.2</confluence.version>
+        <jira.version>5.2</jira.version>
+        <confluence.version>5.0-m3</confluence.version>
         <confluence.data.version>3.5</confluence.data.version>
-        <atlassian.product.test-lib.version>2.3</atlassian.product.test-lib.version>
-		<http.port>8080</http.port>
+        <atlassian.product.test-lib.version>2.3.2</atlassian.product.test-lib.version>
+		<http.port>1990</http.port>
 		<xvfb.enable>false</xvfb.enable>
         <compress.resources>true</compress.resources>
+        <confluence.jvmargs>-Xmx512m -XX:MaxPermSize=256m</confluence.jvmargs>
+        <jira.jvmargs>-Xmx512m -XX:MaxPermSize=256m</jira.jvmargs>
+        <!-- if you change this, also change the value in it.com.atlassian.confluence.plugins.jira.selenium.AbstractJiraDialogTestCase -->
+        <selenium.browser>firefox-3.6</selenium.browser>
     </properties>
 </project>
+# The Insert JIRA issue dialog box
+
+This repository contains the plugin used for integrating JIRA issues into Confluence pages.
+
+## Running the integration tests
+	
+	mvn clean verify
+
+This will compile and package the plugin, start up JIRA and Confluence in the configured versions and run the integration tests (Selenium 1) against them. If you want to specify the target Confluence version for the run, use e.g.
+
+	mvn clean verify -Dconfluence.version=4.3.3
+
+If you want to run single integration tests from your IDE, run 
+
+	mvn clean confluence:run -DtestGroup=conf_jira
+
+first. This will just start up JIRA and Confluence and wait.
+
+## For Atlassians
+
+* [Confluence Stable Plan](https://confluence-bamboo.atlassian.com/browse/CONFPLGSTB-JC)
+* [Confluence Master Plan](https://confluence-bamboo.atlassian.com/browse/CONFPLGTRK-JC)

src/test/java/it/com/atlassian/confluence/plugins/jira/selenium/AbstractJiraDialogTestCase.java

 
     protected SeleniumClient client = AutoInstallClient.seleniumClient();
     protected SeleniumAssertions assertThat = AutoInstallClient.assertThat();
-
+    
+    static {
+        // prevent AutoInstallClient from using the wrong default ...
+        String confluenceBaseUrl = System.getProperty("baseurl", "http://localhost:1990/confluence");
+        System.setProperty("baseurl", confluenceBaseUrl);
+        // default was 3.5.9 which does not work on master anymore
+        String defaultBrowser = System.getProperty("selenium.browser", "firefox-3.6");
+        System.setProperty("selenium.browser", defaultBrowser);
+    }
+    
     @Override
     protected void setUp() throws Exception
     {
         jiraWebTester = new WebTester();
         jiraWebTester.setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT);
         jiraWebTester.setScriptingEnabled(false);
-        jiraWebTester.getTestContext().setBaseUrl(System.getProperty("baseurl.jira1"));
+        jiraWebTester.getTestContext().setBaseUrl(System.getProperty("baseurl.jira1", "http://localhost:11990/jira"));
 
         jiraWebTester.beginAt("/");
     }

src/test/java/it/com/atlassian/confluence/plugins/jira/selenium/SearchIssuesTestCase.java

         client.click("css=div.jira-search-form button");
         
         client.waitForAjaxWithJquery();
-        assertEquals("TST-1", client.getTable("css=#my-jira-search table.my-result.1.0"));
-        assertEquals("TSTT-1", client.getTable("css=#my-jira-search table.my-result.2.0"));
+        assertEquals("TSTT-1", client.getTable("css=#my-jira-search table.my-result.1.0"));
+        assertEquals("TST-1", client.getTable("css=#my-jira-search table.my-result.2.0"));
     }
     
     public void testSearchWithEnter()
         client.keyUp("css=input[name='jiraSearch']", "\\13");
         
         client.waitForAjaxWithJquery();
-        assertEquals("TST-1", client.getTable("css=#my-jira-search table.my-result.1.0"));
-        assertEquals("TSTT-1", client.getTable("css=#my-jira-search table.my-result.2.0"));
+        assertEquals("TSTT-1", client.getTable("css=#my-jira-search table.my-result.1.0"));
+        assertEquals("TST-1", client.getTable("css=#my-jira-search table.my-result.2.0"));
     }
     
     public void testSearchWithJQL()