1 16 17 package org.apache.commons.configuration.web; 18 19 import org.apache.commons.configuration.AbstractConfiguration; 20 import org.apache.commons.configuration.TestAbstractConfiguration; 21 22 import java.applet.Applet ; 23 import java.util.Properties ; 24 25 31 public class TestAppletConfiguration extends TestAbstractConfiguration 32 { 33 protected AbstractConfiguration getConfiguration() 34 { 35 final Properties parameters = new Properties (); 36 parameters.setProperty("key1", "value1"); 37 parameters.setProperty("key2", "value2"); 38 parameters.setProperty("list", "value1, value2"); 39 40 Applet applet = new Applet () 41 { 42 public String getParameter(String key) 43 { 44 return parameters.getProperty(key); 45 } 46 47 public String [][] getParameterInfo() 48 { 49 return new String [][] 50 { 51 {"key1", "String", ""}, 52 {"key2", "String", ""}, 53 {"list", "String[]", ""} 54 }; 55 } 56 }; 57 58 return new AppletConfiguration(applet); 59 } 60 61 protected AbstractConfiguration getEmptyConfiguration() 62 { 63 return new AppletConfiguration(new Applet ()); 64 } 65 66 public void testAddPropertyDirect() 67 { 68 try 69 { 70 super.testAddPropertyDirect(); 71 fail("addPropertyDirect should throw an UnsupportedException"); 72 } 73 catch (UnsupportedOperationException e) 74 { 75 } 77 } 78 79 public void testClearProperty() 80 { 81 try 82 { 83 super.testClearProperty(); 84 fail("testClearProperty should throw an UnsupportedException"); 85 } 86 catch (UnsupportedOperationException e) 87 { 88 } 90 } 91 } 92 | Popular Tags |