Examples of HashMapObjectSource


Examples of org.soybeanMilk.core.os.HashMapObjectSource

  }
 
  @Test
  public void execute_afterInterceptorNotNull() throws Exception
  {
    HashMapObjectSource os=new HashMapObjectSource();
   
    executor.execute(KEY_EXE_HELLO, os);
   
    Assert.assertEquals(ResolverForTest.afterResultVal, os.get(ResolverForTest.afterResultKey));
  }
View Full Code Here

Examples of org.soybeanMilk.core.os.HashMapObjectSource

  @Test
  public void execute_afterInterceptorIsNull() throws Exception
  {
    executor.getConfiguration().getInterceptor().setAfter(null);
   
    HashMapObjectSource os=new HashMapObjectSource();
   
    executor.execute(KEY_EXE_HELLO, os);
   
    Assert.assertNull(os.get(ResolverForTest.afterResultKey));
  }
View Full Code Here

Examples of org.soybeanMilk.core.os.HashMapObjectSource

  }
 
  @Test
  public void execute_exceptionInterceptorNotNull() throws Exception
  {
    HashMapObjectSource os=new HashMapObjectSource();
   
    executor.execute("helloThrow", os);
   
    Assert.assertEquals(ResolverForTest.exceptionResultVal, os.get(ResolverForTest.exceptionResultKey));
  }
View Full Code Here

Examples of org.soybeanMilk.core.os.HashMapObjectSource

  @Test
  public void execute_exceptionInterceptorIsNull() throws Exception
  {
    executor.getConfiguration().getInterceptor().setException(null);
   
    HashMapObjectSource os=new HashMapObjectSource();
   
    try
    {
      executor.execute("helloThrow", os);
    }
    catch(InvocationExecuteException e){}
   
    Assert.assertNull(os.get(ResolverForTest.exceptionResultKey));
  }
View Full Code Here

Examples of org.soybeanMilk.core.os.HashMapObjectSource

  @Test
  public void execute_exceptionIsThrownIfNoExceptionInterceptor() throws Exception
  {
    executor.getConfiguration().getInterceptor().setException(null);
   
    HashMapObjectSource os=new HashMapObjectSource();
   
    InvocationExecuteException re=null;
    try
    {
      executor.execute("helloThrow", os);
View Full Code Here

Examples of org.soybeanMilk.core.os.HashMapObjectSource

  }
 
  @Test
  public void execute_exceptionIsCaughtIfExceptionInterceptorNotNull() throws Exception
  {
    HashMapObjectSource os=new HashMapObjectSource();
   
    executor.execute("helloThrow", os);
   
    Execution re=os.get(KEY_EXECUTION);
   
    Assert.assertTrue( (re.getExecuteException().getCause() instanceof UnsupportedOperationException) );
  }
View Full Code Here

Examples of org.soybeanMilk.core.os.HashMapObjectSource

    cfg.addExecutable(action);
   
    //创建执行器
    Executor executor=new DefaultExecutor(cfg);
   
    ConvertableObjectSource os = new HashMapObjectSource(new DefaultGenericConverter());
   
    //设置参数
    os.set(argKey_hello_to, "mars");
    os.set(argKey_hello_repeat, 3);
   
    //执行
    executor.execute(actionName, os);
  }
View Full Code Here

Examples of org.soybeanMilk.core.os.HashMapObjectSource

    Configuration cfg=new ConfigurationParser().parse(
        "example/"+Constants.DEFAULT_CONFIG_FILE);
   
    Executor executor=new DefaultExecutor(cfg);
   
    ConvertableObjectSource os = new HashMapObjectSource();
   
    os.set("helloTo", "mars");
    os.set("helloRepeat", 3);
   
    printDiv();
    executor.execute("helloActionXml", os);
   
    printDiv();
View Full Code Here

Examples of org.soybeanMilk.core.os.HashMapObjectSource

  private HashMapObjectSource objSource;
 
  @Before
  public void setUp()
  {
    objSource=new HashMapObjectSource(new DefaultGenericConverter());
  }
View Full Code Here

Examples of org.soybeanMilk.core.os.HashMapObjectSource

    };
    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", "1111");
   
    invoke.execute(os);
   
    Assert.assertEquals(TestResolver.RESULT, os.get(RESULT_KEY));
  }
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.