2016-07-13 2 views
1

Я возникли проблемы при запуске отказоустойчивой плагин с помощью mvn verifyПроблемы с запуском Maven плагин Failsafe

В основном это не работает интеграционные тесты! Если я запускаю mvn failsafe:integration-test работает нормально

Кроме того, мне нужен плагин причала или аналогичный для выполнения интеграционных тестов.

отказоустойчивого задачи не обязаны проверить задачу

код был проверен, чтобы .. https://github.com/tonymurphy/builder

<?xml version="1.0" encoding="UTF-8"?> 
<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>com.example</groupId> 
    <artifactId>junit-stuff</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 
    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.12</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-jxr-plugin</artifactId> 
      <version>2.5</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-report-plugin</artifactId> 
      <version>2.19.1</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 

    <build> 
     <resources> 
      <resource> 
       <directory>src/main/resources</directory> 
      </resource> 
     </resources> 
     <testResources> 
      <testResource> 
       <directory>src/test/resources</directory> 
      </testResource> 
     </testResources> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <version>3.5.1</version> 
        <configuration> 
         <source>1.8</source> 
         <target>1.8</target> 
        </configuration> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-surefire-plugin</artifactId> 
        <version>2.19</version> 
        <executions> 
         <execution> 
          <id>default-test</id> 
          <phase>none</phase> 
         </execution> 
         <execution> 
          <id>unit-test</id> 
          <phase>test</phase> 
          <goals> 
           <goal>test</goal> 
          </goals> 
          <configuration> 
           <includes> 
            <include>**/*.java</include> 
           </includes> 
           <excludes> 
            <exclude>**/*$*</exclude> 
            <exclude>**/*ContractTest.java</exclude> 
            <exclude>**/*MvcTest.java</exclude> 
            <exclude>**/*_Test.java</exclude> 
           </excludes> 
           <excludedGroups>com.example.OneAtATime</excludedGroups> 
          </configuration> 
         </execution> 
         <execution> 
          <id>mvc-tests</id> 
          <phase>test</phase> 
          <goals> 
           <goal>test</goal> 
          </goals> 
          <configuration> 
           <includes> 
            <include>**/*MvcTest.java</include> 
           </includes> 
           <excludedGroups>com.example.OneAtATime</excludedGroups> 
           <excludes> 
            <exclude>**/*$*</exclude> 
            <exclude>**/*ContractTest.java</exclude> 
            <exclude>**/*_Test.java</exclude> 
           </excludes> 
          </configuration> 
         </execution> 
        </executions> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-failsafe-plugin</artifactId> 
        <version>2.19.1</version> 
        <executions> 
         <execution> 
          <id>integration-test</id> 
          <configuration> 
           <groups>com.example.OneAtATime</groups> 
          </configuration> 
          <goals> 
           <goal>integration-test</goal> 
           <goal>verify</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 
       <plugin> 
        <groupId>org.eclipse.jetty</groupId> 
        <artifactId>jetty-maven-plugin</artifactId> 
        <version>9.2.2.v20140723</version> 
        <configuration> 
         <scanIntervalSeconds>10</scanIntervalSeconds> 
         <stopPort>8005</stopPort> 
         <stopKey>STOP</stopKey> 
        </configuration> 
        <executions> 
         <execution> 
          <id>start-jetty</id> 
          <phase>pre-integration-test</phase> 
          <goals> 
           <!-- stop any previous instance to free up the port --> 
           <goal>stop</goal> 
           <goal>start</goal> 
          </goals> 
          <configuration> 
           <scanIntervalSeconds>0</scanIntervalSeconds> 
           <daemon>true</daemon> 
          </configuration> 
         </execution> 
         <execution> 
          <id>stop-jetty</id> 
          <phase>post-integration-test</phase> 
          <goals> 
           <goal>stop</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 
    <reporting> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jxr-plugin</artifactId> 
       <version>2.5</version> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-report-plugin</artifactId> 
       <version>2.19.1</version> 
       <reportSets> 
        <reportSet> 
         <id>integration-tests</id> 
        <reports> 
         <report>failsafe-report-only</report> 
        </reports> 
        </reportSet> 
       </reportSets> 
      </plugin> 
     </plugins> 
    </reporting> 
</project> 
+0

Любое решение? – RahulB

+0

Извините. Решение не найдено –

ответ

0

Вам нужно создать отдельное исполнение для подтверждать цель:

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-failsafe-plugin</artifactId> 
    ... 
    <executions> 
     <execution> 
      <id>integration-test</id> 
      <goals> 
       <goal>integration-test</goal> 
      </goals> 
     </execution> 
     <execution> 
      <id>verify</id> 
      <goals> 
       <goal>verify</goal> 
      </goals> 
     </execution> 
    </executions> 
</plugin> 
Смежные вопросы