當前位置: 首頁>>代碼示例>>Java>>正文


Java OperationDAO類代碼示例

本文整理匯總了Java中org.oscm.app.dao.OperationDAO的典型用法代碼示例。如果您正苦於以下問題:Java OperationDAO類的具體用法?Java OperationDAO怎麽用?Java OperationDAO使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OperationDAO類屬於org.oscm.app.dao包,在下文中一共展示了OperationDAO類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setup

import org.oscm.app.dao.OperationDAO; //導入依賴的package包/類
@Before
public void setup() {
    bean = new ServiceInstanceServiceBean();
    bean.dao = mock(ServiceInstanceDAO.class);
    bean.besDao = mock(BesDAO.class);
    bean.em = mock(EntityManager.class);
    bean.timerServcie = mock(APPTimerServiceBean.class);
    bean.opBean = mock(OperationServiceBean.class);
    bean.opDao = mock(OperationDAO.class);
    user = new ServiceUser();
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:12,代碼來源:ServiceInstanceServiceBeanTest.java

示例2: setup

import org.oscm.app.dao.OperationDAO; //導入依賴的package包/類
@Override
protected void setup(TestContainer container) throws Exception {

    container.addBean(LoggerFactory.getLogger(APPTimerServiceBean.class));
    container.addBean(instanceDAO = new ServiceInstanceDAO());
    container.addBean(configService = Mockito
            .mock(APPConfigurationServiceBean.class));

    container.addBean(mock(APPConcurrencyServiceBean.class));
    container.addBean(provFactoryBean = Mockito
            .mock(ProductProvisioningServiceFactoryBean.class));

    provService = mock(ProvisioningService.class);
    doReturn(provService).when(provFactoryBean)
            .getInstance(any(ServiceInstance.class));

    container.addBean(
            mailService = Mockito.mock(APPCommunicationServiceBean.class));

    container.addBean(besDAOMock = mock(BesDAO.class));
    doReturn(Arrays.asList(new VOUserDetails())).when(besDAOMock)
            .getBESTechnologyManagers(any(ServiceInstance.class));
    operationDAOMock = mock(OperationDAO.class);
    container.addBean(operationDAOMock);
    container.addBean(opBean = mock(OperationServiceBean.class));
    container.addBean(mock(APPAuthenticationServiceBean.class));
    container.addBean(new APPlatformServiceBean());
    controller = mock(APPlatformController.class);
    InitialContext context = new InitialContext();
    context.bind("bss/app/controller/ess.vmware", controller);
    container.addBean(controller);

    timer = mock(Timer.class);

    defaultUser = new VOUser();
    defaultUser.setUserId("user");

    em = instanceDAO.em;
    container.addBean(timerService = spy(new APPTimerServiceBean()));
    container.addBean(timerService1 = spy(new APPTimerServiceBean()));
    timerService.em = em;
    timerService1.em = em;
    timerService.instanceDAO = instanceDAO;
    timerService1.instanceDAO = instanceDAO;
    timerService.configService = configService;
    timerService1.configService = configService;
    timerService.provServFact = provFactoryBean;
    timerService1.provServFact = provFactoryBean;
    timerService.besDAO = besDAOMock;
    timerService1.besDAO = besDAOMock;
    timerService.mailService = mailService;
    timerService1.mailService = mailService;
    timerService.operationDAO = operationDAOMock;
    timerService1.operationDAO = operationDAOMock;
    timerService.opBean = opBean;
    timerService1.opBean = opBean;
    timerService.appTimerServiceBean = timerService1;
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:59,代碼來源:APPTimerServiceBeanIT.java

示例3: setup

import org.oscm.app.dao.OperationDAO; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected void setup(TestContainer container) throws Exception {
    AESEncrypter.generateKey();

    container.addBean(configService = Mockito
            .mock(APPConfigurationServiceBean.class));
    container.addBean(Mockito.mock(ServiceInstanceDAO.class));

    container.addBean(Mockito.mock(APPConcurrencyServiceBean.class));
    container.addBean(
            Mockito.mock(ProductProvisioningServiceFactoryBean.class));
    container.addBean(Mockito.mock(APPCommunicationServiceBean.class));

    serviceMock = Mockito.mock(Service.class);
    besDAO = Mockito.mock(BesDAO.class);
    subcriptionService = Mockito.mock(SubscriptionService.class);
    identityService = Mockito.mock(EnhancedIdentityService.class);
    Mockito.doReturn(Arrays.asList(new VOUserDetails())).when(besDAO)
            .getBESTechnologyManagers(any(ServiceInstance.class));

    Mockito.doReturn(identityService).when(besDAO).getBESWebService(
            Matchers.eq(IdentityService.class),
            any(ServiceInstance.class), any(Optional.class));

    Mockito.doNothing().when(besDAO).setUserCredentialsInContext(
            any(BindingProvider.class), anyString(),
            anyString(), Matchers.anyMap());

    Mockito.doReturn(subcriptionService).when(besDAO).getBESWebService(
            Matchers.eq(SubscriptionService.class),
            any(ServiceInstance.class), any(Optional.class));

    Mockito.doNothing().when(subcriptionService).completeAsyncSubscription(
            anyString(), anyString(),
            any(VOInstanceInfo.class));
    Mockito.doNothing().when(subcriptionService).abortAsyncSubscription(
            anyString(), anyString(),
            Matchers.anyListOf(VOLocalizedText.class));
    Mockito.doReturn(subcriptionService).when(serviceMock).getPort(
            any(QName.class),
            Matchers.eq(SubscriptionService.class));

    Mockito.doReturn(serviceMock).when(besDAO).createWebService(
            any(URL.class), any(QName.class));

    Mockito.doReturn(identityService).when(serviceMock).getPort(
            any(QName.class), Matchers.eq(IdentityService.class));

    container.addBean(besDAO);
    container.addBean(Mockito.mock(OperationDAO.class));

    container.addBean(Mockito.mock(ServiceInstanceDAO.class));
    container.addBean(Mockito.mock(OperationServiceBean.class));

    container.addBean(
            authService = Mockito.spy(new APPAuthenticationServiceBean()));
    container.addBean(Mockito.mock(OperationServiceBean.class));

    container.addBean(new APPlatformServiceBean());
    controller = Mockito.mock(APPlatformController.class);
    InitialContext context = new InitialContext();
    context.bind("bss/app/controller/ess.vmware", controller);
    container.addBean(controller);

    besDAO = container.get(BesDAO.class);

    platformService = container.get(APPlatformServiceBean.class);

    em = container.getPersistenceUnit("oscm-app");

    defaultAuth = new PasswordAuthentication("user", "password");
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:74,代碼來源:APPAuthenticationServiceBeanIT.java

示例4: setup

import org.oscm.app.dao.OperationDAO; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected void setup(TestContainer container) throws Exception {
    AESEncrypter.generateKey();

    container.addBean(configService = Mockito
            .mock(APPConfigurationServiceBean.class));
    container.addBean(Mockito.mock(ServiceInstanceDAO.class));

    container.addBean(Mockito.mock(APPConcurrencyServiceBean.class));
    container.addBean(
            Mockito.mock(ProductProvisioningServiceFactoryBean.class));
    container.addBean(Mockito.mock(APPCommunicationServiceBean.class));

    serviceMock = Mockito.mock(Service.class);
    besDAO = Mockito.mock(BesDAO.class);
    subcriptionService = Mockito.mock(SubscriptionService.class);
    identityService = Mockito.mock(EnhancedIdentityService.class);
    Mockito.doReturn(Arrays.asList(new VOUserDetails())).when(besDAO)
            .getBESTechnologyManagers(Matchers.any(ServiceInstance.class));

    Mockito.doReturn(identityService).when(besDAO).getBESWebService(
            Matchers.eq(IdentityService.class),
            Matchers.any(ServiceInstance.class));

    Mockito.doNothing().when(besDAO).setUserCredentialsInContext(
            Matchers.any(BindingProvider.class), Matchers.anyString(),
            Matchers.anyString(), Matchers.anyMap());

    Mockito.doReturn(subcriptionService).when(besDAO).getBESWebService(
            Matchers.eq(SubscriptionService.class),
            Matchers.any(ServiceInstance.class));

    Mockito.doNothing().when(subcriptionService).completeAsyncSubscription(
            Matchers.anyString(), Matchers.anyString(),
            Matchers.any(VOInstanceInfo.class));
    Mockito.doNothing().when(subcriptionService).abortAsyncSubscription(
            Matchers.anyString(), Matchers.anyString(),
            Matchers.anyListOf(VOLocalizedText.class));
    Mockito.doReturn(subcriptionService).when(serviceMock).getPort(
            Matchers.any(QName.class),
            Matchers.eq(SubscriptionService.class));

    Mockito.doReturn(serviceMock).when(besDAO).createWebService(
            Matchers.any(URL.class), Matchers.any(QName.class));

    Mockito.doReturn(identityService).when(serviceMock).getPort(
            Matchers.any(QName.class), Matchers.eq(IdentityService.class));

    container.addBean(besDAO);
    container.addBean(Mockito.mock(OperationDAO.class));

    container.addBean(Mockito.mock(ServiceInstanceDAO.class));
    container.addBean(Mockito.mock(OperationServiceBean.class));

    container.addBean(
            authService = Mockito.spy(new APPAuthenticationServiceBean()));
    container.addBean(Mockito.mock(OperationServiceBean.class));

    container.addBean(new APPlatformServiceBean());
    controller = Mockito.mock(APPlatformController.class);
    InitialContext context = new InitialContext();
    context.bind("bss/app/controller/ess.vmware", controller);
    container.addBean(controller);

    besDAO = container.get(BesDAO.class);

    platformService = container.get(APPlatformService.class);

    em = container.getPersistenceUnit("oscm-app");

    defaultAuth = new PasswordAuthentication("user", "password");
}
 
開發者ID:servicecatalog,項目名稱:development,代碼行數:74,代碼來源:APPAuthenticationServiceBeanIT.java


注:本文中的org.oscm.app.dao.OperationDAO類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。