Package org.soybeanMilk.core

Examples of org.soybeanMilk.core.ObjectSource


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


  @Test
  public void execute_breakerValueIsTrue() throws Exception
  {
    //breaker关键字的值为true
    {
      ObjectSource objSource=new HashMapObjectSource();
      objSource.set("breakerKey", true);
      executor.execute("testBreaker_1", objSource);
     
      Assert.assertNull(objSource.get(RESULT_KEY));
    }
  }
View Full Code Here

  }
 
  @Test
  public void execute_breakerIsLiteralTrue() throws Exception
  {
    ObjectSource objSource=new HashMapObjectSource();
    executor.execute("testBreaker_2", objSource);
   
    Assert.assertNull(objSource.get(RESULT_KEY));
  }
View Full Code Here

  }

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

     
      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("Double", os.get(RESULT_KEY));
    }
   
    {
      Arg[] args=new Arg[]{
          new KeyArg("arg", Integer.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("Integer", os.get(RESULT_KEY));
    }
  }
View Full Code Here

   
    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.assertNotNull(os.get(RESULT_KEY));
  }
View Full Code Here

     
      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

   
    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

   
    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

    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());
    Assert.assertEquals(5, re.getAge().intValue());
  }
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.