Skip to content

Commit

Permalink
Merge pull request #6 in QA/testlink-serenity-integration from develo…
Browse files Browse the repository at this point in the history
…p to master

* commit '1c0607060c18b676cffce4bce0f1898fdba441f4':
  Changelog : - avoid NPE when using parallel stream
  • Loading branch information
argotriwidodo committed Mar 16, 2020
2 parents d35d6a0 + 1c06070 commit 993c7b7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ Map<Integer, Map<String, ScenarioData>> groupingScenariosByTestSuiteId(List<Cucu
Map<Integer, Map<String, ScenarioData>> groupedFeature = new ConcurrentHashMap<>();

System.out.println("Populating scenarios from feature :");
reports.parallelStream().forEach(feature -> {
reports.parallelStream().forEachOrdered(feature -> {
System.out.println(feature.getName());
String summary =
String.format("Feature : %s, %s", feature.getName(), feature.getDescription());
List<String[]> steps = new ArrayList<>();
feature.getElements().parallelStream().forEach(element -> {
feature.getElements().parallelStream().forEachOrdered(element -> {
ScenarioData scenarioData = new ScenarioData();
if (element.getType().equalsIgnoreCase("background")) {
steps.addAll(0, readSteps(element.getSteps()));
Expand Down
26 changes: 21 additions & 5 deletions src/test/java/com/gdn/qa/util/TestReadTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import org.junit.Test;

public class TestReadTags {
/* @Test
@Test
public void testCucumberFromFolder() throws Exception {
long startTime = System.nanoTime();
String testlinkURL = "https://testlink.gdn-app.com/lib/api/xmlrpc/v1/xmlrpc.php";
String devKey = "aa0eb2386227576295d65b753ab60a5f";
String projectName = "Surabaya";
Expand All @@ -22,10 +23,14 @@ public void testCucumberFromFolder() throws Exception {
.setPlatFormName(platformName);
BadakReporter.getReader(SupportedReports.CUCUMBER, testLinkData, cucumberPath)
.writeToTestLink();

long endTime = System.nanoTime();
System.out.println("Total execution time in second : " + (endTime - startTime) / 1000000000);
}
*//*

@Test
public void testCucumberWithBackground() throws Exception {
long startTime = System.nanoTime();
String testlinkURL = "https://testlink.gdn-app.com/lib/api/xmlrpc/v1/xmlrpc.php";
String devKey = "aa0eb2386227576295d65b753ab60a5f";
String projectName = "Surabaya";
Expand All @@ -41,10 +46,14 @@ public void testCucumberWithBackground() throws Exception {
.setPlatFormName(platformName);
BadakReporter.getReader(SupportedReports.CUCUMBER, testLinkData, cucumberPath)
.writeToTestLink();
}*//*

long endTime = System.nanoTime();
System.out.println("Total execution time in second : " + (endTime - startTime) / 1000000000);
}

@Test
public void testCucumberWithFailure() throws Exception {
long startTime = System.nanoTime();
String testlinkURL = "https://testlink.gdn-app.com/lib/api/xmlrpc/v1/xmlrpc.php";
String devKey = "aa0eb2386227576295d65b753ab60a5f";
String projectName = "Surabaya";
Expand All @@ -60,17 +69,21 @@ public void testCucumberWithFailure() throws Exception {
.setPlatFormName(platformName);
BadakReporter.getReader(SupportedReports.CUCUMBER, testLinkData, cucumberPath)
.writeToTestLink();

long endTime = System.nanoTime();
System.out.println("Total execution time in second : " + (endTime - startTime) / 1000000000);
}

@Test
public void testCucumberHuge() throws Exception {
long startTime = System.nanoTime();
String testlinkURL = "https://testlink.gdn-app.com/lib/api/xmlrpc/v1/xmlrpc.php";
String devKey = "aa0eb2386227576295d65b753ab60a5f";
String projectName = "Neo-Loyalty";
String testPlanName = "TEST";
String buildName = "Staging";
String platformName = "API";
String cucumberPath = "/src/test/resources/cucumber-huge.json";
String cucumberPath = "/src/test/resources/cucumber/cucumber-huge.json";
System.out.println(cucumberPath);
TestLinkData testLinkData = new TestLinkData().setUrlTestlink(testlinkURL)
.setDEVKEY(devKey)
Expand All @@ -80,6 +93,9 @@ public void testCucumberHuge() throws Exception {
.setPlatFormName(platformName);
BadakReporter.getReader(SupportedReports.CUCUMBER, testLinkData, cucumberPath)
.writeToTestLink();
}*/

long endTime = System.nanoTime();
System.out.println("Total execution time in second : " + (endTime - startTime) / 1000000000);
}

}

0 comments on commit 993c7b7

Please sign in to comment.