1   /*
2    * Copyright 2002-2004 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package org.springframework.richclient.form.binding.swing;
17  
18  import org.springframework.binding.form.ConfigurableFormModel;
19  import org.springframework.binding.form.support.DefaultFormModel;
20  import org.springframework.binding.support.TestBean;
21  import org.springframework.binding.value.ValueModel;
22  import org.springframework.richclient.test.SpringRichTestCase;
23  
24  public abstract class BindingAbstractTests extends SpringRichTestCase {
25      
26      protected ConfigurableFormModel fm;
27  
28      protected ValueModel vm;
29  
30      protected String property;
31  
32      public void doSetUp() {
33          fm = new DefaultFormModel(createTestBean());        
34          property = setUpBinding();
35          vm = fm.getValueModel(property);
36      }
37  
38      protected TestBean createTestBean() {
39          return new TestBean();
40      }
41  
42      protected abstract String setUpBinding();
43  
44      public abstract void testComponentTracksEnabledChanges();
45  
46      public abstract void testComponentTracksReadOnlyChanges();
47  
48      public abstract void testComponentUpdatesValueModel();
49  
50      public abstract void testValueModelUpdatesComponent();
51  }