Package ubic.gemma.core.util.test
Class BaseSpringContextTest
- java.lang.Object
-
- org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
-
- ubic.gemma.core.util.test.BaseTest
-
- ubic.gemma.core.util.test.BaseIntegrationTest
-
- ubic.gemma.core.util.test.BaseSpringContextTest
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
AbstractArrayDesignProcessingTest
,AbstractGeoServiceTest
,AclAdviceTest
,AclAuthorizationTest
,AclCollectionBeforeTest
,AclCriteriaUtilsTest
,AclQueryUtilsTest
,ArrayDesignMergeServiceTest
,ArrayDesignReportServiceTest
,ArrayDesignServiceTest
,AuditAdviceTest
,AuditEventServiceTest
,AuditTrailDaoTest
,AuditTrailServiceImplTest
,BaseSpringWebTest
,BibliographicReferenceServiceImplTest
,BibliographicReferenceServiceTest
,BioAssayServiceTest
,BioMaterialServiceTest
,BioSequencePersistTest
,BlacklistedEntityServiceTest
,BlacklistTest
,BlatAssociationServiceTest
,BlatResultServiceTest
,CharacteristicServiceTest
,CompositeSequenceServiceTest
,CuratableValueObjectTest
,DatabaseEntryDaoImplTest
,DifferentialExpressionAnalysisServiceTest
,ExecutingTaskTest
,ExperimentalDesignImportDuplicateValueTest
,ExperimentalDesignImporterTest
,ExpressionAnalysisResultSetServiceTest
,ExpressionExperimentDeleteTest
,ExpressionExperimentReportServiceTest
,ExpressionExperimentServiceIntegrationTest
,ExpressionExperimentSetServiceTest
,ExpressionExperimentSetValueObjectHelperTest
,ExpressionExperimentSubSetServiceTest
,ExternalDatabaseServiceTest
,ExternalFileGeneLoaderServiceTest
,FactorValueServiceIntegrationTest
,FilteringVoEnabledServiceIntegrationTest
,Gene2GeneCoexpressionServiceTest
,GeneDiffExMetaAnalysisServiceTest
,GeneMultifunctionalityPopulationServiceTest
,GeneSearchTest
,GeneServiceTest
,GeneSetServiceTest
,GeneSetValueObjectHelperTest
,GenomePersisterTest
,GeoBrowserServiceTest
,GeoConverterTest
,LinkAnalysisServiceTest
,ManualAuthenticationProcessingTest
,NCBIGene2GOAssociationParserTest
,NCBIGeneLoadingTest
,PersisterTest
,PrincipalTest
,RetryTest
,SampleCoexpressionAnalysisServiceTest
,SearchServiceIntegrationTest
,SecureValueObjectAuthorizationTest
,SecurityServiceTest
,SimpleExpressionDataLoaderServiceTest
,SplitExperimentTest
,StrictBeanDefinitionValidatorTest
,TableMaintenanceUtilIntegrationTest
,TaxonLoaderTest
,TaxonServiceImplTest
,TaxonUtilsTest
,TwoChannelMissingValuesTest
,TwoWayAnovaWithInteractionTest2
,UserGroupServiceTest
,WhatsNewServiceTest
@Deprecated public abstract class BaseSpringContextTest extends BaseIntegrationTest
Deprecated.favour the simplerBaseIntegrationTest
for new testsAdd a few utilities on top ofBaseIntegrationTest
.- Author:
- pavlidis
-
-
Field Summary
Fields Modifier and Type Field Description protected ubic.gemma.persistence.service.common.description.ExternalDatabaseService
externalDatabaseService
Deprecated.protected org.apache.commons.logging.Log
log
Deprecated.protected ubic.gemma.persistence.persister.PersisterHelper
persisterHelper
Deprecated.org.mockito.junit.MockitoRule
rule
Deprecated.This allows the usage ofMock
annotation to create mocks.protected ubic.gemma.persistence.service.genome.taxon.TaxonService
taxonService
Deprecated.protected PersistentDummyObjectHelper
testHelper
Deprecated.
-
Constructor Summary
Constructors Constructor Description BaseSpringContextTest()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Collection<ubic.gemma.model.analysis.Analysis>
addTestAnalyses(ubic.gemma.model.expression.experiment.ExpressionExperiment ee)
Deprecated.Create testAnalysis
for the given expression experiment.protected int
countRowsInTable(String tableName)
Deprecated.Count the rows in the given table.protected int
deleteFromTables(String... names)
Deprecated.Convenience method for deleting all rows from the specified tables.protected org.springframework.jdbc.core.JdbcTemplate
getJdbcTemplate()
Deprecated.protected ubic.gemma.model.expression.experiment.ExpressionExperiment
getNewTestPersistentCompleteExpressionExperiment()
Deprecated.ubic.gemma.model.genome.Taxon
getTaxon(String commonName)
Deprecated.Obtain a taxon by its common name.protected ubic.gemma.model.genome.biosequence.BioSequence
getTestNonPersistentBioSequence(ubic.gemma.model.genome.Taxon t)
Deprecated.protected ubic.gemma.model.expression.arrayDesign.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.protected ubic.gemma.model.expression.arrayDesign.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.protected ubic.gemma.model.expression.arrayDesign.ArrayDesign
getTestPersistentArrayDesign(List<String> probeNames, ubic.gemma.model.genome.Taxon taxon)
Deprecated.Convenience method to provide an ArrayDesign that can be used to fill non-nullable associations in test objects.protected ubic.gemma.model.expression.experiment.ExpressionExperiment
getTestPersistentBasicExpressionExperiment()
Deprecated.protected ubic.gemma.model.expression.experiment.ExpressionExperiment
getTestPersistentBasicExpressionExperiment(ubic.gemma.model.expression.arrayDesign.ArrayDesign arrayDesign)
Deprecated.protected ubic.gemma.model.common.description.BibliographicReference
getTestPersistentBibliographicReference(String accession)
Deprecated.protected ubic.gemma.model.expression.bioAssay.BioAssay
getTestPersistentBioAssay(ubic.gemma.model.expression.arrayDesign.ArrayDesign ad)
Deprecated.Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects.protected ubic.gemma.model.expression.bioAssay.BioAssay
getTestPersistentBioAssay(ubic.gemma.model.expression.arrayDesign.ArrayDesign ad, ubic.gemma.model.expression.biomaterial.BioMaterial bm)
Deprecated.Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects.protected ubic.gemma.model.expression.biomaterial.BioMaterial
getTestPersistentBioMaterial()
Deprecated.protected ubic.gemma.model.expression.biomaterial.BioMaterial
getTestPersistentBioMaterial(ubic.gemma.model.genome.Taxon tax)
Deprecated.protected ubic.gemma.model.genome.biosequence.BioSequence
getTestPersistentBioSequence()
Deprecated.protected ubic.gemma.model.genome.biosequence.BioSequence
getTestPersistentBioSequence(ubic.gemma.model.genome.Taxon t)
Deprecated.Set<ubic.gemma.model.association.BioSequence2GeneProduct>
getTestPersistentBioSequence2GeneProducts(ubic.gemma.model.genome.biosequence.BioSequence bioSequence)
Deprecated.protected ubic.gemma.model.genome.sequenceAnalysis.BlatResult
getTestPersistentBlatResult(ubic.gemma.model.genome.biosequence.BioSequence querySequence)
Deprecated.protected ubic.gemma.model.genome.sequenceAnalysis.BlatResult
getTestPersistentBlatResult(ubic.gemma.model.genome.biosequence.BioSequence querySequence, ubic.gemma.model.genome.Taxon taxon)
Deprecated.protected ubic.gemma.model.expression.experiment.ExpressionExperiment
getTestPersistentCompleteExpressionExperiment(boolean readOnly)
Deprecated.Convenience method to get a (fairly) complete randomly generated persisted expression experiment.protected ubic.gemma.model.expression.experiment.ExpressionExperiment
getTestPersistentCompleteExpressionExperimentWithSequences()
Deprecated.Convenience method to get a (fairly) complete randomly generated persisted expression experiment.protected ubic.gemma.model.expression.experiment.ExpressionExperiment
getTestPersistentCompleteExpressionExperimentWithSequences(ubic.gemma.model.expression.experiment.ExpressionExperiment prototype)
Deprecated.protected ubic.gemma.model.common.auditAndSecurity.Contact
getTestPersistentContact()
Deprecated.Convenience method to provide a Contact that can be used to fill non-nullable associations in test objects.protected ubic.gemma.model.common.description.DatabaseEntry
getTestPersistentDatabaseEntry()
Deprecated.Get a database entry from a fictitious database.protected ubic.gemma.model.common.description.DatabaseEntry
getTestPersistentDatabaseEntry(String ed)
Deprecated.protected ubic.gemma.model.common.description.DatabaseEntry
getTestPersistentDatabaseEntry(String accession, String ed)
Deprecated.protected ubic.gemma.model.common.description.DatabaseEntry
getTestPersistentDatabaseEntry(String accession, ubic.gemma.model.common.description.ExternalDatabase ed)
Deprecated.Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects.protected ubic.gemma.model.common.description.DatabaseEntry
getTestPersistentDatabaseEntry(ubic.gemma.model.common.description.ExternalDatabase ed)
Deprecated.Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects.protected ubic.gemma.model.expression.experiment.ExpressionExperiment
getTestPersistentExpressionExperiment()
Deprecated.Convenience method to provide an ExpressionExperiment that can be used to fill non-nullable associations in test objects.protected ubic.gemma.model.expression.experiment.ExpressionExperiment
getTestPersistentExpressionExperiment(ubic.gemma.model.genome.Taxon taxon)
Deprecated.Convenience method to provide an ExpressionExperiment that can be used to fill non-nullable associations in test objects.protected ubic.gemma.model.genome.Gene
getTestPersistentGene()
Deprecated.ubic.gemma.model.genome.Gene
getTestPersistentGene(ubic.gemma.model.genome.Taxon taxon)
Deprecated.protected ubic.gemma.model.genome.gene.GeneProduct
getTestPersistentGeneProduct(ubic.gemma.model.genome.Gene gene)
Deprecated.protected ubic.gemma.model.common.quantitationtype.QuantitationType
getTestPersistentQuantitationType()
Deprecated.Convenience method to provide a QuantitationType that can be used to fill non-nullable associations in test objects.String
randomName()
Deprecated.Convenience shortcut for RandomStringUtils.randomAlphabetic( 10 ) (or something similar to that)protected void
resetTestCollectionSize()
Deprecated.Restore to default.protected void
runAsAdmin()
Deprecated.protected void
runAsAgent()
Deprecated.protected void
runAsAnonymous()
Deprecated.protected void
runAsUser(String userName)
Deprecated.protected void
runAsUser(String userName, boolean createIfMissing)
Deprecated.protected void
setTestCollectionSize(int size)
Deprecated.Change the number of elements created in collections (basically controls the size of test data sets).-
Methods inherited from class ubic.gemma.core.util.test.BaseIntegrationTest
setUpAuthentication, tearDownSecurityContext
-
-
-
-
Field Detail
-
log
protected final org.apache.commons.logging.Log log
Deprecated.
-
rule
public org.mockito.junit.MockitoRule rule
Deprecated.This allows the usage ofMock
annotation to create mocks.
-
externalDatabaseService
@Autowired protected ubic.gemma.persistence.service.common.description.ExternalDatabaseService externalDatabaseService
Deprecated.
-
persisterHelper
@Autowired protected ubic.gemma.persistence.persister.PersisterHelper persisterHelper
Deprecated.
-
taxonService
@Autowired protected ubic.gemma.persistence.service.genome.taxon.TaxonService taxonService
Deprecated.
-
testHelper
@Autowired protected PersistentDummyObjectHelper testHelper
Deprecated.
-
-
Method Detail
-
getJdbcTemplate
protected org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate()
Deprecated.
-
getTaxon
public ubic.gemma.model.genome.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 ubic.gemma.model.genome.Gene getTestPersistentGene(ubic.gemma.model.genome.Taxon taxon)
Deprecated.
-
getTestPersistentBioSequence2GeneProducts
public Set<ubic.gemma.model.association.BioSequence2GeneProduct> getTestPersistentBioSequence2GeneProducts(ubic.gemma.model.genome.biosequence.BioSequence bioSequence)
Deprecated.
-
randomName
public String randomName()
Deprecated.Convenience shortcut for RandomStringUtils.randomAlphabetic( 10 ) (or something similar to that)- Returns:
- random alphabetic string
-
addTestAnalyses
protected Collection<ubic.gemma.model.analysis.Analysis> addTestAnalyses(ubic.gemma.model.expression.experiment.ExpressionExperiment ee)
Deprecated.Create testAnalysis
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 ubic.gemma.model.genome.Gene getTestPersistentGene()
Deprecated.
-
getTestPersistentArrayDesign
protected ubic.gemma.model.expression.arrayDesign.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 ubic.gemma.model.expression.arrayDesign.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_atdoSequence
- add sequences to the array design that is created. Faster to avoid if you can.readOnly
- read only- Returns:
- array design
-
getTestPersistentArrayDesign
protected ubic.gemma.model.expression.arrayDesign.ArrayDesign getTestPersistentArrayDesign(List<String> probeNames, ubic.gemma.model.genome.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 ArrayDesigntaxon
- of the ArrayDesign- Returns:
- ArrayDesign with no TechnologyType
-
getTestPersistentBasicExpressionExperiment
protected ubic.gemma.model.expression.experiment.ExpressionExperiment getTestPersistentBasicExpressionExperiment()
Deprecated.- Returns:
- EE with no data; just bioassays, biomaterials, quantitation types and (minimal) array designs.
-
getTestPersistentBasicExpressionExperiment
protected ubic.gemma.model.expression.experiment.ExpressionExperiment getTestPersistentBasicExpressionExperiment(ubic.gemma.model.expression.arrayDesign.ArrayDesign arrayDesign)
Deprecated.- Parameters:
arrayDesign
- platform- Returns:
- EE with no data; just bioassays, biomaterials, quantitation types and provided arrayDesign
-
getTestPersistentBibliographicReference
protected ubic.gemma.model.common.description.BibliographicReference getTestPersistentBibliographicReference(String accession)
Deprecated.
-
getTestPersistentBioAssay
protected ubic.gemma.model.expression.bioAssay.BioAssay getTestPersistentBioAssay(ubic.gemma.model.expression.arrayDesign.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 ubic.gemma.model.expression.bioAssay.BioAssay getTestPersistentBioAssay(ubic.gemma.model.expression.arrayDesign.ArrayDesign ad, ubic.gemma.model.expression.biomaterial.BioMaterial bm)
Deprecated.Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects.- Parameters:
ad
- platformbm
- material- Returns:
- bio assay
-
getTestPersistentBioMaterial
protected ubic.gemma.model.expression.biomaterial.BioMaterial getTestPersistentBioMaterial()
Deprecated.
-
getTestPersistentBioMaterial
protected ubic.gemma.model.expression.biomaterial.BioMaterial getTestPersistentBioMaterial(ubic.gemma.model.genome.Taxon tax)
Deprecated.
-
getTestPersistentBioSequence
protected ubic.gemma.model.genome.biosequence.BioSequence getTestPersistentBioSequence()
Deprecated.
-
getTestPersistentBioSequence
protected ubic.gemma.model.genome.biosequence.BioSequence getTestPersistentBioSequence(ubic.gemma.model.genome.Taxon t)
Deprecated.
-
getTestNonPersistentBioSequence
protected ubic.gemma.model.genome.biosequence.BioSequence getTestNonPersistentBioSequence(ubic.gemma.model.genome.Taxon t)
Deprecated.
-
getTestPersistentBlatResult
protected ubic.gemma.model.genome.sequenceAnalysis.BlatResult getTestPersistentBlatResult(ubic.gemma.model.genome.biosequence.BioSequence querySequence, ubic.gemma.model.genome.Taxon taxon)
Deprecated.
-
getTestPersistentBlatResult
protected ubic.gemma.model.genome.sequenceAnalysis.BlatResult getTestPersistentBlatResult(ubic.gemma.model.genome.biosequence.BioSequence querySequence)
Deprecated.
-
getTestPersistentCompleteExpressionExperiment
protected ubic.gemma.model.expression.experiment.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 ubic.gemma.model.expression.experiment.ExpressionExperiment getTestPersistentCompleteExpressionExperimentWithSequences()
Deprecated.Convenience method to get a (fairly) complete randomly generated persisted expression experiment.- Returns:
- EE
-
getNewTestPersistentCompleteExpressionExperiment
protected ubic.gemma.model.expression.experiment.ExpressionExperiment getNewTestPersistentCompleteExpressionExperiment()
Deprecated.
-
getTestPersistentCompleteExpressionExperimentWithSequences
protected ubic.gemma.model.expression.experiment.ExpressionExperiment getTestPersistentCompleteExpressionExperimentWithSequences(ubic.gemma.model.expression.experiment.ExpressionExperiment prototype)
Deprecated.- Parameters:
prototype
- used to choose the platform- Returns:
- EE
-
getTestPersistentContact
protected ubic.gemma.model.common.auditAndSecurity.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 ubic.gemma.model.common.description.DatabaseEntry getTestPersistentDatabaseEntry()
Deprecated.Get a database entry from a fictitious database.- Returns:
- Db entry
-
getTestPersistentDatabaseEntry
protected ubic.gemma.model.common.description.DatabaseEntry getTestPersistentDatabaseEntry(ubic.gemma.model.common.description.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 ubic.gemma.model.common.description.DatabaseEntry getTestPersistentDatabaseEntry(String ed)
Deprecated.
-
getTestPersistentDatabaseEntry
protected ubic.gemma.model.common.description.DatabaseEntry getTestPersistentDatabaseEntry(String accession, ubic.gemma.model.common.description.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
- accessioned
- database- Returns:
- Db entry
-
getTestPersistentDatabaseEntry
protected ubic.gemma.model.common.description.DatabaseEntry getTestPersistentDatabaseEntry(String accession, String ed)
Deprecated.
-
getTestPersistentExpressionExperiment
protected ubic.gemma.model.expression.experiment.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 ubic.gemma.model.expression.experiment.ExpressionExperiment getTestPersistentExpressionExperiment(ubic.gemma.model.genome.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 ubic.gemma.model.genome.gene.GeneProduct getTestPersistentGeneProduct(ubic.gemma.model.genome.Gene gene)
Deprecated.
-
getTestPersistentQuantitationType
protected ubic.gemma.model.common.quantitationtype.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:
TestAuthenticationUtils.runAsAdmin()
-
runAsAgent
protected void runAsAgent()
Deprecated.- See Also:
TestAuthenticationUtils.runAsAgent()
-
runAsUser
protected void runAsUser(String userName)
Deprecated.
-
runAsUser
protected void runAsUser(String userName, boolean createIfMissing)
Deprecated.
-
runAsAnonymous
protected void runAsAnonymous()
Deprecated.- See Also:
TestAuthenticationUtils.runAsAnonymous()
-
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
-
-