Package org.soybeanMilk.core

Examples of org.soybeanMilk.core.ObjectSource


  }
 
  @Test
  public void get_objectSourceScope_keyIsScope() throws Exception
  {
    ObjectSource re=webObjectSource.get("objEctSource");
   
    Assert.assertTrue( (re == webObjectSource) );
  }
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

    };
    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

   
    Resolver rp=new ObjectSourceResolver("objectSourceResolver");
   
    Invoke invoke=new Invoke("test", rp, "test1", args, RESULT_KEY);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("objectSourceResolver", new TestResolver());
    os.set("arg0", "arg0");
    os.set("arg1", "1111");
   
    invoke.execute(os);
   
    Assert.assertEquals(TestResolver.RESULT, os.get(RESULT_KEY));
  }
View Full Code Here

   
    Resolver rp=new FactoryResolver(rof, "factoryResolver");
   
    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

   
    Resolver rp=new DynamicResolver(null, new ObjectSourceResolver("dynamicResolver"));
   
    Invoke invoke=new Invoke("test", rp, "test1", args, RESULT_KEY);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("dynamicResolver", new TestResolver());
    os.set("arg0", "arg0");
    os.set("arg1", "1111");
   
    invoke.execute(os);
   
    Assert.assertEquals(TestResolver.RESULT, os.get(RESULT_KEY));
  }
View Full Code Here

   
    Resolver rp=new DynamicResolver(new FactoryResolver(rof, "dynamicResolver"), null);
   
    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

   
    Resolver rp=new DynamicResolver(new FactoryResolver(rof, "dynamicResolver"), new ObjectSourceResolver("dynamicResolver"));
   
    Invoke invoke=new Invoke("test", rp, "test1", args, RESULT_KEY);
   
    ObjectSource os=new HashMapObjectSource(new DefaultGenericConverter());
    os.set("arg0", "arg0");
    os.set("arg1", "1111");
   
    ExecuteException re=null;
   
    try
    {
View Full Code Here

  @Test
  public void execute_breakerNoValue() throws Exception
  {
    //无breaker
    {
      ObjectSource objSource=new HashMapObjectSource();
      executor.execute("testBreaker_0", objSource);
     
      Assert.assertEquals(TestResolver.RESULT, objSource.get(RESULT_KEY));
    }
  }
View Full Code Here

  @Test
  public void execute_breakerValueIsNull() throws Exception
  {
    //breaker关键字的值为null
    {
      ObjectSource objSource=new HashMapObjectSource();
      executor.execute("testBreaker_1", objSource);
     
      Assert.assertEquals(TestResolver.RESULT, objSource.get(RESULT_KEY));
    }
  }
View Full Code Here

TOP

Related Classes of org.soybeanMilk.core.ObjectSource

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.