本文整理匯總了Java中org.oscm.app.dao.ServiceInstanceDAO類的典型用法代碼示例。如果您正苦於以下問題:Java ServiceInstanceDAO類的具體用法?Java ServiceInstanceDAO怎麽用?Java ServiceInstanceDAO使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ServiceInstanceDAO類屬於org.oscm.app.dao包,在下文中一共展示了ServiceInstanceDAO類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setup
import org.oscm.app.dao.ServiceInstanceDAO; //導入依賴的package包/類
@Override
protected void setup(TestContainer container) throws Exception {
container.enableInterfaceMocking(true);
container.addBean(Mockito.mock(BesDAO.class));
container.addBean(instanceDAO = Mockito.mock(ServiceInstanceDAO.class));
container.addBean(
authSvc = Mockito.mock(APPAuthenticationServiceBean.class));
container.addBean(
concSvc = Mockito.mock(APPConcurrencyServiceBean.class));
container.addBean(
configSvc = Mockito.mock(APPConfigurationServiceBean.class));
container.addBean(
commSvc = Mockito.mock(APPCommunicationServiceBean.class));
container.addBean(platformSvc = spy(new APPlatformServiceBean()));
container.get(APPlatformService.class);
Answer<HashMap<String, String>> answer = new Answer<HashMap<String, String>>() {
@Override
public HashMap<String, String> answer(InvocationOnMock invocation)
throws Throwable {
HashMap<String, String> map = new HashMap<>();
map.put("key", "value");
return map;
}
};
Mockito.doAnswer(answer).when(configSvc)
.getControllerConfigurationSettings(Matchers.anyString());
defaultUser = new VOUser();
defaultUser.setUserId("user");
defaultAuth = new PasswordAuthentication("user", "password");
platformSvc.setAuthService(authSvc);
platformSvc.setConfigService(configSvc);
platformSvc.setConcurrencyService(concSvc);
platformSvc.setMailService(commSvc);
platformSvc.setInstanceDAO(instanceDAO);
}
示例2: setup
import org.oscm.app.dao.ServiceInstanceDAO; //導入依賴的package包/類
@Override
protected void setup(TestContainer container) throws Exception {
container.addBean(instanceDAO = new ServiceInstanceDAO());
container.addBean(proxy = new APPConcurrencyServiceBean());
em = instanceDAO.em;
proxy.em = em;
}
示例3: setup
import org.oscm.app.dao.ServiceInstanceDAO; //導入依賴的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();
}
示例4: setup
import org.oscm.app.dao.ServiceInstanceDAO; //導入依賴的package包/類
@Before
public void setup() throws Exception {
timerService = spy(new APPTimerServiceBean());
timer = mock(Timer.class);
em = mock(EntityManager.class);
logger = mock(Logger.class);
timerService.em = em;
timerService.logger = logger;
doNothing().when(em).persist(any(ServiceInstance.class));
ts = mock(TimerService.class);
mailService = Mockito.mock(APPCommunicationServiceBean.class);
besDAOMock = mock(BesDAO.class);
provFactoryBean = mock(ProductProvisioningServiceFactoryBean.class);
configService = mock(APPConfigurationServiceBean.class);
instanceDAO = mock(ServiceInstanceDAO.class);
timerBean = mock(APPTimerServiceBean.class);
timerService.instanceDAO = instanceDAO;
timerService.configService = configService;
timerService.mailService = mailService;
timerService.besDAO = besDAOMock;
timerService.timerService = ts;
timerService.appTimerServiceBean = timerBean;
Collection<Timer> timers = new ArrayList<Timer>();
controller = mock(APPlatformController.class);
doReturn(getResult()).when(instanceDAO).getInstancesInWaitingState();
doReturn(timers).when(timerService.timerService).getTimers();
}
示例5: setup
import org.oscm.app.dao.ServiceInstanceDAO; //導入依賴的package包/類
@Override
protected void setup(TestContainer container) throws Exception {
container.enableInterfaceMocking(true);
container.addBean(Mockito.mock(BesDAO.class));
container.addBean(instanceDAO = Mockito.mock(ServiceInstanceDAO.class));
container.addBean(
authSvc = Mockito.mock(APPAuthenticationServiceBean.class));
container.addBean(
concSvc = Mockito.mock(APPConcurrencyServiceBean.class));
container.addBean(
configSvc = Mockito.mock(APPConfigurationServiceBean.class));
container.addBean(
commSvc = Mockito.mock(APPCommunicationServiceBean.class));
container.addBean(platformSvc = spy(new APPlatformServiceBean()));
container.get(APPlatformService.class);
Answer<HashMap<String, String>> answer = new Answer<HashMap<String, String>>() {
@Override
public HashMap<String, String> answer(InvocationOnMock invocation)
throws Throwable {
HashMap<String, String> map = new HashMap<>();
map.put("key", "value");
return map;
}
};
Mockito.doAnswer(answer).when(configSvc)
.getControllerConfigurationSettings(Matchers.anyString());
defaultUser = new VOUser();
defaultUser.setUserId("user");
defaultAuth = new PasswordAuthentication("user", "password");
}
示例6: setInstanceDAO
import org.oscm.app.dao.ServiceInstanceDAO; //導入依賴的package包/類
public void setInstanceDAO(ServiceInstanceDAO instanceDAO) {
this.instanceDAO = instanceDAO;
}
示例7: setup
import org.oscm.app.dao.ServiceInstanceDAO; //導入依賴的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;
}
示例8: setup
import org.oscm.app.dao.ServiceInstanceDAO; //導入依賴的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");
}
示例9: setup
import org.oscm.app.dao.ServiceInstanceDAO; //導入依賴的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");
}