com.atlassian.confluence.it
Class AcceptanceTestHelper

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

public class AcceptanceTestHelper
extends 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()
           
 String getBaseUrl()
           
 com.sun.jersey.api.client.Client getClient()
          Deprecated. since 5.6 Use getRestClient()
 String getConfiguredBaseUrl()
           
protected static String getPropertyValue(String k, String v, Properties p)
          Retrieves a property value, replacing values like ${token} using the Properties to look them up.
 com.sun.jersey.api.client.WebResource getResource(String uri, User user)
           
 com.sun.jersey.api.client.Client getRestClient()
           
 ConfluenceRpc getRpc()
           
 ServerStateManager getServerStateManager()
           
static File getTempDirectory()
           
static File getTempFileDir()
           
 TestData getTestData()
           
 UserManagementHelper getUserHelper()
           
 net.sourceforge.jwebunit.junit.WebTester getWebTester()
           
static Properties loadProperties(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(Class testClass, String testName)
           
 void setUp(Class testClass, String testName, net.sourceforge.jwebunit.junit.WebTester webTester)
           
 void setUp(Class testClass, String testName, net.sourceforge.jwebunit.junit.WebTester webTester, com.sun.jersey.api.client.Client restClient)
           
 void setUp(Class testClass, org.junit.rules.TestName testName)
           
 void setUp(Class testClass, org.junit.rules.TestName testName, net.sourceforge.jwebunit.junit.WebTester webTester)
           
 void setUp(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(Class testClass,
                  org.junit.rules.TestName testName)
           throws Exception
Throws:
Exception

setUp

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

setUp

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

setUp

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

setUp

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

setUp

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

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

getWebTester

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

getRpc

public ConfluenceRpc getRpc()

getTestData

public TestData getTestData()

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 File getTempFileDir()

getTempDirectory

public static File getTempDirectory()

getUserHelper

public UserManagementHelper getUserHelper()

loadProperties

public static Properties loadProperties(String fileName)

getPropertyValue

protected static String getPropertyValue(String k,
                                         String v,
                                         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(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 String getBaseUrl()

getConfiguredBaseUrl

public String getConfiguredBaseUrl()

createTestUser

public User createTestUser()


Copyright © 2003–2015 Atlassian. All rights reserved.