Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312612 - Tests for the Equinox console
Summary: Tests for the Equinox console
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-12 09:24 EDT by Lazar Kirchev CLA
Modified: 2011-04-05 07:10 EDT (History)
1 user (show)

See Also:


Attachments
Tests for Equinox console (28.47 KB, patch)
2010-05-12 09:25 EDT, Lazar Kirchev CLA
no flags Details | Diff
updated patch (23.60 KB, patch)
2011-03-24 16:05 EDT, Thomas Watson CLA
no flags Details | Diff
Updated patch (27.88 KB, patch)
2011-03-25 08:31 EDT, Lazar Kirchev CLA
tjwatson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.