有4个带有测试TestClass1, TestClasss2, TestClass3, TestClass4
的类。您需要创建2个测试套件,每个套件将包含2个类,并使用Maven surefire plugin
并行运行它们。
我创建了2个具有以下内容的xml文件:
<suite name="TestSuite" verbose="1">
<test name="Test">
<classes>
<class name="Tests.TestClass1">
</class>
<class name="Tests.TestClass2">
</class>
</classes>
</test>
</suite>
和
<suite name="TestSuite1" verbose="1">
<test name="Test1">
<classes>
<class name="Tests.TestClass3">
</class>
<class name="Tests.TestClass4">
</class>
</classes>
</test>
</suite>
还添加了以下内容到pom.xml
中的maven-surefire-plugin
:
<configuration>
<suiteXmlFiles>
<suiteXmlFile>Testng.xml</suiteXmlFile>
<suiteXmlFile>Testng1.xml</suiteXmlFile>
</suiteXmlFiles>
<parallel>suite</parallel>
<perCoreThreadCount>false</perCoreThreadCount>
<threadCount>2</threadCount>
</configuration>
接下来,我将使用命令mvn clean test
运行该项目,该项目将要运行,但是测试不会启动。我在哪里错了?
UPD:
该项目正在建设中,但测试未开始
文件testng.xml位于根文件夹中
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.469 sec - in T
estSuite
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.288 s
[INFO] Finished at: 2018-08-27T15:52:21+03:00
[INFO] ------------------------------------------------------------------------
答案 0 :(得分:0)
尝试以下配置:
let transformedData = observableData.pipe(
map(data => {
console.log(data, data.segments.length);
return data.segments.map(element => {
return { value: element["name"], viewValue: element["name"] };
});
})
);
transformedData.subscribe(data => {
this.mylist = data;
});