1 17 package org.apache.geronimo.common.propertyeditor; 18 19 import java.beans.PropertyEditor ; 20 import java.util.Map ; 21 22 import junit.framework.TestCase; 23 24 30 public abstract class AbstractMapEditorTest extends TestCase { 31 PropertyEditor editor; 32 33 public void testRoundTrip() { 34 Map map = createMap(); 35 map.put("key1","value1"); 36 map.put("key2","value2"); 37 editor.setValue(map); 38 String text = editor.getAsText(); 39 editor.setAsText(text); 40 Map result = (Map ) editor.getValue(); 41 assertEquals(2, result.size()); 42 assertEquals("value1", result.get("key1")); 43 assertEquals("value2", result.get("key2")); 44 } 45 46 protected abstract void checkType(Object output); 47 48 protected abstract Map createMap(); 49 } 50 | Popular Tags |