Package org.apache.cloudstack.affinity

Examples of org.apache.cloudstack.affinity.AffinityGroupService


    @Inject
    IPAddressDao _ipAddressDao;

    @Bean
    public AffinityGroupService affinityGroupService() {
        AffinityGroupService mock = Mockito.mock(AffinityGroupService.class);
        try {
            final AffinityGroupVO gmock = new AffinityGroupVO("grp1", "grp-type", "affinity group", 1, Account.ACCOUNT_ID_SYSTEM, ControlledEntity.ACLType.Account);
            Transaction.execute(new TransactionCallbackNoReturn() {
                @Override
                public void doInTransactionWithoutResult(TransactionStatus status) {
                    _affinityGroupDao.persist(gmock);
                }
            });
            Mockito.when(
                mock.createAffinityGroupInternal(Matchers.any(String.class), Matchers.any(Long.class), Matchers.any(String.class), Matchers.any(String.class),
                    Matchers.any(String.class))).thenReturn(gmock);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mock;
View Full Code Here


    @Inject IPAddressDao _ipAddressDao;


    @Bean
    public AffinityGroupService affinityGroupService() {
        AffinityGroupService mock = Mockito.mock(AffinityGroupService.class);
        try {
            final AffinityGroupVO gmock = new AffinityGroupVO("grp1", "grp-type", "affinity group", 1, AccountVO.ACCOUNT_ID_SYSTEM, ControlledEntity.ACLType.Account);
      Transaction.execute(new TransactionCallbackNoReturn() {
        @Override
        public void doInTransactionWithoutResult(TransactionStatus status) {
      _affinityGroupDao.persist(gmock);   
        }
      });
            Mockito.when(mock.createAffinityGroupInternal(Mockito.any(String.class), Mockito.any(Long.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(String.class))).thenReturn(gmock);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mock;
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.affinity.AffinityGroupService

Copyright © 2018 www.massapicom. 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.