// Path: maven-spy/src/main/java/org/jenkinsci/plugins/pipeline/maven/eventspy/reporter/OutputStreamEventReporter.java
// public class OutputStreamEventReporter implements MavenEventReporter {
// 
//     final PrintWriter out;
//     final XMLWriter xmlWriter;
// 
//     public OutputStreamEventReporter(OutputStream out) {
//         this(new OutputStreamWriter(out, Charset.forName("UTF-8")));
//     }
// 
//     public OutputStreamEventReporter(Writer out) {
//         if (out instanceof PrintWriter) {
//             this.out = (PrintWriter) out;
//         } else {
//             this.out = new PrintWriter(out, true);
//         }
//         this.xmlWriter = new PrettyPrintXMLWriter(out);
//         xmlWriter.startElement("mavenExecution");
// 
//     }
// 
//     @Override
//     public synchronized void print(Object message) {
//         String comment = new Timestamp(System.currentTimeMillis()) + " - " + message;
//         XmlWriterUtil.writeComment(xmlWriter, comment);
//         XmlWriterUtil.writeLineBreak(xmlWriter);
// 
//         out.flush();
//     }
// 
//     @Override
//     public synchronized void print(Xpp3Dom element) {
//         Xpp3DomWriter.write(xmlWriter, element);
//         XmlWriterUtil.writeLineBreak(xmlWriter);
// 
//         out.flush();
//     }
// 
//     @Override
//     public synchronized void close() {
//         xmlWriter.endElement();
//         out.flush();
//     }
// }


import static org.hamcrest.MatcherAssert.assertThat;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.apache.maven.execution.ExecutionEvent;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Model;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.hamcrest.Matchers;
import org.jenkinsci.plugins.pipeline.maven.eventspy.reporter.OutputStreamEventReporter;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
package org.jenkinsci.plugins.pipeline.maven.eventspy.handler;




/**
 * @author <a href="mailto:r.schleuse@gmail.com">René Schleusner</a>
 */
public class DeployDeployFileExecutionHandlerTest {

    DeployDeployFileExecutionHandler handler;
    MavenProject project;
    ByteArrayOutputStream eventReportOutputStream;
// Path: maven-spy/src/main/java/org/jenkinsci/plugins/pipeline/maven/eventspy/reporter/OutputStreamEventReporter.java
// public class OutputStreamEventReporter implements MavenEventReporter {
// 
//     final PrintWriter out;
//     final XMLWriter xmlWriter;
// 
//     public OutputStreamEventReporter(OutputStream out) {
//         this(new OutputStreamWriter(out, Charset.forName("UTF-8")));
//     }
// 
//     public OutputStreamEventReporter(Writer out) {
//         if (out instanceof PrintWriter) {
//             this.out = (PrintWriter) out;
//         } else {
//             this.out = new PrintWriter(out, true);
//         }
//         this.xmlWriter = new PrettyPrintXMLWriter(out);
//         xmlWriter.startElement("mavenExecution");
// 
//     }
// 
//     @Override
//     public synchronized void print(Object message) {
//         String comment = new Timestamp(System.currentTimeMillis()) + " - " + message;
//         XmlWriterUtil.writeComment(xmlWriter, comment);
//         XmlWriterUtil.writeLineBreak(xmlWriter);
// 
//         out.flush();
//     }
// 
//     @Override
//     public synchronized void print(Xpp3Dom element) {
//         Xpp3DomWriter.write(xmlWriter, element);
//         XmlWriterUtil.writeLineBreak(xmlWriter);
// 
//         out.flush();
//     }
// 
//     @Override
//     public synchronized void close() {
//         xmlWriter.endElement();
//         out.flush();
//     }
// }


// Path: maven-spy/src/test/java/org/jenkinsci/plugins/pipeline/maven/eventspy/handler/DeployDeployFileExecutionHandlerTest.java
import static org.hamcrest.MatcherAssert.assertThat;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.apache.maven.execution.ExecutionEvent;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Model;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.hamcrest.Matchers;
import org.jenkinsci.plugins.pipeline.maven.eventspy.reporter.OutputStreamEventReporter;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

package org.jenkinsci.plugins.pipeline.maven.eventspy.handler;




/**
 * @author <a href="mailto:r.schleuse@gmail.com">René Schleusner</a>
 */
public class DeployDeployFileExecutionHandlerTest {

    DeployDeployFileExecutionHandler handler;
    MavenProject project;
    ByteArrayOutputStream eventReportOutputStream;
    OutputStreamEventReporter reporter;