Am new to play framework and Junit. Have little bit knowledge in java. Based on play framework getting started and documentation am started to write unit tests for play application. When i run the application in normal mode. It works fine with database models.
when i run the application in test mode. it shows jpa query exception and schema not found.
Am attached the test class file for your reference : -
import org.junit.*;
import java.net.*;
import java.util.*;
import play.test.*;
import play.test.FunctionalTest.URL;
import models.*;
import params.*;
public class BasicTest extends UnitTest {
@Test
public void testing(){
//User user = null;
User user = User.find("byUsernameAndPassword","admin","Y29tcGFzczEyMw==").first();
assertNotNull(user);
//assertNotNull("test");
}
}
Anyone help me to fix this issue.
This is my current application.conf settings in play :
db.url=jdbc:vertica://verticadatabaseurlurl/XXXXXXX
db.driver=com.vertica.Driver
db.user=XXXXX
db.pass=XXXXXX
db.schema=XXXXXX
# JPA Configuration (Hibernate)
# ~~~~~
#
# Specify the custom JPA dialect to use here (default to guess):
jpa.dialect=org.hibernate.dialect.PostgreSQLDialect
#
# Specify the ddl generation pattern to use. Set to none to disable it
# (default to update in DEV mode, and none in PROD mode):
jpa.ddl=none
#
# Debug SQL statements (logged using DEBUG level):
jpa.debugSQL=true
#
# You can even specify additional hibernate properties here:
# hibernate.use_sql_comments=true
# ...
#
#%test.module.cobertura=${play.path}/modules/cobertura
%test.application.mode=dev
%test.db.url=jdbc:h2:mem:play;MODE=MYSQL;LOCK_MODE=0
%test.db=mem
%test.jpa.ddl=create
%test.mail.smtp=mock
am currently using vertica for database. By this settings can able to run the application in normal mode. In test mode it makes that issue.
http://tinypic.com/r/a48zg4/7 -screenshot reference