# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/matthias/NetBeansProjects/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/src/org/netbeans/api/db/explorer/JDBCDriverManager.java --- db/src/org/netbeans/api/db/explorer/JDBCDriverManager.java Base (BASE) +++ db/src/org/netbeans/api/db/explorer/JDBCDriverManager.java Locally Modified (Based On LOCAL) @@ -87,7 +87,6 @@ if (DEFAULT == null) { // init runtimes DatabaseRuntimeManager.getDefault().getRuntimes(); - JDBCDriverConvertor.importOldDrivers(); DEFAULT = new JDBCDriverManager(); } return DEFAULT; Index: db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java --- db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java Locally Modified (Based On LOCAL) @@ -72,9 +72,6 @@ import org.netbeans.modules.db.explorer.dlg.ConnectPanel; import org.netbeans.modules.db.explorer.dlg.ConnectProgressDialog; import org.openide.nodes.Node; - -//import org.netbeans.modules.db.explorer.PointbasePlus; - import org.netbeans.modules.db.explorer.dlg.ConnectionDialog; import org.netbeans.modules.db.explorer.dlg.ConnectionDialogMediator; import org.netbeans.modules.db.explorer.dlg.SchemaPanel; Index: db/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertor.java --- db/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertor.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertor.java Locally Modified (Based On LOCAL) @@ -102,11 +102,6 @@ public static final String DRIVERS_PATH = "Databases/JDBCDrivers"; // NOI18N /** - * The path where the drivers were registered in 4.1 and previous versions. - */ - static final String OLD_DRIVERS_PATH = "Services/JDBCDrivers"; // NOI18N - - /** * The delay by which the write of the changes is postponed. */ private static final int DELAY = 2000; @@ -263,36 +258,6 @@ } /** - * Moves the existing drivers from the old location (Services/JDBCDrivers) - * used in 4.1 and previous to the new one. - */ - public static void importOldDrivers() { - FileObject oldRoot = FileUtil.getConfigFile(JDBCDriverConvertor.OLD_DRIVERS_PATH); - if (oldRoot == null) { - return; - } - FileObject newRoot = FileUtil.getConfigFile(JDBCDriverConvertor.DRIVERS_PATH); - FileObject[] children = oldRoot.getChildren(); - for (int i = 0; i < children.length; i++) { - try { - JDBCDriver drv = readDriverFromFile(children[i]); - URL[] urls = drv.getURLs(); - for (int j = 0; j < urls.length; j++) { - urls[j] = encodeURL(urls[j]); - } - create(drv); - } catch (Exception ex) { - Exceptions.printStackTrace(ex); - } - try { - children[i].delete(); - } catch (IOException e) { - // what can we do? - } - } - } - - /** * Encode an URL to be a valid URI. Be careful that this method will happily * encode an already encoded URL! Use only on URLs which are not encoded. */ Index: db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java --- db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java Base (BASE) +++ db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java Locally Modified (Based On LOCAL) @@ -45,6 +45,7 @@ package org.netbeans.api.db.explorer.support; import javax.swing.JComboBox; +import static junit.framework.Assert.assertEquals; import org.netbeans.api.db.explorer.*; import org.netbeans.modules.db.test.TestBase; import org.netbeans.modules.db.test.Util; @@ -102,7 +103,7 @@ initConnections(); JComboBox combo = connect(); - assertTrue("Wrong number of items in the combobox", combo.getItemCount() == 3); + assertEquals("Wrong number of items in the combobox", 3, combo.getItemCount()); assertSame(dbconn2, combo.getItemAt(0)); assertSame(dbconn1, combo.getItemAt(1)); @@ -110,13 +111,13 @@ DatabaseConnection dc = DatabaseConnection.create(Util.createDummyDriver(), "dc1", "user", "schema", "password", true); ConnectionManager.getDefault().addConnection(dc); - assertTrue("Wrong number of items in the combobox", combo.getItemCount() == 4); + assertEquals("Wrong number of items in the combobox", 4, combo.getItemCount()); assertSame(dc, combo.getItemAt(2)); ConnectionManager.getDefault().removeConnection(dc); - assertTrue("Wrong number of items in the combobox", combo.getItemCount() == 3); + assertEquals("Wrong number of items in the combobox", 3, combo.getItemCount()); assertSame(dbconn2, combo.getItemAt(0)); assertSame(dbconn1, combo.getItemAt(1)); Index: db/test/unit/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertorTest.java --- db/test/unit/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertorTest.java Base (BASE) +++ db/test/unit/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertorTest.java Locally Modified (Based On LOCAL) @@ -152,31 +152,6 @@ assertEquals(new URL("file:///test%20file"), JDBCDriverConvertor.encodeURL(new URL("file:///test file"))); } - public void testImportOldDrivers() throws Exception { - final String UNENCODED_URL = "file:///foo 1.jar"; - - FileObject oldRoot = FileUtil.getConfigFile(JDBCDriverConvertor.OLD_DRIVERS_PATH); - if (oldRoot == null) { - oldRoot = FileUtil.createFolder(FileUtil.getConfigRoot(), JDBCDriverConvertor.OLD_DRIVERS_PATH); - } - URL[] urls = new URL[] { new URL(UNENCODED_URL) }; - createDriverFile10("testdriver.xml", oldRoot, urls); - - JDBCDriverConvertor.importOldDrivers(); - - assertEquals(0, oldRoot.getChildren().length); - - FileObject newRoot = Util.getDriversFolder(); - assertEquals(1, newRoot.getChildren().length); - - Lookup.Result result = Lookups.forPath(newRoot.getPath()).lookup(new Lookup.Template(JDBCDriver.class)); - Collection instances = result.allInstances(); - JDBCDriver drv = (JDBCDriver)instances.iterator().next(); - assertEquals(JDBCDriverConvertor.encodeURL(new URL(UNENCODED_URL)), drv.getURLs()[0]); - // assert the imported driver has a display name set - assertEquals(drv.getName(), drv.getDisplayName()); - } - private static FileObject createDriverFile10(String fileName, FileObject folder) throws Exception { URL[] urls = new URL[] { new URL("file:///foo1.jar"),