Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
- try to close connection in afterMethod for JPA test
- fix functional test setup
  • Loading branch information
Patrick Huang committed Jun 17, 2013
1 parent a69f545 commit 70d7fc1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions functional-test/pom.xml
Expand Up @@ -154,6 +154,11 @@
<scope>${hibernate.scope}</scope>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>

</dependencies>

<profiles>
Expand Down
Expand Up @@ -31,7 +31,7 @@ public class ManualRunHelper
{
private static final Pattern TAG_PATTERN = Pattern.compile("\\s*<.+>(.+)</.+>\\s*");
private static String url;
private static String driver;
private static String driver = "org.h2.Driver";
private static String username;
private static String password = "";
private static Connection connection;
Expand Down Expand Up @@ -82,6 +82,7 @@ private static void extractConnectionInfo() throws IOException
{
url = tagValue;
}
// in as7 there is no longer a driver class tag
if (line.contains("<driver-class>"))
{
driver = tagValue;
Expand Down
2 changes: 1 addition & 1 deletion functional-test/src/test/resources/conf/zanata.properties
Expand Up @@ -10,7 +10,7 @@
# (Only one can be selected, excepted for internal and openid which
# can be active simultaneously)
# Valid key values: zanata.security.auth.policy.internal, .kerberos, .openid, .jaas
zanata.security.auth.policy.internal = zanata
zanata.security.auth.policy.internal = zanata.internal
#zanata.security.auth.policy.openid = zanata.openid

# Users that should be made administrators upon bootstrap or registration.
Expand Down
Expand Up @@ -5,6 +5,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.sql.SQLException;
import java.sql.Types;
import java.util.ArrayList;
import java.util.List;
Expand Down
4 changes: 4 additions & 0 deletions zanata-war/src/test/java/org/zanata/ZanataJpaTest.java
Expand Up @@ -50,6 +50,10 @@ public void shutdownEM()
log.debug("Shutting down EM");
clearHibernateSecondLevelCache();
em.getTransaction().rollback();
if (em.isOpen())
{
em.close();
}
em = null;
}

Expand Down

0 comments on commit 70d7fc1

Please sign in to comment.