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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations