1 22 package org.objectweb.petals.kernel.admin; 23 24 import org.objectweb.petals.kernel.admin.ContainerInformation.ContainerState; 25 26 import junit.framework.TestCase; 27 28 33 public class ContainerInformationTest extends TestCase { 34 35 public void testSetters() { 36 ContainerInformation containerInformation = new ContainerInformation(); 37 containerInformation.setHost("host"); 38 assertEquals("host", containerInformation.getHost()); 39 containerInformation.setJmxLogin("jmxLogin"); 40 assertEquals("jmxLogin", containerInformation.getJmxLogin()); 41 containerInformation.setJmxPassword("jmxPassword"); 42 assertEquals("jmxPassword", containerInformation.getJmxPassword()); 43 containerInformation.setJmxPort("jmxPort"); 44 assertEquals("jmxPort", containerInformation.getJmxPort()); 45 46 containerInformation.setJoramId("joramID"); 47 assertEquals("joramID", containerInformation.getJoramId()); 48 containerInformation.setJoramLogin("joramLogin"); 49 assertEquals("joramLogin", containerInformation.getJoramLogin()); 50 containerInformation.setJoramPassword("joramPass"); 51 assertEquals("joramPass", containerInformation.getJoramPassword()); 52 containerInformation.setJoramDomainPort("joramDomainPort"); 53 assertEquals("joramDomainPort", containerInformation 54 .getJoramDomainPort()); 55 56 containerInformation.setName("0"); 57 assertEquals("0", containerInformation.getName()); 58 59 containerInformation.setUid((long) 1000); 60 assertEquals(containerInformation.getUid(), 1000); 61 62 containerInformation.setHtmlPort("8082"); 63 assertEquals(containerInformation.getHtmlPort(), "8082"); 64 65 containerInformation.setJndiFactory("factory"); 66 assertEquals(containerInformation.getJndiFactory(), "factory"); 67 68 containerInformation.setJndiPort("16400"); 69 assertEquals(containerInformation.getJndiPort(), "16400"); 70 71 containerInformation.setJoramDomain("domain"); 72 assertEquals(containerInformation.getJoramDomain(), "domain"); 73 74 containerInformation.setJoramTCPPort("16200"); 75 assertEquals(containerInformation.getJoramTCPPort(), "16200"); 76 77 containerInformation.setState(ContainerState.STARTED); 78 assertEquals(containerInformation.getState(), ContainerState.STARTED); 79 assertTrue(containerInformation.isStarted()); 80 assertFalse(containerInformation.isStopped()); 81 82 assertEquals( 83 containerInformation.toString(), 84 "Container joramID (isRunning true) host: host Joram: joramDomainPort JMX: jmxPort JNDI: 16400 HTML: 8082"); 85 86 } 87 88 } 89 | Popular Tags |