Class BaseSpringWebTest

java.lang.Object
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AuditControllerTest, BibRefControllerTest, ExperimentalDesignControllerIntegrationTest, ExpressionExperimentControllerTest, PubMedQueryControllerTest, RssFeedControllerTest, SecurityControllerTest

@Deprecated public abstract class BaseSpringWebTest extends BaseWebIntegrationTest
Deprecated.
favour the simpler BaseWebIntegrationTest for new tests
Class to extend for tests of controllers et al. that need a spring context. Provides convenience methods for dealing with mock requests and responses. Also provides a safe port to send email on for testing (for example, using dumbster)
Author:
pavlidis
  • Field Details

    • log

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

      @Autowired protected ExternalDatabaseService externalDatabaseService
      Deprecated.
    • taxonService

      @Autowired protected TaxonService taxonService
      Deprecated.
    • testHelper

      @Autowired protected PersistentDummyObjectHelper testHelper
      Deprecated.
  • Constructor Details

    • BaseSpringWebTest

      public BaseSpringWebTest()
      Deprecated.
  • Method Details

    • 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
    • getTestPersistentBasicExpressionExperiment

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

      protected BibliographicReference getTestPersistentBibliographicReference(String accession)
      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
    • 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 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
    • 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
    • runAsUser

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