Skip to content

Commit

Permalink
Added test to validate appName using select app_name() query
Browse files Browse the repository at this point in the history
  • Loading branch information
muskan124947 committed Dec 31, 2024
1 parent 52b4459 commit a7889e5
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,24 @@ public void testApplicationName() throws SQLException {
}
}

/**
* test application name by executing select app_name()
*
* @throws SQLException
*/
@Test
public void testApplicationNameUsingApp_Name() throws SQLException {
try (Connection conn = DriverManager.getConnection(connectionString);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT app_name()")) {
if (rs.next()) {
assertEquals(SQLServerDriver.constructedAppName, rs.getString(1));
}
} catch (SQLException e) {
fail(e.getMessage());
}
}

/**
* test application name when system properties are empty
*
Expand Down

0 comments on commit a7889e5

Please # to comment.