当前位置: 首页>>代码示例>>Java>>正文


Java EJBException.getCausedByException方法代码示例

本文整理汇总了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());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:23,代码来源:ServiceProvisioningServiceBeanCopyIT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:ServiceProvisioningServiceBeanIT.java

示例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());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:23,代码来源:ServiceProvisioningServiceBean3IT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:20,代码来源:ServiceProvisioningServiceBean2IT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:IdentityServiceBeanLdapWithDbIT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:15,代码来源:ServiceProvisioningServiceBeanIT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:11,代码来源:ServiceProvisioningPotentialCompatibleServicesIT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:15,代码来源:LdapSettingsMangementServiceBeanIT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:10,代码来源:AccountServiceBeanIT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:15,代码来源:ServiceProvisioningServiceBeanIT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:13,代码来源:LandingpageServiceBean2IT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:10,代码来源:AccountServiceBeanIT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:15,代码来源:LdapSettingsMangementServiceBeanIT.java

示例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();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:14,代码来源:LandingpageServiceBean2IT.java


注:本文中的javax.ejb.EJBException.getCausedByException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。