mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
bug 342640: Ability to create build console dynamically
This commit is contained in:
parent
87ae09ee72
commit
54747c3d22
1 changed files with 21 additions and 0 deletions
|
@ -20,6 +20,7 @@ import org.eclipse.jface.text.IDocument;
|
|||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.ui.console.ConsolePlugin;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.resources.IConsole;
|
||||
import org.eclipse.cdt.core.testplugin.ResourceHelper;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
@ -126,4 +127,24 @@ public class BuildConsoleTests extends BaseUITestCase {
|
|||
}
|
||||
assertTrue("Global CDT Console is not found", isConsoleFound);
|
||||
}
|
||||
|
||||
public void testDynamicBuildConsole() throws IOException, CoreException {
|
||||
String id = this.getName();
|
||||
String consoleName = "Test " + this.getName();
|
||||
IConsole testConsole = CCorePlugin.getDefault().getBuildConsole(id, consoleName, null);
|
||||
assertNotNull(testConsole);
|
||||
|
||||
// the console view
|
||||
org.eclipse.ui.console.IConsole[] consoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
|
||||
org.eclipse.ui.console.IConsole uiConsole=null;
|
||||
for (org.eclipse.ui.console.IConsole console : consoles) {
|
||||
boolean isConsoleFound = console.getName().equals(consoleName);
|
||||
if (isConsoleFound) {
|
||||
uiConsole = console;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assertNotNull("Build Console is not found", uiConsole);
|
||||
assertTrue(uiConsole instanceof BuildConsole);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue