Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312612

Summary: Tests for the Equinox console
Product: [Eclipse Project] Equinox Reporter: Lazar Kirchev <l.kirchev>
Component: FrameworkAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: tjwatson
Version: 3.5   
Target Milestone: 3.7 M7   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Tests for Equinox console
none
updated patch
none
Updated patch tjwatson: iplog+

Description Lazar Kirchev CLA 2010-05-12 09:24:53 EDT
Build Identifier: 3.5.2

Since currently we are working on separating the console from the Equinox framework, we found that there are no tests for the console. We have written several tests in the org.eclipse.osgi.tests project. They are attached as a patch.

The tests are three - TestCommandExecution, TestEquinoxStartWithConsole, TestFrameworkCommandInterpreter, and are in the package org.eclipse.osgi.tests.console

TestCommandExecution tests the whole scanario of executing a shell command - installing a bundle, which provides the command, creating a ConsoleSession, through which the command is sent for execution, and the output is read. Both simple command and a command, which internally executes another command, are tested. 

TestEquinoxStartWithConsole tests if the console is started when the framework starts (the -console option is passed with and without a port).

TestFrameworkCommandInterpreter directly tests the execute() and nextArgument() methods of the FrameworkCommandInterpreter class.



Reproducible: Always
Comment 1 Lazar Kirchev CLA 2010-05-12 09:25:45 EDT
Created attachment 168138 [details]
Tests for Equinox console
Comment 2 Thomas Watson CLA 2011-03-24 16:05:16 EDT
Created attachment 191858 [details]
updated patch

Updated patch to run on J2SE 1.4.  I also removed the test src/org/eclipse/osgi/tests/console/ConvertersTest.java since that was testing the OSGi RFC 147 stuff that is not available in the framework console.

Lazar, could you update the new java classes with the appropriate copyright headers that includes SAP as the initial contributor.

Thanks, and sorry for taking so long to look at these tests.  After you update the headers we should think about adding tests for the new single help command stuff you contributed.
Comment 3 Thomas Watson CLA 2011-03-24 16:06:13 EDT
I also reduced the timeout of the tests to 1000 ms.  Not sure if that is too short, but 10000 ms was way to long for me ;-)
Comment 4 Lazar Kirchev CLA 2011-03-25 08:31:26 EDT
Created attachment 191905 [details]
Updated patch

Thanks Tom. 

I added the copyright information to the new files.
I will write tests for the new functionality. I think I should add also a test for the restriction of the telnet access on a particular address of the host we added some time ago. And also for the new property to disable the console.
Comment 5 Thomas Watson CLA 2011-03-25 09:24:15 EDT
(In reply to comment #4)
> Created attachment 191905 [details]
> Updated patch
> 
> Thanks Tom. 
> 
> I added the copyright information to the new files.
> I will write tests for the new functionality. I think I should add also a test
> for the restriction of the telnet access on a particular address of the host we
> added some time ago. And also for the new property to disable the console.

I released the patch, thank you!

Open up a new bug for additional tests when you have them.  Thanks, much appreciated.
Comment 6 Lazar Kirchev CLA 2011-04-05 07:10:47 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > Created attachment 191905 [details] [details]
> > Updated patch
> > 
> > Thanks Tom. 
> > 
> > I added the copyright information to the new files.
> > I will write tests for the new functionality. I think I should add also a test
> > for the restriction of the telnet access on a particular address of the host we
> > added some time ago. And also for the new property to disable the console.
> 
> I released the patch, thank you!
> 
> Open up a new bug for additional tests when you have them.  Thanks, much
> appreciated.

I opened a new bug 341887 for these tests and provided a patch.