Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffery-Wasty committed Apr 4, 2024
1 parent fa906bb commit 13fb1df
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.sql.Connection;
Expand Down Expand Up @@ -42,7 +41,10 @@ public class BulkCopyMoneyTest extends AbstractTest {
static String destTableName2 = AbstractSQLGenerator.escapeIdentifier(RandomUtil.getIdentifier("moneyBulkCopyDest"));

@Test
public void testMoneyWithBulkCopy() throws SQLException {
/**
* Tests money and smallmoney with bulkcopy using minimum and maximum values of each
*/
public void testMoneyWithBulkCopy() throws Exception {
try (Connection conn = PrepUtil.getConnection(connectionString)) {
testMoneyLimits(-214799.3648, 922337203685387.5887, conn); // SMALLMONEY MIN
testMoneyLimits(214799.3698, 922337203685387.5887, conn); // SMALLMONEY MAX
Expand All @@ -51,7 +53,7 @@ public void testMoneyWithBulkCopy() throws SQLException {
}
}

private void testMoneyLimits(double smallMoneyVal, double moneyVal, Connection conn) throws SQLException {
private void testMoneyLimits(double smallMoneyVal, double moneyVal, Connection conn) throws Exception {
SQLServerBulkCSVFileRecord fileRecord = constructFileRecord(smallMoneyVal, moneyVal);

try {
Expand All @@ -62,7 +64,7 @@ private void testMoneyLimits(double smallMoneyVal, double moneyVal, Connection c
}
}

private SQLServerBulkCSVFileRecord constructFileRecord(double smallMoneyVal, double moneyVal) throws SQLException {
private SQLServerBulkCSVFileRecord constructFileRecord(double smallMoneyVal, double moneyVal) throws Exception {
Map<Object, Object> data = new HashMap();
data.put(smallMoneyVal, moneyVal);

Expand All @@ -77,7 +79,7 @@ private SQLServerBulkCSVFileRecord constructFileRecord(double smallMoneyVal, dou
SQLServerBulkCSVFileRecord fileRecord = null;
try (InputStream inputStream = new ByteArrayInputStream(bytes)) {
fileRecord = new SQLServerBulkCSVFileRecord(inputStream, encoding, delimiter, true);
} catch (IOException e) {}
}
return fileRecord;
}

Expand Down

0 comments on commit 13fb1df

Please sign in to comment.