Skip to content

Instantly share code, notes, and snippets.

@skleinei
Created March 5, 2014 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skleinei/9365235 to your computer and use it in GitHub Desktop.
Save skleinei/9365235 to your computer and use it in GitHub Desktop.
Install a license in a JWebUnit test case.
// Use this in a com.atlassian.confluence.plugin.functest.AbstractConfluencePluginWebTestCase to install a license in Confluence:
static boolean isLicenseInstalled = false;
private void installLicense() {
if (!isLicenseInstalled) {
gotoPage("/admin/license.action");
setWorkingForm("updateLicenseForm");
setTextField("licenseString", LICENSE);
submit("update");
String maxUserString = getElementTextByXPath("//table[@class='confluenceTable']//tr[4]/td[2]/strong");
int maxUsers = NumberUtils.toInt(maxUserString, -1);
if (maxUsers != 10) {
fail("License could not be installed successfully");
}
isLicenseInstalled = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment