These days, I find it sometimes easier to start Confluence in Maven rather than in IDEA when I want to reproduce test failures. It has a more standard classpath, for example, and matches the behaviour of Bamboo more closely.
Starting Confluence in Maven
Here's how:
Code Block |
---|
# put the latest version into the local repo mvn clean install -Dmaven.test.skip # run the setup acceptance test to create the home directory in conf-webapp/target/confluence-home mvn -o clean verify -Dtest=SetupAcceptanceTest -DfailIfNoTests=false # start cargo with the Confluence installation created by the setup acceptance test mvn -o verify -Pdebug -Dcargo.wait -Dmaven.test.skip -Dhttp.port=9000 |
Now you can run any acceptance test or tests in IDEA, pointed at this Confluence instance.
Configuring the tests in IDEA
If you're using port 9000 like in the example above, you'll need to change confluence_default.properties
to set the port appropriately. The default is whatever some sloppy developer accidentally committed last – usually 8080.
When running the first acceptance test since you set up the instance, it needs to know what version of the functest plugin to install. Set the confluence.version
system property in the VM settings of your test's run configuration to upload the right one:
No Format |
---|
-Dconfluence.version=2.10-SNAPSHOT |
The exception you'll get if you don't set this system property is:
No Format |
---|
java.io.FileNotFoundException: Could not find plugin file Confluence Functional Test Remote API (confluence-functestrpc-plugin:com.atlassian.confluence.plugins:null:jar) to upload at com.atlassian.confluence.it.plugin.WebTestPluginHelper.installPlugin(WebTestPluginHelper.java:73) at com.atlassian.confluence.AbstractConfluenceAcceptanceTest.setUp(AbstractConfluenceAcceptanceTest.java:266) at com.atlassian.confluence.AbstractConfluenceAcceptanceTest.setUp(AbstractConfluenceAcceptanceTest.java:213) at com.atlassian.confluence.NotificationContentsAcceptanceTest.setUp(NotificationContentsAcceptanceTest.java:29) at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:58) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) |
The 'null' at the end of confluence-functestrpc-plugin:com.atlassian.confluence.plugins means you haven't specified the version number with the system property.
Debugging
You can attach the debugger to Confluence on the port configured in the webapp POM, if you need to. I think it's 5005.
Warning | ||
---|---|---|
| ||
This is sample content that comes included with Confluence for the purposes of demonstrating how the product can be used. |