hi is there any way i can generate a text file containing all missed lines.



in plugin i edited some things 

Inside sourceannotator class i inserted a a condition as follows in 
printhighlighted lines method.
private void printHighlightedLine(StringBuilder buf, int lineNumber, 
ICounter cov, String sourceLine, int status) {
        String Color_Of_Line=getStatusColor(status);
        if (Color_Of_Line.equals("#ffaaaa"))
        {
        buf.append("<H1>"+lineNumber + ":");

        String tooltip = getTooltip(cov);
        if (tooltip != null) {
            buf.append("•<SPAN title=\"").append(tooltip).append("\"");
        } else {
            buf.append("<SPAN");
        }

        buf.append(" style=\"BACKGROUND-COLOR: " + getStatusColor(status) + 
"\">").append(sourceLine).append("</SPAN>").append("<br></H1>");
            
            try {
                Pappu.Write_to_text(lineNumber, sourceLine, Color_Of_Line, 
buf);
            } catch (IOException ex) {
                
Logger.getLogger(SourceAnnotator.class.getName()).log(Level.SEVERE, null, 
ex);
            }
        }
        else{
        buf.append(lineNumber + ":");
        String tooltip = getTooltip(cov);
        if (tooltip != null) {
            buf.append("•<SPAN title=\"").append(tooltip).append("\"");
        } else {
            buf.append(" <SPAN");
        }

        buf.append(" style=\"BACKGROUND-COLOR: " + getStatusColor(status) + 
"\">").append(sourceLine).append("</SPAN>").append("<br>");
    }
    
    }


this function when find status as #ffaaaa it calls a method in which takes 
four arguments its definition is like this



public void Write_to_text(int LineNumber, String SourceLine, String 
Color_Of_Line,StringBuilder buf) throws IOException{
        String Java_Source_Path;
        String Experiment;//=null;
        SourceLine=SourceLine.replaceAll("&nbsp"," 
").replaceAll("&lt","<").replaceAll("&gt",">");
        buf.append("<H1><br>This Point was reached " );
        buf.append("</H1>");
        
//        if (Java_Source_Path!=null)
//         {
//            
Java_Source_Path=Java_Source_Path.substring(Java_Source_Path.indexOf("com")-1); 
   

//          }
        Java_Source_Path=getSource_Path();
        Experiment="\n" + Java_Source_Path +"\t" + LineNumber + "\t"+ 
SourceLine;
        buf.append("<H1><br>This Point was reached " + Experiment);
        buf.append("</H1>");
        FileWriter Jacoco_File_Writer = null;
        Jacoco_File_Create = new File("/home/test/RedLines.txt");
        try {
        Jacoco_File_Writer = new FileWriter(Jacoco_File_Create,true);
        Jacoco_File_Writer.write(Experiment);
        Jacoco_File_Writer.flush();
        Jacoco_File_Writer.close();
        } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        }                             
        JacocoPub.setWrite_to_Text(Experiment);
}    

but this method writes to text file only when i click to its report on 
console please help me so that i can get this string as soon as i build the 
project in jenkins

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/c69acda5-c09b-4b89-989e-4fe76c6cad64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to