Example #1
0
 @Test
 public void testInitialValuesForSingleText() {
   assertEquals("", text.getText());
   assertEquals("", text.getMessage());
   assertEquals(Text.LIMIT, text.getTextLimit());
   assertEquals(0, text.getSelectionCount());
   assertEquals(new Point(0, 0), text.getSelection());
   assertEquals((char) 0, text.getEchoChar());
 }
Example #2
0
 @Test
 public void testEchoChar() {
   // single line text field
   Text singleText = new Text(shell, SWT.NONE);
   assertEquals((char) 0, singleText.getEchoChar());
   singleText.setEchoChar('?');
   assertEquals('?', singleText.getEchoChar());
   // multi line text field
   Text multiText = new Text(shell, SWT.MULTI);
   assertEquals((char) 0, multiText.getEchoChar());
   multiText.setEchoChar('?');
   assertEquals((char) 0, multiText.getEchoChar());
   // password text field
   Text passwordText = new Text(shell, SWT.PASSWORD);
   assertEquals('?', passwordText.getEchoChar());
   passwordText.setEchoChar('*');
   assertEquals('*', passwordText.getEchoChar());
 }