Esempio n. 1
0
 @Override
 public void startServer() throws Exception {
   component = new Component();
   component.getServers().add(Protocol.HTTP, 8182);
   RestApplication application = module.newObject(RestApplication.class, component.getContext());
   component.getDefaultHost().attach(application);
   component.start();
 }
Esempio n. 2
0
  @Test
  public void payAllBills() throws Exception {
    UnitOfWork uow = module.newUnitOfWork(newUsecase("Pay all bills from checking to creditors"));
    try {
      BalanceData source = uow.get(BalanceData.class, CHECKING_ACCOUNT_ID);

      PayBillsContext2 context = module.newObject(PayBillsContext2.class);
      context.bind(source).payBills();
    } finally {
      uow.discard();
    }
  }
Esempio n. 3
0
 protected <T> T role(Class<T> roleType, Object data) {
   return module.newObject(roleType, data);
 }