public static void startup() throws Exception {
    deployment = EmbeddedContainer.start();

    manager = new MessageServiceManager();
    manager.start();
    deployment.getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
    deployment.getRegistry().addSingletonResource(manager.getTopicManager().getDestination());

    deployment.getRegistry().addPerRequestResource(Receiver.class);
  }
Пример #2
0
 public static void before(Hashtable<String, String> contextParams) throws Exception {
   Hashtable<String, String> initParams = new Hashtable<String, String>();
   deployment = EmbeddedContainer.start(initParams, contextParams);
   dispatcher = deployment.getDispatcher();
   deployment.getRegistry().addPerRequestResource(TestResource.class);
   deployment.getProviderFactory().register(TestExceptionMapper.class);
 }
  @Before
  public void setUp() throws Exception {

    if (server != null) {
      return;
    }

    int port =
        testingPropertiesHelper.getPropertyValueAsInt(
            testingProperties, RestTestingProperties.REST_PORT_PROPERTY);
    server = new TJWSEmbeddedJaxrsServer();
    server.setPort(port);
    ResteasyDeployment deployment = server.getDeployment();

    server.start();
    Dispatcher dispatcher = deployment.getDispatcher();
    SpringBeanProcessor processor =
        new SpringBeanProcessor(
            dispatcher, deployment.getRegistry(), deployment.getProviderFactory());
    ((ConfigurableApplicationContext) applicationContext).addBeanFactoryPostProcessor(processor);

    SpringResourceFactory noDefaults =
        new SpringResourceFactory("userService", applicationContext, UserService.class);
    dispatcher.getRegistry().addResourceFactory(noDefaults);
  }
 @Before
 public void before() throws Exception {
   deployment = EmbeddedContainer.start();
   deployment.getRegistry().addPerRequestResource(TestResource.class);
 }
 @BeforeClass
 public static void setup() throws Exception {
   deployment = EmbeddedContainer.start();
   deployment.getRegistry().addPerRequestResource(TestResource.class);
   client = new ResteasyClientBuilder().build();
 }