[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-3128) SEAM Unit Test is not working when run as TestNG test from Eclipse
Pete Muir (JIRA)
jira-events at lists.jboss.org
Mon Jun 23 08:23:28 EDT 2008
[ http://jira.jboss.com/jira/browse/JBSEAM-3128?page=all ]
Pete Muir closed JBSEAM-3128.
-----------------------------
Resolution: Rejected
Please read the docs on how to set up a testng run from Eclipse.
> SEAM Unit Test is not working when run as TestNG test from Eclipse
> -------------------------------------------------------------------
>
> Key: JBSEAM-3128
> URL: http://jira.jboss.com/jira/browse/JBSEAM-3128
> Project: Seam
> Issue Type: Task
> Affects Versions: 2.0.2.CR1
> Environment: Windows XP, Mozilla FireFox
> Reporter: mca.ambrish at gmail.com
>
> I am running a testng.xml file from eclipse TestNG.
> My test class is
> public class AsmSurveyListTest extends SeamTest
> {
> @Test
> public void unitTestGetList() throws Exception {
> EntityManager em = getEntityManagerFactory().createEntityManager();
> em.getTransaction().begin();
> AsmSurveyList asmSurveyList = new AsmSurveyList();
> assert asmSurveyList.getList().size()== 9;
> em.getTransaction().commit();
> em.close();
> }
>
> private EntityManagerFactory emf;
>
> public EntityManagerFactory getEntityManagerFactory()
> {
> return emf;
> }
>
> @BeforeTest
> public void init() throws Exception
> {
> super.init();
> emf = Persistence.createEntityManagerFactory("SurvetPersistenceUnitName");
> }
>
> @AfterTest
> public void destroy() throws Exception
> {
> emf.close();
> }
> }
> and my testng.xml file is :
> <!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
> <suite name="AsmSurveyList" verbose="2" parallel="false">
> <test name="AsmSurveyList">
> <classes>
> <class name="com.survey.test.AsmSurveyListTest"/>
> </classes>
> </test>
>
> </suite>
> Now when I am running the testng.xml file as TestNG from Eclipse, I get the following error:
> FAILED CONFIGURATION: @BeforeTest init
> java.lang.NoClassDefFoundError: org/jboss/deployers/spi/IncompleteDeploymentException
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.jboss.seam.mock.BaseSeamTest.embeddedJBossAvailable(BaseSeamTest.java:1015)
> at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1003)
> at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:929)
> at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
> at com.survey.test.AsmSurveyListTest.init(AsmSurveyListTest.java:41)
> ... Removed 19 stack frames
> FAILED CONFIGURATION: @BeforeMethod begin
> java.lang.IllegalStateException: Attempted to invoke a Seam component outside the an initialized application
> at org.jboss.seam.contexts.Lifecycle.getApplication(Lifecycle.java:36)
> at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:173)
> at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:124)
> at org.jboss.seam.mock.BaseSeamTest.begin(BaseSeamTest.java:918)
> at org.jboss.seam.mock.SeamTest.begin(SeamTest.java:28)
> ... Removed 24 stack frames
> SKIPPED CONFIGURATION: @AfterMethod end
> SKIPPED CONFIGURATION: @AfterClass cleanup
> SKIPPED CONFIGURATION: @AfterTest destroy
> SKIPPED: unitTestGetList
> ===============================================
> com.survey.test.AsmSurveyListTest
> Tests run: 1, Failures: 0, Skips: 1
> Configuration Failures: 2, Skips: 3
> ===============================================
> ===============================================
> SurvetPersistenceUnitName
> Total tests run: 1, Failures: 0, Skips: 1
> Configuration Failures: 2, Skips: 3
> ===============================================
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list