Package ubic.gemma.rest.util
Class BaseJerseyTest
- java.lang.Object
-
- org.glassfish.jersey.test.JerseyTest
-
- ubic.gemma.rest.util.BaseJerseyTest
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
AnnotationsWebServiceTest
,BaseJerseyIntegrationTest
,DatasetsWebServiceTest
,SearchWebServiceTest
@ActiveProfiles({"web","test"}) @WebAppConfiguration @TestExecutionListeners({org.springframework.test.context.web.ServletTestExecutionListener.class,org.springframework.test.context.support.DependencyInjectionTestExecutionListener.class,org.springframework.test.context.support.DirtiesContextTestExecutionListener.class}) public abstract class BaseJerseyTest extends org.glassfish.jersey.test.JerseyTest implements org.springframework.context.ApplicationContextAware
Base class for Jersey-based tests that needs aWebApplicationContext
for loading and configuring or mocking Spring components.Unfortunately, it is not possible to inherit from
AbstractJUnit4SpringContextTests
, so we have to borrow some its annotations here.- Author:
- poirigui
-
-
Constructor Summary
Constructors Constructor Description BaseJerseyTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.ws.rs.core.Application
configure()
protected void
configureClient(org.glassfish.jersey.client.ClientConfig config)
protected org.glassfish.jersey.test.spi.TestContainerFactory
getTestContainerFactory()
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setUp()
This is intentionally made final to prevent subclasses from overriding.void
tearDown()
This is intentionally made final to prevent subclasses from overriding.-
Methods inherited from class org.glassfish.jersey.test.JerseyTest
client, close, closeIfNotNull, configureDeployment, disable, enable, forceDisable, forceEnable, forceSet, getAsyncTimeoutMultiplier, getBaseUri, getClient, getLastLoggedRecord, getLoggedRecords, getPort, isEnabled, set, set, setClient, target, target
-
-
-
-
Method Detail
-
getTestContainerFactory
protected final org.glassfish.jersey.test.spi.TestContainerFactory getTestContainerFactory() throws org.glassfish.jersey.test.spi.TestContainerException
- Overrides:
getTestContainerFactory
in classorg.glassfish.jersey.test.JerseyTest
- Throws:
org.glassfish.jersey.test.spi.TestContainerException
-
configure
protected final javax.ws.rs.core.Application configure()
- Overrides:
configure
in classorg.glassfish.jersey.test.JerseyTest
-
setApplicationContext
public final void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
configureClient
protected final void configureClient(org.glassfish.jersey.client.ClientConfig config)
- Overrides:
configureClient
in classorg.glassfish.jersey.test.JerseyTest
-
setUp
public final void setUp() throws Exception
This is intentionally made final to prevent subclasses from overriding.- Overrides:
setUp
in classorg.glassfish.jersey.test.JerseyTest
- Throws:
Exception
-
-