Lines 45-50
Link Here
|
45 |
package org.netbeans.api.db.explorer.support; |
45 |
package org.netbeans.api.db.explorer.support; |
46 |
|
46 |
|
47 |
import javax.swing.JComboBox; |
47 |
import javax.swing.JComboBox; |
|
|
48 |
import static junit.framework.Assert.assertEquals; |
48 |
import org.netbeans.api.db.explorer.*; |
49 |
import org.netbeans.api.db.explorer.*; |
49 |
import org.netbeans.modules.db.test.TestBase; |
50 |
import org.netbeans.modules.db.test.TestBase; |
50 |
import org.netbeans.modules.db.test.Util; |
51 |
import org.netbeans.modules.db.test.Util; |
Lines 102-108
Link Here
|
102 |
initConnections(); |
103 |
initConnections(); |
103 |
JComboBox combo = connect(); |
104 |
JComboBox combo = connect(); |
104 |
|
105 |
|
105 |
assertTrue("Wrong number of items in the combobox", combo.getItemCount() == 3); |
106 |
assertEquals("Wrong number of items in the combobox", 3, combo.getItemCount()); |
106 |
|
107 |
|
107 |
assertSame(dbconn2, combo.getItemAt(0)); |
108 |
assertSame(dbconn2, combo.getItemAt(0)); |
108 |
assertSame(dbconn1, combo.getItemAt(1)); |
109 |
assertSame(dbconn1, combo.getItemAt(1)); |
Lines 110-122
Link Here
|
110 |
DatabaseConnection dc = DatabaseConnection.create(Util.createDummyDriver(), "dc1", "user", "schema", "password", true); |
111 |
DatabaseConnection dc = DatabaseConnection.create(Util.createDummyDriver(), "dc1", "user", "schema", "password", true); |
111 |
ConnectionManager.getDefault().addConnection(dc); |
112 |
ConnectionManager.getDefault().addConnection(dc); |
112 |
|
113 |
|
113 |
assertTrue("Wrong number of items in the combobox", combo.getItemCount() == 4); |
114 |
assertEquals("Wrong number of items in the combobox", 4, combo.getItemCount()); |
114 |
|
115 |
|
115 |
assertSame(dc, combo.getItemAt(2)); |
116 |
assertSame(dc, combo.getItemAt(2)); |
116 |
|
117 |
|
117 |
ConnectionManager.getDefault().removeConnection(dc); |
118 |
ConnectionManager.getDefault().removeConnection(dc); |
118 |
|
119 |
|
119 |
assertTrue("Wrong number of items in the combobox", combo.getItemCount() == 3); |
120 |
assertEquals("Wrong number of items in the combobox", 3, combo.getItemCount()); |
120 |
|
121 |
|
121 |
assertSame(dbconn2, combo.getItemAt(0)); |
122 |
assertSame(dbconn2, combo.getItemAt(0)); |
122 |
assertSame(dbconn1, combo.getItemAt(1)); |
123 |
assertSame(dbconn1, combo.getItemAt(1)); |