Lines 41-47
Link Here
|
41 |
* Version 2 license, then the option applies only if the new code is |
41 |
* Version 2 license, then the option applies only if the new code is |
42 |
* made subject to such option by the copyright holder. |
42 |
* made subject to such option by the copyright holder. |
43 |
*/ |
43 |
*/ |
44 |
|
|
|
45 |
package org.netbeans.api.db.explorer.support; |
44 |
package org.netbeans.api.db.explorer.support; |
46 |
|
45 |
|
47 |
import javax.swing.JComboBox; |
46 |
import javax.swing.JComboBox; |
Lines 111-122
Link Here
|
111 |
DatabaseConnection dc = DatabaseConnection.create(Util.createDummyDriver(), "dc1", "user", "schema", "password", true); |
110 |
DatabaseConnection dc = DatabaseConnection.create(Util.createDummyDriver(), "dc1", "user", "schema", "password", true); |
112 |
ConnectionManager.getDefault().addConnection(dc); |
111 |
ConnectionManager.getDefault().addConnection(dc); |
113 |
|
112 |
|
|
|
113 |
forceFlush(); |
114 |
|
114 |
assertEquals("Wrong number of items in the combobox", 4, combo.getItemCount()); |
115 |
assertEquals("Wrong number of items in the combobox", 4, combo.getItemCount()); |
115 |
|
116 |
|
116 |
assertSame(dc, combo.getItemAt(2)); |
117 |
assertSame(dc, combo.getItemAt(2)); |
117 |
|
118 |
|
118 |
ConnectionManager.getDefault().removeConnection(dc); |
119 |
ConnectionManager.getDefault().removeConnection(dc); |
119 |
|
120 |
|
|
|
121 |
forceFlush(); |
122 |
|
120 |
assertEquals("Wrong number of items in the combobox", 3, combo.getItemCount()); |
123 |
assertEquals("Wrong number of items in the combobox", 3, combo.getItemCount()); |
121 |
|
124 |
|
122 |
assertSame(dbconn2, combo.getItemAt(0)); |
125 |
assertSame(dbconn2, combo.getItemAt(0)); |