Search in sources :

Example 6 with PlainTextActionReporter

use of com.sun.enterprise.v3.common.PlainTextActionReporter in project Payara by payara.

the class AdminCommandContextTest method testSerialization.

@Test
public void testSerialization() throws IOException, ClassNotFoundException {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(os);
    ActionReport report = new PlainTextActionReporter();
    AdminCommandContext context = new AdminCommandContextImpl(null, /* logger */
    report);
    report.setFailureCause(new RuntimeException("Test"));
    oos.writeObject(context);
    ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
    ObjectInputStream ois = new ObjectInputStream(is);
    AdminCommandContext restored = (AdminCommandContextImpl) ois.readObject();
    assertEquals("failureCause", "Test", restored.getActionReport().getFailureCause().getMessage());
// context.setPayload
}
Also used : AdminCommandContextImpl(org.glassfish.api.admin.AdminCommandContextImpl) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ObjectOutputStream(java.io.ObjectOutputStream) ActionReport(org.glassfish.api.ActionReport) PlainTextActionReporter(com.sun.enterprise.v3.common.PlainTextActionReporter) AdminCommandContext(org.glassfish.api.admin.AdminCommandContext) ObjectInputStream(java.io.ObjectInputStream) Test(org.junit.Test)

Example 7 with PlainTextActionReporter

use of com.sun.enterprise.v3.common.PlainTextActionReporter in project Payara by payara.

the class MonitoringReporter method runAggregate.

private void runAggregate() {
    List<String> list = getOutputLines();
    ActionReport aggregateReporter = null;
    if (aggregateDataOnly) {
        plainReporter = new PlainTextActionReporter();
        aggregateReporter = plainReporter.addSubActionsReport();
    } else
        aggregateReporter = reporter.addSubActionsReport();
    setClusterInfo(aggregateReporter, list);
    if (aggregateDataOnly) {
        reporter = plainReporter;
        context.setActionReport(plainReporter);
    }
}
Also used : ActionReport(org.glassfish.api.ActionReport) PlainTextActionReporter(com.sun.enterprise.v3.common.PlainTextActionReporter)

Aggregations

PlainTextActionReporter (com.sun.enterprise.v3.common.PlainTextActionReporter)7 ActionReport (org.glassfish.api.ActionReport)4 File (java.io.File)2 IOException (java.io.IOException)2 AdminCommandContext (org.glassfish.api.admin.AdminCommandContext)2 AdminCommandContextImpl (org.glassfish.api.admin.AdminCommandContextImpl)2 DeployCommandParameters (org.glassfish.api.deployment.DeployCommandParameters)2 ExtendedDeploymentContext (org.glassfish.internal.deployment.ExtendedDeploymentContext)2 ApplicationRef (com.sun.enterprise.config.serverbeans.ApplicationRef)1 Applications (com.sun.enterprise.config.serverbeans.Applications)1 Application (com.sun.enterprise.deployment.Application)1 ModulesRegistry (com.sun.enterprise.module.ModulesRegistry)1 RestartDomainCommand (com.sun.enterprise.v3.admin.RestartDomainCommand)1 PropertyVetoException (java.beans.PropertyVetoException)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 ObjectInputStream (java.io.ObjectInputStream)1 ObjectOutputStream (java.io.ObjectOutputStream)1 AdminCommand (org.glassfish.api.admin.AdminCommand)1 ParameterMap (org.glassfish.api.admin.ParameterMap)1