001    /*
002     * Copyright 2002-2004 the original author or authors.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005     * use this file except in compliance with the License. You may obtain a copy of
006     * the License at
007     *
008     * http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012     * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013     * License for the specific language governing permissions and limitations under
014     * the License.
015     */
016    package org.springframework.richclient.form.binding.swing;
017    
018    import org.springframework.binding.form.ConfigurableFormModel;
019    import org.springframework.binding.form.support.DefaultFormModel;
020    import org.springframework.binding.support.TestBean;
021    import org.springframework.binding.value.ValueModel;
022    import org.springframework.richclient.test.SpringRichTestCase;
023    
024    public abstract class BindingAbstractTests extends SpringRichTestCase {
025        
026        protected ConfigurableFormModel fm;
027    
028        protected ValueModel vm;
029    
030        protected String property;
031    
032        public void doSetUp() {
033            fm = new DefaultFormModel(createTestBean());        
034            property = setUpBinding();
035            vm = fm.getValueModel(property);
036        }
037    
038        protected TestBean createTestBean() {
039            return new TestBean();
040        }
041    
042        protected abstract String setUpBinding();
043    
044        public abstract void testComponentTracksEnabledChanges();
045    
046        public abstract void testComponentTracksReadOnlyChanges();
047    
048        public abstract void testComponentUpdatesValueModel();
049    
050        public abstract void testValueModelUpdatesComponent();
051    }