Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions 5 .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
Expand All @@ -11,7 +11,8 @@ org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
Expand Down
35 changes: 30 additions & 5 deletions 35 src/nu/validator/client/TestRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
Expand All @@ -56,7 +54,6 @@
import nu.validator.messages.MessageEmitterAdapter;
import nu.validator.validation.SimpleDocumentValidator;

@SuppressWarnings("unchecked")
public class TestRunner extends MessageEmitterAdapter {

private boolean inError = false;
Expand Down Expand Up @@ -218,6 +215,14 @@ private void checkFiles(List<File> files) throws IOException {
checkHtmlFile(file);
}
} catch (IOException | SAXException e) {
if (verbose) {
out.println(String.format(
"\"%s\": error: Exception while processing file: %s",
this.getFileURL(file), e.getMessage()));
e.printStackTrace(out);
out.flush();
}
failed = true;
}
if (inError) {
failed = true;
Expand All @@ -233,7 +238,7 @@ private boolean messageMatches(String testFilename) {
"?");
String messageExpected = expectedMessages.get(testFilename).getString().replaceAll(
"\\p{C}", "?");
// FIXME: The string replacements below are a hack to "normalize"
// NOTE: The string replacements below are a hack to "normalize"
// error messages reported for bad values of the ins/del datetime
// attribute, to work around the fact that in Java 8, parts of
// those error messages don't always get emitted in the same order
Expand All @@ -260,6 +265,11 @@ private void checkInvalidFiles(List<File> files) throws IOException {
checkHtmlFile(file);
}
} catch (IOException | SAXException e) {
err.println(String.format(
"\"%s\": error: Exception while processing file: %s",
file.getPath(),
e.getMessage()));
err.flush();
}
if (exception != null) {
testFilename = this.getRelativePathname(file, baseDir);
Expand Down Expand Up @@ -322,6 +332,16 @@ private void checkHasWarningFiles(List<File> files) throws IOException {
checkHtmlFile(file);
}
} catch (IOException | SAXException e) {
failed = true;
try {
err.println(String.format(
"\"%s\": error: Exception while checking file: %s",
this.getFileURL(file),
e.getMessage()));
err.flush();
} catch (MalformedURLException e1) {
throw new RuntimeException(e1);
}
}
if (exception != null) {
testFilename = this.getRelativePathname(file, baseDir);
Expand Down Expand Up @@ -463,7 +483,12 @@ public boolean runTestSuite() throws SAXException, Exception {
baseDir = messagesFile.getCanonicalFile().getParentFile();
FileInputStream fis = new FileInputStream(messagesFile);
JsonReader reader = Json.createReader(fis);
expectedMessages = (Map)reader.readObject();
javax.json.JsonObject jsonObject = reader.readObject();
final Map<String, Object> expectedMessagesMap = new HashMap<String, Object>();
for (Map.Entry<String, javax.json.JsonValue> entry : jsonObject.entrySet()) {
expectedMessagesMap.put(entry.getKey(), entry.getValue());
}
expectedMessages = (Map) expectedMessagesMap;
} else {
baseDir = new File(System.getProperty("user.dir"));
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.