Package org.soybeanMilk.core.exe

Examples of org.soybeanMilk.core.exe.Invoke


          new ValueArg(33D),
        };
     
      Resolver rp=new ObjectResolver(new TestResolver());
     
      Invoke invoke=new Invoke("test", rp, "sameMethod", args, RESULT_KEY);
     
      ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
     
      invoke.execute(os);
     
      Assert.assertEquals("Double", os.get(RESULT_KEY));
    }
   
    {
      Arg[] args=new Arg[]{
          new ValueArg(33),
        };
     
      Resolver rp=new ObjectResolver(new TestResolver());
     
      Invoke invoke=new Invoke("test", rp, "sameMethod", args, RESULT_KEY);
     
      ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
      os.set("arg", "33");
     
      invoke.execute(os);
     
      Assert.assertEquals("Integer", os.get(RESULT_KEY));
    }
  }
View Full Code Here


        new ValueArg(33, int.class),
      };
   
    Resolver rp=new ObjectResolver(new TestResolver());
   
    Invoke invoke=new Invoke("test", rp, "sameMethod", args, RESULT_KEY);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("arg", "33");
   
    invoke.execute(os);
   
    Assert.assertEquals("int", os.get(RESULT_KEY));
  }
View Full Code Here

        new ValueArg(null, Integer.class),
      };
   
    Resolver rp=new ObjectResolver(new TestResolver());
   
    Invoke invoke=new Invoke("test", rp, "sameMethod", args, RESULT_KEY);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
   
    invoke.execute(os);
   
    Assert.assertNotNull(os.get(RESULT_KEY));
  }
View Full Code Here

    Arg[] args=new Arg[]
        {
          new KeyArg("arg0", JavaBeanSub.class)
        };
   
    Invoke invoke=new Invoke(null, new ObjectResolver(new SubGenericResolverImpl<JavaBean>()), "resolveBase", args, "result");
   
    Map<String, Object> src=new HashMap<String, Object>();
    src.put("id", 1);
    src.put("name", "generic");
    src.put("age", 5);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("arg0", src);
   
    invoke.execute(os);
   
    JavaBeanSub re=os.get("result");
   
    Assert.assertEquals(1, re.getId().intValue());
    Assert.assertEquals("generic", re.getName());
View Full Code Here

  @Test
  public void execute_genericMethod_resolveBase() throws Exception
  {
    Arg[] args=new Arg[1];
    args[0]=new KeyArg("arg0");
    Invoke invoke=new Invoke(null, new ObjectResolver(new SubSubSubGenericResolverImpl()), "resolveBase", args, "result");
   
    Map<String, Object> src=new HashMap<String, Object>();
    src.put("id", 1);
    src.put("name", "generic");
    src.put("age", 5);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("arg0", src);
   
    invoke.execute(os);
   
    JavaBeanSub re=os.get("result");
   
    Assert.assertEquals(1, re.getId().intValue());
    Assert.assertEquals("generic", re.getName());
View Full Code Here

  @Test
  public void execute_genericMethod_resolveSub() throws Exception
  {
    Arg[] args=new Arg[1];
    args[0]=new KeyArg("arg0");
    Invoke invoke=new Invoke(null, new ObjectResolver(new SubSubSubGenericResolverImpl()), "resolveSub", args, "result");
   
    Map<String, Object> src=new HashMap<String, Object>();
    src.put("id", 1);
    src.put("name", "generic");
    src.put("age", 5);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("arg0", src);
   
    invoke.execute(os);
   
    JavaBeanSub re=os.get("result");
   
    Assert.assertEquals(1, re.getId().intValue());
    Assert.assertEquals("generic", re.getName());
View Full Code Here

          }
        });
   
    Arg[] args=new Arg[1];
    args[0]=new KeyArg("arg0");
    Invoke invoke=new Invoke(null, new ObjectResolver(resolver), "resolveBase", args, "result");
   
    Map<String, Object> src=new HashMap<String, Object>();
    src.put("id", 1);
    src.put("name", "generic");
    src.put("age", 5);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("arg0", src);
   
    invoke.execute(os);
   
    JavaBeanSub re=os.get("result");
   
    Assert.assertEquals(1, re.getId().intValue());
    Assert.assertEquals("generic", re.getName());
View Full Code Here

          }
        });
   
    Arg[] args=new Arg[1];
    args[0]=new KeyArg("arg0");
    Invoke invoke=new Invoke(null, new ObjectResolver(resolver), "resolveSub", args, "result");
   
    Map<String, Object> src=new HashMap<String, Object>();
    src.put("id", 1);
    src.put("name", "generic");
    src.put("age", 5);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("arg0", src);
   
    invoke.execute(os);
   
    JavaBeanSub re=os.get("result");
   
    Assert.assertEquals(1, re.getId().intValue());
    Assert.assertEquals("generic", re.getName());
View Full Code Here

        new KeyArg("arg0"),
        new KeyArg("arg1"),
    };
    Resolver rp=new ObjectResolver(new TestResolver());
   
    Invoke invoke=new Invoke("test", rp, "test1", args, RESULT_KEY);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("arg0", "arg0");
    os.set("arg1", "arg1");
   
    ArgPrepareExecuteException re=null;
    try
    {
      invoke.execute(os);
    }
    catch(ArgPrepareExecuteException e)
    {
      re=e;
    }
View Full Code Here

  @Test
  public void execute_exception_InvocationExecuteException() throws Exception
  {
    Resolver rp=new ObjectResolver(new TestResolver());
   
    Invoke invoke=new Invoke("test", rp, "testThrow", null, RESULT_KEY);
   
    InvocationExecuteException re=null;
    try
    {
      invoke.execute(new HashMapObjectSource());
    }
    catch(InvocationExecuteException e)
    {
      re=e;
    }
View Full Code Here

TOP

Related Classes of org.soybeanMilk.core.exe.Invoke

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.