Package org.soybeanMilk.core.os

Examples of org.soybeanMilk.core.os.HashMapObjectSource


  }
 
  @Test
  public void execute_inexistentExecutableName() throws Exception
  {
    HashMapObjectSource os=new HashMapObjectSource();
   
    ExecutableNotFoundException re=null;
   
    try
    {
View Full Code Here


  }
 
  @Test
  public void execute_setGenericConverterToObjectSource_autoIfConvertableObjectSource() throws Exception
  {
    HashMapObjectSource os=new HashMapObjectSource();
   
    executor.execute(KEY_EXE_HELLO, os);
   
    Assert.assertTrue((executor.getConfiguration().getGenericConverter() == os.getGenericConverter()));
  }
View Full Code Here

  }
 
  @Test
  public void execute_executionIsCreated() throws Exception
  {
    HashMapObjectSource os=new HashMapObjectSource();
    executor.execute(KEY_EXE_HELLO, os);
   
    Execution re=os.get(KEY_EXECUTION);
   
    Assert.assertEquals(os, re.getObjectSource());
    Assert.assertEquals(KEY_EXE_HELLO, re.getExecutable().getName());
    Assert.assertNull(re.getExecuteException());
  }
View Full Code Here

  public void execute_executionIsCreatedEachExecute() throws Exception
  {
    Execution re0=null;
    Execution re1=null;
   
    HashMapObjectSource os=new HashMapObjectSource();
   
    executor.execute(KEY_EXE_HELLO, os);
    re0=os.get(KEY_EXECUTION);
   
    executor.execute(KEY_EXE_HELLO, os);
    re1=os.get(KEY_EXECUTION);
   
    Assert.assertTrue( re0!=null && re1!=null && re0!=re1 );
  }
View Full Code Here

    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

    Configuration cfg=new ConfigurationParser().parse(
        "example/"+Constants.DEFAULT_CONFIG_FILE);
   
    Executor executor=new DefaultExecutor(cfg);
   
    ConvertableObjectSource os = new HashMapObjectSource();
   
    os.set("helloTo", "friend");
    os.set("helloRepeat", 3);
   
    os.set("genericStringInput", "11");
    os.set("genericStringArrayInput", new String[]{"11", "22", "33"});
   
    printDiv();
    executor.execute("helloXml", os);
   
    printDiv();
View Full Code Here

    DefaultResolverObjectFactory drof=(DefaultResolverObjectFactory)cfg.getResolverObjectFactory();
    drof.setExternalResolverObjectFactory(new SpringBeanFactory());
   
    Executor executor=new DefaultExecutor(cfg);
   
    ObjectSource os = new HashMapObjectSource();
   
    os.set("helloTo", "friend");
    os.set("helloRepeat", 3);
   
    os.set("genericStringInput", "11");
    os.set("genericStringArrayInput", new String[]{"11", "22", "33"});
   
    printDiv();
    executor.execute("helloXml", os);
   
    printDiv();
    executor.execute("helloStatement", os);
   
    printDiv();
    executor.execute("literals", os);
   
    printDiv();
    os.set("dynamicResolver", new DynamicResolver());
    executor.execute("dynamicResolver", os);
   
    printDiv();
    executor.execute("reference", os);
   
View Full Code Here

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

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

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

TOP

Related Classes of org.soybeanMilk.core.os.HashMapObjectSource

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.