Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 集成测试期间的OSGi代码覆盖率_Maven_Osgi_Integration Testing_Code Coverage_Soapui - Fatal编程技术网

Maven 集成测试期间的OSGi代码覆盖率

Maven 集成测试期间的OSGi代码覆盖率,maven,osgi,integration-testing,code-coverage,soapui,Maven,Osgi,Integration Testing,Code Coverage,Soapui,我正在使用SOAPUI对OSGi捆绑包运行集成测试。到目前为止,我已经将SOAPUI与Maven集成在一起,Maven在OSGi捆绑包上运行集成测试*(运行于ApacheKaraf)*。我试图找出如何进一步增强我的pom.xml,以便在运行时计算捆绑包的代码覆盖率 有人能提出一些建议吗 我有以下pom.xml文件: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001

我正在使用
SOAPUI
OSGi
捆绑包运行集成测试。到目前为止,我已经将SOAPUI与Maven集成在一起,Maven在OSGi捆绑包上运行集成测试*(运行于
ApacheKaraf
)*。我试图找出如何进一步增强我的
pom.xml
,以便在运行时计算捆绑包的
代码覆盖率

有人能提出一些建议吗

我有以下pom.xml文件:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.m2m.aricent.parent</groupId>
  <artifactId>CustRestExampleOsgi</artifactId>
  <version>1.0</version>

  <packaging>pom</packaging>
  <name>CustRestExampleOsgii</name>


  <modules>
      <module>M2mCustImplProvider</module>
      <module>M2mCustInterface</module>
      <module>M2mRestCustConsumer</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <karaf.deploy.build.folder>
        G:\apache-karaf-3.0.0.RC1\deploy
    </karaf.deploy.build.folder>
  </properties>

  <dependencies>
    <!-- needed to execute Integration tests instrumented with Cobertura -->
    <dependency>
        <groupId>net.sourceforge.cobertura</groupId>
        <artifactId>cobertura</artifactId>
        <version>1.9.4</version>
        <scope>test</scope>
    </dependency>
  </dependencies>

<pluginRepositories>
   <pluginRepository>
      <id>eviwarePluginRepository</id>
      <url>http://www.soapui.org/repository/maven2/</url>
   </pluginRepository>
    <pluginRepository>
     <id>cobertura-it-maven-plugin-maven2-release</id>
     <url>http://cobertura-it-maven-plugin.googlecode.com/svn/maven2/releases</url>
     <snapshots>
         <enabled>false</enabled>
     </snapshots>
     <releases>
         <enabled>true</enabled>
     </releases>
 </pluginRepository>
</pluginRepositories>

  <build>
      <plugins>
         <plugin>
            <groupId>eviware</groupId>
            <artifactId>maven-soapui-plugin</artifactId>
            <version>4.5.1</version>
            <configuration>
                <junitReport>true</junitReport>
                <exportAll>true</exportAll>
                <projectFile>C:\Documents and Settings\gur31659.AD\workspace\CustomerRestfulExampleOSGi\test-classes\cust.xml</projectFile>
                <outputFolder>C:\Documents and Settings\gur31659.AD\workspace\CustomerRestfulExampleOSGi\test_output</outputFolder>
                <testFailIgnore>true</testFailIgnore>
            </configuration>
            <executions>
                <execution>
                    <id>wsn-server-test</id>
                    <phase>integration-test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
             <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-it-maven-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <formats>
                    <format>xml</format>
                    <format>html</format>
                </formats>
                <check>
                    <haltOnFailure>false</haltOnFailure>
                </check>
            </configuration>
            <executions>
                <execution>
                    <id>cobertura-clean</id>
                    <phase>clean</phase>
                    <goals>
                        <goal>clean</goal>
                    </goals>
                </execution>
                <execution>
                    <id>cobertura-instrument</id>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>instrument</goal>
                    </goals>
                </execution>
                <execution>
                    <id>cobertura-report</id>
                    <phase>pre-site</phase>
                    <goals>
                        <goal>report-only</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.6.5.201403032054</version>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                    <execution>
                            <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                           <goal>report</goal>
                        </goals>
                   </execution>
                    <!--
                        Prepares the property pointing to the JaCoCo runtime agent which
                        is passed as VM argument when Maven the Failsafe plugin is executed.
                    -->
                    <execution>
                        <id>pre-integration-test</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <destFile>${jacoco.it.execution.data.file}</destFile>
                            <!--
                                Sets the name of the property containing the settings
                                for JaCoCo runtime agent.
                            -->
                            <propertyName>failsafeArgLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
            <id>default-prepare-agent-integration</id>
            <goals>
              <goal>prepare-agent-integration</goal>
            </goals>
          </execution>


                    <!--
                        Ensures that the code coverage report for integration tests after
                        integration tests have been run.
                    -->
                    <execution>
                        <id>post-integration-test</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <dataFile>${jacoco.it.execution.data.file}</dataFile>
                            <!-- Sets the output directory for the code coverage report. -->
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                        </configuration>
                    </execution>                   
            </executions>
        </plugin>
                <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>8.1.2.v20120308</version>
            <configuration>
                <stopPort>18043</stopPort>
                <stopKey>STOP</stopKey>
                <connectors>
                    <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                        <port>18042</port>
                    </connector>
                </connectors>
            </configuration>
            <executions>
                <execution>
                    <id>start-jetty</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start</goal>
                    </goals>
                    <configuration>
                        <!-- Needed in order to to code coverage on SoapUI tests -->
                        <classesDirectory>${project.build.directory}/generated-classes/cobertura</classesDirectory>
                        <useTestScope>true</useTestScope>
                        <scanIntervalSeconds>0</scanIntervalSeconds>
                        <daemon>true</daemon>
                        <contextPath>/myIntegrationTestsContext</contextPath>
                    </configuration>
                </execution>
                <execution>
                    <id>stop-jetty</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
  </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <minimumTokens>20</minimumTokens>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.3</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
            </plugin>
            <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-it-maven-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <formats>
                    <format>html</format>
                    <format>xml</format>
                </formats>
            </configuration>
            <reportSets>
                <reportSet>
                    <reports>
                        <report>report-only</report>
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>
        </plugins>
    </reporting>

</project>

4.0.0
org.m2m.aricent.parent
CustRestExampleOsgi
1
聚甲醛
卡斯特雷斯特范例酒店
M2MCU标准提供程序
M2MCU接口
M2mRestCustConsumer
UTF-8
G:\apache-karaf-3.0.0.RC1\deploy
net.sourceforge.cobertura
科贝图拉
1.9.4
测试
EviwarePlugin存储库
http://www.soapui.org/repository/maven2/
cobertura-it-maven-plugin-maven2-release
http://cobertura-it-maven-plugin.googlecode.com/svn/maven2/releases
假的
真的
电子设备
maven soapui插件
4.5.1
真的
真的
C:\Documents and Settings\gur31659.AD\workspace\CustomerRestfulExampleOSGi\test classes\cust.xml
C:\Documents and Settings\gur31659.AD\workspace\CustomerRestfulExampleOSGi\test\u输出
真的
无线传感器网络服务器测试
集成测试
测试
org.codehaus.mojo
cobertura it maven插件
2.5
xml
html
假的
科贝图拉清洁酒店
清洁的
清洁的
科贝图拉仪器
进程类
仪器
科贝图拉报告
现场前
仅报告
org.jacoco
jacocomaven插件
0.6.5.201403032054
配制剂
报告
准备包装
报告
预集成测试
预集成测试
配制剂
${jacoco.it.execution.data.file}
故障保护argline
默认准备代理集成
准备代理集成
整合后测试
整合后测试
报告
${jacoco.it.execution.data.file}
${project.reporting.outputDirectory}/jacoco-it
org.mortbay.jetty
jetty maven插件
8.1.2.v20120308
18043
停止
18042
起动码头
预集成测试
开始
${project.build.directory}/generated classes/cobertura
真的
0
真的
/myIntegrationTestsContext
停靠码头
整合后测试
停止
org.apache.maven.plugins
maven pmd插件
3
20
org.apache.maven.plugins
maven jxr插件
2.3
org.apache.maven.plugins
maven javadoc插件
2.9.1
org.codehaus.mojo
cobertura it maven插件
2.5
html
xml
仅报告

回答:

我建议你试试。Jacoco可以配置为,因此它可以与任何javaap一起工作