Package org.soybeanMilk.core.config.parser

Examples of org.soybeanMilk.core.config.parser.InvokeStatementParser


{
  @Test
  public void parse_noArgNoResult() throws Exception
  {
    String stmt=" testResolver . method_a( ); ";
    InvokeStatementParser isp=new InvokeStatementParser(stmt);
    isp.parse();
   
    Assert.assertNull(isp.getResultKey());
    Assert.assertEquals("testResolver", isp.getResolver());
    Assert.assertEquals("method_a", isp.getMethodName());
    Assert.assertNull(isp.getArgs());
    Assert.assertNull(isp.getArgTypes());
  }
View Full Code Here


 
  @Test
  public void parse_hasArghasResult() throws Exception
  {
    String stmt=" testResult =  testResolver . method_b  ( my.argKey, 10, agrEnd); ";
    InvokeStatementParser isp=new InvokeStatementParser(stmt);
    isp.parse();
   
    Assert.assertEquals("testResult", isp.getResultKey());
    Assert.assertEquals("testResolver", isp.getResolver());
    Assert.assertEquals("method_b", isp.getMethodName());
    Assert.assertEquals("my.argKey", isp.getArgs()[0]);
    Assert.assertEquals("10", isp.getArgs()[1]);
    Assert.assertEquals("agrEnd", isp.getArgs()[2]);
   
    Assert.assertEquals(isp.getArgs().length, isp.getArgTypes().length);
  }
View Full Code Here

 
  @Test
  public void parse_hasArgType() throws Exception
  {
    String stmt=" testResult =  testResolver . method_b  ( my.argKey (int), \"aaa\", 10 ( somepkg. some\t\r. someClass \t ) , 345 \t(double ) , \"aaa\"   (String), 'a'  (char) , endArg()); ";
    InvokeStatementParser isp=new InvokeStatementParser(stmt);
    isp.parse();
   
    Assert.assertEquals("testResult", isp.getResultKey());
    Assert.assertEquals("testResolver", isp.getResolver());
    Assert.assertEquals("method_b", isp.getMethodName());
   
    String[] args=isp.getArgs();
    String[] argTypes=isp.getArgTypes();
   
    Assert.assertEquals(args.length, argTypes.length);
   
    Assert.assertEquals("my.argKey", args[0]);
    Assert.assertEquals("int", argTypes[0]);
View Full Code Here

TOP

Related Classes of org.soybeanMilk.core.config.parser.InvokeStatementParser

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.