use of org.jboss.as.jaxrs.deployment.JaxrsMethodParameterProcessor in project wildfly by wildfly.
the class JaxrsMethodParameterProcessorTestCase method primitiveParameterTest.
/**
* Check the primitive datatypes are not processed by any converter.
* @throws Exception
*/
@Test
public void primitiveParameterTest() throws Exception {
providers.clear();
resources.clear();
providers.add(SimpleClassParamConverterProvider.class.getName());
resources.add(PrimitiveParamResource.class.getName());
JaxrsMethodParameterProcessor jProcessor = new JaxrsMethodParameterProcessor();
try {
jProcessor.testProcessor(Thread.currentThread().getContextClassLoader(), resteasyDeploymentData);
} catch (Exception e) {
Assert.fail("Test failed no exception should have been thrown");
}
}
use of org.jboss.as.jaxrs.deployment.JaxrsMethodParameterProcessor in project wildfly by wildfly.
the class JaxrsMethodParameterProcessorTestCase method fromStringTest.
@Test
public void fromStringTest() throws Exception {
providers.clear();
resources.clear();
providers.add(SimpleFromStringProvider.class.getName());
resources.add(SimpleFromStringResource.class.getName());
JaxrsMethodParameterProcessor jProcessor = new JaxrsMethodParameterProcessor();
try {
jProcessor.testProcessor(Thread.currentThread().getContextClassLoader(), resteasyDeploymentData);
} catch (Exception e) {
Assert.fail("Test failed. It should not have thrown an exception: " + e);
}
}
use of org.jboss.as.jaxrs.deployment.JaxrsMethodParameterProcessor in project wildfly by wildfly.
the class JaxrsSubsystemAdd method performBoottime.
protected void performBoottime(final OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
final ServiceTarget serviceTarget = context.getServiceTarget();
JaxrsLogger.JAXRS_LOGGER.resteasyVersion(ResteasyDeployment.class.getPackage().getImplementationVersion());
context.addStep(new AbstractDeploymentChainStep() {
public void execute(DeploymentProcessorTarget processorTarget) {
processorTarget.addDeploymentProcessor(JaxrsExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_JAXRS_ANNOTATIONS, new JaxrsAnnotationProcessor());
processorTarget.addDeploymentProcessor(JaxrsExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_JAXRS_SPRING, new JaxrsSpringProcessor(serviceTarget));
processorTarget.addDeploymentProcessor(JaxrsExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_JAXRS, new JaxrsDependencyProcessor());
processorTarget.addDeploymentProcessor(JaxrsExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_JAXRS_SCANNING, new JaxrsScanningProcessor());
processorTarget.addDeploymentProcessor(JaxrsExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_JAXRS_COMPONENT, new JaxrsComponentDeployer());
CapabilityServiceSupport capabilities = context.getCapabilityServiceSupport();
if (capabilities.hasCapability(WELD_CAPABILITY_NAME)) {
processorTarget.addDeploymentProcessor(JaxrsExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_JAXRS_CDI_INTEGRATION, new JaxrsCdiIntegrationProcessor());
}
processorTarget.addDeploymentProcessor(JaxrsExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_JAXRS_METHOD_PARAMETER, new JaxrsMethodParameterProcessor());
processorTarget.addDeploymentProcessor(JaxrsExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_JAXRS_DEPLOYMENT, new JaxrsIntegrationProcessor());
}
}, OperationContext.Stage.RUNTIME);
JaxrsServerConfig serverConfig = createServerConfig(operation, context);
JaxrsServerConfigService.install(serviceTarget, serverConfig);
}
use of org.jboss.as.jaxrs.deployment.JaxrsMethodParameterProcessor in project wildfly by wildfly.
the class JaxrsMethodParameterProcessorTestCase method valueOfTest.
@Test
public void valueOfTest() throws Exception {
providers.clear();
resources.clear();
providers.add(SimpleValueOfProvider.class.getName());
resources.add(SimpleValueOfResource.class.getName());
JaxrsMethodParameterProcessor jProcessor = new JaxrsMethodParameterProcessor();
try {
jProcessor.testProcessor(Thread.currentThread().getContextClassLoader(), resteasyDeploymentData);
} catch (Exception e) {
Assert.fail("Test failed. It should not have thrown an exception: " + e);
}
}
use of org.jboss.as.jaxrs.deployment.JaxrsMethodParameterProcessor in project wildfly by wildfly.
the class JaxrsMethodParameterProcessorTestCase method customParameterTest.
/**
* Check that a custom datatype is process by the ParamConverterProvider.
* The provider throws an exception by design.
*
* @throws Exception
*/
@Test
public void customParameterTest() throws Exception {
providers.clear();
resources.clear();
providers.add(SimpleClassParamConverterProvider.class.getName());
resources.add(SimpleClassParamConverterResource.class.getName());
JaxrsMethodParameterProcessor jProcessor = new JaxrsMethodParameterProcessor();
try {
jProcessor.testProcessor(Thread.currentThread().getContextClassLoader(), resteasyDeploymentData);
} catch (Exception e) {
Assert.fail("Test failed. It should not have thrown an exception: " + e);
}
}
Aggregations