1 19 20 package org.apache.james.test.mock.mailet; 21 22 import org.apache.mailet.MailetConfig; 23 import org.apache.mailet.MailetContext; 24 25 import java.util.Iterator ; 26 import java.util.Properties ; 27 28 31 public class MockMailetConfig extends Properties implements MailetConfig { 32 33 private String mailetName; 34 private MailetContext mc; 35 36 37 public MockMailetConfig(String mailetName, MailetContext mc) { 38 super(); 39 this.mailetName = mailetName; 40 this.mc = mc; 41 } 42 43 public MockMailetConfig(String mailetName, MailetContext mc, Properties arg0) { 44 super(arg0); 45 this.mailetName = mailetName; 46 this.mc = mc; 47 } 48 49 public String getInitParameter(String name) { 50 return getProperty(name); 51 } 52 53 public Iterator getInitParameterNames() { 54 return keySet().iterator(); 55 } 56 57 public MailetContext getMailetContext() { 58 return mc; 59 } 60 61 public String getMailetName() { 62 return mailetName; 63 } 64 65 public Object setProperty(String key, String value) { 67 String oldValue = getProperty(key); 68 String newValue = value; 69 70 if (oldValue != null) { 71 newValue = oldValue + "," + value; 72 } 73 return super.setProperty(key, newValue); 74 } 75 } 76 | Popular Tags |