public abstract class AlfrescoSDKTestCase extends android.test.InstrumentationTestCase implements ServerConfiguration, TestConstant
Modifier and Type | Field and Description |
---|---|
protected AlfrescoSession |
alfsession |
protected static String |
BASE_URL |
protected static String |
BINDING_URL |
protected static String |
CLOUD_BASIC_AUTH |
protected ServerConfigFile |
config |
protected static String |
PASSWORD |
static String |
TAG |
protected static String |
USER |
ALFRESCO_CLOUD_PASSWORD, ALFRESCO_CLOUD_URL, ALFRESCO_CLOUD_USER, ALFRESCO_CMIS_ATOMPUB_URL, ALFRESCO_CMIS_BASE_URL, ALFRESCO_CMIS_PASSWORD, ALFRESCO_CMIS_USER, CLOUD_CONFIG_PATH, CMIS_CONFIG_PATH, CMIS_SERVER_ATOMPUB_URL, CMIS_SERVER_BASE_URL, CMIS_SERVER_PASSWORD, CMIS_SERVER_USERNAME, COLLABORATOR, COLLABORATOR_PASSWORD, CONSUMER, CONSUMER_PASSWORD, CONTRIBUTOR, CONTRIBUTOR_PASSWORD, ENABLE_CONFIG_FILE, INVITED, INVITED_PASSWORD, ONPREMISE_CONFIG_PATH, WORKFLOW, WORKFLOW_PASSWORD
ALFRESCO_CMIS_NAME, CLOUD_SITENAME, CMIS_VERSION, FAKE_SITENAME, FAKE_USERNAME, FOREIGN_CHARACTER, FOREIGN_CHARACTER_DOUBLE_BYTE, MODERATED_SITE, ONPREMISE_SITENAME, PRIVATE_SITE, PUBLIC_SITE, ROOT_TEST_FOLDER_NAME, ROOT_TEST_SAMPLE_DATA, SAMPLE_DATA_COMMENT_FILE, SAMPLE_DATA_COMMENT_FOLDER, SAMPLE_DATA_DOCFOLDER_FILE, SAMPLE_DATA_DOCFOLDER_FOLDER, SAMPLE_DATA_PATH_COMMENT_FILE, SAMPLE_DATA_PATH_DOCFOLDER_FILE, SAMPLE_DATA_PATH_DOCFOLDER_FOLDER, SAMPLE_DATA_PATH_TAG, SAMPLE_DATA_PERMISSIONS_FILE, SAMPLE_DATA_PERMISSIONS_FOLDER, SAMPLE_DATA_SEARCH_FOLDER, SAMPLE_DATAPATH_WORKFLOW, SAMPLE_DOC_NAME, SAMPLE_FOLDER_DESCRIPTION, SAMPLE_FOLDER_NAME
Constructor and Description |
---|
AlfrescoSDKTestCase() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkSession() |
protected void |
checkSession(AlfrescoSession session) |
boolean |
compareDate(Date date1,
Date date2) |
CloudSession |
createCloudSession() |
CloudSession |
createCloudSession(Map<String,Serializable> parameters) |
protected AlfrescoSession |
createCloudSession(String username,
String password,
Map<String,Serializable> parameters) |
RepositorySession |
createCMISSession() |
protected ContentFile |
createContentFile(String contentValue) |
protected Document |
createDeletedDocument(Folder root,
String docName) |
protected Folder |
createDeletedFolder(Folder root,
String folderName) |
protected Document |
createDocument(Folder folder,
String docName) |
protected Document |
createDocumentFromAsset(Folder root,
String assetName) |
protected void |
createDocuments(Folder root,
int size)
Create a list of sample Documents.
|
protected Document |
createEmptyDocument(Folder root,
String docName) |
protected void |
createFolders(Folder root,
int size)
Creates a list of sample folder
|
Folder |
createNewFolder(AlfrescoSession session,
Folder parentFolder,
String folderName,
Map<String,Serializable> properties)
Create new folder (delete if already exists and if possible)
|
RepositorySession |
createRepositorySession()
Default creation of a repositorySession
|
RepositorySession |
createRepositorySession(Map<String,Serializable> parameters)
Create a repositorySession with parameters.
|
protected AlfrescoSession |
createRepositorySession(String username,
String password,
Map<String,Serializable> parameters)
Creation with a specific username
|
AlfrescoSession |
createSession(String username,
String password,
Map<String,Serializable> parameters) |
Folder |
createUnitTestFolder(AlfrescoSession session)
Create Root Folder Sandbox for unit Test.
|
protected AuthenticationProvider |
getAuthenticationProvider() |
protected AuthenticationProvider |
getAuthenticationProvider(AlfrescoSession session) |
protected android.content.Context |
getContext()
Retrieve the context of the test application.
|
static String |
getFolderPath(AlfrescoSession session) |
static String |
getSampleDataPath(AlfrescoSession session) |
static String |
getSiteName(AlfrescoSession session) |
static String |
getSitePath(AlfrescoSession session) |
static String |
getSitePath(String siteShortName) |
static SiteVisibility |
getSiteVisibility(AlfrescoSession session) |
protected android.content.Context |
getTargetContext()
Retrieve the context of the sample application.
|
static String |
getUnitTestFolderPath(AlfrescoSession session) |
String |
getUsername(String username) |
protected boolean |
hasPublicAPI() |
protected abstract void |
initSession()
Generic initialization method to create an AlfrescoSession and retrieve
some services.
|
protected boolean |
isAlfresco()
Detect if it's an Alfresco Repository server.
|
protected boolean |
isAlfrescoV4()
Detect if Alfresco repository server is on version 4 or above.
|
protected boolean |
isOnPremise()
Detect if the repository test server is OnPremise
|
protected boolean |
isOnPremise(AlfrescoSession session)
Detect if the repository test server is OnPremise
|
protected String |
readContent(ContentStream contentStream)
Reads the content from a content stream into a byte array.
|
protected void |
setUp() |
protected void |
tearDown() |
protected void |
wait(int milliseconds)
Sometimes we have to wait...
|
getInstrumentation, injectInsrumentation, injectInstrumentation, launchActivity, launchActivityWithIntent, runTest, runTestOnUiThread, sendKeys, sendKeys, sendRepeatedKeys
countTestCases, createResult, getName, run, run, runBare, setName, toString
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
public static final String TAG
protected static final String BINDING_URL
protected static final String BASE_URL
protected static final String USER
protected static final String PASSWORD
protected static final String CLOUD_BASIC_AUTH
protected AlfrescoSession alfsession
protected ServerConfigFile config
public RepositorySession createCMISSession()
public RepositorySession createRepositorySession()
protected AlfrescoSession createRepositorySession(String username, String password, Map<String,Serializable> parameters)
username
- password
- parameters
- public RepositorySession createRepositorySession(Map<String,Serializable> parameters)
parameters
- public AlfrescoSession createSession(String username, String password, Map<String,Serializable> parameters)
public CloudSession createCloudSession()
protected AlfrescoSession createCloudSession(String username, String password, Map<String,Serializable> parameters)
public CloudSession createCloudSession(Map<String,Serializable> parameters)
public Folder createUnitTestFolder(AlfrescoSession session)
public Folder createNewFolder(AlfrescoSession session, Folder parentFolder, String folderName, Map<String,Serializable> properties)
session
- : session currently use to create the new Folder.parentFolder
- : parent Folderproperties
- : map of properties that folder must include.protected void createFolders(Folder root, int size)
root
- - parent foldersize
- - number of folders to createAlfrescoException
protected void createDocuments(Folder root, int size)
root
- size
- AlfrescoException
protected ContentFile createContentFile(String contentValue)
protected String readContent(ContentStream contentStream) throws IOException
IOException
public static String getUnitTestFolderPath(AlfrescoSession session)
public static String getSitePath(AlfrescoSession session)
public static String getFolderPath(AlfrescoSession session)
public static String getSampleDataPath(AlfrescoSession session)
public static String getSiteName(AlfrescoSession session)
public static SiteVisibility getSiteVisibility(AlfrescoSession session)
protected android.content.Context getContext()
protected android.content.Context getTargetContext()
protected void wait(int milliseconds)
milliseconds
- : milliseconds you want to wait before continuing
test.protected boolean isAlfrescoV4()
protected boolean isAlfresco()
protected boolean isOnPremise(AlfrescoSession session)
session
- : specific alfresco session.protected boolean isOnPremise()
protected boolean hasPublicAPI()
protected AuthenticationProvider getAuthenticationProvider()
protected AuthenticationProvider getAuthenticationProvider(AlfrescoSession session)
protected void checkSession()
protected void checkSession(AlfrescoSession session)
protected void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
protected abstract void initSession()
Copyright © 2012-2018 Alfresco Software. All Rights Reserved.