Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What is the JPA configuration you use for the unit tests. More specifc, what's the persistence.xml that you use for unit tests. It might be that you need to add the schema autogeneration config param to the test persistence unit you use, something like: </p> <pre><code>&lt;persistence-unit name="emApplicationManaged_forTests_h2" transaction-type="RESOURCE_LOCAL"&gt; &lt;class&gt;model.Employee&lt;/class&gt; &lt;!-- your Entity classes here --&gt; &lt;properties&gt; &lt;!-- your hibernate specific params here --&gt; &lt;!-- the below parameter tells hibernate to create the schema when you start your app (test) and to erase it when it finishes: --&gt; &lt;property name="hibernate.hbm2ddl.auto" value="create-drop" /&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; </code></pre> <p>The above is for when you use Hibernate JPA implementation. If you use Toplink, try:</p> <pre><code>&lt;persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"&gt; &lt;persistence-unit name="todos" transaction-type="RESOURCE_LOCAL"&gt; &lt;!-- entity classes --&gt; &lt;properties&gt; &lt;!-- eclipselink specific config--&gt; &lt;!-- EclipseLink should create the database schema automatically --&gt; &lt;property name="eclipselink.ddl-generation" value="create-tables" /&gt; &lt;property name="eclipselink.ddl-generation.output-mode" value="database" /&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre> <p>For Play framework, you have special config params that start with test. prefix. Try this: open your application.conf config file and add the lines that configures the test environment for db schema auto-creation:</p> <pre><code>%test.db=mem %test.jpa.ddl=create-drop </code></pre> <p>Then try your tests from the Play unit test running page (localhost:9090/@tests#)</p> <p>Also check out this Play cheat-sheet, its pretty useful (I think the chapter called "Multidev Environment" is pertinent to your specific issue): </p> <p><a href="http://playcheatsheet.appspot.com/show/ArtemMedeu/armed/play-cheatsheets" rel="nofollow">http://playcheatsheet.appspot.com/show/ArtemMedeu/armed/play-cheatsheets</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload