本文整理汇总了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();
}
示例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;
}
});
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}