use of com.sun.enterprise.admin.report.PropsFileActionReporter in project Payara by payara.
the class DeleteJndiResourceTest method setUp.
@Before
public void setUp() {
habitat = getHabitat();
resources = habitat.<Domain>getService(Domain.class).getResources();
parameters = new ParameterMap();
cr = habitat.getService(CommandRunner.class);
context = new AdminCommandContextImpl(LogDomains.getLogger(DeleteJndiResourceTest.class, LogDomains.ADMIN_LOGGER), new PropsFileActionReporter());
}
use of com.sun.enterprise.admin.report.PropsFileActionReporter in project Payara by payara.
the class GetCommand method preAuthorizationForNonMonitoring.
private boolean preAuthorizationForNonMonitoring(final AdminCommandContext context) {
report = context.getActionReport();
/* Issue 5918 Used in ManifestManager to keep output sorted */
try {
PropsFileActionReporter reporter = (PropsFileActionReporter) report;
reporter.useMainChildrenAttribute(true);
} catch (ClassCastException e) {
// ignore this is not a manifest output.
}
matchingNodesSorted = findSortedMatchingNodes();
return matchingNodesSorted != null;
}
use of com.sun.enterprise.admin.report.PropsFileActionReporter in project Payara by payara.
the class ListJdbcResourcesTest method testExecuteSuccessListOriginal.
/**
* Test of execute method, of class ListJdbcResources.
* list-jdbc-resources
*/
@Test
public void testExecuteSuccessListOriginal() {
// List the original set of JDBC Resources
// Get an instance of the ListJdbcResources command
ListJdbcResources listCommand = habitat.getService(ListJdbcResources.class);
AdminCommandContext 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, list.size());
// Check the exit code is SUCCESS
assertEquals(ActionReport.ExitCode.SUCCESS, context.getActionReport().getActionExitCode());
}
use of com.sun.enterprise.admin.report.PropsFileActionReporter in project Payara by payara.
the class ListJdbcResourcesTest method testExecuteSuccessValidTargetOperand.
/**
* Test of execute method, of class ListJdbcResource.
* list-jdbc-resources server
*/
@Test
public void testExecuteSuccessValidTargetOperand() {
// List the original set of JDBC Resources
// Get an instance of the ListJdbcResources command
listCommand = habitat.getService(ListJdbcResources.class);
parameters.add("DEFAULT", "server");
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, list.size());
// Check the exit code is Success
assertEquals(ActionReport.ExitCode.SUCCESS, context.getActionReport().getActionExitCode());
}
use of com.sun.enterprise.admin.report.PropsFileActionReporter in project Payara by payara.
the class ListJdbcResourcesTest method testExecuteFailInvalidTargetOperand.
/**
* Test of execute method, of class ListJdbcResource.
* list-jdbc-resources invalid
*/
@Ignore
@Test
public void testExecuteFailInvalidTargetOperand() {
// List the original set of JDBC Resources
// Get an instance of the ListJdbcResources command
listCommand = habitat.getService(ListJdbcResources.class);
parameters.add("DEFAULT", "invalid");
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);
// Need bug fix before uncommenting assertion
// List<MessagePart> list = context.getActionReport().getTopMessagePart().getChildren();
// assertEquals(0, list.size());
// Check the exit code is FAILURE
// Need bug fix before uncommenting assertion
// assertEquals(ActionReport.ExitCode.FAILURE, context.getActionReport().getActionExitCode());
// Check error msg 'Invalid target: invalid'
}
Aggregations