Skip to content

Commit

Permalink
Remove unneeded injected test (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored Feb 18, 2022
1 parent a296493 commit 5257fc5
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/main/java/org/jvnet/hudson/test/JellyTestSuiteBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ private static class JellyCheck extends TestCase {
protected void runTest() throws Exception {
jct.createContext().compileScript(jelly);
Document dom = new SAXReader().read(jelly);
checkLabelFor(dom);
if (requirePI) {
ProcessingInstruction pi = dom.processingInstruction("jelly");
if (pi==null || !pi.getText().contains("escape-by-default"))
Expand All @@ -111,18 +110,6 @@ protected void runTest() throws Exception {
// TODO: what else can we check statically? use of taglibs?
}

/**
* Makes sure that <label for=...> is not used inside config.jelly nor global.jelly
*/
private void checkLabelFor(Document dom) {
if (isConfigJelly() || isGlobalJelly()) {
if (!dom.selectNodes("//label[@for]").isEmpty())
throw new AssertionError("<label for=...> shouldn't be used because it doesn't work " +
"when the configuration item is repeated. Use <label class=\"attach-previous\"> " +
"to have your label attach to the previous DOM node instead.\nurl="+jelly);
}
}

private boolean isConfigJelly() {
return jelly.toString().endsWith("/config.jelly");
}
Expand Down

0 comments on commit 5257fc5

Please sign in to comment.