KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > kernel > admin > ContainerInformationTest


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: ContainerInformationTest.java 14:26:58 ddesjardins $
20  * -------------------------------------------------------------------------
21  */

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 /**
29  * Test of the ContainerInformation
30  *
31  * @author ddesjardins - eBMWebsourcing
32  */

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