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


Java EJBAccessException类代码示例

本文整理汇总了Java中javax.ejb.EJBAccessException的典型用法代码示例。如果您正苦于以下问题:Java EJBAccessException类的具体用法?Java EJBAccessException怎么用?Java EJBAccessException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EJBAccessException类属于javax.ejb包,在下文中一共展示了EJBAccessException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: savePublicLandingpageConfig_invalidRole

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test(expected = EJBAccessException.class)
public void savePublicLandingpageConfig_invalidRole() throws Throwable {
    // given
    String invalidRole = UserRoleType.ORGANIZATION_ADMIN.name();
    container.login(mpOwnerUserKey, invalidRole);

    // when
    try {
        landingpageServiceLocal
                .savePublicLandingpageConfig(new VOPublicLandingpage());
    } catch (EJBException e) {
        throw e.getCause();
    }

    // then
    fail();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:LandingpageServiceBeanIT.java

示例2: getAvailableReportsForOrgAdmin_NotAuthorized

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test(expected = EJBAccessException.class)
public void getAvailableReportsForOrgAdmin_NotAuthorized()
        throws Exception {
    runTX(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
            container.login(String.valueOf(supplierUserA.getKey()),
                    UserRoleType.SUBSCRIPTION_MANAGER.name());
            try {
                reportService
                        .getAvailableReportsForOrgAdmin(ReportType.ALL);
            } catch (EJBException e) {
                throw e.getCausedByException();
            }
            return null;
        }
    });
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:ReportingQueryIT.java

示例3: saveOrganizationVats_asReseller

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void saveOrganizationVats_asReseller() throws Exception {
    // given
    container.login(givenReseller().getKey(),
            UserRoleType.RESELLER_MANAGER.name());

    // when
    try {
        vatService.saveOrganizationVats(
                new ArrayList<VOOrganizationVatRate>());
        fail("EJBException expected as operation must fail due to not allowed role!");
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:VatServiceBeanPermissionIT.java

示例4: updateCustomerDiscount_asReseller

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void updateCustomerDiscount_asReseller() throws Exception {
    // given
    container.login(givenReseller().getKey(),
            UserRoleType.RESELLER_MANAGER.name());

    // when
    try {
        as.updateCustomerDiscount(new VOOrganization());
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:AccountServiceBeanPermissionIT.java

示例5: updateCustomerDiscount_asBroker

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void updateCustomerDiscount_asBroker() throws Exception {
    // given
    container.login(givenBroker().getKey(),
            UserRoleType.BROKER_MANAGER.name());

    // when
    try {
        as.updateCustomerDiscount(new VOOrganization());
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:AccountServiceBeanPermissionIT.java

示例6: getCustomerPaymentConfiguration_asBroker

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void getCustomerPaymentConfiguration_asBroker() throws Exception {
    // given
    container.login(givenBroker().getKey(),
            UserRoleType.BROKER_MANAGER.name());

    try {
        // when
        as.getCustomerPaymentConfiguration();
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:AccountServiceBeanPermissionIT.java

示例7: getDefaultPaymentConfiguration_asBroker

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void getDefaultPaymentConfiguration_asBroker() throws Exception {
    // given
    container.login(givenBroker().getKey(),
            UserRoleType.BROKER_MANAGER.name());

    try {
        // when
        as.getDefaultPaymentConfiguration();
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:AccountServiceBeanPermissionIT.java

示例8: getDefaultServicePaymentConfiguration_asBroker

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void getDefaultServicePaymentConfiguration_asBroker()
        throws Exception {
    // given
    container.login(givenBroker().getKey(),
            UserRoleType.BROKER_MANAGER.name());

    try {
        // when
        as.getDefaultServicePaymentConfiguration();
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:AccountServiceBeanPermissionIT.java

示例9: getServicePaymentConfiguration_asBroker

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void getServicePaymentConfiguration_asBroker() throws Exception {
    // given
    container.login(givenBroker().getKey(),
            UserRoleType.BROKER_MANAGER.name());

    try {
        // when
        as.getServicePaymentConfiguration();
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:AccountServiceBeanPermissionIT.java

示例10: getPartnerRevenueShareForAllStatesService_invalidRole

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void getPartnerRevenueShareForAllStatesService_invalidRole()
        throws Exception {
    setupWithContainer();
    // given
    container.login(mpOwnerUserKey, UserRoleType.TECHNOLOGY_MANAGER.name());

    // when
    try {
        pricingService.getPartnerRevenueShareForAllStatesService(
                new POServiceForPricing());
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:PricingServiceBeanAllStatesServiceRevenueSharesIT.java

示例11: getPartnerRevenueShareForService_invalidRole

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void getPartnerRevenueShareForService_invalidRole()
        throws Exception {
    setupWithContainer();
    // given
    container.login(mpOwnerUserKey, UserRoleType.TECHNOLOGY_MANAGER.name());

    // when
    try {
        pricingService.getPartnerRevenueShareForService(
                new POServiceForPricing());
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:PricingServiceBeanServiceRevenueSharesIT.java

示例12: getPricingForMarketplace_invalidRole

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void getPricingForMarketplace_invalidRole() throws Exception {
    // given
    container.login(givenTechProvider().getKey(),
            UserRoleType.TECHNOLOGY_MANAGER.name());

    // when
    try {
        pricingService.getPricingForMarketplace(OPEN_MP_ID);
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:PricingServiceBeanMarketplacesIT.java

示例13: getPartnerRevenueSharesForMarketplace_invalidRole

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void getPartnerRevenueSharesForMarketplace_invalidRole()
        throws Exception {

    // given
    container.login(mpOwnerUserKey, UserRoleType.TECHNOLOGY_MANAGER.name());

    // when
    try {
        pricingService.getPartnerRevenueSharesForMarketplace(MARKETPLACEID);
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:PricingServiceBeanContainerIT.java

示例14: getMarketplaceRevenueShares_invalidRole

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void getMarketplaceRevenueShares_invalidRole() throws Exception {

    // given
    container.login(mpOwnerUserKey, UserRoleType.TECHNOLOGY_MANAGER.name());

    // when
    try {
        pricingService.getMarketplaceRevenueShares(MARKETPLACEID);
        fail();
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:PricingServiceBeanContainerIT.java

示例15: saveAllVats_asBroker

import javax.ejb.EJBAccessException; //导入依赖的package包/类
@Test
public void saveAllVats_asBroker() throws Exception {
    // given
    container.login(givenBroker().getKey(),
            UserRoleType.BROKER_MANAGER.name());

    // when
    try {
        vatService.saveAllVats(new VOVatRate(),
                new ArrayList<VOCountryVatRate>(),
                new ArrayList<VOOrganizationVatRate>());
        fail("EJBException expected as operation must fail due to not allowed role!");
    } catch (EJBException e) {

        // then
        assertTrue(e.getCausedByException() instanceof EJBAccessException);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:VatServiceBeanPermissionIT.java


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