1 22 package org.objectweb.petals.kernel.mx4j; 23 24 import javax.management.MBeanServer ; 25 import javax.xml.parsers.DocumentBuilder ; 26 27 import junit.framework.TestCase; 28 import mx4j.tools.adaptor.http.ServerCommandProcessor; 29 30 import org.easymock.classextension.EasyMock; 31 32 37 public class PetalsCommandProcessorTest extends TestCase { 38 39 73 public void testSetDocumentBuilder() { 74 PetalsCommandProcessor petalsCommandProcessor = new PetalsCommandProcessor(); 75 DocumentBuilder documentBuilder = EasyMock 76 .createMock(DocumentBuilder .class); 77 78 petalsCommandProcessor.setDocumentBuilder(documentBuilder); 79 80 assertEquals(petalsCommandProcessor.documentBuilder, documentBuilder); 81 } 82 83 public void testSetMBeanServer() { 84 PetalsCommandProcessor petalsCommandProcessor = new PetalsCommandProcessor(); 85 MBeanServer mBeanServer = EasyMock.createMock(MBeanServer .class); 86 87 ServerCommandProcessor serverCommandProcessor = EasyMock 88 .createMock(ServerCommandProcessor.class); 89 90 serverCommandProcessor.setMBeanServer(mBeanServer); 91 92 EasyMock.replay(serverCommandProcessor); 93 petalsCommandProcessor.serverCommandProcessor = serverCommandProcessor; 94 95 petalsCommandProcessor.setMBeanServer(mBeanServer); 96 } 97 98 } 99 | Popular Tags |