@@ -0,0 +1,3323 @@
+package com.microsoft.sqlserver.jdbc.callablestatement;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.DriverManager;%0Aimport java.sql.SQLException;%0Aimport java.sql.Statement;%0Aimport java.util.UUID;%0A%0Aimport org.junit.jupiter.api.AfterAll;%0Aimport org.junit.jupiter.api.BeforeAll;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.platform.runner.JUnitPlatform;%0Aimport org.junit.runner.RunWith;%0A%0Aimport com.microsoft.sqlserver.jdbc.SQLServerCallableStatement;%0Aimport com.microsoft.sqlserver.testframework.AbstractTest;%0Aimport com.microsoft.sqlserver.testframework.Utils;%0A%0A/**%0A * Test CallableStatement%0A */%0A@RunWith(JUnitPlatform.class)%0Apublic class CallableStatementTest extends AbstractTest %7B%0A    private static String tableNameGUID = %22uniqueidentifier_Table%22;%0A    private static String outputProcedureNameGUID = %22uniqueidentifier_SP%22;%0A%0A    private static Connection connection = null;%0A    private static Statement stmt = null;%0A%0A    /**%0A     * Setup before test%0A     * %0A     * @throws SQLException%0A     */%0A    @BeforeAll%0A    public static void setupTest() throws SQLException %7B%0A        connection = DriverManager.getConnection(connectionString);%0A        stmt = connection.createStatement();%0A%0A        Utils.dropTableIfExists(tableNameGUID, stmt);%0A        Utils.dropProcedureIfExists(outputProcedureNameGUID, stmt);%0A%0A        createGUIDTable();%0A        createGUIDStoredProcedure();%0A    %7D%0A%0A    /**%0A     * Tests CallableStatement.getString() with uniqueidentifier parameter%0A     * %0A     * @throws SQLException%0A     */%0A    @Test%0A    public void getStringGUIDTest() throws SQLException %7B%0A%0A        SQLServerCallableStatement callableStatement = null;%0A        try %7B%0A            String sql = %22%7Bcall %22 + outputProcedureNameGUID + %22(?)%7D%22;%0A%0A            callableStatement = (SQLServerCallableStatement) connection.prepareCall(sql);%0A%0A            UUID originalValue = UUID.randomUUID();%0A%0A            callableStatement.registerOutParameter(1, microsoft.sql.Types.GUID);%0A            callableStatement.setObject(1, originalValue.toString(), microsoft.sql.Types.GUID);%0A%0A            callableStatement.execute();%0A%0A            String retrievedValue = callableStatement.getString(1);%0A%0A            assertEquals(originalValue.toString().toLowerCase(), retrievedValue.toLowerCase());%0A%0A        %7D%0A        finally %7B%0A            if (null != callableStatement) %7B%0A                callableStatement.close();%0A            %7D%0A        %7D%0A    %7D%0A%0A    /**%0A     * Cleanup after test%0A     * %0A     * @throws SQLException%0A     */%0A    @AfterAll%0A    public static void cleanup() throws SQLException %7B%0A        Utils.dropTableIfExists(tableNameGUID, stmt);%0A        Utils.dropProcedureIfExists(outputProcedureNameGUID, stmt);%0A        if (null != stmt) %7B%0A            stmt.close();%0A        %7D%0A        if (null != connection) %7B%0A            connection.close();%0A        %7D%0A    %7D%0A%0A    private static void createGUIDStoredProcedure() throws SQLException %7B%0A        String sql = %22CREATE PROCEDURE %22 + outputProcedureNameGUID + %22(@p1 uniqueidentifier OUTPUT) AS SELECT @p1 = c1 FROM %22 + tableNameGUID + %22;%22;%0A        stmt.execute(sql);%0A    %7D%0A%0A    private static void createGUIDTable() throws SQLException %7B%0A        String sql = %22CREATE TABLE %22 + tableNameGUID + %22 (c1 uniqueidentifier null)%22;%0A        stmt.execute(sql);%0A    %7D%0A%7D%0A

add test