PEDomainConfigValidatorTestpublic class PEDomainConfigValidatorTest extends TestCase
Fields Summary |
---|
PEDomainConfigValidator | p | com.sun.enterprise.admin.servermgmt.DomainConfig | dc1 | com.sun.enterprise.admin.servermgmt.DomainConfig | dc2 |
Constructors Summary |
---|
public PEDomainConfigValidatorTest(String name)
super(name);
|
Methods Summary |
---|
public static void | main(java.lang.String[] args)
if (args.length == 0){
junit.textui.TestRunner.run(PEDomainConfigValidatorTest.class);
} else {
junit.textui.TestRunner.run(makeSuite(args));
}
| private static junit.framework.TestSuite | makeSuite(java.lang.String[] args)
final TestSuite ts = new TestSuite();
for (int i = 0; i < args.length; i++){
ts.addTest(new PEDomainConfigValidatorTest(args[i]));
}
return ts;
| private void | nyi()
fail("Not Yet Implemented");
| protected void | setUp()
p = new PEDomainConfigValidator();
dc1 = new DomainConfig("domainName",
new Integer(1),
"domainRoot",
"adminUser",
"adminPassword",
"masterPassword",
new Integer(2),
"jmsUser",
"jmsPassword",
new Integer(3),
new Integer(4),
new Integer(5),
new Integer(6),
new Integer(7),
new Properties()){
protected String getFilePath(String p){
return p;
}
};
dc2 = new DomainConfig("domainName",
new Integer(1),
"domainRoot",
"adminUser",
"adminPassword",
new Integer(1),
"jmsUser",
"jmsPassword",
new Integer(1),
new Integer(2),
new Integer(1),
new Integer(2),
new Integer(3),
new Properties()){
protected String getFilePath(String p){
return p;
}
};
| protected void | tearDown()
| public void | testDuplicatesInDomainConfig()
try {
p.uniquePorts(dc2);
fail("Expectged an InvalidConfigException indicating that there were duplicate ports");
}
catch (InvalidConfigException e){
assertEquals("Duplicate ports were found: 1 -> {domain.adminPort, domain.instancePort, http.ssl.port, jms.port}, 2 -> {orb.listener.port, orb.ssl.port}", e.getMessage());
}
| public void | testGetDuplicatePorts()
final Map ports = new HashMap();
ports.put("a", "1");
ports.put("b", "1");
ports.put("c", "2");
ports.put("d", "2");
ports.put("e", "3");
assertEquals("1 -> {a, b}, 2 -> {c, d}", p.getDuplicatePorts(ports));
| public void | testNoDuplicatePorts()
final Map ports = new HashMap();
ports.put("a", "1");
assertEquals("", p.getDuplicatePorts(ports));
| public void | testNoDuplicatesInDomainConfig()
p.uniquePorts(dc1);
| public void | testNumPorts()
assertEquals(7, dc2.getPorts().size());
|
|