1 17 package org.apache.geronimo.activation.handlers; 18 19 import java.io.InputStream ; 20 import javax.activation.CommandMap ; 21 import javax.activation.MailcapCommandMap ; 22 import javax.activation.CommandInfo ; 23 24 import junit.framework.TestCase; 25 26 29 public class MailcapTest extends TestCase { 30 private CommandMap map; 31 32 public void testTextPlainHandler() { 33 CommandInfo info = map.getCommand("text/plain", "content-handler"); 34 assertEquals(TextPlainHandler.class.getName(), info.getCommandClass()); 35 } 36 37 protected void setUp() throws Exception { 38 InputStream is = TextPlainHandler.class.getClassLoader().getResourceAsStream("META-INF/mailcap"); 39 map = new MailcapCommandMap (is); 40 is.close(); 41 } 42 } 43 | Popular Tags |