尝试使用maven 3运行jbehave时出错(RejectedExecutionException)

时间:2016-03-03 17:23:45

标签: jbehave

我正在尝试JBehave,我需要运行我的3个故事(每个故事或多或少2个场景(testCases - > Given / When / Then))使用maven。

当我运行mvn integration-test时,我有以下异常

[ERROR] Failed to execute goal org.jbehave:jbehave-maven-plugin:4.0.5:run-stories-as-embeddables (run-stories-as-embeddables) on project bds: Failed to run stories as embeddables: Failures in running embeddables:
[ERROR] com.etermax.bds.test.stories.scenarios.RegisterContentScenarios: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@77c7bb87 rejected from java.util.concurrent.ThreadPoolExecutor@7cc8d976[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
[ERROR] com.etermax.bds.test.stories.scenarios.GenerateReportScenarios: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@56999414 rejected from java.util.concurrent.ThreadPoolExecutor@7cc8d976[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]

我的POM配置是:

<plugin>
            <groupId>org.jbehave</groupId>
            <artifactId>jbehave-maven-plugin</artifactId>
            <version>4.0.5</version>
            <dependencies>
                <dependency>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                    <version>1.2.16</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <id>run-stories-as-embeddables</id>
                    <phase>integration-test</phase>
                    <configuration>

                        <includes>
                            <include>**/GenerateReportScenarios.java</include>
                            <include>**/DeleteReportScenarios.java</include>
                            <include>**/RegisterContentScenarios.java</include>
                        </includes>
                        <scope>test</scope>

                        <systemProperties>
                            <property>
                                <name>java.awt.headless</name>
                                <value>true</value>
                            </property>
                        </systemProperties>
                        <batch>true</batch>
                        <ignoreFailureInStories>false</ignoreFailureInStories>
                        <ignoreFailureInView>true</ignoreFailureInView>
                    </configuration>
                    <goals>
                        <goal>run-stories-as-embeddables</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>           

但是,如果我运行一个故事(例如,如果我只包括GenerateReportScenarios.java),那么执行成功......当我同时运行3个故事时,我不明白出了什么问题

大家可以帮我解决这个问题吗?

感谢.-

1 个答案:

答案 0 :(得分:1)

我有同样的例外,我删除了

  

&LT;范围&GT;测试&lt; / scope&gt;

行,现在它正在工作。