1 package de.java2html.plugin.jspwiki.test; 2 3 import java.util.HashMap ; 4 5 import com.ecyrd.jspwiki.plugin.PluginException; 6 7 import de.java2html.plugin.jspwiki.PluginParameter; 8 import de.java2html.plugin.jspwiki.PluginParameterChecker; 9 import junit.framework.TestCase; 10 11 14 public class PluginParameterCheckerTest extends TestCase { 15 private HashMap parameters = new HashMap (); 16 17 public void testEmptyParameterListIsSupported() throws PluginException { 18 new PluginParameterChecker().checkParametersSupported(parameters); 19 } 20 21 public void testInternalParameterIsSupported() throws PluginException { 22 parameters.put("_body", ""); 23 new PluginParameterChecker().checkParametersSupported(parameters); 24 } 25 26 public void testIllegalParameterIsNotSupported() { 27 try { 28 parameters.put("A very unsupported parameter am I", ""); 29 new PluginParameterChecker().checkParametersSupported(parameters); 30 fail(); 31 } 32 catch (PluginException expected) { 33 } 35 } 36 37 public void testValidParameterIsSupported() throws PluginException { 38 parameters.put(PluginParameter.SOURCE.getName(), ""); 39 new PluginParameterChecker().checkParametersSupported(parameters); 40 } 41 42 public void testNonStringObjectIsSupported() throws PluginException { 43 parameters.put(new Integer (42), ""); 44 new PluginParameterChecker().checkParametersSupported(parameters); 45 } 46 } | Popular Tags |