Skip to content

Commit

Permalink
Split jdbc 4.1 and jdbc 4.0 tests and run them according to the java …
Browse files Browse the repository at this point in the history
…version
  • Loading branch information
alexismeneses committed May 6, 2014
1 parent 39aae42 commit 420f5ee
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
9 changes: 9 additions & 0 deletions build.xml
Expand Up @@ -175,6 +175,13 @@
</and>
</condition>

<condition property="jdbc41tests">
<and>
<isset property="jdbc41" />
<isset property="junit" />
</and>
</condition>

<condition property="jdbc.version" value="jdbc3">
<isset property="jdbc3any" />
</condition>
Expand Down Expand Up @@ -446,6 +453,7 @@
<include name="${package}/test/**" />

<exclude name="${package}/test/jdbc4/**" unless="jdbc4tests" />
<exclude name="${package}/test/jdbc4/jdbc41/**" unless="jdbc41tests" />
<exclude name="${package}/test/ssl/**" unless="jdbc4tests" />

<classpath>
Expand Down Expand Up @@ -492,6 +500,7 @@
<test name="org.postgresql.test.xa.XATestSuite" outfile="${testResultsDir}/xa"/>
<test name="org.postgresql.test.extensions.ExtensionsSuite" outfile="${testResultsDir}/extensions"/>
<test name="org.postgresql.test.jdbc4.Jdbc4TestSuite" if="jdbc4tests" outfile="${testResultsDir}/jdbc4"/>
<test name="org.postgresql.test.jdbc4.jdbc41.Jdbc41TestSuite" if="jdbc41tests" outfile="${testResultsDir}/jdbc41"/>
<test name="org.postgresql.test.ssl.SslTestSuite" if="jdbc4tests" outfile="${testResultsDir}/ssl"/>
<test name="org.postgresql.test.ssl.SingleCertValidatingFactoryTest" if="jdbc4tests" outfile="${testResultsDir}/scsf-ssl"/>
</junit>
Expand Down
4 changes: 1 addition & 3 deletions org/postgresql/test/jdbc4/Jdbc4TestSuite.java
Expand Up @@ -10,6 +10,7 @@
import junit.framework.TestSuite;

import java.sql.*;

import org.postgresql.test.TestUtil;

/*
Expand All @@ -32,10 +33,7 @@ public static TestSuite suite() throws Exception
suite.addTestSuite(WrapperTest.class);
suite.addTestSuite(BinaryTest.class);
suite.addTestSuite(IsValidTest.class);
suite.addTestSuite(SchemaTest.class);
suite.addTestSuite(AbortTest.class);
suite.addTestSuite(ClientInfoTest.class);
suite.addTestSuite(CloseOnCompletionTest.class);

Connection connection = TestUtil.openDB();
try
Expand Down
Expand Up @@ -5,7 +5,7 @@
*
*-------------------------------------------------------------------------
*/
package org.postgresql.test.jdbc4;
package org.postgresql.test.jdbc4.jdbc41;

import java.sql.*;
import java.util.concurrent.Callable;
Expand Down
@@ -1,4 +1,4 @@
package org.postgresql.test.jdbc4;
package org.postgresql.test.jdbc4.jdbc41;

import java.sql.Connection;
import java.sql.ResultSet;
Expand Down
33 changes: 33 additions & 0 deletions org/postgresql/test/jdbc4/jdbc41/Jdbc41TestSuite.java
@@ -0,0 +1,33 @@
/*-------------------------------------------------------------------------
*
* Copyright (c) 2007-2014, PostgreSQL Global Development Group
*
*
*-------------------------------------------------------------------------
*/
package org.postgresql.test.jdbc4.jdbc41;

import junit.framework.TestSuite;

/*
* Executes all known tests for JDBC4.1
*/
public class Jdbc41TestSuite extends TestSuite
{

/*
* The main entry point for JUnit
*/
public static TestSuite suite() throws Exception
{
Class.forName("org.postgresql.Driver");
TestSuite suite = new TestSuite();

suite.addTestSuite(SchemaTest.class);
suite.addTestSuite(AbortTest.class);
suite.addTestSuite(CloseOnCompletionTest.class);

return suite;
}

}
Expand Up @@ -5,7 +5,7 @@
*
*-------------------------------------------------------------------------
*/
package org.postgresql.test.jdbc4;
package org.postgresql.test.jdbc4.jdbc41;

import java.sql.*;
import junit.framework.TestCase;
Expand Down

0 comments on commit 420f5ee

Please sign in to comment.