Search in sources :

Example 16 with WadlGenerator

use of org.glassfish.jersey.server.wadl.WadlGenerator in project jersey by jersey.

the class WadlGeneratorConfigurationLoaderTest method testLoadConfigInstance.

@Test
public void testLoadConfigInstance() {
    final WadlGeneratorConfig config = WadlGeneratorConfig.generator(MyWadlGenerator.class).build();
    final ResourceConfig resourceConfig = new ResourceConfig();
    resourceConfig.property(ServerProperties.WADL_GENERATOR_CONFIG, config);
    final InjectionManager locator = InjectionManagerFactory.createInjectionManager(resourceConfig.getProperties());
    final WadlGenerator wadlGenerator = WadlGeneratorConfigLoader.loadWadlGeneratorsFromConfig(resourceConfig.getProperties()).createWadlGenerator(locator);
    Assert.assertTrue(wadlGenerator instanceof MyWadlGenerator);
}
Also used : WadlGenerator(org.glassfish.jersey.server.wadl.WadlGenerator) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) InjectionManager(org.glassfish.jersey.internal.inject.InjectionManager) Test(org.junit.Test)

Aggregations

WadlGenerator (org.glassfish.jersey.server.wadl.WadlGenerator)16 Test (org.junit.Test)11 InjectionManager (org.glassfish.jersey.internal.inject.InjectionManager)10 Properties (java.util.Properties)5 File (java.io.File)4 URL (java.net.URL)4 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)2 WadlGeneratorJAXBGrammarGenerator (org.glassfish.jersey.server.wadl.internal.generators.WadlGeneratorJAXBGrammarGenerator)2 Application (com.sun.research.ws.wadl.Application)1 Resource (com.sun.research.ws.wadl.Resource)1 Resources (com.sun.research.ws.wadl.Resources)1 StringWriter (java.io.StringWriter)1 ProcessingException (javax.ws.rs.ProcessingException)1 JAXBContext (javax.xml.bind.JAXBContext)1 Marshaller (javax.xml.bind.Marshaller)1 Resource (org.glassfish.jersey.server.model.Resource)1 ApplicationDescription (org.glassfish.jersey.server.wadl.internal.ApplicationDescription)1 WadlBuilder (org.glassfish.jersey.server.wadl.internal.WadlBuilder)1 WadlGeneratorImpl (org.glassfish.jersey.server.wadl.internal.WadlGeneratorImpl)1 WadlGeneratorResourceDocSupport (org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.WadlGeneratorResourceDocSupport)1