Examples of AccountManager


Examples of accounts.AccountManager

  private AccountValidator validator;

  @Before
  public void setUp() throws Exception {
    AccountManager accountManager = new StubAccountManager();
    validator = new AccountValidator(accountManager);
  }
View Full Code Here

Examples of com.apress.prospring.ch12.business.AccountManager

  private ApplicationContext context;
 
  private void run() {
    System.out.println("Initializing application");
    context = new ClassPathXmlApplicationContext(new String[] { "applicationContext.xml", "applicationContext-local.xml" });
    AccountManager manager = (AccountManager)context.getBean("accountManager");
   
    int count = manager.count();
    int failures = 0;
    int attempts = 100;
   
    for (int i = 0; i < attempts; i++) {
      Account a = new Account();
      a.setBalance(new BigDecimal(10));
      a.setNumber("123 " + i);
      a.setSortCode("xxx " + i);
      try {
        manager.insert(a);
      } catch (RuntimeException ex) {
        System.out.println("Failed to insert account " + ex.getMessage());
        failures++;
      }
    }
   
    System.out.println("Attempts  : " + attempts);
    System.out.println("Failures  : " + failures);
    System.out.println("Prev count: " + count);
    System.out.println("New count : " + manager.count());
   
    System.out.println("Done");
  }
View Full Code Here

Examples of com.hp.hpl.jena.gvs.services.http.accountmanager.AccountManager

        rootNode, "/application"));
    prefixHandlerMap.put("/put-infobit", new PutInfoBitHandler(store, identity));
    prefixHandlerMap.put("/meta/sources", new GraphHandlerAdaptor(
        new SourceGraphHandler(store)));
    prefixHandlerMap.put("/meta/account-manager", new GraphHandlerAdaptor(
        new AccountManager(store, identity, trustedSources,
            configuration)));
    prefixHandlerMap.put("/", new GraphHandlerAdaptor(new GVSGraphHandler(
        store, new DiscoBitHandler(trustedGOT))));
    return launchGVSServer(store, serverBinding, prefixHandlerMap, trustedGOT);
View Full Code Here

Examples of org.jboss.test.ejb3.nointerface.AccountManager

    * @throws Exception
    */
   public void testNoInterfaceViewAccess() throws Exception
   {
      Context ctx = new InitialContext();
      AccountManager accountMgr = (AccountManager) ctx.lookup(AccountManagerBean.JNDI_NAME);
     
      long dummyAccountNumber = 123;
      // credit 50 dollars (Note that the current balance is hard coded in the bean to 100)
      // so after crediting, the current balance is going to be 150
      int currentBalance = accountMgr.credit(dummyAccountNumber, 50);
     
      assertEquals("Unexpected account balance after credit", 150, currentBalance);
     
      // now let's debit 10 dollars (Note that the current balance is again hard coded in the bean to 100).
      // So after debiting, the current balance is going to be 90
      currentBalance = accountMgr.debit(dummyAccountNumber, 10);
     
      assertEquals("Unexpected account balance after debit", 90, currentBalance);
   }
View Full Code Here

Examples of org.jboss.test.ejb3.singleton.AccountManager

      return getDeploySetup(SingletonUnitTestCase.class, "ejb31singleton.jar");
   }

   public void testSingletonBeanAccess() throws Exception
   {
      AccountManager accountManager = (AccountManager) this.getInitialContext().lookup(AccountManagerBean.JNDI_NAME);

      int initialBalance = accountManager.balance();
      assertEquals("Unexpected initial balance", 0, initialBalance);

      // credit
      accountManager.credit(100);

      AccountManager anotherAccountManagerInstance = (AccountManager) this.getInitialContext().lookup(
            AccountManagerBean.JNDI_NAME);
      int balanceAfterCredit = anotherAccountManagerInstance.balance();
      assertEquals("Unexpected balance after credit", 100, balanceAfterCredit);

      // debit
      anotherAccountManagerInstance.debit(50);

      int balanceAfterDebit = accountManager.balance();
      assertEquals("Unexpected balance after debit", 50, balanceAfterDebit);

   }
View Full Code Here

Examples of org.jivesoftware.smack.AccountManager

                    .getString("sureDeleteAccountPart2"), resources
                    .getString("deleteAccount"), JOptionPane.YES_NO_OPTION);
        }

        if (result == 0) {
            AccountManager manager = BuddyList.getInstance().getConnection()
                    .getAccountManager();

            // go ahead and delete the account
            try {
                manager.deleteAccount();
            } catch (XMPPException e) {
                String errorMessage = "";
                errorMessage = resources.getString("xmppError"
                        + e.getXMPPError().getCode());
View Full Code Here

Examples of org.jivesoftware.smack.AccountManager

        public void run() {
            String errorMessage = null;

            if (BuddyList.getInstance().checkConnection()) {
                AccountManager manager = BuddyList.getInstance()
                        .getConnection().getAccountManager();
                try {
                    manager.changePassword(newPass);
                } catch (XMPPException e) {
                    if (e.getXMPPError() == null)
                        errorMessage = e.getMessage();
                    else
                        errorMessage = resources.getString("xmppError"
View Full Code Here

Examples of org.jivesoftware.smack.AccountManager

                if (password == null) {
                    LOG.warn("No password configured for user: " + user);
                }

                if (createAccount) {
                    AccountManager accountManager = new AccountManager(connection);
                    accountManager.createAccount(user, password);
                }
                if (resource != null) {
                    connection.login(user, password, resource);
                } else {
                    connection.login(user, password);
View Full Code Here

Examples of org.jivesoftware.smack.AccountManager

                if (password == null) {
                    LOG.warn("No password configured for user: " + user);
                }

                if (createAccount) {
                    AccountManager accountManager = new AccountManager(connection);
                    accountManager.createAccount(user, password);
                }
                if (resource != null) {
                    connection.login(user, password, resource);
                } else {
                    connection.login(user, password);
View Full Code Here

Examples of org.jivesoftware.smack.AccountManager

                if (password == null) {
                    LOG.warn("No password configured for user: " + user);
                }

                if (createAccount) {
                    AccountManager accountManager = new AccountManager(connection);
                    accountManager.createAccount(user, password);
                }
                if (resource != null) {
                    connection.login(user, password, resource);
                } else {
                    connection.login(user, password);
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.