Skip to content

Commit

Permalink
[xproc-maven-plugin] xprocspec: Support focus on x:description
Browse files Browse the repository at this point in the history
  • Loading branch information
bertfrees committed Dec 13, 2016
1 parent e2dfd3d commit 0966320
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,18 @@ public boolean hasFocus(File testDir) {
public boolean hasFocus(Collection<File> tests) {
for (File test : tests)
if (test.exists())
if ((Boolean)evaluateXPath(test, "exists(//x:scenario[@focus])", XPROCSPEC_NS, Boolean.class))
if (fileHasFocus(test))
return true;
return false;
}

private boolean fileHasFocus(File test) {
return (Boolean)evaluateXPath(test,
"exists(//x:scenario[@focus]) or exists(/x:description[@focus])",
XPROCSPEC_NS,
Boolean.class);
}

public boolean run(Map<String,File> tests,
File reportsDir,
File surefireReportsDir,
Expand Down Expand Up @@ -119,7 +126,7 @@ public boolean run(Map<String,File> tests,
for (String testName : tests.keySet()) {
File test = tests.get(testName);
if (test.exists())
if ((Boolean)evaluateXPath(test, "exists(//x:scenario[@focus])", XPROCSPEC_NS, Boolean.class))
if (fileHasFocus(test))
focusTests.add(testName); }}
Set<String> skipTests = new HashSet<String>(); {
if (!focusTests.isEmpty())
Expand Down

0 comments on commit 0966320

Please sign in to comment.