Skip to content
Permalink
Browse files

Sort test suites and enable missed tests (#1530)

* refactor: Add trailing comma to Jdbc2TestSuite class list

* refactor: Add trailing comma to Jdbc4TestSuite class list

* refactor: Sort Jdbc4TestSuite class list

* refactor: Add trailing comma to Jdbc3TestSuite class list

* refactor: Sort Jdbc3TestSuite class list

* refactor: Sort Jdbc2TestSuite class list

* test: Add missing tests to existing test suites

* refactor: Add trailing comma to ReplicationTestSuite class list

* refactor: Sort ReplicationTestSuite class list

* refactor: Add trailing comma to SslTestSuite class list

* refactor: Add trailing comma to Jdbc42TestSuite class list

* refactor: Add trailing comma to Jdbc41TestSuite class list

* refactor: Sort Jdbc41TestSuite class list

* refactor: Sort Jdbc42TestSuite class list

* refactor: Sort SslTestSuite class list

* test: Add server min version check to CompositeTest

Adds a check that the server version is at least 8.3 to CompositeTest
as it uses the uuid data type.

* fix: Reset default timezone after ParameterStatusTest

* fix: Skip composite type test when running in simple query mode
  • Loading branch information...
sehrope authored and davecramer committed Jul 17, 2019
1 parent 51f3d0b commit aa8778d91bd166e2f351343855d6e0b0b71b1e62
@@ -22,12 +22,13 @@
@RunWith(Suite.class)
@Suite.SuiteClasses({
CopyBothResponseTest.class,
LogicalReplicationStatusTest.class,
LogicalReplicationTest.class,
LogSequenceNumberTest.class,
PhysicalReplicationTest.class,
LogicalReplicationStatusTest.class,
ReplicationConnectionTest.class,
ReplicationSlotTest.class})
ReplicationSlotTest.class,
})
public class ReplicationTestSuite {

@BeforeClass
@@ -32,98 +32,80 @@
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
ANTTest.class,
JavaVersionTest.class,

DriverTest.class,
ConnectionTest.class,
DateStyleTest.class,
DatabaseMetaDataTest.class,
DatabaseMetaDataPropertiesTest.class,
SearchPathLookupTest.class,
EncodingTest.class,
ExpressionPropertiesTest.class,
ColumnSanitiserDisabledTest.class,
ColumnSanitiserEnabledTest.class,
LruCacheTest.class,
HostSpecTest.class,
ReaderInputStreamTest.class,
ServerVersionParseTest.class,
ServerVersionTest.class,

OptionsPropertyTest.class,

TypeCacheDLLStressTest.class,

ResultSetTest.class,
ResultSetMetaDataTest.class,
StringTypeUnspecifiedArrayTest.class,
ArrayTest.class,
PrimitiveArraySupportTest.class,
RefCursorTest.class,

DateTest.class,
TimeTest.class,
TimestampTest.class,
TimezoneTest.class,
PGTimeTest.class,
PGTimestampTest.class,
TimezoneCachingTest.class,
ParserTest.class,
ReturningParserTest.class,
CommandCompleteParserTest.class,
CommandCompleteParserNegativeTest.class,
ReplaceProcessingTest.class,

OidToStringTest.class,
OidValueOfTest.class,

PreparedStatementTest.class,
StatementTest.class,
QuotationTest.class,

ServerPreparedStmtTest.class,

BatchExecuteTest.class,
BatchFailureTest.class,

BatchedInsertReWriteEnabledTest.class,
NativeQueryBindLengthTest.class,
DeepBatchedInsertStatementTest.class,
JBuilderTest.class,
MiscTest.class,
NotifyTest.class,
DatabaseEncodingTest.class,
ClientEncodingTest.class,

BlobTest.class,
BlobTransactionTest.class,

UpdateableResultTest.class,

CallableStmtTest.class,
CursorFetchTest.class,
ConcurrentStatementFetch.class,
ServerCursorTest.class,

IntervalTest.class,
GeometricTest.class,

LoginTimeoutTest.class,
TestACL.class,

ConnectTimeoutTest.class,

PGPropertyTest.class,

V3ParameterListTests.class,

CopyTest.class,
CopyLargeFileTest.class,
ServerErrorTest.class,
UpsertTest.class,
OuterJoinSyntaxTest.class,
ParameterStatusTest.class
ANTTest.class,
ArrayTest.class,
BatchedInsertReWriteEnabledTest.class,
BatchExecuteTest.class,
BatchFailureTest.class,
BlobTest.class,
BlobTransactionTest.class,
CallableStmtTest.class,
ClientEncodingTest.class,
ColumnSanitiserDisabledTest.class,
ColumnSanitiserEnabledTest.class,
CommandCompleteParserNegativeTest.class,
CommandCompleteParserTest.class,
ConcurrentStatementFetch.class,
ConnectionTest.class,
ConnectTimeoutTest.class,
CopyLargeFileTest.class,
CopyTest.class,
CursorFetchTest.class,
DatabaseEncodingTest.class,
DatabaseMetaDataPropertiesTest.class,
DatabaseMetaDataTest.class,
DateStyleTest.class,
DateTest.class,
DeepBatchedInsertStatementTest.class,
DriverTest.class,
EncodingTest.class,
ExpressionPropertiesTest.class,
GeometricTest.class,
GetXXXTest.class,
HostSpecTest.class,
IntervalTest.class,
JavaVersionTest.class,
JBuilderTest.class,
LoginTimeoutTest.class,
LruCacheTest.class,
MiscTest.class,
NativeQueryBindLengthTest.class,
NotifyTest.class,
OidToStringTest.class,
OidValueOfTest.class,
OptionsPropertyTest.class,
OuterJoinSyntaxTest.class,
ParameterStatusTest.class,
ParserTest.class,
PGPropertyTest.class,
PGTimestampTest.class,
PGTimeTest.class,
PreparedStatementTest.class,
PrimitiveArraySupportTest.class,
QuotationTest.class,
ReaderInputStreamTest.class,
RefCursorTest.class,
ReplaceProcessingTest.class,
ResultSetMetaDataTest.class,
ResultSetTest.class,
ReturningParserTest.class,
SearchPathLookupTest.class,
ServerCursorTest.class,
ServerErrorTest.class,
ServerPreparedStmtTest.class,
ServerVersionParseTest.class,
ServerVersionTest.class,
StatementTest.class,
StringTypeUnspecifiedArrayTest.class,
TestACL.class,
TimestampTest.class,
TimeTest.class,
TimezoneCachingTest.class,
TimezoneTest.class,
TypeCacheDLLStressTest.class,
UpdateableResultTest.class,
UpsertTest.class,
V3ParameterListTests.class,
})
public class Jdbc2TestSuite {
}
@@ -31,6 +31,11 @@
private final TimeZone tzPlus0800 = TimeZone.getTimeZone("GMT+8:00");
private final Logger logger = Logger.getLogger(ParameterStatusTest.class.getName());

@Override
public void tearDown() {
TimeZone.setDefault(null);
}

@Test
public void expectedInitialParameters() throws Exception {
TimeZone.setDefault(tzPlus0800);
@@ -9,11 +9,16 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import org.postgresql.PGConnection;
import org.postgresql.core.ServerVersion;
import org.postgresql.jdbc.PreferQueryMode;
import org.postgresql.test.TestUtil;
import org.postgresql.util.PGobject;

import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import java.sql.Array;
@@ -26,6 +31,16 @@

private Connection conn;

@BeforeClass
public static void beforeClass() throws Exception {
Connection conn = TestUtil.openDB();
try {
Assume.assumeTrue("uuid requires PostgreSQL 8.3+", TestUtil.haveMinimumServerVersion(conn, ServerVersion.v8_3));
} finally {
conn.close();
}
}

@Before
public void setUp() throws Exception {
conn = TestUtil.openDB();
@@ -74,6 +89,7 @@ public void testComplexSelect() throws SQLException {

@Test
public void testSimpleArgumentSelect() throws SQLException {
Assume.assumeTrue("Skip if running in simple query mode", conn.unwrap(PGConnection.class).getPreferQueryMode() != PreferQueryMode.SIMPLE);
PreparedStatement pstmt = conn.prepareStatement("SELECT ?");
PGobject pgo = new PGobject();
pgo.setType("simplecompositetest");
@@ -87,6 +103,7 @@ public void testSimpleArgumentSelect() throws SQLException {

@Test
public void testComplexArgumentSelect() throws SQLException {
Assume.assumeTrue("Skip if running in simple query mode", conn.unwrap(PGConnection.class).getPreferQueryMode() != PreferQueryMode.SIMPLE);
PreparedStatement pstmt = conn.prepareStatement("SELECT ?");
PGobject pgo = new PGobject();
pgo.setType("\"Composites\".\"ComplexCompositeTest\"");
@@ -13,18 +13,20 @@
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
Jdbc3CallableStatementTest.class,
GeneratedKeysTest.class,
CompositeQueryParseTest.class,
SqlCommandParseTest.class,
CompositeTest.class,
DatabaseMetaDataTest.class,
GeneratedKeysTest.class,
Jdbc3BlobTest.class,
Jdbc3CallableStatementTest.class,
Jdbc3SavepointTest.class,
TypesTest.class,
ResultSetTest.class,
ParameterMetaDataTest.class,
Jdbc3BlobTest.class,
DatabaseMetaDataTest.class,
ResultSetTest.class,
SendRecvBufferSizeTest.class,
StringTypeParameterTest.class})
SqlCommandParseTest.class,
StringTypeParameterTest.class,
TypesTest.class,
})
public class Jdbc3TestSuite {

}
@@ -13,18 +13,20 @@
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
DatabaseMetaDataTest.class,
ArrayTest.class,
WrapperTest.class,
BinaryTest.class,
IsValidTest.class,
ClientInfoTest.class,
PGCopyInputStreamTest.class,
BlobTest.class,
BinaryStreamTest.class,
CharacterStreamTest.class,
UUIDTest.class,
XmlTest.class
ArrayTest.class,
BinaryStreamTest.class,
BinaryTest.class,
BlobTest.class,
CharacterStreamTest.class,
ClientInfoTest.class,
DatabaseMetaDataTest.class,
IsValidTest.class,
JsonbTest.class,
LogTest.class,
PGCopyInputStreamTest.class,
UUIDTest.class,
WrapperTest.class,
XmlTest.class,
})
public class Jdbc4TestSuite {
}
@@ -13,13 +13,13 @@
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
SchemaTest.class,
AbortTest.class,
CloseOnCompletionTest.class,
SharedTimerClassLoaderLeakTest.class,
NetworkTimeoutTest.class,
GetObjectTest.class}
)
AbortTest.class,
CloseOnCompletionTest.class,
GetObjectTest.class,
NetworkTimeoutTest.class,
SchemaTest.class,
SharedTimerClassLoaderLeakTest.class,
})
public class Jdbc41TestSuite {

}
@@ -11,13 +11,14 @@

@RunWith(Suite.class)
@SuiteClasses({
SimpleJdbc42Test.class,
CustomizeDefaultFetchSizeTest.class,
GetObject310InfinityTests.class,
GetObject310Test.class,
PreparedStatementTest.class,
Jdbc42CallableStatementTest.class,
GetObject310InfinityTests.class,
SetObject310Test.class})
PreparedStatementTest.class,
SetObject310Test.class,
SimpleJdbc42Test.class,
})
public class Jdbc42TestSuite {

}
@@ -10,9 +10,9 @@

@RunWith(Suite.class)
@Suite.SuiteClasses({
LibPQFactoryHostNameTest.class,
CommonNameVerifierTest.class,
SslTest.class
LibPQFactoryHostNameTest.class,
SslTest.class,
})
public class SslTestSuite {
}

0 comments on commit aa8778d

Please sign in to comment.
You can’t perform that action at this time.