use of com.sun.enterprise.v3.common.PropsFileActionReporter in project Payara by payara.
the class ListJdbcResourcesTest method testExecuteSuccessListBob.
/**
* Test of execute method, of class ListJdbcResource.
* create-jdbc-resource --connectionpoolid DerbyPool bob
* list-jdbc-resources
*/
@Test
public void testExecuteSuccessListBob() {
// Create JDBC Resource bob
assertTrue(resources != null);
// Get an instance of the CreateJdbcResource command
createCommand = habitat.getService(CreateJdbcResource.class);
assertTrue(createCommand != null);
parameters.add("connectionpoolid", "DerbyPool");
parameters.add("DEFAULT", "bob");
context = new AdminCommandContextImpl(LogDomains.getLogger(ListJdbcResourcesTest.class, LogDomains.ADMIN_LOGGER), new PropsFileActionReporter());
cr.getCommandInvocation("create-jdbc-resource", context.getActionReport(), adminSubject()).parameters(parameters).execute(createCommand);
assertEquals(ActionReport.ExitCode.SUCCESS, context.getActionReport().getActionExitCode());
// List JDBC Resources and check if bob is in the list
// Get an instance of the ListJdbcResources command
listCommand = habitat.getService(ListJdbcResources.class);
parameters = new ParameterMap();
context = new AdminCommandContextImpl(LogDomains.getLogger(ListJdbcResourcesTest.class, LogDomains.ADMIN_LOGGER), new PropsFileActionReporter());
// Call CommandRunnerImpl.doCommand(..) to execute the command
cr.getCommandInvocation("list-jdbc-resources", context.getActionReport(), adminSubject()).parameters(parameters).execute(listCommand);
List<MessagePart> list = context.getActionReport().getTopMessagePart().getChildren();
assertEquals(origNum + 1, list.size());
List<String> listStr = new java.util.ArrayList();
for (MessagePart mp : list) {
listStr.add(mp.getMessage());
}
assertTrue(listStr.contains("bob"));
// Check the exit code is SUCCESS
assertEquals(ActionReport.ExitCode.SUCCESS, context.getActionReport().getActionExitCode());
}
use of com.sun.enterprise.v3.common.PropsFileActionReporter in project Payara by payara.
the class ListJndiResourcesTest method setUp.
@Before
public void setUp() {
habitat = getHabitat();
cr = habitat.getService(CommandRunner.class);
context = new AdminCommandContextImpl(LogDomains.getLogger(ListJndiResourcesTest.class, LogDomains.ADMIN_LOGGER), new PropsFileActionReporter());
parameters = new ParameterMap();
Resources resources = habitat.<Domain>getService(Domain.class).getResources();
for (Resource resource : resources.getResources()) {
if (resource instanceof org.glassfish.resources.config.ExternalJndiResource) {
origNum = origNum + 1;
}
}
}
use of com.sun.enterprise.v3.common.PropsFileActionReporter in project Payara by payara.
the class DeleteJavaMailResourceTest method setUp.
@Before
public void setUp() {
habitat = getHabitat();
parameters = new ParameterMap();
cr = habitat.getService(CommandRunner.class);
resources = habitat.<Domain>getService(Domain.class).getResources();
context = new AdminCommandContextImpl(LogDomains.getLogger(DeleteJavaMailResourceTest.class, LogDomains.ADMIN_LOGGER), new PropsFileActionReporter());
}
use of com.sun.enterprise.v3.common.PropsFileActionReporter in project Payara by payara.
the class ListJavaMailResourcesTest method setUp.
@Before
public void setUp() {
habitat = getHabitat();
parameters = new ParameterMap();
cr = habitat.getService(CommandRunner.class);
assertTrue(cr != null);
Resources resources = habitat.<Domain>getService(Domain.class).getResources();
context = new AdminCommandContextImpl(LogDomains.getLogger(ListJavaMailResourcesTest.class, LogDomains.ADMIN_LOGGER), new PropsFileActionReporter());
for (Resource resource : resources.getResources()) {
if (resource instanceof MailResource) {
origNum = origNum + 1;
}
}
}
use of com.sun.enterprise.v3.common.PropsFileActionReporter in project Payara by payara.
the class CreateIiopListenerTest method setUp.
@Before
public void setUp() {
services = getHabitat();
iiopService = services.getService(IiopService.class);
parameters = new ParameterMap();
context = new AdminCommandContextImpl(LogDomains.getLogger(CreateIiopListenerTest.class, LogDomains.ADMIN_LOGGER), new PropsFileActionReporter());
cr = services.getService(CommandRunner.class);
}
Aggregations