Class BaseSpringContextTest

java.lang.Object
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AbstractArrayDesignProcessingTest, AbstractGeoServiceTest, AclAdviceTest, AclAuthorizationTest, AclCollectionBeforeTest, AclCriteriaUtilsTest, AclQueryUtilsTest, ArrayDesignMergeServiceTest, ArrayDesignReportServiceTest, AuditAdviceTest, AuditEventServiceTest, AuditTrailDaoTest, AuditTrailServiceImplTest, BibliographicReferenceServiceImplTest, BibliographicReferenceServiceTest, BioAssayServiceTest, BioMaterialServiceTest, BioSequencePersistTest, BlacklistedEntityServiceTest, BlacklistTest, BlatAssociationServiceTest, BlatResultServiceTest, CharacteristicServiceTest, CompositeSequenceServiceTest, CuratableValueObjectTest, DatabaseEntryDaoImplTest, ExecutingTaskTest, ExperimentalDesignImportDuplicateValueTest, ExperimentalDesignImporterTest, ExpressionAnalysisResultSetServiceTest, ExpressionExperimentDeleteTest, ExpressionExperimentReportServiceTest, ExpressionExperimentServiceIntegrationTest, ExpressionExperimentSetServiceTest, ExpressionExperimentSetValueObjectHelperTest, ExpressionExperimentSubSetServiceTest, ExternalDatabaseServiceTest, ExternalFileGeneLoaderServiceTest, FactorValueServiceIntegrationTest, Gene2GeneCoexpressionServiceTest, GeneDiffExMetaAnalysisServiceTest, GeneMultifunctionalityPopulationServiceTest, GeneSetServiceTest, GeneSetValueObjectHelperTest, GenomePersisterTest, GeoBrowserServiceTest, LinkAnalysisServiceTest, ManualAuthenticationProcessingTest, NCBIGene2GOAssociationParserTest, NCBIGeneLoadingTest, PersisterTest, PrincipalTest, RetryTest, SampleCoexpressionAnalysisServiceTest, SearchServiceIntegrationTest, SecureValueObjectAuthorizationTest, SecurityServiceTest, SimpleExpressionDataLoaderServiceTest, SplitExperimentTest, StrictBeanDefinitionValidatorTest, TaxonLoaderTest, TaxonUtilsTest, TwoChannelMissingValuesTest, TwoWayAnovaWithInteractionTest2, UserGroupServiceTest, WhatsNewServiceTest

@Deprecated public abstract class BaseSpringContextTest extends BaseIntegrationTest
Deprecated.
favour the simpler BaseIntegrationTest for new tests
Add a few utilities on top of BaseIntegrationTest.
Author:
pavlidis
  • Field Details

    • log

      protected final org.apache.commons.logging.Log log
      Deprecated.
    • rule

      public org.mockito.junit.MockitoRule rule
      Deprecated.
      This allows the usage of Mock annotation to create mocks.
    • externalDatabaseService

      @Autowired protected ExternalDatabaseService externalDatabaseService
      Deprecated.
    • persisterHelper

      @Autowired protected PersisterHelper persisterHelper
      Deprecated.
    • taxonService

      @Autowired protected TaxonService taxonService
      Deprecated.
    • testHelper

      @Autowired protected PersistentDummyObjectHelper testHelper
      Deprecated.
  • Constructor Details

    • BaseSpringContextTest

      public BaseSpringContextTest()
      Deprecated.
  • Method Details

    • getJdbcTemplate

      protected org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate()
      Deprecated.
    • getTaxon

      public Taxon getTaxon(String commonName)
      Deprecated.
      Obtain a taxon by its common name.

      See sql/init-data.sql for a list of available taxa to use in tests.

    • getTestPersistentGene

      public Gene getTestPersistentGene(Taxon taxon)
      Deprecated.
    • getTestPersistentBioSequence2GeneProducts

      public Set<BioSequence2GeneProduct> getTestPersistentBioSequence2GeneProducts(BioSequence bioSequence)
      Deprecated.
    • randomName

      public String randomName()
      Deprecated.
      Convenience shortcut for RandomStringUtils.insecure().nextAlphabetic( 10 ) (or something similar to that)
      Returns:
      random alphabetic string
    • addTestAnalyses

      protected Collection<Analysis> addTestAnalyses(ExpressionExperiment ee)
      Deprecated.
      Create test Analysis for the given expression experiment.
      Parameters:
      ee - expression experiment to use for creating test analyses
      Returns:
      a collection of persisted analyses that were created
    • countRowsInTable

      protected int countRowsInTable(String tableName)
      Deprecated.
      Count the rows in the given table.
      Parameters:
      tableName - table name to count rows in
      Returns:
      the number of rows in the table
    • deleteFromTables

      protected int deleteFromTables(String... names)
      Deprecated.
      Convenience method for deleting all rows from the specified tables. Use with caution outside of a transaction!
      Parameters:
      names - the names of the tables from which to remove
      Returns:
      the total number of rows deleted from all specified tables
    • getTestPersistentGene

      protected Gene getTestPersistentGene()
      Deprecated.
    • getTestPersistentArrayDesign

      protected ArrayDesign getTestPersistentArrayDesign(int numCompositeSequences, boolean randomNames)
      Deprecated.
      Convenience method to provide an ArrayDesign that can be used to fill non-nullable associations in test objects. The ArrayDesign is provided with some CompositeSequence DesignElements if desired. If composite sequences are created, they are each associated with a single generated Reporter.
      Parameters:
      numCompositeSequences - The number of CompositeSequences to populate the ArrayDesign with.
      randomNames - If true, probe names will be random strings; otherwise they will be 0_at....N_at
      Returns:
      array design
    • getTestPersistentArrayDesign

      protected ArrayDesign getTestPersistentArrayDesign(int numCompositeSequences, boolean randomNames, boolean doSequence, boolean readOnly)
      Deprecated.
      Convenience method to provide an ArrayDesign that can be used to fill non-nullable associations in test objects. The ArrayDesign is provided with some CompositeSequence DesignElements if desired. If composite sequences are created, they are each associated with a single generated Reporter.
      Parameters:
      numCompositeSequences - The number of CompositeSequences to populate the ArrayDesign with.
      randomNames - If true, probe names will be random strings; otherwise they will be 0_at....N_at
      doSequence - add sequences to the array design that is created. Faster to avoid if you can.
      readOnly - read only
      Returns:
      array design
    • getTestPersistentArrayDesign

      protected ArrayDesign getTestPersistentArrayDesign(List<String> probeNames, Taxon taxon)
      Deprecated.
      Convenience method to provide an ArrayDesign that can be used to fill non-nullable associations in test objects.
      Parameters:
      probeNames - will be assigned to each CompositeSequence in the ArrayDesign
      taxon - of the ArrayDesign
      Returns:
      ArrayDesign with no TechnologyType
    • getTestPersistentBasicExpressionExperiment

      protected ExpressionExperiment getTestPersistentBasicExpressionExperiment()
      Deprecated.
      Returns:
      EE with no data; just bioassays, biomaterials, quantitation types and (minimal) array designs.
    • getTestPersistentBasicExpressionExperiment

      protected ExpressionExperiment getTestPersistentBasicExpressionExperiment(ArrayDesign arrayDesign)
      Deprecated.
      Parameters:
      arrayDesign - platform
      Returns:
      EE with no data; just bioassays, biomaterials, quantitation types and provided arrayDesign
    • getTestPersistentBibliographicReference

      protected BibliographicReference getTestPersistentBibliographicReference(String accession)
      Deprecated.
    • getTestPersistentBioAssay

      protected BioAssay getTestPersistentBioAssay(ArrayDesign ad)
      Deprecated.
      Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects.
      Parameters:
      ad - paltform
      Returns:
      bio assay
    • getTestPersistentBioAssay

      protected BioAssay getTestPersistentBioAssay(ArrayDesign ad, BioMaterial bm)
      Deprecated.
      Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects.
      Parameters:
      ad - platform
      bm - material
      Returns:
      bio assay
    • getTestPersistentBioMaterial

      protected BioMaterial getTestPersistentBioMaterial()
      Deprecated.
    • getTestPersistentBioMaterial

      protected BioMaterial getTestPersistentBioMaterial(Taxon tax)
      Deprecated.
    • getTestPersistentBioSequence

      protected BioSequence getTestPersistentBioSequence()
      Deprecated.
    • getTestPersistentBioSequence

      protected BioSequence getTestPersistentBioSequence(Taxon t)
      Deprecated.
    • getTestNonPersistentBioSequence

      protected BioSequence getTestNonPersistentBioSequence(Taxon t)
      Deprecated.
    • getTestPersistentBlatResult

      protected BlatResult getTestPersistentBlatResult(BioSequence querySequence, Taxon taxon)
      Deprecated.
    • getTestPersistentBlatResult

      protected BlatResult getTestPersistentBlatResult(BioSequence querySequence)
      Deprecated.
    • getTestPersistentCompleteExpressionExperiment

      protected ExpressionExperiment getTestPersistentCompleteExpressionExperiment(boolean readOnly)
      Deprecated.
      Convenience method to get a (fairly) complete randomly generated persisted expression experiment.
      Parameters:
      readOnly - If the test only needs to read, a new data set might not be created.
      Returns:
      EE
    • getTestPersistentCompleteExpressionExperimentWithSequences

      protected ExpressionExperiment getTestPersistentCompleteExpressionExperimentWithSequences()
      Deprecated.
      Convenience method to get a (fairly) complete randomly generated persisted expression experiment.
      Returns:
      EE
    • getNewTestPersistentCompleteExpressionExperiment

      protected ExpressionExperiment getNewTestPersistentCompleteExpressionExperiment()
      Deprecated.
    • getTestPersistentCompleteExpressionExperimentWithSequences

      protected ExpressionExperiment getTestPersistentCompleteExpressionExperimentWithSequences(ExpressionExperiment prototype)
      Deprecated.
      Parameters:
      prototype - used to choose the platform
      Returns:
      EE
    • getTestPersistentContact

      protected Contact getTestPersistentContact()
      Deprecated.
      Convenience method to provide a Contact that can be used to fill non-nullable associations in test objects.
      Returns:
      Contact
    • getTestPersistentDatabaseEntry

      protected DatabaseEntry getTestPersistentDatabaseEntry()
      Deprecated.
      Get a database entry from a fictitious database.
      Returns:
      Db entry
    • getTestPersistentDatabaseEntry

      protected DatabaseEntry getTestPersistentDatabaseEntry(ExternalDatabase ed)
      Deprecated.
      Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects. The accession and ExternalDatabase name are set to random strings.
      Parameters:
      ed - external Db
      Returns:
      Db entry
    • getTestPersistentDatabaseEntry

      protected DatabaseEntry getTestPersistentDatabaseEntry(String ed)
      Deprecated.
    • getTestPersistentDatabaseEntry

      protected DatabaseEntry getTestPersistentDatabaseEntry(String accession, ExternalDatabase ed)
      Deprecated.
      Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects. The accession and ExternalDatabase name are set to random strings.
      Parameters:
      accession - accession
      ed - database
      Returns:
      Db entry
    • getTestPersistentDatabaseEntry

      protected DatabaseEntry getTestPersistentDatabaseEntry(String accession, String ed)
      Deprecated.
    • getTestPersistentExpressionExperiment

      protected ExpressionExperiment getTestPersistentExpressionExperiment()
      Deprecated.
      Convenience method to provide an ExpressionExperiment that can be used to fill non-nullable associations in test objects. This implementation does NOT fill in associations of the created object.
      Returns:
      EE
    • getTestPersistentExpressionExperiment

      protected ExpressionExperiment getTestPersistentExpressionExperiment(Taxon taxon)
      Deprecated.
      Convenience method to provide an ExpressionExperiment that can be used to fill non-nullable associations in test objects. This implementation does NOT fill in associations of the created object except for the creation of persistent BioMaterials and BioAssays so that database taxon lookups for this experiment will work.
      Parameters:
      taxon - taxon
      Returns:
      EE
    • getTestPersistentGeneProduct

      protected GeneProduct getTestPersistentGeneProduct(Gene gene)
      Deprecated.
    • getTestPersistentQuantitationType

      protected QuantitationType getTestPersistentQuantitationType()
      Deprecated.
      Convenience method to provide a QuantitationType that can be used to fill non-nullable associations in test objects.
      Returns:
      QT
    • resetTestCollectionSize

      protected void resetTestCollectionSize()
      Deprecated.
      Restore to default.
    • runAsAdmin

      protected void runAsAdmin()
      Deprecated.
      See Also:
    • runAsAgent

      protected void runAsAgent()
      Deprecated.
      See Also:
    • runAsUser

      protected void runAsUser(String userName)
      Deprecated.
      See Also:
    • runAsUser

      protected void runAsUser(String userName, boolean createIfMissing)
      Deprecated.
      See Also:
    • runAsAnonymous

      protected void runAsAnonymous()
      Deprecated.
      See Also:
    • setTestCollectionSize

      protected void setTestCollectionSize(int size)
      Deprecated.
      Change the number of elements created in collections (basically controls the size of test data sets). This need not be called unless the test needs larger data sets. Call resetTestCollectionSize after you are done.
      Parameters:
      size - size