Package br.com.caelum.vraptor.controller

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


    this.container = container;
  }

  public void instantiate(@Observes ControllerMethodDiscovered event) {
    Object instance = container.instanceFor(event.getController().getType());
    this.controllerInstance = new DefaultControllerInstance(instance);
  }
View Full Code Here


    if (instance == null) {
      Class<?> type = method.getController().getType();
      instance = container.instanceFor(type);
    }
   
    this.controllerInstance = new DefaultControllerInstance(instance);
    invocation.next(method, instance);
  }
View Full Code Here

    this.container = container;
  }

  public void instantiate(@Observes ControllerFound event) {
    Object instance = container.instanceFor(event.getController().getType());
    this.controllerInstance = new DefaultControllerInstance(instance);
  }
View Full Code Here

    if (instance == null) {
      Class<?> type = method.getController().getType();
      instance = container.instanceFor(type);
    }
   
    this.controllerInstance = new DefaultControllerInstance(instance);
    invocation.next(method, instance);
  }
View Full Code Here

 

  @Test
  public void shouldAcceptMethodWithAnnotation() throws Exception {
    WithAnnotationAcceptor acceptor = new WithAnnotationAcceptor();   
    DefaultControllerInstance controllerInstance = new DefaultControllerInstance(new MethodLevelAcceptsController());
    AnnotationLiteral<NotLogged> notLogged = new AnnotationLiteral<NotLogged>() {};
   
    acceptor.initialize(annotation);
   
    when(controllerMethod.getAnnotations()).thenReturn(new Annotation[]{notLogged});
View Full Code Here

  }
 
  @Test
  public void shouldNotAcceptMethodWithoutAnnotation() throws Exception {
    WithAnnotationAcceptor acceptor = new WithAnnotationAcceptor();
    DefaultControllerInstance controllerInstance = new DefaultControllerInstance(new MethodLevelAcceptsController());
   
    acceptor.initialize(annotation);
   
    when(controllerMethod.getAnnotations()).thenReturn(new Annotation[]{});
   
View Full Code Here

  }
 
  @Test
  public void shouldAcceptsAllMethodsInsideAnnotatedClass() throws Exception {
    WithAnnotationAcceptor acceptor = new WithAnnotationAcceptor();
    DefaultControllerInstance controllerInstance = new DefaultControllerInstance(new ClassLevelAcceptsController());
   
    acceptor.initialize(annotation);
   
    when(controllerMethod.getAnnotations()).thenReturn(new Annotation[]{});
   
View Full Code Here

 
 
  @Test
  public void shouldNotAcceptsAnyMethodsInsideNonAnnotatedClass() throws Exception {
    WithAnnotationAcceptor acceptor = new WithAnnotationAcceptor();
    DefaultControllerInstance controllerInstance = new DefaultControllerInstance(new Object());
   
    acceptor.initialize(annotation);
   
    when(controllerMethod.getAnnotations()).thenReturn(new Annotation[]{});
   
View Full Code Here

  @Before
  public void setup() {
    MockitoAnnotations.initMocks(this);
    interceptor = new InterceptorWithCustomizedAccepts();
    controllerInstance = new DefaultControllerInstance(new MethodLevelAcceptsController());
    constraints = getCustomAcceptsAnnotations(interceptor.getClass());
    when(withAnnotationAcceptor.validate(controllerMethod, controllerInstance)).thenReturn(true);
  }
View Full Code Here

 

  @Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);
    controllerInstance = new DefaultControllerInstance(controller);
    stack = new DefaultInterceptorStack(cache, new MockInstanceImpl<>(controllerMethod), new MockInstanceImpl<>(controllerInstance), interceptorsExecutedEvent, interceptorsReadyEvent);
    LinkedList<InterceptorHandler> handlers = new LinkedList<>();
    handlers.add(handler);
   
    when(cache.getInterceptorHandlers()).thenReturn(handlers);
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.controller.DefaultControllerInstance

Copyright © 2018 www.massapicom. 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.