com.atlassian.confluence.it
Class AcceptanceTestHelper

java.lang.Object
  extended by com.atlassian.confluence.it.AcceptanceTestHelper

public class AcceptanceTestHelper
extends java.lang.Object

Uber helper for all Acceptance tests - HTMLUnit, Selenium, WebDriver, REST. It does all of the things, and should end up replacing a lot of the logic in the Abstract test super-classes like ACAT.


Field Summary
static Page TEST_PAGE
           
static Space TEST_SPACE
           
 
Constructor Summary
AcceptanceTestHelper()
          Deprecated. 
 
Method Summary
 User createTestUser()
           
 java.lang.String getBaseUrl()
           
 com.sun.jersey.api.client.Client getClient()
          Deprecated. since 5.6 Use getRestClient()
 java.lang.String getConfiguredBaseUrl()
           
protected static java.lang.String getPropertyValue(java.lang.String k, java.lang.String v, java.util.Properties p)
          Retrieves a property value, replacing values like ${token} using the Properties to look them up.
 com.sun.jersey.api.client.WebResource getResource(java.lang.String uri, User user)
           
 com.sun.jersey.api.client.Client getRestClient()
           
 ConfluenceRpc getRpc()
           
 ServerStateManager getServerStateManager()
           
static java.io.File getTempDirectory()
           
static java.io.File getTempFileDir()
           
 UserManagementHelper getUserHelper()
           
 net.sourceforge.jwebunit.junit.WebTester getWebTester()
           
static java.util.Properties loadProperties(java.lang.String fileName)
           
static AcceptanceTestHelper make()
          Deprecated. since 5.6. Use make(boolean) to explicitly specify whether User.TEST should be auto-created.
static AcceptanceTestHelper make(boolean autoCreateUsers)
           
 void setUp(java.lang.Class testClass, java.lang.String testName)
           
 void setUp(java.lang.Class testClass, java.lang.String testName, net.sourceforge.jwebunit.junit.WebTester webTester)
           
 void setUp(java.lang.Class testClass, java.lang.String testName, net.sourceforge.jwebunit.junit.WebTester webTester, com.sun.jersey.api.client.Client restClient)
           
 void setUp(java.lang.Class testClass, org.junit.rules.TestName testName)
           
 void setUp(java.lang.Class testClass, org.junit.rules.TestName testName, net.sourceforge.jwebunit.junit.WebTester webTester)
           
 void setUp(java.lang.Class testClass, org.junit.rules.TestName testName, net.sourceforge.jwebunit.junit.WebTester webTester, com.sun.jersey.api.client.Client restClient)
           
 void tearDown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_SPACE

public static final Space TEST_SPACE

TEST_PAGE

public static final Page TEST_PAGE
Constructor Detail

AcceptanceTestHelper

@Deprecated
public AcceptanceTestHelper()
Deprecated. 

Since:
5.6 Use make(boolean)
Method Detail

setUp

public void setUp(java.lang.Class testClass,
                  org.junit.rules.TestName testName)
           throws java.lang.Exception
Throws:
java.lang.Exception

setUp

public void setUp(java.lang.Class testClass,
                  java.lang.String testName)
           throws java.lang.Exception
Throws:
java.lang.Exception

setUp

public void setUp(java.lang.Class testClass,
                  org.junit.rules.TestName testName,
                  net.sourceforge.jwebunit.junit.WebTester webTester,
                  com.sun.jersey.api.client.Client restClient)
           throws java.io.IOException
Throws:
java.io.IOException

setUp

public void setUp(java.lang.Class testClass,
                  java.lang.String testName,
                  net.sourceforge.jwebunit.junit.WebTester webTester,
                  com.sun.jersey.api.client.Client restClient)
           throws java.io.IOException
Throws:
java.io.IOException

setUp

public void setUp(java.lang.Class testClass,
                  java.lang.String testName,
                  net.sourceforge.jwebunit.junit.WebTester webTester)
           throws java.io.IOException
Throws:
java.io.IOException

setUp

public void setUp(java.lang.Class testClass,
                  org.junit.rules.TestName testName,
                  net.sourceforge.jwebunit.junit.WebTester webTester)
           throws java.io.IOException
Throws:
java.io.IOException

tearDown

public void tearDown()
              throws java.lang.Exception
Throws:
java.lang.Exception

getWebTester

public net.sourceforge.jwebunit.junit.WebTester getWebTester()

getRpc

public ConfluenceRpc getRpc()

getClient

@Deprecated
public com.sun.jersey.api.client.Client getClient()
Deprecated. since 5.6 Use getRestClient()


getRestClient

public com.sun.jersey.api.client.Client getRestClient()

getServerStateManager

public ServerStateManager getServerStateManager()

getTempFileDir

public static java.io.File getTempFileDir()

getTempDirectory

public static java.io.File getTempDirectory()

getUserHelper

public UserManagementHelper getUserHelper()

loadProperties

public static java.util.Properties loadProperties(java.lang.String fileName)

getPropertyValue

protected static java.lang.String getPropertyValue(java.lang.String k,
                                                   java.lang.String v,
                                                   java.util.Properties p)
Retrieves a property value, replacing values like ${token} using the Properties to look them up.

It will leave unresolved properties alone, trying for System properties, and implements reparsing (in the case that the value of a property contains a key), and will not loop endlessly on a pair like test = ${test}.


getResource

public com.sun.jersey.api.client.WebResource getResource(java.lang.String uri,
                                                         User user)

make

@Deprecated
public static AcceptanceTestHelper make()
Deprecated. since 5.6. Use make(boolean) to explicitly specify whether User.TEST should be auto-created.

Creates a new AcceptanceTestHelper which will auto-create User.TEST during setup.

Returns:

make

public static AcceptanceTestHelper make(boolean autoCreateUsers)

getBaseUrl

public java.lang.String getBaseUrl()

getConfiguredBaseUrl

public java.lang.String getConfiguredBaseUrl()

createTestUser

public User createTestUser()


Copyright © 2003-2014 Atlassian. All Rights Reserved.