# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: D:\QADev\Projects\nb.org\main-golden # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: db/test/unit/src/org/netbeans/api/db/explorer/DatabaseConnectionTest.java --- db/test/unit/src/org/netbeans/api/db/explorer/DatabaseConnectionTest.java Base (BASE) +++ db/test/unit/src/org/netbeans/api/db/explorer/DatabaseConnectionTest.java Locally Modified (Based On LOCAL) @@ -195,6 +195,41 @@ } } + /** + * Verifies that the {@link DatabaseConnection#create(org.netbeans.api.db.explorer.JDBCDriver, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, java.lang.String)} + * factory method creates a valid connection with the given display name + * + * @throws Exception + */ + public void testDatabaseConnectionCreatedWithDisplayName() throws Exception{ + Util.clearConnections(); + Util.deleteDriverFiles(); + + JDBCDriver driver = Util.createDummyDriver(); + DatabaseConnection dbconn = DatabaseConnection.create(driver, "database", "user", "schema", "password", true,"displayName"); + + assertEquals("The connection was created with a display name different that the one provided", "displayName",dbconn.getDisplayName()); + + Util.clearConnections(); + + } + /** + * Verifies that the {@link DatabaseConnection#create(org.netbeans.api.db.explorer.JDBCDriver, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)} + * creates some default display name that is not null + * @throws Exception + */ + public void testDatabaseConnectionCreatedWithDefaultDisplayName() throws Exception{ + Util.clearConnections(); + Util.deleteDriverFiles(); + + JDBCDriver driver = Util.createDummyDriver(); + DatabaseConnection dbconn = DatabaseConnection.create(driver, "database", "user", "schema", "password", true); + + assertNotNull("The connection was created with a null display name ", dbconn.getDisplayName()); + + Util.clearConnections(); + } + private static boolean connectionIsValid(Connection conn) throws Exception { return org.netbeans.modules.db.explorer.DatabaseConnection.isVitalConnection(conn, null); }