當前位置: 首頁>>代碼示例>>Java>>正文


Java EJBException.getCause方法代碼示例

本文整理匯總了Java中javax.ejb.EJBException.getCause方法的典型用法代碼示例。如果您正苦於以下問題:Java EJBException.getCause方法的具體用法?Java EJBException.getCause怎麽用?Java EJBException.getCause使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.ejb.EJBException的用法示例。


在下文中一共展示了EJBException.getCause方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: saveEnterpriseLandingpageConfig_invalidRole

import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
 * User must have "MARKETPLACE_OWNER" role
 */
@Test(expected = EJBAccessException.class)
public void saveEnterpriseLandingpageConfig_invalidRole() throws Throwable {

    // given wrong role
    String invalidRole = UserRoleType.ORGANIZATION_ADMIN.name();
    container.login(mpOwnerUserKey, invalidRole);

    // when saving, then exception must be thrown
    try {
        landingpageServiceLocal
                .saveEnterpriseLandingpageConfig(MARKETPLACEID);
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:19,代碼來源:LandingpageServiceBeanIT.java

示例2: testAdd

import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
 * <b>Test case:</b> Add a new product review entry<br>
 * <b>ExpectedResult:</b>
 * <ul>
 * <li>The product review entry can be retrieved from DB and is identical to
 * the provided object</li>
 * <li>A history object is created for the product review entry</li>
 * </ul>
 * 
 * @throws Exception
 */
@Test
public void testAdd() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                createProductReview();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestAddCheck();
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:33,代碼來源:ProductReviewIT.java

示例3: testViolateUniqueConstraint

import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
 * <b>Testcase:</b> Try to insert two organizations with the same
 * organizationId<br>
 * <b>ExpectedResult:</b> SaasNonUniqueBusinessKeyException
 * 
 * @throws Throwable
 */
@Test(expected = NonUniqueBusinessKeyException.class)
public void testViolateUniqueConstraint() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestViolateUniqueConstraintPrepare();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestViolateUniqueConstraint();
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:27,代碼來源:OrganizationIT.java

示例4: testViolateUniqueConstraintSameOrganizationInOneTX

import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
 * <b>Testcase:</b> Try to insert two Users with the same login for the same
 * organization<br>
 * <b>ExpectedResult:</b> SaasNonUniqueBusinessKeyException
 * 
 * @throws Throwable
 */
@Test(expected = NonUniqueBusinessKeyException.class)
public void testViolateUniqueConstraintSameOrganizationInOneTX()
        throws Throwable {
    try {
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestViolateUniqueConstraintInOneTX();
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:23,代碼來源:PlatformUserIT.java

示例5: testViolateUniqueConstraint

import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
 * <b>Testcase:</b> Try to insert two Subscription with the same
 * subscriptionId<br>
 * <b>ExpectedResult:</b> SaasNonUniqueBusinessKeyException
 * 
 * @throws Throwable
 */
@Test(expected = NonUniqueBusinessKeyException.class)
public void testViolateUniqueConstraint() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestViolateUniqueConstraintPrepare();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestViolateUniqueConstraint();
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:29,代碼來源:SubscriptionIT.java

示例6: add

import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test
public void add() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestAdd();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestAddCheck();
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:20,代碼來源:UdaDefinitionIT.java

示例7: getRevenueShareData_InvalidRoleOrganizationAdmin

import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = EJBAccessException.class)
public void getRevenueShareData_InvalidRoleOrganizationAdmin()
        throws Exception {
    // given no revenue share result entries. Login with invalid user role
    container.login(brokerUser.getKey(), ROLE_ORGANIZATION_ADMIN);

    // when
    try {
        bs.getRevenueShareData(Long.valueOf(PERIOD_START_MONTH1),
                Long.valueOf(PERIOD_END_MONTH1),
                BillingSharesResultType.BROKER);
        fail();
    } catch (EJBException e) {
        throw (EJBAccessException) e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:17,代碼來源:BillingServiceGetShareDataIT.java

示例8: testModify

import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test
public void testModify() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestAdd();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestModify();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestModifyCheck();
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:26,代碼來源:RevenueShareModelIT.java

示例9: testDelete

import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test
public void testDelete() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestDeletePrepare();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestDelete();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                doTestDeleteCheck();
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:26,代碼來源:MarketplaceIT.java

示例10: testGetGlobalByOwner

import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test
public void testGetGlobalByOwner() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            public Void call() throws Exception {
                Marketplace marketplace = Marketplaces
                        .findOneGlobalMarketplace(mgr);
                Assert.assertNotNull("No marketplace found", marketplace);
                Assert.assertNotNull("No owner set",
                        marketplace.getOrganization());

                Query query = mgr
                        .createNamedQuery("Marketplace.getByOwner");
                String oId = marketplace.getOrganization()
                        .getOrganizationId();
                query.setParameter("organizationId", oId);
                List<Marketplace> result = ParameterizedTypes.list(
                        query.getResultList(), Marketplace.class);
                Assert.assertNotNull("No marketplace found", result);
                Assert.assertTrue("No marketplace found", result.size() > 0);
                for (Marketplace mp : result) {
                    Assert.assertNotNull("No owner set",
                            mp.getOrganization());
                    Assert.assertEquals("Wrong owner - ", oId, mp
                            .getOrganization().getOrganizationId());
                }
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:34,代碼來源:MarketplaceIT.java

示例11: testSearchServices_NullLocale

import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = IllegalArgumentException.class)
public void testSearchServices_NullLocale() throws Throwable {
    try {
        search.searchServices(FUJITSU, null, "wicked_de");
    } catch (EJBException e) {
        throw e.getCause();
    }
    Assert.fail();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:10,代碼來源:SearchServiceBeanListIT.java

示例12: testSearchServices_EmptyLocale

import javax.ejb.EJBException; //導入方法依賴的package包/類
@Test(expected = IllegalArgumentException.class)
public void testSearchServices_EmptyLocale() throws Throwable {
    try {
        search.searchServices(FUJITSU, "", "wicked_de");
    } catch (EJBException e) {
        throw e.getCause();
    }
    Assert.fail();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:10,代碼來源:SearchServiceBeanListIT.java

示例13: testModifyUser

import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
 * <b>Testcase:</b> Modify an existing PlatformUser object <br>
 * <b>ExpectedResult:</b>
 * <ul>
 * <li>Modification is saved to the DB</li>
 * <li>History object created for the platformUser</li>
 * <li>No new history object for Organization</li>
 * </ul>
 * 
 * @throws Throwable
 */
@Test
public void testModifyUser() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestModifyUserPrepare();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestModifyUser();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestModifyUserCheck();
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:40,代碼來源:PlatformUserIT.java

示例14: testModify

import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
 * <b>Testcase:</b> Modify the list of supported country codes for an
 * existing organization object <br>
 * <b>ExpectedResult:</b>
 * <ul>
 * <li>Modification is saved to the DB</li>
 * <li>History object created for the country codes</li>
 * </ul>
 * 
 * @throws Throwable
 */
@Test
public void testModify() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestModifyPrepare();
                return null;
            }

        });
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestModify();
                return null;
            }

        });
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestModifyCheck();
                return null;
            }

        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:43,代碼來源:OrganizationToCountryIT.java

示例15: testModify

import javax.ejb.EJBException; //導入方法依賴的package包/類
/**
 * <b>Testcase:</b> Modify an existing product review object <br>
 * <b>ExpectedResult:</b>
 * <ul>
 * <li>Modification is saved to the DB</li>
 * <li>History object created for the product review</li>
 * <li>PlatformUser unchanged</li>
 * <li>No new history object for PlatformUser</li>
 * </ul>
 * 
 * @throws Throwable
 */
@Test
public void testModify() throws Throwable {
    try {
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                createProductReview();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestModify();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestModifyCheck();
                return null;
            }
        });
    } catch (EJBException e) {
        throw e.getCause();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:41,代碼來源:ProductReviewIT.java


注:本文中的javax.ejb.EJBException.getCause方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。