Examples of DefaultBeanClass


Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  public void configure(){
    Set<Bean<?>> beans = beanManager.getBeans(Object.class);
    for (Bean<?> bean : beans) {
      Annotation qualifier = tryToFindAStereotypeQualifier(bean);
      if(qualifier!=null){
        beanManager.fireEvent(new DefaultBeanClass(bean.getBeanClass()),qualifier);
      }
    }
    interceptorsCache.init();
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  public void configure(){
    Set<Bean<?>> beans = beanManager.getBeans(Object.class);
    for (Bean<?> bean : beans) {
      Annotation qualifier = tryToFindAStereotypeQualifier(bean);
      if(qualifier!=null){
        beanManager.fireEvent(new DefaultBeanClass(bean.getBeanClass()),qualifier);
      }
    }
    interceptorsCache.init();
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  public void configure(@Observes VRaptorInitialized event){
    for (Bean<?> bean : beanManager.getBeans(Object.class)) {
      Annotation qualifier = tryToFindAStereotypeQualifier(bean);
      if (qualifier != null) {
        beanManager.fireEvent(new DefaultBeanClass(bean.getBeanClass()), qualifier);
      }
    }
    interceptorsCache.init();
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  public void configure(){
    Set<Bean<?>> beans = beanManager.getBeans(Object.class);
    for (Bean<?> bean : beans) {
      Annotation qualifier = tryToFindAStereotypeQualifier(bean);
      if(qualifier!=null){
        beanManager.fireEvent(new DefaultBeanClass(bean.getBeanClass()),qualifier);
      }
    }
    interceptorsCache.init();
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  @Test
  public void shouldUseContainerForNewComponent() throws InterceptionException, IOException {
    final DogController myDog = new DogController();
    InstanceContainer container = new InstanceContainer(myDog);
    InstantiateObserver observer = new InstantiateObserver(container);
    when(event.getController()).thenReturn(new DefaultBeanClass(DogController.class));
    observer.instantiate(event);
    assertEquals(myDog,observer.getControllerInstance().getController());
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  @Test
  public void shouldThrowExceptionWhenTypeIsNotADeserializer() throws Exception {
    exception.expect(IllegalArgumentException.class);
    exception.expectMessage(containsString("must implement Deserializer"));
    handler.handle(new DefaultBeanClass(NotADeserializer.class));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

    handler.handle(new DefaultBeanClass(NotADeserializer.class));
  }

  @Test
  public void shouldRegisterTypesOnDeserializers() throws Exception {
    handler.handle(new DefaultBeanClass(MyDeserializer.class));
    verify(deserializers).register(MyDeserializer.class);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

    handler = new InterceptorStereotypeHandler(interceptorRegistry, interceptorValidator);
  }

  @Test
  public void shouldRegisterInterceptorsOnRegistry() throws Exception {
    handler.handle(new DefaultBeanClass(InterceptorA.class));
    verify(interceptorRegistry, times(1)).register(InterceptorA.class);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  @Test
  public void shouldThrowExceptionWhenMethodIsAmbiguous() throws Throwable {
    try {
      //${linkTo[TestController].method()}
      invoke(handler.get(new DefaultBeanClass(TestController.class)), "method");
      fail();
    } catch (IllegalArgumentException e) {
      assertThat(e.getMessage().toLowerCase(), startsWith("ambiguous method"));
    }
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  @Test
  public void shouldThrowExceptionWhenUsingParametersOfWrongTypes() throws Throwable {
    //${linkTo[TestController].method(123)}
    try {
      invoke(handler.get(new DefaultBeanClass(TestController.class)), "method", 123);
      fail();
    } catch (IllegalArgumentException e) {
      assertThat(e.getMessage().toLowerCase(), startsWith("there are no methods"));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.