Package net.infopeers.restrant.engine.parser

Examples of net.infopeers.restrant.engine.parser.TestParams


public class ReflectInvokerTest extends TestCase {
 
  public void testSenario() throws Exception{
   
    TestController controller = new TestController();
    TestParams params = new TestParams();
   
    //"test"はメソッドとして存在する
    ReflectInvoker invoker = new ReflectInvoker(null, controller, "test", params);
    invoker.invoke(null, null);
   
View Full Code Here


  }

  public void testAnnotatedArg() throws Exception{
   
    TestController controller = new TestController();
    TestParams params = new TestParams();
    params.addExtension("id", "12345");
   
    // idは@Method({"id"})で指定されている
    ReflectInvoker invoker = new ReflectInvoker(null, controller, "testAnnotated", params);
    invoker.invoke(null, null);
   
View Full Code Here

  }

  public void testAnnotatedArgs() throws Exception{
   
    TestController controller = new TestController();
    TestParams params = new TestParams();
    params.addExtension("id", "12345");
    params.addExtension("label", "LABEL");
   
    // idは@Method({"id", "label"})で指定されている
    ReflectInvoker invoker = new ReflectInvoker(null, controller, "testAnnotated", params);
    invoker.invoke(null, null);
   
View Full Code Here

  }
 
  public void testNamed() throws Exception{
   
    TestController controller = new TestController();
    TestParams params = new TestParams();
    params.addExtension("id", "12345");
   
    // "namedMethod"は@Method(name="namedMethod")で指定されている
    ReflectInvoker invoker = new ReflectInvoker(null, controller, "namedMethod", params);
    invoker.invoke(null, null);
   
View Full Code Here

  }
 
  public void testArray() throws Exception{
   
    TestController controller = new TestController();
    TestParams params = new TestParams();
    params.addExtension("values", "12345");
    params.addExtension("values", "12346");
   
    // "namedMethod"は@Method(name="namedMethod")で指定されている
    ReflectInvoker invoker = new ReflectInvoker(null, controller, "testArray", params);
    invoker.invoke(null, null);
   
View Full Code Here

  }

  public void testArrayKeyNotFound() throws Exception{
   
    TestController controller = new TestController();
    TestParams params = new TestParams();
    //実際のキーに対応した値が送信されなかった場合
    params.addExtension("nokey", "12345");
    params.addExtension("nokey", "12346");
   
    try{
      ReflectInvoker invoker = new ReflectInvoker(null, controller, "testArray", params);
      invoker.invoke(null, null);
      fail("値が合致しない場合には例外");
View Full Code Here

 
 
  public void testComplexed() throws Exception{
   
    TestController controller = new TestController();
    TestParams params = new TestParams();
    params.addExtension("id", "12345");
    params.addExtension("label", "ThisIsIt");

    // "namedMethod"及び、複数の引数で、かつメソッド名一致条件。
    // @Method(name="namedMethod", args={"id", "label"})で指定されている
    ReflectInvoker invoker = new ReflectInvoker(null, controller, "namedMethod", params);
    invoker.invoke(null, null);
View Full Code Here

 
 
  public void testNotFound() throws Exception{
   
    TestController controller = new TestController();
    TestParams params = new TestParams();
   
    try{
      new ReflectInvoker(null, controller, "NotFound", params);
      fail("メソッドが見つからなければ例外");
    }catch(IllegalStateException e){
View Full Code Here

  }

  public void testNotFoundByNamed() throws Exception{
   
    TestController controller = new TestController();
    TestParams params = new TestParams();
   
    try{
       //testNamedは見つからない名前。メソッドとしては存在するが、nameで隠されている
      new ReflectInvoker(null, controller, "testNamed", params);
      fail("メソッドが見つからなければ例外");
View Full Code Here

TOP

Related Classes of net.infopeers.restrant.engine.parser.TestParams

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.