Package org.alfresco.utility.data
Class TestData<Data>
- java.lang.Object
-
- org.alfresco.utility.data.TestData<Data>
-
- All Implemented Interfaces:
DSL<Data>
- Direct Known Subclasses:
DataCalendarEvent,DataContent,DataEmail,DataGroup,DataLink,DataSite,DataUser,DataWiki,DataWorkflow
public abstract class TestData<Data> extends java.lang.Object implements DSL<Data>
-
-
Field Summary
Fields Modifier and Type Field Description protected UserModelcurrentUserThis is the currentUser that we will use for creating specific test data If none specified we will use the admin user defined in default.propertiesstatic java.lang.StringEMAILstatic java.lang.StringPASSWORDprotected TasPropertiestasProperties
-
Constructor Summary
Constructors Constructor Description TestData()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertExtensionAmpExists(java.lang.String moduleId)DataassertLogLineIs(java.lang.String logLine)UserModelgetAdminUser()java.lang.StringgetAlfrescoHome()Returns Alfresco Content Services Home (Alfresco root) directory using JMX propertyjava.lang.StringgetCurrentSite()java.lang.StringgetCurrentSpace()UserModelgetCurrentUser()gets the current test userjava.lang.StringgetDataDictionaryPath()java.lang.StringgetLastResource()java.lang.StringgetRootPath()java.lang.StringgetSitesPath()java.lang.StringgetUserHomesPath()static booleanisAFile(java.lang.String filename)Check ifpassed as parameter is a file or not based on extension voidsetCurrentSite(java.lang.String currentSite)DatasetCurrentSpace(java.lang.String currentRepositorySpace)DSL.getSitesPath(), DSL.getUserHomesPath(),DSL.getDataDictionaryPath(), etc If nothing is specified, the root folder is usedvoidsetCurrentUser(UserModel testUser)DatasetLastResource(java.lang.String lastResource)Set last resource with content protocol locationDatausingAdmin()Defines the current user to be AdminDatausingLastServerLogLines(int lineNumber)DatausingResource(ContentModel model)Resource can be a folder, file where we want to create new content or make assertion.DatausingRoot()DatausingSite(java.lang.String siteId)Defines the current test site to be usedDatausingSite(SiteModel siteModel)Defines the current test site to be used based onSiteModelDatausingUser(UserModel user)Call this method if you want to use another user rather than admin defined inTasPropertiesproperties fileDatausingUserHome()DatausingUserHome(java.lang.String username)Defines the current User Home to be used Example: /User Homes/DSLJmxwithJMX()
-
-
-
Field Detail
-
currentUser
protected UserModel currentUser
This is the currentUser that we will use for creating specific test data If none specified we will use the admin user defined in default.properties
-
tasProperties
@Autowired protected TasProperties tasProperties
-
PASSWORD
public static java.lang.String PASSWORD
-
EMAIL
public static java.lang.String EMAIL
-
-
Method Detail
-
isAFile
public static boolean isAFile(java.lang.String filename)
Check ifpassed as parameter is a file or not based on extension
-
usingUser
public Data usingUser(UserModel user)
Call this method if you want to use another user rather than admin defined inTasPropertiesproperties file
-
usingAdmin
public Data usingAdmin()
Description copied from interface:DSLDefines the current user to be Admin- Specified by:
usingAdminin interfaceDSL<Data>- Returns:
-
getAdminUser
public UserModel getAdminUser()
-
getCurrentUser
public UserModel getCurrentUser()
Description copied from interface:DSLgets the current test user- Specified by:
getCurrentUserin interfaceDSL<Data>- Returns:
-
usingRoot
public Data usingRoot() throws java.lang.Exception
-
getCurrentSpace
public java.lang.String getCurrentSpace()
- Specified by:
getCurrentSpacein interfaceDSL<Data>- Returns:
- the current Repository Space
-
setCurrentSpace
public Data setCurrentSpace(java.lang.String currentRepositorySpace)
Description copied from interface:DSLDSL.getSitesPath(), DSL.getUserHomesPath(),DSL.getDataDictionaryPath(), etc If nothing is specified, the root folder is used- Specified by:
setCurrentSpacein interfaceDSL<Data>
-
usingResource
public Data usingResource(ContentModel model) throws java.lang.Exception
Resource can be a folder, file where we want to create new content or make assertion. The resource is the current object tested in your test- Specified by:
usingResourcein interfaceDSL<Data>- Returns:
- Throws:
java.lang.Exception
-
usingSite
public Data usingSite(java.lang.String siteId) throws java.lang.Exception
Description copied from interface:DSLDefines the current test site to be used
-
usingSite
public Data usingSite(SiteModel siteModel) throws java.lang.Exception
Description copied from interface:DSLDefines the current test site to be used based onSiteModel
-
usingUserHome
public Data usingUserHome(java.lang.String username) throws java.lang.Exception
Description copied from interface:DSLDefines the current User Home to be used Example: /User Homes/- Specified by:
usingUserHomein interfaceDSL<Data>- Returns:
- Throws:
java.lang.Exception
-
usingUserHome
public Data usingUserHome() throws java.lang.Exception
- Specified by:
usingUserHomein interfaceDSL<Data>- Returns:
- the userhome path based on
DSL.getCurrentUser() - Throws:
java.lang.Exception
-
getRootPath
public java.lang.String getRootPath() throws TestConfigurationException- Specified by:
getRootPathin interfaceDSL<Data>- Returns:
- the root path
- Throws:
TestConfigurationException
-
getSitesPath
public java.lang.String getSitesPath() throws TestConfigurationException- Specified by:
getSitesPathin interfaceDSL<Data>- Returns:
- the Sites path Example: /Sites
- Throws:
TestConfigurationException
-
getUserHomesPath
public java.lang.String getUserHomesPath() throws TestConfigurationException- Specified by:
getUserHomesPathin interfaceDSL<Data>- Returns:
- user home path Example: /User Homes
- Throws:
TestConfigurationException
-
getDataDictionaryPath
public java.lang.String getDataDictionaryPath() throws TestConfigurationException- Specified by:
getDataDictionaryPathin interfaceDSL<Data>- Returns:
- the Data Dictionary path /Data Dictionary
- Throws:
TestConfigurationException
-
getCurrentSite
public java.lang.String getCurrentSite()
-
setCurrentSite
public void setCurrentSite(java.lang.String currentSite)
-
getLastResource
public java.lang.String getLastResource()
-
setLastResource
public Data setLastResource(java.lang.String lastResource)
Set last resource with content protocol location- Parameters:
lastResource-
-
setCurrentUser
public void setCurrentUser(UserModel testUser)
-
usingLastServerLogLines
public Data usingLastServerLogLines(int lineNumber) throws java.lang.Exception
- Throws:
java.lang.Exception
-
assertLogLineIs
public Data assertLogLineIs(java.lang.String logLine) throws java.lang.Exception
- Throws:
java.lang.Exception
-
assertExtensionAmpExists
public void assertExtensionAmpExists(java.lang.String moduleId) throws java.lang.Exception- Throws:
java.lang.Exception
-
getAlfrescoHome
public java.lang.String getAlfrescoHome() throws java.lang.ExceptionReturns Alfresco Content Services Home (Alfresco root) directory using JMX property- Returns:
- Alfresco Content Services Home (Alfresco root) directory
- Throws:
java.lang.Exception
-
withJMX
public DSLJmx withJMX()
- Returns:
- JMX DSL for this wrapper
-
-