Package br.com.caelum.vraptor.controller

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


  @Test
  public void shouldDeserializeFromGenericTypeTwoParams() {
    InputStream stream = asStream("{'entity':{'name':'Brutus','age':7,'birthday':'2013-07-23T17:14:14-03:00'}, 'param': 'test', 'over': 'value'}");
    BeanClass resourceClass = new DefaultBeanClass(DogGenericController.class);
    Method method = new Mirror().on(DogGenericController.class).reflect().method("anotherMethod").withAnyArgs();
    ControllerMethod resource = new DefaultControllerMethod(resourceClass, method);
   
    Object[] deserialized = deserializer.deserialize(stream, resource);

    Dog dog = (Dog) deserialized[0];
    String param = (String) deserialized[1];
View Full Code Here


  public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);

    provider = new ParanamerNameProvider();
   
    method = new DefaultControllerMethod(new DefaultBeanClass(MyResource.class), MyResource.class.getMethod(
        "method", String.class, Integer.class, BigDecimal.class));

    proxifier = new JavassistProxifier();
    typeFinder = new DefaultTypeFinder(provider);
  }
View Full Code Here

      assertThat(e.getAllowedMethods(), is((Set<HttpMethod>)EnumSet.of(HttpMethod.GET)));
    }
  }

  private DefaultControllerMethod anyControllerMethod() throws NoSuchMethodException {
    return new DefaultControllerMethod(new DefaultBeanClass(MyController.class), MyController.class.getMethod("customizedPath"));
  }
View Full Code Here

    deserializer = new XStreamXMLDeserializer(provider, cleanInstance(new CalendarConverter()));
    BeanClass controllerClass = new DefaultBeanClass(DogController.class);
    BeanClass personControllerClass = new DefaultBeanClass(PersonController.class);

    woof = new DefaultControllerMethod(controllerClass, DogController.class.getDeclaredMethod("woof"));
    bark = new DefaultControllerMethod(controllerClass, DogController.class.getDeclaredMethod("bark", Dog.class));
    jump = new DefaultControllerMethod(controllerClass, DogController.class.getDeclaredMethod("jump", Dog.class, Integer.class));
    dropDead = new DefaultControllerMethod(controllerClass, DogController.class.getDeclaredMethod("dropDead", Integer.class, Dog.class));
    annotated = new DefaultControllerMethod(controllerClass, DogController.class.getDeclaredMethod("annotated", DogWithAnnotations.class));
    walk = new DefaultControllerMethod(personControllerClass, PersonController.class.getDeclaredMethod("walk", Person.class));
  }
View Full Code Here

TOP

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

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.