atg.adapter.gsa
Class GSATest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by atg.adapter.gsa.GSATest
All Implemented Interfaces:
junit.framework.Test

public class GSATest
extends junit.framework.TestCase

A basic GSA test which is expected to be extended than used directly. Has several utility methods.

Author:
adwivedi

Constructor Summary
GSATest()
           
GSATest(java.lang.String arg0)
          Constructor for GSATest.
 
Method Summary
protected  atg.repository.MutableRepositoryItem createDummyItem(atg.adapter.gsa.GSARepository pGSARepository, java.lang.String descName, java.lang.String pID)
           
protected  java.lang.Object generateDummyValue(atg.repository.RepositoryPropertyDescriptor propertyDescriptor)
           
 java.io.File getConfigpath()
           
 java.io.File getConfigpath(java.lang.String pConfigDirectory)
          Returns the configpath for tests
protected  atg.adapter.gsa.GSAId getNewCompoundId(atg.adapter.gsa.GSARepository r, atg.adapter.gsa.GSAItemDescriptor desc)
          Get a id suitable for creating items of this type.
protected  DBUtils initDB(java.util.Properties props)
           
protected  void setUp()
           
protected  void setUpAndTest(java.io.File pConfigPathWhereToCreateTheRepository, java.lang.String[] definitionFiles, java.util.Properties pDBProperties, java.lang.String pMethodName)
          Create a repository in the given configpath using the given repository definitions (Absolute paths) connecting to the db whose properties are specified in pDBProperties @see DBUtils Method pMethodName is invoked with the GSARepository passed to it as a parameter.
protected  void setUpAndTest(java.lang.String pMethodName)
          Createa a file using reasonable defaults.
static atg.nucleus.Nucleus startNucleus(java.io.File configpath)
          Starts Nucleus using the given config directory
static atg.nucleus.Nucleus startNucleus(java.lang.String configpathStr)
          Starts Nucleus given an array of configpath entries
protected  void tearDown()
           
 void testDummy()
          A Dummy test so smokestack won't report this class as a failure.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GSATest

public GSATest()

GSATest

public GSATest(java.lang.String arg0)
Constructor for GSATest.

Parameters:
arg0 -
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

getConfigpath

public java.io.File getConfigpath()

getConfigpath

public java.io.File getConfigpath(java.lang.String pConfigDirectory)
Returns the configpath for tests

Returns:

setUpAndTest

protected void setUpAndTest(java.io.File pConfigPathWhereToCreateTheRepository,
                            java.lang.String[] definitionFiles,
                            java.util.Properties pDBProperties,
                            java.lang.String pMethodName)
                     throws java.lang.Exception
Create a repository in the given configpath using the given repository definitions (Absolute paths) connecting to the db whose properties are specified in pDBProperties @see DBUtils Method pMethodName is invoked with the GSARepository passed to it as a parameter.

Parameters:
pConfigPathWhereToCreateTheRepository -
definitionFiles -
pDBProperties -
pMethodName -
Throws:
java.lang.Exception
java.lang.Exception

setUpAndTest

protected void setUpAndTest(java.lang.String pMethodName)
                     throws java.lang.Exception
Createa a file using reasonable defaults. Your definition file should exist in the same package as the test and should be names Repository.xml. Configpath is assumed to be what is returned

Parameters:
pMethodName -
Throws:
java.lang.Exception
java.lang.Exception

startNucleus

public static atg.nucleus.Nucleus startNucleus(java.io.File configpath)
Starts Nucleus using the given config directory

Parameters:
configpath -
Returns:

startNucleus

public static atg.nucleus.Nucleus startNucleus(java.lang.String configpathStr)
Starts Nucleus given an array of configpath entries

Parameters:
configpathStr -
Returns:

initDB

protected DBUtils initDB(java.util.Properties props)
                  throws java.lang.Exception,
                         java.sql.SQLException
Parameters:
dbName -
Returns:
Throws:
java.lang.Exception
java.sql.SQLException

testDummy

public final void testDummy()
A Dummy test so smokestack won't report this class as a failure. It expects that all *Test.class files have at least one test.


createDummyItem

protected atg.repository.MutableRepositoryItem createDummyItem(atg.adapter.gsa.GSARepository pGSARepository,
                                                               java.lang.String descName,
                                                               java.lang.String pID)
                                                        throws atg.repository.RepositoryException
Parameters:
pGSARepository -
descName -
Returns:
Throws:
atg.repository.RepositoryException

getNewCompoundId

protected atg.adapter.gsa.GSAId getNewCompoundId(atg.adapter.gsa.GSARepository r,
                                                 atg.adapter.gsa.GSAItemDescriptor desc)
                                          throws atg.repository.RepositoryException
Get a id suitable for creating items of this type. We use out Repository's IdGenerator.

Returns:
a new id, which is unique across all items in this repository with this item descriptor.
Throws:
atg.repository.RepositoryException - if there is trouble creating the id

generateDummyValue

protected java.lang.Object generateDummyValue(atg.repository.RepositoryPropertyDescriptor propertyDescriptor)


Copyright © 2009. All Rights Reserved.