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(Output is not sent to console nor to file)
icon5.gif  Problem when launching configuration from JUnit Plug-in Test [message #530599] 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:***Urgent***Need a separator to objectContribution
Next Topic:Problem when launching configuration from JUnit Plug-in Test
Goto Forum:
  


Current Time: Sat Oct 25 07:57:45 GMT 2014

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

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