Examples of AccountDAO


Examples of com.cloud.user.dao.AccountDao

        when(mockNetwork.getId()).thenReturn((long)2);
        when(mockNetwork.getBroadcastDomainType()).thenReturn(Networks.BroadcastDomainType.Mido);
        when(mockNetwork.getTrafficType()).thenReturn(Networks.TrafficType.Guest);

        //mockAccountDao
        AccountDao mockAccountDao = mock(AccountDao.class);
        AccountVO mockAccountVO = mock(AccountVO.class);
        when(mockAccountDao.findById(anyLong())).thenReturn(mockAccountVO);
        when(mockAccountVO.getUuid()).thenReturn("1");

        //mockNic
        NicProfile mockNic = mock(NicProfile.class);
        when(mockNic.getIp4Address()).thenReturn("10.10.10.170");
View Full Code Here

Examples of com.cloud.user.dao.AccountDao

    public void testImplement() {
        //mock
        MidonetApi api = mock(MidonetApi.class, RETURNS_DEEP_STUBS);

        //mockAccountDao
        AccountDao mockAccountDao = mock(AccountDao.class);
        AccountVO mockAccountVO = mock(AccountVO.class);
        when(mockAccountDao.findById(anyLong())).thenReturn(mockAccountVO);
        when(mockAccountVO.getUuid()).thenReturn("1");
        MidoNetElement elem = new MidoNetElement();

        elem.setMidonetApi(api);
        elem.setAccountDao(mockAccountDao);
View Full Code Here

Examples of com.cloud.user.dao.AccountDao

        when(mockNetwork.getId()).thenReturn((long)2);
        when(mockNetwork.getBroadcastDomainType()).thenReturn(Networks.BroadcastDomainType.Mido);
        when(mockNetwork.getTrafficType()).thenReturn(Networks.TrafficType.Guest);

        //mockAccountDao
        AccountDao mockAccountDao = mock(AccountDao.class);
        AccountVO mockAccountVO = mock(AccountVO.class);
        when(mockAccountDao.findById(anyLong())).thenReturn(mockAccountVO);
        when(mockAccountVO.getUuid()).thenReturn("1");

        //mockNic
        NicProfile mockNic = mock(NicProfile.class);
        when(mockNic.getIp4Address()).thenReturn("10.10.10.170");
View Full Code Here

Examples of com.cloud.user.dao.AccountDao

    public void testImplement() {
        //mock
        MidonetApi api = mock(MidonetApi.class, RETURNS_DEEP_STUBS);

        //mockAccountDao
        AccountDao mockAccountDao = mock(AccountDao.class);
        AccountVO mockAccountVO = mock(AccountVO.class);
        when(mockAccountDao.findById(anyLong())).thenReturn(mockAccountVO);
        when(mockAccountVO.getUuid()).thenReturn("1");
        MidoNetElement elem = new MidoNetElement();

        elem.setMidonetApi(api);
        elem.setAccountDao(mockAccountDao);
View Full Code Here

Examples of com.cloud.user.dao.AccountDao

        when(mockNetwork.getId()).thenReturn((long)2);
        when(mockNetwork.getBroadcastDomainType()).thenReturn(Networks.BroadcastDomainType.Mido);
        when(mockNetwork.getTrafficType()).thenReturn(Networks.TrafficType.Guest);

        //mockAccountDao
        AccountDao mockAccountDao = mock(AccountDao.class);
        AccountVO mockAccountVO = mock(AccountVO.class);
        when(mockAccountDao.findById(anyLong())).thenReturn(mockAccountVO);
        when(mockAccountVO.getUuid()).thenReturn("1");

        //mockNic
        NicProfile mockNic = mock(NicProfile.class);
        when(mockNic.getIp4Address()).thenReturn("10.10.10.170");
View Full Code Here

Examples of com.cloud.user.dao.AccountDao

    public void testImplement() {
        //mock
        MidonetApi api = mock(MidonetApi.class, RETURNS_DEEP_STUBS);

        //mockAccountDao
        AccountDao mockAccountDao = mock(AccountDao.class);
        AccountVO mockAccountVO = mock(AccountVO.class);
        when(mockAccountDao.findById(anyLong())).thenReturn(mockAccountVO);
        when(mockAccountVO.getUuid()).thenReturn("1");
        MidoNetElement elem = new MidoNetElement();

        elem.setMidonetApi(api);
        elem.setAccountDao(mockAccountDao);
View Full Code Here

Examples of com.elasticinbox.core.AccountDAO

    cluster = HFactory.getOrCreateCluster("TestCluster", conf);
    keyspace = HFactory.createKeyspace(KEYSPACE, cluster, clp);
   
    dao = new CassandraDAOFactory();
    CassandraDAOFactory.setKeyspace(keyspace);
    AccountDAO accountDAO = dao.getAccountDAO();
    accountDAO.add(new Mailbox(MAILBOX));
  }
View Full Code Here

Examples of com.elasticinbox.core.AccountDAO

  @After
  public void teardownCase() throws IOException {
    keyspace = null;
    cluster = null;

    AccountDAO accountDAO = dao.getAccountDAO();
    accountDAO.delete(new Mailbox(MAILBOX));
  }
View Full Code Here

Examples of com.wesabe.api.accounts.dao.AccountDAO

      when(query.setParameterList(Mockito.anyString(), Mockito.anyCollection())).thenReturn(query);
     
      this.session = mock(Session.class);
      when(session.getNamedQuery(Mockito.anyString())).thenReturn(query);
     
      this.dao = new AccountDAO(new Provider<Session>() {
        @Override
        public Session get() {
          return session;
        }
      });
View Full Code Here

Examples of marauroa.server.game.db.AccountDAO

   */
  @Test
  public void testPerform() throws Throwable {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      AccountDAO accountDAO = DAORegister.get().get(AccountDAO.class);
      CharacterDAO characterDAO = DAORegister.get().get(CharacterDAO.class);
      BanAction ban = new BanAction();
      Player player = PlayerTestHelper.createPlayer("bob");
      RPAction action = new RPAction();
      action.put("target", player.getName());
      action.put("hours", -1);
      action.put("reason", "Because we were testing banning");
     
      // I don't know if this is still needed.
      if (!accountDAO.hasPlayer(transaction, player.getName())) {
        accountDAO.addPlayer(transaction, player.getName(), new byte[0], "schnubbel");
      }
     
      // we do a character check now. Made the the character name and the account name the same
      if (!characterDAO.hasCharacter(transaction, player.getName(), player.getName())) {
        characterDAO.addCharacter(transaction,  player.getName(), player.getName(), player);
      }

      System.out.println(DAORegister.get().get(CharacterDAO.class).getAccountName(transaction, player.getName()));
      accountDAO.setAccountStatus(transaction, player.getName(), "active");
      assertEquals("active", accountDAO.getAccountStatus(transaction, player.getName()));

      TransactionPool.get().commit(transaction);

      ban.perform(player , action);

      transaction = TransactionPool.get().beginWork();

      assertEquals("banned", accountDAO.getAccountStatus(transaction, player.getName()));
 
      // just undo the changes so the next test starts clean
      TransactionPool.get().rollback(transaction);
    } catch (Throwable e) {
      TransactionPool.get().rollback(transaction);
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.