Java Code Examples for org.wso2.carbon.automation.engine.frameworkutils.CodeCoverageUtils#getJacocoAgentJarLocation()

The following examples show how to use org.wso2.carbon.automation.engine.frameworkutils.CodeCoverageUtils#getJacocoAgentJarLocation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CarbonServerManager.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
/**
 * This methods will insert jacoco agent settings into startup script under JAVA_OPTS
 *
 * @param scriptName - Name of the startup script
 * @throws IOException - throws if shell script edit fails
 */
private void insertJacocoAgentToShellScript(String scriptName) throws IOException {

    String jacocoAgentFile = CodeCoverageUtils.getJacocoAgentJarLocation();
    coverageDumpFilePath = FrameworkPathUtil.getCoverageDumpFilePath();

    File inFile = Paths.get(carbonHome, "bin", scriptName + ".sh").toFile();
    File tmpFile = Paths.get(carbonHome, "tmp" + scriptName + ".sh").toFile();
    String lineToBeChecked = "-Dwso2.server.standalone=true";
    String lineToBeInserted =
            "-javaagent:" + jacocoAgentFile + "=destfile=" + coverageDumpFilePath + "" + ",append=true,includes="
                    + CodeCoverageUtils.getInclusionJarsPattern(":") + ",excludes=" + CodeCoverageUtils
                    .getExclusionJarsPattern(":") + " \\";

    CodeCoverageUtils.insertStringToFile(inFile, tmpFile, lineToBeChecked, lineToBeInserted);
}
 
Example 2
Source File: CarbonServerManager.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
/**
 * This methods will insert jacoco agent settings into windows bat script
 *
 * @param scriptName - Name of the startup script
 * @throws IOException - throws if shell script edit fails
 */
private void insertJacocoAgentToBatScript(String scriptName) throws IOException {

    String jacocoAgentFile = CodeCoverageUtils.getJacocoAgentJarLocation();
    coverageDumpFilePath = FrameworkPathUtil.getCoverageDumpFilePath();
    CodeCoverageUtils.insertJacocoAgentToStartupBat(Paths.get(carbonHome, "bin", scriptName + ".bat").toFile(),
            Paths.get(carbonHome, "wso2", "tmp", scriptName + ".bat").toFile(), "-Dcatalina.base",
            "-javaagent:" + jacocoAgentFile + "=destfile=" + coverageDumpFilePath + "" + ",append=true,includes="
                    + CodeCoverageUtils.getInclusionJarsPattern(":") + ",excludes=" + CodeCoverageUtils
                    .getExclusionJarsPattern(":"));
}
 
Example 3
Source File: CarbonServerManager.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * This methods will insert jacoco agent settings into startup script under JAVA_OPTS
 *
 * @param scriptName - Name of the startup script
 * @throws IOException - throws if shell script edit fails
 */
private void insertJacocoAgentToShellScript(String scriptName) throws IOException {

    scriptName = "integrator";
    String jacocoAgentFile = CodeCoverageUtils.getJacocoAgentJarLocation();
    coverageDumpFilePath = FrameworkPathUtil.getCoverageDumpFilePath();
    CodeCoverageUtils.insertStringToFile(Paths.get(carbonHome, "bin", scriptName + ".sh").toFile(),
            Paths.get(carbonHome, "wso2", "tmp", scriptName + ".sh").toFile(), "-Dwso2.server.standalone=true",
            "-javaagent:" + jacocoAgentFile + "=destfile=" + coverageDumpFilePath + "" + ",append=true,includes="
                    + CodeCoverageUtils.getInclusionJarsPattern(":") + ",excludes=" + CodeCoverageUtils
                    .getExclusionJarsPattern(":") + " \\");

}
 
Example 4
Source File: CarbonServerManager.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * This methods will insert jacoco agent settings into windows bat script
 *
 * @param scriptName - Name of the startup script
 * @throws IOException - throws if shell script edit fails
 */
private void insertJacocoAgentToBatScript(String scriptName) throws IOException {

    String jacocoAgentFile = CodeCoverageUtils.getJacocoAgentJarLocation();
    coverageDumpFilePath = FrameworkPathUtil.getCoverageDumpFilePath();
    scriptName = "integrator";
    CodeCoverageUtils.insertJacocoAgentToStartupBat(Paths.get(carbonHome, "bin", scriptName + ".bat").toFile(),
            Paths.get(carbonHome, "wso2", "tmp", scriptName + ".bat").toFile(), "-Dcatalina.base",
            "-javaagent:" + jacocoAgentFile + "=destfile=" + coverageDumpFilePath + "" + ",append=true,includes="
                    + CodeCoverageUtils.getInclusionJarsPattern(":") + ",excludes=" + CodeCoverageUtils
                    .getExclusionJarsPattern(":"));
}
 
Example 5
Source File: StratosTestServerManager.java    From attic-stratos with Apache License 2.0 5 votes vote down vote up
private void insertJacocoAgentToShellScript(String scriptName) throws IOException {
    String jacocoAgentFile = CodeCoverageUtils.getJacocoAgentJarLocation();
    this.coverageDumpFilePath = FrameworkPathUtil.getCoverageDumpFilePath();
    CodeCoverageUtils.insertStringToFile(
            new File(this.carbonHome + File.separator + "bin" + File.separator + scriptName + ".sh"),
            new File(this.carbonHome + File.separator + "tmp" + File.separator + scriptName + ".sh"),
            "-Dwso2.server.standalone=true",
            "-javaagent:" + jacocoAgentFile + "=destfile=" + this.coverageDumpFilePath + "" +
                    ",append=true,includes=" + CodeCoverageUtils.getInclusionJarsPattern(":") + " \\");
}
 
Example 6
Source File: StratosTestServerManager.java    From attic-stratos with Apache License 2.0 5 votes vote down vote up
private void insertJacocoAgentToBatScript(String scriptName) throws IOException {
    String jacocoAgentFile = CodeCoverageUtils.getJacocoAgentJarLocation();
    this.coverageDumpFilePath = FrameworkPathUtil.getCoverageDumpFilePath();
    CodeCoverageUtils.insertJacocoAgentToStartupBat(
            new File(this.carbonHome + File.separator + "bin" + File.separator + scriptName + ".bat"),
            new File(this.carbonHome + File.separator + "tmp" + File.separator + scriptName + ".bat"),
            "-Dcatalina.base", "-javaagent:" + jacocoAgentFile + "=destfile=" + this.coverageDumpFilePath + "" +
                    ",append=true,includes=" + CodeCoverageUtils.getInclusionJarsPattern(":"));
}
 
Example 7
Source File: CarbonServerManagerExtension.java    From product-iots with Apache License 2.0 2 votes vote down vote up
/**
 * This methods will insert jacoco agent settings into startup script under JAVA_OPTS
 *
 * @param scriptName - Name of the startup script
 * @throws IOException - throws if shell script edit fails
 */
private void insertJacocoAgentToShellScript(String scriptName) throws IOException {
    String jacocoAgentFile = CodeCoverageUtils.getJacocoAgentJarLocation();
    this.coverageDumpFilePath = FrameworkPathUtil.getCoverageDumpFilePath();
    CodeCoverageUtils.insertStringToFile(new File(this.carbonHome + File.separator + "bin" + File.separator + scriptName + ".sh"), new File(this.carbonHome + File.separator + "tmp" + File.separator + scriptName + ".sh"), "-Dwso2.server.standalone=true", "-javaagent:" + jacocoAgentFile + "=destfile=" + this.coverageDumpFilePath + "" + ",append=true,includes=" + CodeCoverageUtils.getInclusionJarsPattern(":") + " \\");
}
 
Example 8
Source File: CarbonServerManagerExtension.java    From product-iots with Apache License 2.0 2 votes vote down vote up
/**
 * This methods will insert jacoco agent settings into windows bat script
 *
 * @param scriptName - Name of the startup script
 * @throws IOException - throws if shell script edit fails
 */
private void insertJacocoAgentToBatScript(String scriptName) throws IOException {
    String jacocoAgentFile = CodeCoverageUtils.getJacocoAgentJarLocation();
    this.coverageDumpFilePath = FrameworkPathUtil.getCoverageDumpFilePath();
    CodeCoverageUtils.insertJacocoAgentToStartupBat(new File(this.carbonHome + File.separator + "bin" + File.separator + scriptName + ".bat"), new File(this.carbonHome + File.separator + "tmp" + File.separator + scriptName + ".bat"), "-Dcatalina.base", "-javaagent:" + jacocoAgentFile + "=destfile=" + this.coverageDumpFilePath + "" + ",append=true,includes=" + CodeCoverageUtils.getInclusionJarsPattern(":"));
}