|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.adapter.gsa.GSATestUtils
public class GSATestUtils
A utility class to simplify testing with GSARepositories inside of junit tests.
Field Summary | |
---|---|
static java.util.List<java.io.File> |
mFilesCreated
|
static java.lang.String |
sClassName
|
static java.lang.String |
sVersionedClassName
|
Constructor Summary | |
---|---|
GSATestUtils(boolean pB)
|
Method Summary | |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
additionalVersionProperties(java.io.File pRoot,
java.lang.String pRepositoryPath,
java.lang.String pRepositoryName)
|
void |
assertEmptyRepository(DBUtils dbTwo,
atg.adapter.gsa.GSARepository storeRepository)
Given a repository, and the DBUtils object used to create the connection for that Repository, this method asserts that all the tables are empty |
void |
cleanup()
Deletes any files created by initializing the configpath |
void |
copyToConfigpath(java.io.File pConfigRoot,
java.lang.String pString)
|
void |
copyToConfigpath(java.io.File pConfigRoot,
java.lang.String pString,
java.lang.String configPath)
|
java.io.File |
createClientLockManager(java.io.File pRoot)
|
static java.io.File |
createFakeXADataSource(java.io.File pRoot,
java.util.Properties pJDBCProperties,
java.lang.String pName)
|
java.io.File |
createGlobal(java.io.File pRoot)
Creates a GLOBAL.properties |
java.io.File |
createIdGenerator(java.io.File pRoot)
|
void |
createIDGeneratorTables(DBUtils db)
Creates the das_id_generator tables using the given database |
java.io.File |
createIdSpaces(java.io.File pRoot)
Writes the idspaces.xml file |
static java.io.File |
createJTDataSource(java.io.File pRoot)
|
static java.io.File |
createJTDataSource(java.io.File pRoot,
java.lang.String pName,
java.lang.String pFakeXAName)
Creates a new JTDataSource component. |
java.io.File |
createNucleus(java.io.File pRoot)
Creates Nucleus' Nucleus.properties |
java.io.File |
createRepositoryPropertiesFile(java.io.File pRoot,
java.lang.String pRepositoryPath,
java.lang.String[] pDefinitionFiles,
java.lang.String pCreateSQLAbsolutePath,
java.lang.String pDropSQLAbsolutePath,
java.lang.String[] pImportFiles)
Creates a .properties file for the given repository. |
java.io.File |
createRepositoryPropertiesFile(java.io.File pRoot,
java.lang.String pRepositoryPath,
java.lang.String[] pDefinitionFiles,
java.lang.String pCreateSQLAbsolutePath,
java.lang.String pDropSQLAbsolutePath,
java.lang.String[] pImportFiles,
java.lang.String pJTDataSourceName)
Creates a .properties file for the given repository. |
java.io.File |
createScreenLog(java.io.File pRoot,
boolean pLogging)
Creates a ScreenLog component |
java.io.File |
createSQLRepositoryEventServer(java.io.File pRoot)
Creates a SQLRepositoryEventServer |
java.io.File |
createTransactionManager(java.io.File pRoot)
|
java.io.File |
createUserTransaction(java.io.File pRoot)
Creates the UserTransaction component |
java.io.File |
createVersionRepositoryPropertiesFile(java.io.File pRoot,
java.lang.String pRepositoryPath,
java.lang.String[] pDefinitionFiles)
Creates a .properties file for the given repository. |
java.io.File |
createXMLToolsFactory(java.io.File pRoot)
|
static void |
dumpTable(atg.adapter.gsa.Table pTable,
java.util.Collection<java.lang.String> pPrintColumnNames)
Dump all the data from a table to the console |
static void |
dumpTables(atg.adapter.gsa.GSARepository pRepository,
java.lang.String pItemDescriptorName)
|
static atg.repository.Repository[] |
duplicateRepositories(atg.adapter.gsa.GSARepository[] pRepositories,
javax.sql.DataSource[] pDS)
Duplicates the given array of repositories. |
static atg.repository.Repository |
duplicateRepository(atg.adapter.gsa.GSARepository pRepository,
javax.sql.DataSource pDS)
|
static atg.repository.Repository |
duplicateRepository(atg.adapter.gsa.GSARepository pRepository,
javax.sql.DataSource pDS,
boolean pStart)
Duplicates the given repository, binds it into nucleus with the suffix "-Shadow" |
static GSATestUtils |
getGSATestUtils()
|
java.lang.String[] |
getTableNames(atg.adapter.gsa.GSARepository pRepository)
Returns all the tables names used for the given repository. |
static GSATestUtils |
getVersionedGSATestUtils()
|
static void |
importFiles(atg.adapter.version.VersionRepository pVerRep,
java.lang.String[] pImportFiles,
java.lang.String pWorkspaceName,
boolean pDoWithoutTransaction,
java.lang.String pWorkspaceComment,
boolean pCheckin)
|
void |
initializeMinimalConfigpath(java.io.File pRoot,
java.lang.String pRepositoryPath,
java.lang.String[] pDefinitionFiles,
java.util.Properties pJDBCProperties,
java.lang.String pCreateSQLAbsolutePath,
java.lang.String pDropSQLAbsolutePath,
java.lang.String[] pImportFile)
Given a directory, pRoot, this method creates the minimal .properties files required to startup a GSA Repository from Nucleus. |
void |
initializeMinimalConfigpath(java.io.File pRoot,
java.lang.String pRepositoryPath,
java.lang.String[] pDefinitionFiles,
java.util.Properties pJDBCProperties,
java.lang.String pCreateSQLAbsolutePath,
java.lang.String pDropSQLAbsolutePath,
java.lang.String[] pImportFile,
boolean pLogging)
Given a directory, pRoot, this method creates the minimal .properties files required to startup a GSA Repository from Nucleus. |
void |
initializeMinimalConfigpath(java.io.File pRoot,
java.lang.String pRepositoryPath,
java.lang.String[] pDefinitionFiles,
java.util.Properties pJDBCProperties,
java.lang.String pCreateSQLAbsolutePath,
java.lang.String pDropSQLAbsolutePath,
java.lang.String[] pImportFile,
boolean pLogging,
java.lang.String pFakeXADataSourceComponentName,
java.lang.String pJTDataSourceComponentName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.List<java.io.File> mFilesCreated
public static java.lang.String sClassName
public static java.lang.String sVersionedClassName
Constructor Detail |
---|
public GSATestUtils(boolean pB)
pB
- Method Detail |
---|
public static atg.repository.Repository[] duplicateRepositories(atg.adapter.gsa.GSARepository[] pRepositories, javax.sql.DataSource[] pDS) throws atg.nucleus.ServiceException
pRepositories
- pDS
-
atg.nucleus.ServiceException
public static atg.repository.Repository duplicateRepository(atg.adapter.gsa.GSARepository pRepository, javax.sql.DataSource pDS) throws atg.nucleus.ServiceException
atg.nucleus.ServiceException
public static atg.repository.Repository duplicateRepository(atg.adapter.gsa.GSARepository pRepository, javax.sql.DataSource pDS, boolean pStart) throws atg.nucleus.ServiceException
pStart
- If true, also starts the repository
atg.nucleus.ServiceException
public void initializeMinimalConfigpath(java.io.File pRoot, java.lang.String pRepositoryPath, java.lang.String[] pDefinitionFiles, java.util.Properties pJDBCProperties, java.lang.String pCreateSQLAbsolutePath, java.lang.String pDropSQLAbsolutePath, java.lang.String[] pImportFile) throws java.io.IOException, java.lang.Exception
cleanup()
method to remove any files
created by this method call.
pRoot
- The root directory of the testing configpathpRepositoryPath
- The Nucleus path of your testing repositorypDefinitionFiles
- Array of Nucleus paths to definition filespJDBCProperties
- properties object containing JDBC connection informationpImportFile
-
java.io.IOException
java.lang.Exception
GSATestUtils.cleanup
public void initializeMinimalConfigpath(java.io.File pRoot, java.lang.String pRepositoryPath, java.lang.String[] pDefinitionFiles, java.util.Properties pJDBCProperties, java.lang.String pCreateSQLAbsolutePath, java.lang.String pDropSQLAbsolutePath, java.lang.String[] pImportFile, boolean pLogging) throws java.io.IOException, java.lang.Exception
cleanup()
method to remove any files
created by this method call.
pRoot
- The root directory of the testing configpathpRepositoryPath
- The Nucleus path of your testing repositorypDefinitionFiles
- Array of Nucleus paths to definition filespJDBCProperties
- properties object containing JDBC connection informationpImportFile
- pLogging
- if true log to stdout, else logging is disabled
java.io.IOException
java.lang.Exception
GSATestUtils.cleanup
public void initializeMinimalConfigpath(java.io.File pRoot, java.lang.String pRepositoryPath, java.lang.String[] pDefinitionFiles, java.util.Properties pJDBCProperties, java.lang.String pCreateSQLAbsolutePath, java.lang.String pDropSQLAbsolutePath, java.lang.String[] pImportFile, boolean pLogging, java.lang.String pFakeXADataSourceComponentName, java.lang.String pJTDataSourceComponentName) throws java.io.IOException, java.lang.Exception
java.io.IOException
java.lang.Exception
public void cleanup()
public java.io.File createIdSpaces(java.io.File pRoot) throws java.io.IOException
java.io.IOException
public java.io.File createNucleus(java.io.File pRoot) throws java.io.IOException
java.io.IOException
public static java.io.File createFakeXADataSource(java.io.File pRoot, java.util.Properties pJDBCProperties, java.lang.String pName) throws java.io.IOException
java.io.IOException
public static java.io.File createJTDataSource(java.io.File pRoot) throws java.io.IOException
pRoot
-
java.io.IOException
public static java.io.File createJTDataSource(java.io.File pRoot, java.lang.String pName, java.lang.String pFakeXAName) throws java.io.IOException
pRoot
- pName
- pFakeXAName
-
java.io.IOException
public java.io.File createSQLRepositoryEventServer(java.io.File pRoot) throws java.io.IOException
pRoot
-
java.io.IOException
public java.io.File createScreenLog(java.io.File pRoot, boolean pLogging) throws java.io.IOException
pRoot
- pLogging
- TODO
java.io.IOException
public java.io.File createGlobal(java.io.File pRoot) throws java.io.IOException
pRoot
- pJDBCProperties
-
java.io.IOException
public java.io.File createClientLockManager(java.io.File pRoot) throws java.io.IOException
pRoot
-
java.io.IOException
public java.io.File createIdGenerator(java.io.File pRoot) throws java.io.IOException
pRoot
-
java.io.IOException
public java.io.File createXMLToolsFactory(java.io.File pRoot) throws java.io.IOException
pRoot
-
java.io.IOException
public java.io.File createTransactionManager(java.io.File pRoot) throws java.io.IOException
pRoot
-
java.io.IOException
public java.io.File createUserTransaction(java.io.File pRoot) throws java.io.IOException
java.io.IOException
public java.io.File createRepositoryPropertiesFile(java.io.File pRoot, java.lang.String pRepositoryPath, java.lang.String[] pDefinitionFiles, java.lang.String pCreateSQLAbsolutePath, java.lang.String pDropSQLAbsolutePath, java.lang.String[] pImportFiles) throws java.io.IOException
atg.adapter.gsa.InitializingGSA
class.
This implementation is used instead because it has the ability
to create tables and import data before the repository starts.
pRoot
- pRepositoryPath
- pDefinitionFiles
- pSQLAbsolutePath
- pDropSQLAbsolutePath
- pImportFiles
-
java.io.IOException
public java.io.File createRepositoryPropertiesFile(java.io.File pRoot, java.lang.String pRepositoryPath, java.lang.String[] pDefinitionFiles, java.lang.String pCreateSQLAbsolutePath, java.lang.String pDropSQLAbsolutePath, java.lang.String[] pImportFiles, java.lang.String pJTDataSourceName) throws java.io.IOException
atg.adapter.gsa.InitializingGSA
class.
This implementation is used instead because it has the ability
to create tables and import data before the repository starts.
pRoot
- pRepositoryPath
- pDefinitionFiles
- pSQLAbsolutePath
- pDropSQLAbsolutePath
- pImportFiles
-
java.io.IOException
protected java.util.Map<java.lang.String,java.lang.String> additionalVersionProperties(java.io.File pRoot, java.lang.String pRepositoryPath, java.lang.String pRepositoryName) throws java.io.IOException
pRoot
- pRepositoryPath
- pRepositoryName
-
java.io.IOException
public void copyToConfigpath(java.io.File pConfigRoot, java.lang.String pString) throws java.io.FileNotFoundException, java.io.IOException
prop
-
java.io.FileNotFoundException
java.io.IOException
public void copyToConfigpath(java.io.File pConfigRoot, java.lang.String pString, java.lang.String configPath) throws java.io.FileNotFoundException, java.io.IOException
prop
- configPath
- where in config path the file must be copied.
java.io.FileNotFoundException
java.io.IOException
public java.io.File createVersionRepositoryPropertiesFile(java.io.File pRoot, java.lang.String pRepositoryPath, java.lang.String[] pDefinitionFiles) throws java.io.IOException
atg.adapter.gsa.InitializingGSA
class.
This implementation is used instead because it has the ability
to create tables and import data before the repository starts.
pRoot
- pRepositoryPath
- pDefinitionFiles
-
java.io.IOException
public java.lang.String[] getTableNames(atg.adapter.gsa.GSARepository pRepository) throws java.lang.Exception
java.lang.Exception
public void assertEmptyRepository(DBUtils dbTwo, atg.adapter.gsa.GSARepository storeRepository) throws java.lang.Exception, java.sql.SQLException
dbTwo
- storeRepository
-
java.lang.Exception
java.sql.SQLException
public void createIDGeneratorTables(DBUtils db) throws java.sql.SQLException
db
-
java.sql.SQLException
public static void importFiles(atg.adapter.version.VersionRepository pVerRep, java.lang.String[] pImportFiles, java.lang.String pWorkspaceName, boolean pDoWithoutTransaction, java.lang.String pWorkspaceComment, boolean pCheckin) throws atg.versionmanager.exceptions.VersionException
pVerRep
- pImportFiles
- pWorkspaceName
- pDoWithoutTransaction
- pWorkspaceComment
-
atg.versionmanager.exceptions.VersionException
public static GSATestUtils getGSATestUtils()
public static GSATestUtils getVersionedGSATestUtils()
public static void dumpTable(atg.adapter.gsa.Table pTable, java.util.Collection<java.lang.String> pPrintColumnNames) throws java.sql.SQLException
pTable
-
java.sql.SQLException
public static void dumpTables(atg.adapter.gsa.GSARepository pRepository, java.lang.String pItemDescriptorName) throws atg.repository.RepositoryException, java.sql.SQLException
pVersionRepository
- pString
-
atg.repository.RepositoryException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |