Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded injected test #393

Merged
merged 1 commit into from
Feb 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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