Examples of Account


Examples of org.jboss.remoting.samples.transporter.multiple.Account

      System.out.println("Customer is now: " + processedCustomer);

      AccountProcessor accountProcessor = (AccountProcessor) TransporterClient.createTransporterClient(locatorURI, AccountProcessor.class);

      System.out.println("Asking for a new account to be created for customer.");
      Account account = accountProcessor.createAccount(processedCustomer);
      System.out.println("New account: " + account);

      TransporterClient.destroyTransporterClient(customerProcessor);
      TransporterClient.destroyTransporterClient(accountProcessor);
View Full Code Here

Examples of org.jboss.seam.example.quartz.Account

                @Override
                protected void renderResponse() throws Exception
                {
                    // Check the job exists
                    assert ((Boolean)getValue("#{accountHome.idDefined}"));               
                    Account account = (Account) getValue("#{selectedAccount}");               
                    assert account !=null;
                    assert account.getId() == 1;
                    assert account.getPayments().size() == 1;           
                   
                    Payment payment = (Payment) getValue("#{newPayment}");
                    assert payment.getPayee().equals("IRS");
                    assert payment.getAmount().equals(new BigDecimal("110.00"));
                    assert payment.getAccount() != null;
                    assert payment.getAccount().getId() == 1;
                    assert payment.getActive();
                }
               
            }.run();
           
            // Start the triggerHandle, wait a lot shorter than the job takes
            // At this point the job should have executed once exactly
            quartzTriggerHandle.resume();
            pause((long) (REPEATING.getInterval() * 0.1));
            quartzTriggerHandle.pause();
           
            new FacesRequest("/search.xhtml", id)
            {
   
                @Override
                protected void beforeRequest()
                {
                    setParameter("accountId", "1");
                }
               
                @Override
                protected void renderResponse() throws Exception
                {
                    assert ((Boolean)getValue("#{accountHome.idDefined}"));               
                    Account account = (Account) getValue("#{selectedAccount}");               
                    assert account !=null;
                    assert account.getId() == 1;
                    assert account.getPayments().size() == 1;
                    Payment payment = account.getPayments().get(0);
                    assert new BigDecimal("110.00").equals(payment.getAmount());
                    assert payment.getActive();
                    assert REPEATING.equals(payment.getPaymentFrequency());
                   
                    assert new BigDecimal("891.46").equals(account.getBalance());
                }
               
            }.run();
           
            // Start the triggerHandle, wait until some short time after the
            // job triggers once
            quartzTriggerHandle.resume();
            pause(REPEATING.getInterval());
            quartzTriggerHandle.pause();
           
           
            new FacesRequest("/search.xhtml", id)
            {
   
                @Override
                protected void beforeRequest()
                {
                    setParameter("accountId", "1");
                }
               
                @Override
                protected void renderResponse() throws Exception
                {

                    // Job should have run twice
                    assert ((Boolean)getValue("#{accountHome.idDefined}"));               
                    Account account = (Account) getValue("#{selectedAccount}");

                    assert account !=null;
                    assert account.getId() == 1;
                    assert account.getPayments().size() == 1;
                    Payment payment = account.getPayments().get(0);
                    assert new BigDecimal("110.00").equals(payment.getAmount());
                    assert payment.getActive();
                    assert REPEATING.equals(payment.getPaymentFrequency());
                    assert payment.getLastPaid() != null;
                    assert new BigDecimal("781.46").equals(account.getBalance());
                    paymentId = payment.getId();
                }
               
            }.run();
           
            new FacesRequest("/search.xhtml", id)
            {
   
                @Override
                protected void beforeRequest()
                {
                    setParameter("accountId", "1");
                    setParameter("paymentId", paymentId.toString());
                }
               
                @Override
                protected void invokeApplication() throws Exception
                {
                    // Resume the job, then cancel it
                    quartzTriggerHandle.resume();
                    invokeMethod("#{paymentHome.cancel}");
                }
               
                @Override
                protected void renderResponse() throws Exception
                {

                    assert ((Boolean)getValue("#{accountHome.idDefined}"));               
                    Account account = (Account) getValue("#{selectedAccount}");

                    assert account !=null;
                    assert account.getId() == 1;
                    assert account.getPayments().size() == 1;
                    Payment payment = account.getPayments().get(0);
                    assert new BigDecimal("110.00").equals(payment.getAmount());
                    assert !payment.getActive();
                    assert payment.getLastPaid() != null;
                    assert new BigDecimal("781.46").equals(account.getBalance());
                }
               
            }.run();
           
            // Wait until some short time after another execution would
            // have occurred to check it really stops
            pause((long) (REPEATING.getInterval() * 1.05));
           
            new FacesRequest("/search.xhtml", id)
            {
   
                @Override
                protected void beforeRequest()
                {
                    setParameter("accountId", "1");
                }
               
                @Override
                protected void renderResponse() throws Exception
                {

                    assert ((Boolean)getValue("#{accountHome.idDefined}"));               
                    Account account = (Account) getValue("#{selectedAccount}");

                    assert account !=null;
                    assert account.getId() == 1;
                    assert new BigDecimal("781.46").equals(account.getBalance());
                }
               
            }.run();
           
        }
View Full Code Here

Examples of org.jboss.seam.example.seampay.Account

           
        }               
    }

    protected Payment createTestPayment(BigDecimal amount, Frequency frequency) {
        Account account = new Account();
        account.setAccountNumber(ACCOUNT_NUMBER);
        setField(account, "balance", INITIAL_BALANCE);
       
        Payment payment = new Payment();
        payment.setAccount(account);
        payment.setAmount(amount);
View Full Code Here

Examples of org.jboss.seam.examples.seamcrm.account.Account

    }

    @Override
    public String getAsString(final FacesContext context, final UIComponent comp, final Object object) {
        if (object != null) {
            Account account = (Account) object;
            return account.getEntityId();
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.jboss.test.bankiiop.interfaces.Account

      getLog().debug("Acquire customers");
      Customer marc = teller.getCustomer("Marc");
      Customer rickard = teller.getCustomer("Rickard");
     
      getLog().debug("Acquire accounts");
      Account from = teller.getAccount(marc, 200);
      Account to = teller.getAccount(rickard, 200);
     
      getLog().debug("Show balance");
      getLog().debug(from.getPrimaryKey()+":"+from.getBalance());
      getLog().debug(to.getPrimaryKey()+":"+to.getBalance());

      getLog().debug("Transfer money");
     
      long start = System.currentTimeMillis();
      int iter = 10;
      for (int i = 0; i < iter; i++)
         teller.transfer(from, to, 50);
      long end = System.currentTimeMillis();
      getLog().info("Average call time: "+((end - start) / (iter*6)));
     
      getLog().debug("Show balance");
      AccountHome accountHome = (AccountHome)PortableRemoteObject.narrow(
                            getInitialContext().lookup(AccountHome.JNDI_NAME),
                            AccountHome.class);
      Collection accts = accountHome.findAll();
      Iterator i = accts.iterator();
      while(i.hasNext())
      {
         Account acct = (Account)PortableRemoteObject.narrow(i.next(),
                                                             Account.class);
         AccountData data = acct.getData();
         getLog().debug(data.getId()+"("+data.getOwner().getName()+"):"+data.getBalance());
         acct.withdraw(data.getBalance()); // Clear
      }
     
      teller.remove();
   }
View Full Code Here

Examples of org.jboss.test.banknew.interfaces.Account

   {
      AccountData lData = new AccountData();
      lData.setCustomerId( pCustomerId );
      lData.setType( pType );
      lData.setBalance( pInitialDeposit );
      Account lAccount = getAccountHome().create( lData );
      AccountData lNew = lAccount.getData();
      getTransactionHome().create(
         lNew.getId(),
         Constants.INITIAL_DEPOSIT,
         pInitialDeposit,
         "Account Creation"
View Full Code Here

Examples of org.jboss.test.jca.bank.interfaces.Account

   public Account createAccount(Integer id)
   {
      try
      {
         AccountHome home = (AccountHome)new InitialContext().lookup("Account");
         Account acct = home.create(id, 0, null);

         return acct;
      } catch (Exception e)
      {
         throw new EJBException("Could not create account", e);
View Full Code Here

Examples of org.jboss.test.jpa.classloader.model.Account

   public void testSimpleInsert() throws Exception
   {
      Integer id = Integer.valueOf(1001);
      Integer balance = Integer.valueOf(5);
      sfsb0.createAccount(SMITH, id, balance, "94536");
      Account acct = sfsb0.getAccount(id);
      assertNotNull(acct);
      AccountHolder holder = acct.getAccountHolder();
      assertNotNull(holder);
      assertEquals("Smith", holder.getLastName());
      assertEquals("1000", holder.getSsn());
      assertEquals(balance, acct.getBalance());
      assertEquals("94536", acct.getBranch());
   }
View Full Code Here

Examples of org.jclouds.cloudstack.domain.Account

   @Test
   public void testCreateAndRemoveAccount() {
      skipIfNotGlobalAdmin();

      Account account = null;
      try {
         account = createTestAccount(globalAdminClient, prefix);

         assertNotNull(account);
         assertEquals(account.getName(), prefix + "-account");
         assertEquals(account.getType(), Account.Type.USER);

         Account updated = globalAdminClient.getAccountClient().updateAccount(
            account.getName(), account.getDomainId(), prefix + "-account-2");

         assertNotNull(updated);
         assertEquals(updated.getName(), prefix + "-account-2");

      } finally {
         if (account != null) {
            globalAdminClient.getAccountClient().deleteAccount(account.getId());
         }
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.Account

   @Test
   public void testGetAccountMetadata() throws Exception {
      for (String regionId : api.getConfiguredRegions()) {
         AccountApi accountApi = api.getAccountApiForRegion(regionId);
         Account account = accountApi.get();
         assertNotNull(account);
         assertTrue(account.getContainerCount() >= 0);
         assertTrue(account.getBytesUsed() >= 0);
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.