Skip to content

Commit

Permalink
remove outdated code
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaber committed Dec 18, 2023
1 parent d3312b2 commit 204ba77
Showing 1 changed file with 0 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@

import java.io.IOException;
import java.io.InputStream;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

import static junit.framework.Assert.fail;
Expand All @@ -52,7 +49,6 @@ protected void runTests(Language lang, String onlyRunCode) throws IOException {
}

protected void runTests(Language lang, String onlyRunCode, String additionalValidationChars) throws IOException {
testRulePriorities(lang);
new WordListValidatorTest(additionalValidationChars).testWordListValidity(lang);
testNoLineBreaksEtcInMessage(lang);
testNoQuotesAroundSuggestion(lang);
Expand All @@ -69,39 +65,6 @@ protected void runTests(Language lang, String onlyRunCode, String additionalVali
}
}

private void testRulePriorities(Language lang) throws IOException {
if (lang.isVariant()) {
return;
}
String filename;
if (lang.getShortCode().equals("xx")) {
filename = "Demo.java";
} else {
filename = lang.getName() + ".java";
}
final AtomicInteger foundFiles = new AtomicInteger();
FileVisitor<Path> fv = new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
//System.out.println("-> " + file.getFileName().toString());
if (file.getFileName().toString().equals(filename)) {
System.out.println("FOUND " + file);
foundFiles.incrementAndGet();
}
return FileVisitResult.CONTINUE;
}
};
Path p = Paths.get("");
System.out.println("-->" + p.toAbsolutePath());
Files.walkFileTree(p, fv);
if (foundFiles.get() == 0) {
fail("Could not find " + filename);
}
if (foundFiles.get() > 1) {
fail("Found " + filename + " more than once, stopping");
}
}

protected void testReplaceRuleReplacements(Language lang) throws IOException {
JLanguageTool lt = new JLanguageTool(lang);
SpellingCheckRule spellRule = lang.getDefaultSpellingRule();
Expand Down

0 comments on commit 204ba77

Please sign in to comment.