Clover Coverage Report - Impex Parent 1.0.21-SNAPSHOT (Aggregated)
Coverage timestamp: Tue Feb 8 2011 11:33:53 EST
../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
11   44   6   1.83
0   31   0.55   6
6     1  
1    
 
  VersionTableMorpher       Line # 7 11 0% 6 17 0% 0.0
 
No Tests
 
1    package org.apache.torque.mojo.morph;
2   
3    import org.apache.commons.lang.StringUtils;
4    import org.apache.commons.logging.Log;
5    import org.apache.commons.logging.LogFactory;
6   
 
7    public class VersionTableMorpher extends Morpher {
8    private static final Log log = LogFactory.getLog(VersionTableMorpher.class);
9   
10    String projectVersion;
11   
 
12  0 toggle public VersionTableMorpher() {
13  0 this(null, null);
14    }
15   
 
16  0 toggle public VersionTableMorpher(MorphRequest morphRequest, String artifactId) {
17  0 super(morphRequest, artifactId);
18    }
19   
 
20  0 toggle protected String getMorphedContents(String contents) {
21  0 log.debug("contents=" + contents);
22  0 String oldVersion = StringUtils.substringBetween(contents, "VERSION=\"", "\"");
23  0 String searchString = "VERSION=\"" + oldVersion + "\"";
24  0 String replacement = "VERSION=\"" + getProjectVersion() + "\"";
25  0 String s = StringUtils.replace(contents, searchString, replacement);
26  0 return s;
27    }
28   
29    /**
30    * Return true if we need to morph this file
31    */
 
32  0 toggle protected boolean isMorphNeeded(String contents) {
33  0 return true;
34    }
35   
 
36  0 toggle public String getProjectVersion() {
37  0 return projectVersion;
38    }
39   
 
40  0 toggle public void setProjectVersion(String projectVersion) {
41  0 this.projectVersion = projectVersion;
42    }
43   
44    }