JUnit « Development « JPA Q&A





1. problem with using JPA    stackoverflow.com

I am getting following error while executing a unti test case(JUNIT).I am using it to understand the part of the project.Project is a web based project.Project is using OPENJPA

<openjpa-1.2.1-SNAPSHOT-r422266:686069 fatal store ...

2. Hibernate statement hangs    stackoverflow.com

From my junit test I'm calling a simple method to clear my table:

    @AfterClass  
public static void runAfterClass() {   
    //Clear db ...

3. junit hibernate netbeans: CurrentSessionContext    stackoverflow.com

I'm trying to test my hibernate project with junit tests and I keep on getting org.hibernate.HibernateException: No CurrentSessionContext configured! I can manually run the hibernate requests and they work fine (i.e. I ...

4. JUnit and Hibernate    coderanch.com

I am using this code in JUnit to setup Hibernate with HSQLDB. This is without any hibernate.cfg.xml / hibernate.properties. protected void setUp() throws Exception { Configuration configuration = new Configuration(); configuration.setProperty(Environment.DRIVER,"org.hsqldb.jdbcDriver"); configuration.setProperty(Environment.URL,"jdbc:hsqldb:hsql://127.0.0.1/forum"); configuration.setProperty(Environment.USER, "sa"); configuration.setProperty(Environment.DIALECT,HSQLDialect.class.getName()); configuration.setProperty(Environment.SHOW_SQL, "true"); configuration.setProperty("hibernate.format_sql", "true"); configuration.addResource("forum.hbm.xml"); sessionFactory = configuration.buildSessionFactory(); HibernateTemplate hibernateTemplate = new HibernateTemplate(sessionFactory); dao.setHibernateTemplate(hibernateTemplate); System.out.println(">>>>>>>>> configuration done "); super.setUp(); } But I once I run some ...

5. New to Hibernate. Trying out using Junit, settings screwed    forum.hibernate.org

Newbie Joined: Tue Jun 15, 2010 3:52 am Posts: 1 Error I am getting is : 1767 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured If I specify : name="java:hibernate/SessionFactory" is the hiberate.cfg.xml file with session-factory, I get the following error 2052 [main] WARN org.hibernate.impl.SessionFactoryObjectFactory - Could not bind factory to JNDI javax.naming.NoInitialContextException: Need to specify ...

6. maven, hibernate, junit and CreateProcess error=87    forum.hibernate.org

did anybody meet this before? it looks so simple but i just can not get rid of it: the simplest junit: @Test public void findOne() { Assert.assertNotNull("aaa"); } the almost simplest POM: junit junit 4.8.2 jar compile org.hibernate hibernate-entitymanager 3.6.3.Final compile the junit test even has nothing to do with the hibernate. but once i add ...

7. Junit errors out during setup    forum.hibernate.org

Newbie Joined: Sat Nov 08, 2003 12:12 am Posts: 3 Hi I am trying to use hibernate and spring to build a sample application. When I run maven test:test with log4j turned on, I get the following output. Also, I have included the junit log at the end. Looks like the process is dying somewhere in the secondPassCompile:Configuration.java I have been ...

8. Problem with DoubleType in jUnit    forum.hibernate.org

I am having a problem with jUnit reading a double type in a testcase the output is: Code: [junit] ------------- Standard Error ----------------- [junit] net.sf.hibernate.MappingException: Bad identifier type: net.sf.hibernate.type.DoubleType [junit] at net.sf.hibernate.persister.AbstractEntityPersister.(AbstractEntityPersister.java:655) [junit] at net.sf.hibernate.persister.EntityPersister.(EntityPersister.java:741) [junit] at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:41) [junit] at net.sf.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:136) [junit] ...

9. IllegalArgumentException when running under junit    forum.hibernate.org

Hi. I installed hibernate, created standalone and servlet demo programs and everything worked fine. Now I'm trying to run my classes under junit and I get strange exception. The mapping and the Java class seem to be correct. Could this be some kind of problem related to running the code in different environment (maybe I omitted some class from classpath?)? I ...





10. JUnit - ing you hibernate application    forum.hibernate.org

Hi All, As one of eXtreme programming fans, i always try to test my applications. And this comes no difference with hibernate. Just a while ago i found out that when I run my junit test, hibernate will tries to read from the datasource that I use for my Resin web server. But unfortunately a data source cannot be run outside ...

11. Junit    forum.hibernate.org

I ran into an oddity. When using the JUnit swing UI, I get an exception when I instantiate a configuration. It whines about: org.apache.commonts.logging.LogConfigurationException: class org.apache.commons.logging.impl.Log4Jlogger does not implement Log Although I can run the junit.textui.TestRunner just fine. It must be a newbie problem, but I haven't been able to figure it out. --Kurt

12. Error during the invoking setUp() method in Junit testcase    forum.hibernate.org

Hi, Currently I'm facing a problem setting up the initial data in setUp() method of the class extending TestCase of Junit. The code for the same is below. public void setUp() throws Exception{ try{ Configuration hibernateConfig = new Configuration().configure("/price-range-trawler.cfg.xml"); persister = new HibernateCHMTrawlerPersister(hibernateConfig.buildSessionFactory()); }catch(Exception e){ log.error("Error during setup", e); } } It seems that some jar file is missing. Could any ...

13. Junit Hibernate Failures    forum.hibernate.org

if I am using old version of hibernate , what is the correct version to use ? to avoid this error ? I am using J2sdk1.4. thanks Hibernate version: 2.1.2 , Jdk1.4 Mapping documents: #hinetlogic hibernate properties #Mon Dec 27 00:35:28 PST 2004 hibernate.connection.username=xxxx hibernate.connection.password=xxx hibernate.jdbc.use_scrollable_resultsets=false hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect hibernate.connection.url=jdbc\:db2\:sample hibernate.use_outer_join=true hibernate.jdbc.batch_size=0 hibernate.connection.driver_class=COM.ibm.db2.jdbc.app.DB2Driver ...

14. Junit and Hibernate Problem    forum.hibernate.org

/src /conf /java /essex.cc403.registry EventRegistry.java /test /essex.cc403.registry EventRegistry.java ...

15. Hibernate and JUnit: LogConfigurationException    forum.hibernate.org

I use Hibernate, and test my application with JUnit. When I do the first database-command, I get a LogConfigurationException. The command, where I get problems, is: protected void saveOrUpdateObj(Object obj) throws DAOException { try { Session session = HibernateUtil.getSession(); // Here I get the exception HibernateUtil.beginTransaction(); session.saveOrUpdate(obj); HibernateUtil.commitTransaction(); } catch (HibernateException he) { throw new DAOException(he); } finally { HibernateUtil.closeSession(); } ...

16. Article: Ant, JUnit and Hibernate Tracing and Profiling    forum.hibernate.org

Hi all, I hope that users on this forum find the following article interesting and useful in the context of their own hibernate app build and testing efforts. http://www.jinspired.com/products/jdbin ... acing.html It would be great if Gavin and team considered the transaction analysis coupled with the traceability from ant to task to test suite valuable. I have attempted to minimise the ...





17. wierd hibernate / junit interaction    forum.hibernate.org

18. JUnit and JNDI    forum.hibernate.org

Hi, If I build my war file and deploy it to JBoss using the following config file : Code: