public class SimpleTestCase extends BaseConfigurationTest {
public void test1()
throws Throwable{
runTest("test/yan/test.xml");
final Component c = yan.getComponent("service_maker");
assertNotNull(c);
final BankAccount acc = new BankAccount("test", 1000000);
final Component service =
c.withArguments(new Component[]{Components.value(acc), Components.value("getBalance")});
final Integer bal = (Integer)yan.instantiateComponent(service);
assertEquals(1000000, bal.intValue());
final Component acct_request = yan.getComponent("bankaccount_request");
final HashMap props = new HashMap();
props.put("balance", new Integer(6666));
final Integer result = (Integer)yan.instantiateComponent(
acct_request.withArgument(0, Components.value(props)));
assertEquals(6666, result.intValue());
final Component acct_request2 = yan.getComponent("bankaccount_request2");
final HashMap props2 = new HashMap();
props.put("balance", new Integer(7777));
final String result2 = (String)yan.instantiateComponent(
acct_request2.withArgument(0, Components.value(props2)));
assertEquals("this is my test", result2);
}