Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Problem when launching configuration from JUnit Plug-in Test
Problem when launching configuration from JUnit Plug-in Test [message #605697] Fri, 30 April 2010 09:53
Agata Vackova is currently offline Agata Vackova
Messages: 18
Registered: July 2009
Junior Member
Hello,
in our plug-in we have a class, that extends org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDel egate. My problem is that in my JUnit Plug-in Test nothing is sent to console. I've also tried to capture the output to the file, but file is not created.
My original code:
LaunchConfigGenerator lcg = new LaunchConfigGenerator();
ILaunchConfigurationWorkingCopy configuration = lcg.getLaunchConfiguration(
graph , CLOVER_LAUNCH_CONFIG_TYPE).getWorkingCopy();
ETLGraphLaunchConfigurationDelegate launch = new ETLGraphLaunchConfigurationDelegate();
launch.launch(configuration, ILaunchManager.RUN_MODE,
new Launch(configuration, ILaunchManager.RUN_MODE, null),
new NullProgressMonitor());
The process is executed successfully. (I can check it as it produces some output files), but when I try the get IOConsole it is always null:
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IViewReference[] view = window.getActivePage().getViewReferences();
ConsoleView consoleView = null;
for (int i = 0; i < view.length; i++) {
if (view[i].getId().equals("org.eclipse.ui.console.ConsoleView ")) {
consoleView = (ConsoleView)view[i].getView(true);
break;
}
}
IOConsole console = null;
console = (IOConsole) consoleView.getConsole();
When I debug the test, console view has always title "No consoles to display at this time".
I've tried to set configuration parameters to capture the output: configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN _CONSOLE, (String)null);
configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN _FILE,
(new File("output/test.grf.output.txt")).getAbsolutePath());
configuration.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_ BACKGROUND, false);
but the result is always the same: IOconsole is null.
What do I need to do, the process output would be sent to console?
Previous Topic:Problem when launching configuration from JUnit Plug-in Test
Next Topic:Javadoc attachment, org.eclipse.pde.core.javadoc, and zip
Goto Forum:
  


Current Time: Sat Oct 25 16:58:54 GMT 2014

Powered by FUDForum. Page generated in 0.01817 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software