diff --git a/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java b/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java index c94b71966ad3..f96692d3744f 100644 --- a/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java +++ b/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,12 +69,6 @@ import java.util.StringTokenizer; public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCase { protected DebuggerSession myDebuggerSession; - private StringBuffer myConsoleBuffer; - - @Override - protected void setUp() throws Exception { - super.setUp(); - } @Override protected void initApplication() throws Exception { @@ -97,11 +91,6 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas assertNull(DebuggerManagerEx.getInstanceEx(myProject).getDebugProcess(getDebugProcess().getProcessHandler())); myDebuggerSession = null; } - if(myConsoleBuffer != null) { - //println("", b); - //println("Console output:", b); - //println(myConsoleBuffer.toString(), b); - } checkTestOutput(); } @@ -121,7 +110,6 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas @Override protected void tearDown() throws Exception { FileEditorManagerEx.getInstanceEx(getProject()).closeAllFiles(); - myConsoleBuffer = null; super.tearDown(); } @@ -180,12 +168,9 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas }, ModalityState.defaultModalityState()); myDebugProcess = myDebuggerSession.getProcess(); - //myConsoleBuffer = new StringBuffer(); - myDebugProcess.addProcessListener(new ProcessAdapter() { @Override public void onTextAvailable(ProcessEvent event, Key outputType) { - //myConsoleBuffer.append(event.getText()); print(event.getText(), outputType); } }); @@ -330,6 +315,7 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas @Override public PsiFile compute() { PsiClass psiClass = JavaPsiFacade.getInstance(myProject).findClass(className, GlobalSearchScope.allScope(myProject)); + assertNotNull(psiClass); return psiClass.getContainingFile(); } }); @@ -339,10 +325,9 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas protected EvaluationContextImpl createEvaluationContext(final SuspendContextImpl suspendContext) { try { - return new EvaluationContextImpl( - suspendContext, - suspendContext.getFrameProxy(), - suspendContext.getFrameProxy().thisObject()); + StackFrameProxyImpl proxy = suspendContext.getFrameProxy(); + assertNotNull(proxy); + return new EvaluationContextImpl(suspendContext, proxy, proxy.thisObject()); } catch (EvaluateException e) { error(e); @@ -440,6 +425,7 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas public void run() { BreakpointManager breakpointManager = DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager(); PsiClass psiClass = JavaPsiFacade.getInstance(myProject).findClass("HelloWorld", GlobalSearchScope.allScope(myProject)); + assertNotNull(psiClass); Document document = PsiDocumentManager.getInstance(myProject).getDocument(psiClass.getContainingFile()); breakpointManager.addLineBreakpoint(document, 3); } @@ -481,33 +467,31 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas @Override @NotNull public Module[] getModules() { - return Module.EMPTY_ARRAY; //To change body of implemented methods use File | Settings | File Templates. + return Module.EMPTY_ARRAY; } @Override public Icon getIcon() { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } @Override public ConfigurationFactory getFactory() { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } @Override - public void setName(final String name) { - //To change body of implemented methods use File | Settings | File Templates. - } + public void setName(String name) { } @NotNull @Override public SettingsEditor getConfigurationEditor() { - return null; //To change body of implemented methods use File | Settings | File Templates. + throw new UnsupportedOperationException(); } @Override public Project getProject() { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } @Override @@ -517,18 +501,18 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas } @Override - public ConfigurationPerRunnerSettings createRunnerSettings(final ConfigurationInfoProvider provider) { - return null; //To change body of implemented methods use File | Settings | File Templates. + public ConfigurationPerRunnerSettings createRunnerSettings(ConfigurationInfoProvider provider) { + return null; } @Override - public SettingsEditor getRunnerSettingsEditor(final ProgramRunner runner) { - return null; //To change body of implemented methods use File | Settings | File Templates. + public SettingsEditor getRunnerSettingsEditor(ProgramRunner runner) { + return null; } @Override public RunConfiguration clone() { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } @Override @@ -537,28 +521,22 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas } @Override - public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException { - return null; //To change body of implemented methods use File | Settings | File Templates. + public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) throws ExecutionException { + return null; } @Override public String getName() { - return ""; //To change body of implemented methods use File | Settings | File Templates. + return ""; } @Override - public void checkConfiguration() throws RuntimeConfigurationException { - //To change body of implemented methods use File | Settings | File Templates. - } + public void checkConfiguration() throws RuntimeConfigurationException { } @Override - public void readExternal(final Element element) throws InvalidDataException { - //To change body of implemented methods use File | Settings | File Templates. - } + public void readExternal(Element element) throws InvalidDataException { } @Override - public void writeExternal(final Element element) throws WriteExternalException { - //To change body of implemented methods use File | Settings | File Templates. - } + public void writeExternal(Element element) throws WriteExternalException { } } }