本文整理匯總了Java中javax.ejb.EJBException.getCausedByException方法的典型用法代碼示例。如果您正苦於以下問題:Java EJBException.getCausedByException方法的具體用法?Java EJBException.getCausedByException怎麽用?Java EJBException.getCausedByException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.ejb.EJBException
的用法示例。
在下文中一共展示了EJBException.getCausedByException方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validateCopiedProductPaymentConfiguration
import javax.ejb.EJBException; //導入方法依賴的package包/類
private void validateCopiedProductPaymentConfiguration(final long key,
String... payments) throws Exception {
final Set<String> ptIds = new HashSet<String>(Arrays.asList(payments));
try {
runTX(new Callable<Void>() {
@Override
public Void call() throws Exception {
Product prod = dataManager.getReference(Product.class, key);
List<ProductToPaymentType> types = prod.getPaymentTypes();
for (ProductToPaymentType t : types) {
assertTrue(ptIds.remove(t.getPaymentType()
.getPaymentTypeId()));
}
return null;
}
});
} catch (EJBException e) {
throw e.getCausedByException();
}
assertTrue(ptIds.isEmpty());
}
示例2: testCreateMarketingProductImageTypeNull
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = SaaSSystemException.class)
public void testCreateMarketingProductImageTypeNull() throws Exception {
VOTechnicalService tp = createTechnicalProduct(svcProv);
VOServiceDetails product = new VOServiceDetails();
product.setServiceId("test");
VOImageResource imageResource = new VOImageResource();
byte[] content = BaseAdmUmTest.getFileAsByteArray(
ServiceProvisioningServiceBeanIT.class, "icon1.png");
imageResource.setBuffer(content);
imageResource.setContentType("image/png");
try {
container.login(supplierUserKey, ROLE_SERVICE_MANAGER);
svcProv.createService(tp, product, imageResource);
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例3: validateCopiedProductPaymentConfiguration
import javax.ejb.EJBException; //導入方法依賴的package包/類
protected void validateCopiedProductPaymentConfiguration(final long key,
String... payments) throws Exception {
final Set<String> ptIds = new HashSet<String>(Arrays.asList(payments));
try {
runTX(new Callable<Void>() {
@Override
public Void call() throws Exception {
Product prod = mgr.getReference(Product.class, key);
List<ProductToPaymentType> types = prod.getPaymentTypes();
for (ProductToPaymentType t : types) {
assertTrue(ptIds.remove(t.getPaymentType()
.getPaymentTypeId()));
}
return null;
}
});
} catch (EJBException e) {
throw e.getCausedByException();
}
assertTrue(ptIds.isEmpty());
}
示例4: testSetCompatibleProductsTargetIsCopy
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = SaaSSystemException.class)
public void testSetCompatibleProductsTargetIsCopy() throws Exception {
VOTechnicalService tp = createTechnicalProduct(svcProv);
container.login(supplierUserKey, ROLE_SERVICE_MANAGER);
VOService product1 = createProduct(tp, "1", svcProv);
publishToLocalMarketplaceSupplier(product1, mpSupplier);
VOServiceDetails product2 = createProduct(tp, "2", svcProv);
publishToLocalMarketplaceSupplier(product2, mpSupplier);
VOPriceModel priceModel = createPriceModel();
VOOrganization customer = getOrganizationForOrgId(customerOrgId);
product2 = svcProv.savePriceModelForCustomer(product2, priceModel,
customer);
try {
svcProv.setCompatibleServices(product1,
Collections.singletonList((VOService) product2));
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例5: createUser_LDAPUsed
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = UnsupportedOperationException.class)
public void createUser_LDAPUsed() throws Exception {
try {
final VOUserDetails userToCreate = new VOUserDetails();
userToCreate.setUserId("newUser");
runTX(new Callable<Void>() {
@Override
public Void call() throws Exception {
idMgmt.createUser(userToCreate, Collections.singletonList(
UserRoleType.ORGANIZATION_ADMIN), null);
return null;
}
});
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例6: testResumeService_validUserRole
import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
* Check the execution of the resume service method with a allowed user
* role. (For reasons of simplification we pass null and expect a illegal
* argument exception)
*/
@Test(expected = IllegalArgumentException.class)
public void testResumeService_validUserRole() throws Exception {
container.login(supplierUserKey, ROLE_MARKETPLACE_OWNER);
try {
svcProv.resumeService(null);
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例7: getPotentialCompatibleServices_MarketplaceOwner
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = EJBAccessException.class)
public void getPotentialCompatibleServices_MarketplaceOwner()
throws Exception {
container.login(userKey, UserRoleType.MARKETPLACE_OWNER.name());
try {
sps.getPotentialCompatibleServices(null);
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例8: resetOrganizationSettings_nullOrgId
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = IllegalArgumentException.class)
public void resetOrganizationSettings_nullOrgId() throws Throwable {
try {
runTX(new Callable<Void>() {
@Override
public Void call() throws Exception {
ldapSettingsMgmtSvc.resetOrganizationSettings(null);
return null;
}
});
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例9: testDeletePaymentInfo_NotAuthorized
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = EJBAccessException.class)
public void testDeletePaymentInfo_NotAuthorized() throws Exception {
container.login(String.valueOf(supplier1User.getKey()));
try {
accountMgmt.deletePaymentInfo(new VOPaymentInfo());
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例10: testSuspendService_validUserRole
import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
* Check the execution of the suspend service method with a allowed user
* role. (For reasons of simplification we pass null and expect a illegal
* argument exception)
*/
@Test(expected = IllegalArgumentException.class)
public void testSuspendService_validUserRole() throws Exception {
container.login(supplierUserKey, ROLE_MARKETPLACE_OWNER);
try {
svcProv.suspendService(null, null);
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例11: servicesForPublicLandingpage_anonymus_MarketplaceIdNull
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = IllegalArgumentException.class)
public void servicesForPublicLandingpage_anonymus_MarketplaceIdNull()
throws Exception {
// given
try {
// when
landingpageService.servicesForPublicLandingpage(null, locale);
} catch (EJBException e) {
// then
throw e.getCausedByException();
}
}
示例12: getMarketplacesForService_SvcNotFound
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = ObjectNotFoundException.class)
public void getMarketplacesForService_SvcNotFound() throws Exception {
VOService svc = new VOService();
svc.setServiceId("UNKNOWN_SVC_ID");
try {
container.login(supplier1Key, ROLE_SERVICE_MANAGER);
marketplaceService.getMarketplacesForService(svc);
} catch (EJBException e) {
throw e.getCausedByException();
}
}
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:12,代碼來源:MarketplaceServiceBeanGetMarketplaceAndOrganizationIT.java
示例13: testSavePaymentInfo_NotAuthorized
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = EJBAccessException.class)
public void testSavePaymentInfo_NotAuthorized() throws Exception {
container.login(String.valueOf(supplier1User.getKey()));
try {
accountMgmt.savePaymentInfo(new VOPaymentInfo());
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例14: getOrganizationSettings_emptyOrgId
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = IllegalArgumentException.class)
public void getOrganizationSettings_emptyOrgId() throws Throwable {
try {
runTX(new Callable<Void>() {
@Override
public Void call() throws Exception {
ldapSettingsMgmtSvc.getOrganizationSettings("");
return null;
}
});
} catch (EJBException e) {
throw e.getCausedByException();
}
}
示例15: servicesForPublicLandingpage_anonymus_LocaleNull
import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = IllegalArgumentException.class)
public void servicesForPublicLandingpage_anonymus_LocaleNull()
throws Exception {
// given
try {
// when
landingpageService.servicesForPublicLandingpage(SUPPLIER_MP_ID,
null);
} catch (EJBException e) {
// then
throw e.getCausedByException();
}
}