Search in sources :

Example 16 with IiopListener

use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.

the class CreateIiopListenerTest method testExecuteSuccess.

/**
 * Test of execute method, of class CreateIiopListener.
 * asadmin create-iiop-listener --listeneraddress localhost
 * --iiopport 4440 --enabled=true --securityenabled=true iiop_1
 */
@Test
public void testExecuteSuccess() {
    parameters.set("listeneraddress", "localhost");
    parameters.set("iiopport", "4440");
    parameters.set("listener_id", "iiop_1");
    parameters.set("enabled", "true");
    parameters.set("securityenabled", "true");
    CreateIiopListener command = services.getService(CreateIiopListener.class);
    cr.getCommandInvocation("create-iiop-listener", context.getActionReport(), adminSubject()).parameters(parameters).execute(command);
    checkActionReport(context.getActionReport());
    boolean isCreated = false;
    List<IiopListener> listenerList = iiopService.getIiopListener();
    for (IiopListener listener : listenerList) {
        if (listener.getId().equals("iiop_1")) {
            assertEquals("localhost", listener.getAddress());
            assertEquals("true", listener.getEnabled());
            assertEquals("4440", listener.getPort());
            assertEquals("true", listener.getSecurityEnabled());
            isCreated = true;
            logger.fine("IIOPListener name iiop_1 is created.");
            break;
        }
    }
    assertTrue(isCreated);
    logger.fine("msg: " + context.getActionReport().getMessage());
}
Also used : IiopListener(org.glassfish.orb.admin.config.IiopListener) Test(org.junit.Test)

Example 17 with IiopListener

use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.

the class CreateIiopListenerTest method testExecuteSuccessNoValueOptionSecurityEnabled.

/**
 * Test of execute method, of class CreateIiopListener when enabled has no value
 * asadmin create-iiop-listener --listeneraddress localhost
 * --iiopport 4440 --securityenabled iiop_1
 */
@Test
public void testExecuteSuccessNoValueOptionSecurityEnabled() {
    parameters.set("listeneraddress", "localhost");
    parameters.set("iiopport", "4440");
    parameters.set("listener_id", "iiop_1");
    parameters.set("securityenabled", "");
    CreateIiopListener command = services.getService(CreateIiopListener.class);
    cr.getCommandInvocation("create-iiop-listener", context.getActionReport(), adminSubject()).parameters(parameters).execute(command);
    checkActionReport(context.getActionReport());
    boolean isCreated = false;
    List<IiopListener> listenerList = iiopService.getIiopListener();
    for (IiopListener listener : listenerList) {
        if (listener.getId().equals("iiop_1")) {
            assertEquals("localhost", listener.getAddress());
            assertEquals("true", listener.getSecurityEnabled());
            assertEquals("4440", listener.getPort());
            isCreated = true;
            logger.fine("IIOPListener name iiop_1 is created.");
            break;
        }
    }
    assertTrue(isCreated);
    logger.fine("msg: " + context.getActionReport().getMessage());
}
Also used : IiopListener(org.glassfish.orb.admin.config.IiopListener) Test(org.junit.Test)

Example 18 with IiopListener

use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.

the class CreateIiopListenerTest method testExecuteFailForSamePortAndListenerAddress.

/**
 * Test of execute method, of class CreateIiopListener with same iiop port number
 * and listener address.
 * asadmin create-iiop-listener --listeneraddress localhost
 * --iiopport 4440 iiop_1
 * asadmin create-iiop-listener --listeneraddress localhost
 * --iiopport 4440 iiop_2
 */
@Test
public void testExecuteFailForSamePortAndListenerAddress() {
    parameters.set("listeneraddress", "localhost");
    parameters.set("iiopport", "4440");
    parameters.set("listener_id", "iiop_1");
    CreateIiopListener command = services.getService(CreateIiopListener.class);
    cr.getCommandInvocation("create-iiop-listener", context.getActionReport(), adminSubject()).parameters(parameters).execute(command);
    checkActionReport(context.getActionReport());
    boolean isCreated = false;
    List<IiopListener> listenerList = iiopService.getIiopListener();
    for (IiopListener listener : listenerList) {
        if (listener.getId().equals("iiop_1")) {
            assertEquals("localhost", listener.getAddress());
            assertEquals("4440", listener.getPort());
            isCreated = true;
            logger.fine("IIOPListener name iiop_1 is created.");
            break;
        }
    }
    assertTrue(isCreated);
    logger.fine("msg: " + context.getActionReport().getMessage());
    parameters = new ParameterMap();
    parameters.set("listener_id", "iiop_2");
    parameters.set("iiopport", "4440");
    parameters.set("listeneraddress", "localhost");
    cr.getCommandInvocation("create-iiop-listener", context.getActionReport(), adminSubject()).parameters(parameters).execute(command);
    assertEquals(ActionReport.ExitCode.FAILURE, context.getActionReport().getActionExitCode());
    logger.fine("msg: " + context.getActionReport().getMessage());
}
Also used : IiopListener(org.glassfish.orb.admin.config.IiopListener) ParameterMap(org.glassfish.api.admin.ParameterMap) Test(org.junit.Test)

Example 19 with IiopListener

use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.

the class CreateIiopListenerTest method testExecuteSuccessNoValueOptionEnabled.

/**
 * Test of execute method, of class CreateIiopListener when enabled has no value
 * asadmin create-iiop-listener --listeneraddress localhost
 * --iiopport 4440 --enable iiop_1
 */
@Test
public void testExecuteSuccessNoValueOptionEnabled() {
    parameters.set("listeneraddress", "localhost");
    parameters.set("iiopport", "4440");
    parameters.set("listener_id", "iiop_1");
    parameters.set("enabled", "");
    CreateIiopListener command = services.getService(CreateIiopListener.class);
    cr.getCommandInvocation("create-iiop-listener", context.getActionReport(), adminSubject()).parameters(parameters).execute(command);
    checkActionReport(context.getActionReport());
    boolean isCreated = false;
    List<IiopListener> listenerList = iiopService.getIiopListener();
    for (IiopListener listener : listenerList) {
        if (listener.getId().equals("iiop_1")) {
            assertEquals("localhost", listener.getAddress());
            assertEquals("true", listener.getEnabled());
            assertEquals("4440", listener.getPort());
            isCreated = true;
            logger.fine("IIOPListener name iiop_1 is created.");
            break;
        }
    }
    assertTrue(isCreated);
    logger.fine("msg: " + context.getActionReport().getMessage());
}
Also used : IiopListener(org.glassfish.orb.admin.config.IiopListener) Test(org.junit.Test)

Example 20 with IiopListener

use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.

the class DeleteIiopListenerTest method testExecuteSuccessDefaultTarget.

/**
 * Test of execute method, of class DeleteIiopListener.
 * delete-iiop-listener iiop_1
 */
@Test
public void testExecuteSuccessDefaultTarget() {
    parameters.set("listeneraddress", "localhost");
    parameters.set("iiopport", "4440");
    parameters.set("listener_id", "iiop_1");
    CreateIiopListener createCommand = services.getService(CreateIiopListener.class);
    cr.getCommandInvocation("create-iiop-listener", context.getActionReport(), adminSubject()).parameters(parameters).execute(createCommand);
    CreateIiopListenerTest.checkActionReport(context.getActionReport());
    parameters = new ParameterMap();
    parameters.set("listener_id", "iiop_1");
    DeleteIiopListener deleteCommand = services.getService(DeleteIiopListener.class);
    cr.getCommandInvocation("delete-iiop-listener", context.getActionReport(), adminSubject()).parameters(parameters).execute(deleteCommand);
    CreateIiopListenerTest.checkActionReport(context.getActionReport());
    boolean isDeleted = true;
    List<IiopListener> listenerList = iiopService.getIiopListener();
    for (IiopListener listener : listenerList) {
        if (listener.getId().equals("iiop_1")) {
            isDeleted = false;
            logger.fine("IIOPListener name iiop_1 is not deleted.");
            break;
        }
    }
    assertTrue(isDeleted);
    logger.fine("msg: " + context.getActionReport().getMessage());
}
Also used : IiopListener(org.glassfish.orb.admin.config.IiopListener) ParameterMap(org.glassfish.api.admin.ParameterMap) Test(org.junit.Test)

Aggregations

IiopListener (org.glassfish.orb.admin.config.IiopListener)24 IiopService (org.glassfish.orb.admin.config.IiopService)9 Test (org.junit.Test)7 PropertyVetoException (java.beans.PropertyVetoException)5 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)5 ParameterMap (org.glassfish.api.admin.ParameterMap)4 Config (com.sun.enterprise.config.serverbeans.Config)3 ActionReport (org.glassfish.api.ActionReport)3 CommandTarget (org.glassfish.config.support.CommandTarget)3 Ssl (org.glassfish.grizzly.config.dom.Ssl)3 Target (org.glassfish.internal.api.Target)3 List (java.util.List)2 TransientNameService (com.sun.corba.ee.impl.naming.cosnaming.TransientNameService)1 ClusterInstanceInfo (com.sun.corba.ee.spi.folb.ClusterInstanceInfo)1 SocketInfo (com.sun.corba.ee.spi.folb.SocketInfo)1 NoSuchWorkQueueException (com.sun.corba.ee.spi.threadpool.NoSuchWorkQueueException)1 ThreadPool (com.sun.corba.ee.spi.threadpool.ThreadPool)1 ThreadPoolManager (com.sun.corba.ee.spi.threadpool.ThreadPoolManager)1 Acceptor (com.sun.corba.ee.spi.transport.Acceptor)1 CreateSsl (com.sun.enterprise.admin.commands.CreateSsl)1