remove spam from console

This commit is contained in:
Alexey Kudravtsev
2018-11-22 18:15:08 +03:00
parent 1e667080e9
commit 612d44e162
21 changed files with 49 additions and 49 deletions
@@ -81,6 +81,6 @@ public class RefreshOutputDirectoriesTest extends BaseCompilerTestCase {
VirtualFile outputDir = LocalFileSystem.getInstance().findFileByIoFile(dir);
assertNotNull("output directory wasn't refreshed: " + dir.getAbsolutePath(), outputDir);
}
System.out.println("myRootsChangedCount = " + myRootsChangedCount);
LOG.debug("myRootsChangedCount = " + myRootsChangedCount);
}
}
@@ -205,7 +205,6 @@ public class BytecodeAnalysisIntegrationTest extends LightCodeInsightFixtureTest
assertEmpty(diffs);
}
@SuppressWarnings("unused")
public void _testExportInferredAnnotations() {
PsiPackage rootPackage = JavaPsiFacade.getInstance(getProject()).findPackage("");
assertNotNull(rootPackage);
@@ -80,7 +80,7 @@ class FileTemplatesTest extends IdeaTestCase {
properties.load(propFile, FileTemplate.ourEncoding)
properties.put(FileTemplateManager.PROJECT_NAME_VARIABLE, getProject().getName())
System.out.println(resultFile.getName())
LOG.debug(resultFile.getName())
doTestTemplate(inputText, properties, outputText)
}
}
@@ -551,7 +551,7 @@ public class JavaStubBuilderTest extends LightIdeaTestCase {
" FIELD:PsiFieldStub[BIG:BigInteger=;INITIALIZER_NOT_STORED;]\n" +
" MODIFIER_LIST:PsiModifierListStub[mask=0]\n",
DebugUtil.stubTreeToString(tree));
System.out.println("SOE depth=" + i + ", time=" + t + "ms");
LOG.debug("SOE depth=" + i + ", time=" + t + "ms");
}
public void testPerformance() throws IOException {
@@ -81,9 +81,9 @@ public class MiscPsiTest extends LightCodeInsightFixtureTestCase {
fileCopy = (PsiFile) fileCopy.setName("NewTest.xxx");
PsiFile newFile = (PsiFile)dir.add(fileCopy);
if (!(newFile instanceof PsiBinaryFile)) {
System.out.println(newFile.getVirtualFile().getFileType());
System.out.println(newFile.getFileType());
System.out.println(newFile.getText());
System.err.println(newFile.getVirtualFile().getFileType());
System.err.println(newFile.getFileType());
System.err.println(newFile.getText());
}
assertInstanceOf(newFile, PsiBinaryFile.class);
@@ -58,7 +58,7 @@ public class PsiConcurrencyStressTest extends DaemonAnalyzerTestCase {
DaemonProgressIndicator.setDebug(false);
int numOfThreads = Runtime.getRuntime().availableProcessors();
int iterations = Timings.adjustAccordingToMySpeed(20, true);
System.out.println("iterations = " + iterations);
LOG.debug("iterations = " + iterations);
final int readIterations = iterations * 3;
synchronized (this) {
@@ -48,25 +48,25 @@ public class ResolvePerformanceTest extends ResolveTestCase {
visitElement(expression);
}
});
System.out.println();
System.out.println("Found " + references.size() + " references");
LOG.debug("");
LOG.debug("Found " + references.size() + " references");
long time = System.currentTimeMillis();
// Not cached pass
resolveAllReferences(references);
System.out.println("Not cached resolve: " + (System.currentTimeMillis() - time)/(double)1000 + "s");
LOG.debug("Not cached resolve: " + (System.currentTimeMillis() - time)/(double)1000 + "s");
ApplicationManager.getApplication().runWriteAction(() -> ResolveCache.getInstance(myProject).clearCache(true));
time = System.currentTimeMillis();
// Cached pass
resolveAllReferences(references);
System.out.println("Not cached resolve with cached repository: " + (System.currentTimeMillis() - time)/(double)1000 + "s");
LOG.debug("Not cached resolve with cached repository: " + (System.currentTimeMillis() - time)/(double)1000 + "s");
time = System.currentTimeMillis();
// Cached pass
resolveAllReferences(references);
System.out.println("Cached resolve: " + (System.currentTimeMillis() - time)/(double)1000 + "s");
LOG.debug("Cached resolve: " + (System.currentTimeMillis() - time)/(double)1000 + "s");
}
public void testPerformance2() throws Exception{
@@ -92,8 +92,8 @@ public class ResolvePerformanceTest extends ResolveTestCase {
}
});
System.out.println();
System.out.println("Found " + references.size() + " references");
LOG.debug("");
LOG.debug("Found " + references.size() + " references");
resolveAllReferences(references);
}
@@ -763,7 +763,7 @@ public class TypeCookTest extends MultiFileTestCase {
writer.print(itemRepr);
}
System.out.println("Pattern not found, file " + patternName + " created.");
System.err.println("Pattern not found, file " + patternName + " created.");
LocalFileSystem.getInstance().refreshAndFindFileByIoFile(patternFile);
}
@@ -514,7 +514,7 @@ public class SmartPsiElementPointersTest extends CodeInsightTestCase {
//System.out.println("file = " + file);
}
else {
System.out.println("already loaded file = " + file);
LOG.debug("already loaded file = " + file);
}
}
}
@@ -39,7 +39,7 @@ public class ScopeConfigurableTest extends CodeInsightTestCase {
manager.addScope(utilscope);
try {
for (NamedScope scope : manager.getScopes()) {
System.out.println("scope = " + scope);
LOG.debug("scope = " + scope);
ScopeConfigurable configurable = new ScopeConfigurable(scope, true, getProject(), null);
configurable.reset();
assertFalse("Configurable " + configurable + " is modified immediately after creation", configurable.isModified());
@@ -176,7 +176,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase {
writer.print(report);
}
System.out.println("Pattern not found, file " + patternName + " created.");
System.err.println("Pattern not found, file " + patternName + " created.");
LocalFileSystem.getInstance().refreshAndFindFileByIoFile(patternFile);
}
@@ -735,7 +735,7 @@ public class ApplicationImplTest extends LightPlatformTestCase {
app.runReadAction(EmptyRunnable.getInstance());
assertFalse(writeCompleted.get());
if (exception != null) throw new RuntimeException(exception);
System.out.println(ThreadDumper.dumpThreadsToString());
System.err.println(ThreadDumper.dumpThreadsToString());
fail("Must have been failed");
}
catch (ApplicationUtil.CannotRunReadActionException ignored) {
@@ -184,7 +184,7 @@ public abstract class EditorPaintingTestCase extends AbstractEditorTest {
File fileWithExpectedResult = getTestDataFile(getTestDataPath(), expectedResultFileName);
if (OVERWRITE_TESTDATA) {
ImageIO.write(image, "png", fileWithExpectedResult);
System.out.println("File " + fileWithExpectedResult.getPath() + " created.");
System.err.println("File " + fileWithExpectedResult.getPath() + " created.");
}
if (fileWithExpectedResult.exists()) {
BufferedImage expectedResult = ImageIO.read(fileWithExpectedResult);
@@ -83,7 +83,7 @@ public class FoldingStressTest extends LightPlatformTestCase {
}
public void testRestoreManyFoldRegionsPerformance() {
System.out.println("In stress test: " + ApplicationInfoImpl.isInStressTest());
LOG.debug("In stress test: " + ApplicationInfoImpl.isInStressTest());
int N = 100_000;
DocumentImpl doc = new DocumentImpl(StringUtil.repeat("x", N));
Editor editor = EditorFactory.getInstance().createEditor(doc);
@@ -94,7 +94,7 @@ public class FoldingStressTest extends LightPlatformTestCase {
for (int i = 0; i < N; i++) {
addAndCollapseFoldRegion(model, i, i+1, "/*...*/");
}
System.out.println((System.nanoTime() - t) / 1000000); // temporary code to investigate test blinking
LOG.debug(""+(System.nanoTime() - t) / 1000000); // temporary code to investigate test blinking
}))
.setup(()-> model.runBatchFoldingOperation(model::clearFoldRegions))
.assertTiming();
@@ -810,7 +810,7 @@ public class RangeMarkerTest extends LightPlatformTestCase {
public void testRandomStressEdit_NoCommand() {
final Random gen = new Random();
int N_TRIES = Timings.adjustAccordingToMySpeed(7000, false);
System.out.println("N_TRIES = " + N_TRIES);
LOG.debug("N_TRIES = " + N_TRIES);
DocumentEx document = null;
final int N = 100;
for (int tryn = 0; tryn < N_TRIES; tryn++) {
@@ -322,7 +322,8 @@ public class FileTypesTest extends PlatformTestCase {
}
private static void log(String message) {
System.out.println(message);
LOG.debug(message);
//System.out.println(message);
}
private void ensureRedetected(VirtualFile vFile, Set<VirtualFile> detectorCalled) {
@@ -707,8 +708,7 @@ public class FileTypesTest extends PlatformTestCase {
//ra.setLength(ra.length()+(isText ? 1 : -1));
//ra.close();
//LocalFileSystem.getInstance().refreshFiles(Collections.singletonList(virtualFile));
System.out
.println(i + "; f = " + f.length() + "; virtualFile=" + virtualFile.getLength() + "; type=" + virtualFile.getFileType());
LOG.debug(i + "; f = " + f.length() + "; virtualFile=" + virtualFile.getLength() + "; type=" + virtualFile.getFileType());
//Thread.sleep(random.nextInt(100));
}
}
@@ -744,7 +744,7 @@ public class FileTypesTest extends PlatformTestCase {
for (int i = 0; i < N; i++) {
ApplicationManager.getApplication().runReadAction(() -> {
String text = psiFile.getText();
System.out.println("text = " + text.length());
LOG.debug("text = " + text.length());
//if (!virtualFile.getFileType().isBinary()) {
// LoadTextUtil.loadText(virtualFile);
//}
@@ -753,7 +753,7 @@ public class FileTypesTest extends PlatformTestCase {
try {
FileUtil.appendToFile(f, StringUtil.repeatSymbol(' ', 50));
LocalFileSystem.getInstance().refreshFiles(Collections.singletonList(virtualFile));
System.out.println("f = " + f.length()+"; virtualFile="+virtualFile.getLength()+"; psiFile="+psiFile.isValid()+"; type="+virtualFile.getFileType());
LOG.debug("f = " + f.length()+"; virtualFile="+virtualFile.getLength()+"; psiFile="+psiFile.isValid()+"; type="+virtualFile.getFileType());
}
catch (IOException e) {
throw new RuntimeException(e);
@@ -115,7 +115,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase {
alarm.cancelAllRequests();
}, "", false, getProject(), null, "");
long averageDelay = ArrayUtil.averageAmongMedians(times.toNativeArray(), 5);
System.out.println("averageDelay = " + averageDelay);
LOG.debug("averageDelay = " + averageDelay);
assertTrue(averageDelay < CoreProgressManager.CHECK_CANCELED_DELAY_MILLIS *3);
}
@@ -123,7 +123,7 @@ public class UrlClassLoaderTest {
assertNotNull(findResource(loader, name, random.nextBoolean()));
}
catch (Throwable e) {
System.out.println("Failed loading " + name);
System.err.println("Failed loading " + name);
throw new RuntimeException(e);
}
}
@@ -40,7 +40,7 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
protected void setUp() throws Exception {
long start = System.currentTimeMillis();
super.setUp();
System.out.println("setUp took " + (System.currentTimeMillis() - start) + " ms");
LOG.debug("setUp took " + (System.currentTimeMillis() - start) + " ms");
}
public void testLargeTextFileWithManyTypos() {
@@ -49,17 +49,17 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
long start = System.currentTimeMillis();
VirtualFile file = myFixture.addFileToProject("foo.txt", text).getVirtualFile();
System.out.println("creation took " + (System.currentTimeMillis() - start) + " ms");
LOG.debug("creation took " + (System.currentTimeMillis() - start) + " ms");
start = System.currentTimeMillis();
myFixture.configureFromExistingVirtualFile(file);
System.out.println("configure took " + (System.currentTimeMillis() - start) + " ms");
LOG.debug("configure took " + (System.currentTimeMillis() - start) + " ms");
myFixture.enableInspections(getInspectionTools());
start = System.currentTimeMillis();
assertSize(typoCount, runLocalInspections());
System.out.println("warm-up took " + (System.currentTimeMillis() - start) + " ms");
LOG.debug("warm-up took " + (System.currentTimeMillis() - start) + " ms");
PlatformTestUtil.startPerformanceTest("many typos highlighting", 12_000, () -> {
DaemonCodeAnalyzer.getInstance(getProject()).restart();
@@ -73,16 +73,16 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
long start = System.currentTimeMillis();
VirtualFile file = myFixture.addFileToProject("foo.java", text).getVirtualFile();
System.out.println("creation took " + (System.currentTimeMillis() - start) + " ms");
LOG.debug("creation took " + (System.currentTimeMillis() - start) + " ms");
start = System.currentTimeMillis();
myFixture.configureFromExistingVirtualFile(file);
System.out.println("configure took " + (System.currentTimeMillis() - start) + " ms");
LOG.debug("configure took " + (System.currentTimeMillis() - start) + " ms");
start = System.currentTimeMillis();
List<HighlightInfo> infos = runLocalInspections();
assertEmpty(infos);
System.out.println("warm-up took " + (System.currentTimeMillis() - start) + " ms");
LOG.debug("warm-up took " + (System.currentTimeMillis() - start) + " ms");
PlatformTestUtil.startPerformanceTest("many whitespaces highlighting", 4500, () -> {
DaemonCodeAnalyzer.getInstance(getProject()).restart();
@@ -129,8 +129,9 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
PlatformTestUtil.startPerformanceTest("long word for spelling", expectedTime, () -> {
try{
splitter.split(text, TextRange.allOf(text), (textRange) -> {});
}catch(ProcessCanceledException pce){
System.out.println("pce is thrown");
}
catch(ProcessCanceledException pce){
System.err.println("pce is thrown");
}
}).attempts(1).assertTiming();
}
@@ -230,8 +230,8 @@ public class XmlFormatterTest extends XmlFormatterTestBase {
long memoryAfter = currentFreeMemory();
long timeAfter = System.currentTimeMillis();
System.out.println("\nMEMORY: " + (memoryAfter - memoryBefore));
System.out.println("\nTIME: " + (timeAfter - timeBefore));
LOG.debug("\nMEMORY: " + (memoryAfter - memoryBefore));
LOG.debug("\nTIME: " + (timeAfter - timeBefore));
}
private void doWrapAlways(String resultNumber, boolean align, int rightMargin) throws Exception {
@@ -197,7 +197,7 @@ public class XmlParsingTest extends ParsingTestCase {
lexer.advance();
count++;
}
System.out.println("Plain lexing took " + (System.currentTimeMillis() - time) + "ms lexems count:" + count);
LOG.debug("Plain lexing took " + (System.currentTimeMillis() - time) + "ms lexems count:" + count);
}
private static void transformAllChildren(final ASTNode file) {
@@ -211,7 +211,7 @@ public class XmlParsingTest extends ParsingTestCase {
long time = System.currentTimeMillis();
final PsiFile file = createFile("test.xml", text);
transformAllChildren(file.getNode());
System.out.println("Old parsing took " + (System.currentTimeMillis() - time) + "ms");
LOG.debug("Old parsing took " + (System.currentTimeMillis() - time) + "ms");
int index = 0;
while (index++ < 10) {
newParsing(text);
@@ -222,7 +222,7 @@ public class XmlParsingTest extends ParsingTestCase {
index++;
}
while ((firstLeaf = TreeUtil.nextLeaf(firstLeaf, null)) != null);
System.out.println("For " + index + " lexems");
LOG.debug("For " + index + " lexems");
}
public void _testReparsePerformance() throws Exception {
@@ -240,7 +240,7 @@ public class XmlParsingTest extends ParsingTestCase {
final long tm = System.currentTimeMillis();
doc.insertString(0, "<additional root=\"tag\"/>");
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
System.out.println("Reparsed for: " + (System.currentTimeMillis() - tm));
LOG.debug("Reparsed for: " + (System.currentTimeMillis() - tm));
}
}).useLegacyScaling().assertTiming());
}
@@ -250,7 +250,7 @@ public class XmlParsingTest extends ParsingTestCase {
long time = System.currentTimeMillis();
final PsiFile file = createFile("test.xml", text);
transformAllChildren(file.getNode());
System.out.println("Old parsing took " + (System.currentTimeMillis() - time) + "ms");
LOG.debug("Old parsing took " + (System.currentTimeMillis() - time) + "ms");
int index = 0;
while (index++ < 10) {
newParsing(text);
@@ -261,7 +261,7 @@ public class XmlParsingTest extends ParsingTestCase {
index++;
}
while ((firstLeaf = TreeUtil.nextLeaf(firstLeaf, null)) != null);
System.out.println("For " + index + " lexems");
LOG.debug("For " + index + " lexems");
}
private static void newParsing(final String text) {
@@ -269,7 +269,7 @@ public class XmlParsingTest extends ParsingTestCase {
ASTFactory.lazy(XmlElementType.XML_FILE, text).getFirstChildNode(); // ensure parsed
System.out.println("parsed for " + (System.currentTimeMillis() - time) + "ms");
LOG.debug("parsed for " + (System.currentTimeMillis() - time) + "ms");
}
public void testXmlDecl() throws Exception {