1 Reply Latest reply on Apr 1, 2008 7:26 PM by john hedden

    Unit Testing

    john hedden Newbie

      Used seam gen to generate my project and while doing some unit testing via testng i get the following errors:



      ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] Unsuccessful: create table Address
      ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] Table already exists: ADDRESS





      This is my persistence-test.xml:


      <persistence-unit name="ooord">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:/DefaultDS</jta-data-source>
            <properties>
               <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
               <property name="hibernate.show_sql" value="true"/>
               <property name="hibernate.cache.use_second_level_cache" value="false"/>
               <property name="jboss.entity.manager.factory.jndi.name" value="java:/ooordEntityManagerFactory"/>
            </properties>
         </persistence-unit>



      This happened when I changed the domain model.  Another odd thing, it randomly disappeared last night.  I came back this morning, made some tweaks to the model, and bam! back again. 


      any ideas?  Im spinning my wheels at this point. A point in the right direction would be helpful.  thanks!


        • 1. Re: Unit Testing
          john hedden Newbie

          AH HA!


          After spending a good 12 hrs on it, I figured it out just after I posted.  Seemed like Entities were getting cached so I took a look in /boostrap/hsqldb-ds.xml.  Looky, Looky, I commented out this:



          <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>



          and uncommented this:



          <connection-url>jdbc:hsqldb:.</connection-url>