Coverage Report - org.apache.torque.util.MojoAntBuildListener
 
Classes in this File Line Coverage Branch Coverage Complexity
MojoAntBuildListener
0%
0/27
0%
0/6
1.818
 
 1  
 package org.apache.torque.util;
 2  
 
 3  
 import org.apache.maven.plugin.logging.Log;
 4  
 import org.apache.tools.ant.BuildEvent;
 5  
 import org.apache.tools.ant.BuildListener;
 6  
 import org.apache.tools.ant.Project;
 7  
 
 8  
 /**
 9  
  * This listener issues Ant logging messages to the Maven logging system
 10  
  */
 11  
 public class MojoAntBuildListener implements BuildListener {
 12  
         Log mavenLog;
 13  
 
 14  
         public MojoAntBuildListener() {
 15  0
                 this(null);
 16  0
         }
 17  
 
 18  
         public MojoAntBuildListener(Log mavenLog) {
 19  0
                 super();
 20  0
                 this.mavenLog = mavenLog;
 21  0
         }
 22  
 
 23  
         // Log the Ant message using Maven's logger
 24  
         public void messageLogged(BuildEvent event) {
 25  0
                 String message = event.getMessage();
 26  0
                 int priority = event.getPriority();
 27  0
                 switch (priority) {
 28  
                 case (Project.MSG_VERBOSE):
 29  
                 case (Project.MSG_DEBUG):
 30  0
                         mavenLog.debug(message);
 31  0
                         return;
 32  
                 case (Project.MSG_ERR):
 33  0
                         mavenLog.error(message);
 34  0
                         return;
 35  
                 case (Project.MSG_WARN):
 36  0
                         mavenLog.warn(message);
 37  0
                         return;
 38  
                 case (Project.MSG_INFO):
 39  0
                         mavenLog.info(message);
 40  0
                         return;
 41  
                 default:
 42  0
                         mavenLog.info(message);
 43  0
                         return;
 44  
                 }
 45  
         }
 46  
 
 47  
         // Ignore all other events
 48  
         public void taskStarted(BuildEvent event) {
 49  0
         }
 50  
 
 51  
         public void taskFinished(BuildEvent event) {
 52  0
         }
 53  
 
 54  
         public void targetStarted(BuildEvent event) {
 55  0
         }
 56  
 
 57  
         public void targetFinished(BuildEvent event) {
 58  0
         }
 59  
 
 60  
         public void buildStarted(BuildEvent event) {
 61  0
         }
 62  
 
 63  
         public void buildFinished(BuildEvent event) {
 64  0
         }
 65  
 
 66  
         public Log getMavenLog() {
 67  0
                 return mavenLog;
 68  
         }
 69  
 
 70  
         public void setMavenLog(Log mavenLog) {
 71  0
                 this.mavenLog = mavenLog;
 72  0
         }
 73  
 
 74  
 }