diff --git a/pom.xml b/pom.xml
index 68fd5e0..35a3d44 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.microfocus.adm.almoctane.bdd
bdd2octane
- 1.1.7-SNAPSHOT
+ 1.1.8-SNAPSHOT
maven-plugin
bdd2octane
diff --git a/src/main/java/com/microfocus/bdd/Bdd2Octane.java b/src/main/java/com/microfocus/bdd/Bdd2Octane.java
index 2735d80..98ddffa 100644
--- a/src/main/java/com/microfocus/bdd/Bdd2Octane.java
+++ b/src/main/java/com/microfocus/bdd/Bdd2Octane.java
@@ -124,6 +124,7 @@ public void run() throws IOException, XMLStreamException, InstantiationException
}
if (previousFeature != null && previousFeature != octaneFeature) {
+ previousFeature.setStarted(FileUtil.getFileCreationTime(file));
writeFeatureToXML(writer, previousFeature);
}
previousFeature = octaneFeature;
@@ -150,6 +151,7 @@ public void run() throws IOException, XMLStreamException, InstantiationException
count++;
}
if (previousFeature != null) {
+ previousFeature.setStarted(FileUtil.getFileCreationTime(file));
writeFeatureToXML(writer, previousFeature);
previousFeature = null;
}
diff --git a/src/main/java/com/microfocus/bdd/CucumberJvmHandler.java b/src/main/java/com/microfocus/bdd/CucumberJvmHandler.java
index 48579a8..95b4960 100644
--- a/src/main/java/com/microfocus/bdd/CucumberJvmHandler.java
+++ b/src/main/java/com/microfocus/bdd/CucumberJvmHandler.java
@@ -192,9 +192,7 @@ public Optional getFeatureName(OctaneFeatureLocator... octaneFeatureLoca
if (octaneFeatureLocator != null && octaneFeatureLocator.length > 0) {
Optional octaneFeatureOpt;
String classnamePart = classname;
- while (classnamePart.contains("-")) {
- int lastIndex = classnamePart.lastIndexOf("-");
- classnamePart = classnamePart.substring(0, lastIndex).trim();
+ while (!classnamePart.isEmpty()) {
try {
octaneFeatureOpt = octaneFeatureLocator[0].getOctaneFeatureByName(classnamePart);
} catch (IOException e) {
@@ -203,6 +201,12 @@ public Optional getFeatureName(OctaneFeatureLocator... octaneFeatureLoca
if (octaneFeatureOpt.isPresent()) {
return Optional.of(classnamePart);
}
+ if (classnamePart.contains("-")) {
+ int lastIndex = classnamePart.lastIndexOf("-");
+ classnamePart = classnamePart.substring(0, lastIndex).trim();
+ } else {
+ return Optional.of(classname);
+ }
}
}
return Optional.of(classname);
diff --git a/src/main/java/com/microfocus/bdd/FeatureFileLocator.java b/src/main/java/com/microfocus/bdd/FeatureFileLocator.java
index bdc8d72..88d4dd1 100644
--- a/src/main/java/com/microfocus/bdd/FeatureFileLocator.java
+++ b/src/main/java/com/microfocus/bdd/FeatureFileLocator.java
@@ -176,10 +176,7 @@ private Optional tryToGetFeatureFileMeta(String featureName, St
}
private OctaneFeature parseFeatureFile(FeatureFileMeta featureFileMeta) {
- OctaneFeature octaneFeature = GherkinDocumentUtil.generateSkeletonFeature(featureFileMeta);
- String creationTime = FileUtil.getFileCreationTime(featureFileMeta.getFeatureFile());
- octaneFeature.setStarted(creationTime);
- return octaneFeature;
+ return GherkinDocumentUtil.generateSkeletonFeature(featureFileMeta);
}
private void cacheScenarios(OctaneFeature octaneFeature, FeatureFileMeta meta) {
diff --git a/src/test/java/com/microfocus/bdd/it/Bdd2OctaneHandlerITCase.java b/src/test/java/com/microfocus/bdd/it/Bdd2OctaneHandlerITCase.java
index b08816e..bb76a3a 100644
--- a/src/test/java/com/microfocus/bdd/it/Bdd2OctaneHandlerITCase.java
+++ b/src/test/java/com/microfocus/bdd/it/Bdd2OctaneHandlerITCase.java
@@ -97,8 +97,9 @@ public static List