Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for getBigDecimal of int4 field in both text and bina…
…ry modes
- Loading branch information
Showing
8 changed files
with
225 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.postgresql.test; | ||
|
||
import java.util.Properties; | ||
|
||
import org.postgresql.test.jdbc2.CursorFetchTest; | ||
|
||
public class CursorFetchBinaryTest extends CursorFetchTest { | ||
public CursorFetchBinaryTest(String name) | ||
{ | ||
super(name); | ||
} | ||
|
||
@Override | ||
protected void updateProperties(Properties props) | ||
{ | ||
forceBinary(props); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.postgresql.test.jdbc2; | ||
|
||
import junit.framework.TestCase; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
import java.util.Properties; | ||
|
||
import org.postgresql.PGProperty; | ||
import org.postgresql.test.TestUtil; | ||
|
||
public class BaseTest extends TestCase { | ||
protected Connection con; | ||
|
||
public BaseTest(String name) | ||
{ | ||
super(name); | ||
|
||
try | ||
{ | ||
new org.postgresql.Driver(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
/* ignore */ | ||
} | ||
} | ||
|
||
protected void updateProperties(Properties props) { | ||
} | ||
|
||
protected void forceBinary(Properties props) | ||
{ | ||
PGProperty.PREPARE_THRESHOLD.set(props, -1); | ||
} | ||
|
||
protected void setUp() throws Exception | ||
{ | ||
Properties props = new Properties(); | ||
updateProperties(props); | ||
con = TestUtil.openDB(props); | ||
} | ||
|
||
protected void tearDown() throws SQLException | ||
{ | ||
TestUtil.closeDB(con); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.postgresql.test.jdbc2; | ||
|
||
import java.util.Properties; | ||
|
||
public class BatchExecuteBinaryTest extends BatchExecuteTest { | ||
public BatchExecuteBinaryTest(String name) | ||
{ | ||
super(name); | ||
} | ||
|
||
@Override | ||
protected void updateProperties(Properties props) | ||
{ | ||
forceBinary(props); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
org/postgresql/test/jdbc2/PreparedStatementBinaryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.postgresql.test.jdbc2; | ||
|
||
import java.util.Properties; | ||
|
||
public class PreparedStatementBinaryTest extends PreparedStatementTest { | ||
public PreparedStatementBinaryTest(String name) | ||
{ | ||
super(name); | ||
} | ||
|
||
@Override | ||
protected void updateProperties(Properties props) | ||
{ | ||
forceBinary(props); | ||
} | ||
} |
Oops, something went wrong.