3 Replies Latest reply on Dec 14, 2007 10:47 AM by Denise Ketcham

    Trying to run tests in Embedded.

    Neill Robbins Newbie

      I'm sorry I'm maybe missing something very obvious.

      I am trying to run a test in Seam2.0BETA using testNG in the embedded EJB3 container and I'm getting the following:

       [testng] java.lang.RuntimeException: PROVIDER_URL not provided in jndi.proper
      ties. Automatic discovery not implemented yet.
       [testng] at org.jboss.naming.JBossRemotingContextFactory.getInitialContex
      t(JBossRemotingContextFactory.java:162)
       [testng] at javax.naming.spi.NamingManager.getInitialContext(NamingManage
      r.java:667)
       [testng] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.
      java:288)
       [testng] at javax.naming.InitialContext.init(InitialContext.java:223)
       [testng] at javax.naming.InitialContext.<init>(InitialContext.java:175)
       [testng] at org.hibernate.util.NamingHelper.getInitialContext(NamingHelpe
      r.java:28)
       [testng] at org.hibernate.connection.DatasourceConnectionProvider.configu
      re(DatasourceConnectionProvider.java:52)
       [testng] at org.hibernate.connection.ConnectionProviderFactory.newConnect
      ionProvider(ConnectionProviderFactory.java:124)
       [testng] at org.hibernate.ejb.InjectionSettingsFactory.createConnectionPr
      ovider(InjectionSettingsFactory.java:29)
       [testng] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFacto
      ry.java:62)
       [testng] at org.hibernate.cfg.Configuration.buildSettings(Configuration.j
      ava:2006)
       [testng] at org.hibernate.cfg.Configuration.buildSessionFactory(Configura
      tion.java:1289)
       [testng] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory
      (Ejb3Configuration.java:691)
       [testng] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFac
      tory(HibernatePersistence.java:121)
       [testng] at javax.persistence.Persistence.createEntityManagerFactory(Pers
      istence.java:51)
       [testng] at javax.persistence.Persistence.createEntityManagerFactory(Pers
      istence.java:33)
       [testng] at au.com.sandstone.ib.service.AddTransferServiceRequestTest.ini
      t(AddTransferServiceRequestTest.java:21)
       [testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       [testng] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
      sorImpl.java:39)
       [testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
      hodAccessorImpl.java:25)
       [testng] at java.lang.reflect.Method.invoke(Method.java:597)
       [testng] at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.ja
      va:604)
       [testng] at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker
      .java:394)
       [testng] at org.testng.internal.Invoker.invokeConfigurations(Invoker.java
      :142)
       [testng] at org.testng.internal.Invoker.invokeConfigurations(Invoker.java
      :79)
       [testng] at org.testng.TestRunner.beforeRun(TestRunner.java:519)
       [testng] at org.testng.TestRunner.run(TestRunner.java:487)
       [testng] at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
       [testng] at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
       [testng] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
       [testng] at org.testng.SuiteRunner.run(SuiteRunner.java:190)
       [testng] at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
       [testng] at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
       [testng] at org.testng.TestNG.run(TestNG.java:699)
       [testng] at org.testng.TestNG.privateMain(TestNG.java:824)
       [testng] at org.testng.TestNG.main(TestNG.java:802)
       [testng] FAILED CONFIGURATION: @BeforeTest init
       [testng] javax.persistence.PersistenceException: org.hibernate.HibernateExcep
      tion: Could not find datasource
       [testng] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory
      (Ejb3Configuration.java:698)
       [testng] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFac
      tory(HibernatePersistence.java:121)
       [testng] at javax.persistence.Persistence.createEntityManagerFactory(Pers
      istence.java:51)
       [testng] at javax.persistence.Persistence.createEntityManagerFactory(Pers
      istence.java:33)
       [testng] at au.com.sandstone.ib.service.AddTransferServiceRequestTest.ini
      t(AddTransferServiceRequestTest.java:21)
       [testng] Caused by: org.hibernate.HibernateException: Could not find datasour
      ce
       [testng] at org.hibernate.connection.DatasourceConnectionProvider.configu
      re(DatasourceConnectionProvider.java:56)
       [testng] at org.hibernate.connection.ConnectionProviderFactory.newConnect
      ionProvider(ConnectionProviderFactory.java:124)
       [testng] at org.hibernate.ejb.InjectionSettingsFactory.createConnectionPr
      ovider(InjectionSettingsFactory.java:29)
       [testng] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFacto
      ry.java:62)
       [testng] at org.hibernate.cfg.Configuration.buildSettings(Configuration.j
      ava:2006)
       [testng] at org.hibernate.cfg.Configuration.buildSessionFactory(Configura
      tion.java:1289)
       [testng] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory
      (Ejb3Configuration.java:691)
       [testng] ... 23 more
       [testng] Caused by: java.lang.RuntimeException: PROVIDER_URL not provided in
      jndi.properties. Automatic discovery not implemented yet.
       [testng] at org.jboss.naming.JBossRemotingContextFactory.getInitialContex
      t(JBossRemotingContextFactory.java:162)
       [testng] at javax.naming.spi.NamingManager.getInitialContext(NamingManage
      r.java:667)
       [testng] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.
      java:288)
       [testng] at javax.naming.InitialContext.init(InitialContext.java:223)
       [testng] at javax.naming.InitialContext.<init>(InitialContext.java:175)
       [testng] at org.hibernate.util.NamingHelper.getInitialContext(NamingHelpe
      r.java:28)
       [testng] at org.hibernate.connection.DatasourceConnectionProvider.configu
      re(DatasourceConnectionProvider.java:52)
       [testng] ... 29 more
       [testng] ... Removed 19 stack frames
       [testng] FAILED CONFIGURATION: @BeforeMethod begin
       [testng] java.lang.IllegalStateException: Attempted to invoke a Seam componen
      t outside the an initialized application
       [testng] at org.jboss.seam.contexts.Lifecycle.getApplication(Lifecycle.ja
      va:36)
       [testng] at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java
      :169)
       [testng] at org.jboss.seam.contexts.ServletLifecycle.beginSession(Servlet
      Lifecycle.java:127)
       [testng] at org.jboss.seam.mock.BaseSeamTest.begin(BaseSeamTest.java:845)
      
       [testng] at org.jboss.seam.mock.SeamTest.begin(SeamTest.java:28)
       [testng] ... Removed 24 stack frames
       [testng] SKIPPED CONFIGURATION: @AfterMethod end
       [testng] SKIPPED CONFIGURATION: @AfterClass cleanup
       [testng] SKIPPED CONFIGURATION: @AfterTest destroy
       [testng] SKIPPED: testProcess
       [testng]
       [testng] ===============================================
       [testng] BankLinkDomain
       [testng] Tests run: 1, Failures: 0, Skips: 1
       [testng] Configuration Failures: 2, Skips: 3
       [testng] ===============================================
       [testng]
       [testng]
       [testng] ===============================================
       [testng] Bank-Link
       [testng] Total tests run: 1, Failures: 0, Skips: 1
       [testng] Configuration Failures: 2, Skips: 3
       [testng] ===============================================
       [testng]
      


      I have just got a vanilla installation, and have used sen gen to create a project. I have created a class and a test and I was running "ant test".

      Any idea what I am missing?
      Cheers
      N