Announcement Announcement Module
Collapse
No announcement yet.
a DefaultFormModel's test Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • a DefaultFormModel's test

    Code:
        public void testComponentAdapter2() {
                User user = new User();
                DefaultFormModel formModel = new DefaultFormModel(user);
                formModel.setBufferChangesDefault(true); // have buffer
    
                ValueModel nameModel = formModel.add("name");
    
                JTextField j1 = new JTextField();
                new AsYouTypeTextComponentAdapter(j1,nameModel);
                j1.setText("liuwei");
    
                [color=red]assertTrue(formModel.isDirty());[/color]
                assertEquals(user.getName(),null);
                formModel.commit();
                assertEquals(user.getName(),"liuwei");
        }
    the red code can't pass.
Working...
X