Package ubic.gemma.web.util
Class BaseSpringWebTest
- java.lang.Object
- 
- org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
- 
- ubic.gemma.core.util.test.BaseSpringContextTest
- 
- ubic.gemma.web.util.BaseSpringWebTest
 
 
 
- 
- All Implemented Interfaces:
- Aware,- InitializingBean,- ApplicationContextAware
 - Direct Known Subclasses:
- ArrayDesignControllerTest,- AuditControllerTest,- BibRefControllerTest,- CuratableValueObjectTest,- ErrorPagesTest,- ExperimentalDesignControllerIntegrationTest,- ExpressionExperimentControllerTest,- MessageSourceTest,- PubMedQueryControllerTest,- RssFeedControllerTest,- SchedulerSecurityTest,- SecurityControllerTest,- SignupControllerTest,- TaskRunningTest
 
 @ActiveProfiles("web") @WebAppConfiguration @ContextConfiguration(locations="classpath*:WEB-INF/gemma-servlet.xml") public abstract class BaseSpringWebTest extends BaseSpringContextTest 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) This is meant for integration tests, if you want to perform unit tests, consider usingWebAppConfigurationandContextConfigurationwith a static inner class annotated withConfiguration. Seeubic.gemma.web.services.rest.SearchWebServiceTestfor a complete example.- Author:
- pavlidis
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected WebApplicationContextapplicationContextprotected MockMvcmvc- 
Fields inherited from class ubic.gemma.core.util.test.BaseSpringContextTestexternalDatabaseService, jdbcTemplate, log, persisterHelper, rule, taxonService, testHelper
 - 
Fields inherited from class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTestslogger
 
- 
 - 
Constructor SummaryConstructors Constructor Description BaseSpringWebTest()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()MockHttpServletRequestnewGet(String url)MockHttpServletRequestnewPost(String url)Convenience methods to make tests simpler- 
Methods inherited from class ubic.gemma.core.util.test.BaseSpringContextTestaddTestAnalyses, countRowsInTable, deleteFromTables, executeSqlScript, getNewTestPersistentCompleteExpressionExperiment, getTaxon, getTestNonPersistentBioSequence, getTestPersistentArrayDesign, getTestPersistentArrayDesign, getTestPersistentArrayDesign, getTestPersistentBasicExpressionExperiment, getTestPersistentBasicExpressionExperiment, getTestPersistentBibliographicReference, getTestPersistentBioAssay, getTestPersistentBioAssay, getTestPersistentBioMaterial, getTestPersistentBioMaterial, getTestPersistentBioSequence, getTestPersistentBioSequence, getTestPersistentBioSequence2GeneProducts, getTestPersistentBlatResult, getTestPersistentBlatResult, getTestPersistentCompleteExpressionExperiment, getTestPersistentCompleteExpressionExperimentWithSequences, getTestPersistentCompleteExpressionExperimentWithSequences, getTestPersistentContact, getTestPersistentDatabaseEntry, getTestPersistentDatabaseEntry, getTestPersistentDatabaseEntry, getTestPersistentDatabaseEntry, getTestPersistentDatabaseEntry, getTestPersistentExpressionExperiment, getTestPersistentExpressionExperiment, getTestPersistentGene, getTestPersistentGene, getTestPersistentGeneProduct, getTestPersistentQuantitationType, randomName, resetTestCollectionSize, runAsAdmin, runAsAgent, runAsAnonymous, runAsUser, runAsUser, setPersisterHelper, setTaxonService, setTestCollectionSize, setUpAuthentication, setUpSecurityContextHolderStrategy, tearDownSecurityContext
 - 
Methods inherited from class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTestssetApplicationContext
 
- 
 
- 
- 
- 
Field Detail- 
applicationContext@Autowired protected WebApplicationContext applicationContext 
 - 
mvcprotected MockMvc mvc 
 
- 
 - 
Method Detail- 
afterPropertiesSet@OverridingMethodsMustInvokeSuper public void afterPropertiesSet() - Specified by:
- afterPropertiesSetin interface- InitializingBean
- Overrides:
- afterPropertiesSetin class- BaseSpringContextTest
 
 - 
newGetpublic MockHttpServletRequest newGet(String url) 
 - 
newPostpublic MockHttpServletRequest newPost(String url) Convenience methods to make tests simpler
 
- 
 
-