File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
src/org/openstreetmap/josm/gui/widgets
test/unit/org/openstreetmap/josm/gui/widgets Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ public final String getHint() {
180
180
* @since 18221 (signature)
181
181
*/
182
182
public String setHint (String hint ) {
183
- String old = hint ;
183
+ String old = this . hint ;
184
184
this .hint = hint ;
185
185
return old ;
186
186
}
Original file line number Diff line number Diff line change
1
+ // License: GPL. For details, see LICENSE file.
2
+ package org .openstreetmap .josm .gui .widgets ;
3
+
4
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
5
+
6
+ import org .junit .jupiter .api .Test ;
7
+ import org .openstreetmap .josm .testutils .annotations .BasicPreferences ;
8
+
9
+ /**
10
+ * Test class for {@link JosmTextField}
11
+ */
12
+ @ BasicPreferences
13
+ class JosmTextFieldTest {
14
+ @ Test
15
+ void testSetHint () {
16
+ JosmTextField josmTextField = new JosmTextField ();
17
+ josmTextField .setHint ("some hint" );
18
+ assertEquals ("some hint" , josmTextField .getHint ());
19
+ assertEquals ("some hint" , josmTextField .setHint ("new hint" ));
20
+ assertEquals ("new hint" , josmTextField .getHint ());
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments