Search in sources :

Example 11 with DomainConfig

use of com.sun.enterprise.admin.servermgmt.DomainConfig in project Payara by payara.

the class TestDomainPortValidator method testForNegativePort.

@Test(expectedExceptions = DomainException.class)
public void testForNegativePort() throws Exception {
    DomainConfig domainConfig = new DomainConfig("test", null);
    domainConfig.add(DomainConfig.K_VALIDATE_PORTS, Boolean.TRUE);
    domainConfig.add(DomainConfig.K_ADMIN_PORT, "-2");
    _portValidator = new DomainPortValidator(domainConfig, new Properties());
    _portValidator.validateAndSetPorts();
}
Also used : Properties(java.util.Properties) DomainConfig(com.sun.enterprise.admin.servermgmt.DomainConfig) Test(org.testng.annotations.Test)

Example 12 with DomainConfig

use of com.sun.enterprise.admin.servermgmt.DomainConfig in project Payara by payara.

the class TestDomainPortValidator method testForPortValueZero.

@Test(expectedExceptions = DomainException.class)
public void testForPortValueZero() throws Exception {
    DomainConfig domainConfig = new DomainConfig("test", null);
    domainConfig.add(DomainConfig.K_VALIDATE_PORTS, Boolean.TRUE);
    domainConfig.add(DomainConfig.K_ADMIN_PORT, "0");
    _portValidator = new DomainPortValidator(domainConfig, new Properties());
    _portValidator.validateAndSetPorts();
}
Also used : Properties(java.util.Properties) DomainConfig(com.sun.enterprise.admin.servermgmt.DomainConfig) Test(org.testng.annotations.Test)

Aggregations

DomainConfig (com.sun.enterprise.admin.servermgmt.DomainConfig)12 PEDomainsManager (com.sun.enterprise.admin.servermgmt.pe.PEDomainsManager)6 DomainsManager (com.sun.enterprise.admin.servermgmt.DomainsManager)5 Properties (java.util.Properties)5 Test (org.testng.annotations.Test)5 File (java.io.File)4 DomainException (com.sun.enterprise.admin.servermgmt.DomainException)3 IOException (java.io.IOException)3 CommandException (org.glassfish.api.admin.CommandException)3 CommandValidationException (org.glassfish.api.admin.CommandValidationException)2 EndOfFileException (org.jline.reader.EndOfFileException)2 UserInterruptException (org.jline.reader.UserInterruptException)2 DomainBuilder (com.sun.enterprise.admin.servermgmt.domain.DomainBuilder)1 ColumnFormatter (com.sun.enterprise.util.ColumnFormatter)1 HostAndPort (com.sun.enterprise.util.HostAndPort)1 HashMap (java.util.HashMap)1 XMLStreamException (javax.xml.stream.XMLStreamException)1