Community
Participate
Working Groups
Double-clicking the index.html in org.eclipse.rap.rwt.q07.jstest leads to an error after some tests are executed: Always run tests from an http-server! Am I really supposed to run the JavaScript tests from an HTTP server? If so, could someone tell how this could be done easiest.
I will share my setup: 1. Apache HTTP Server 2.2.17 installed on Windows 7 2. Add two aliases in Apache config file (httpd.conf) like: # # RAP JavaScript tests runner # Alias /org.eclipse.rap.rwt.q07.jstest "E:/Workspace/org.eclipse.rap.rwt.q07.jstest" <Directory "E:/Workspace/org.eclipse.rap.rwt.q07.jstest"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> Alias /org.eclipse.rap.rwt.q07 "E:/Workspace/org.eclipse.rap.rwt.q07" <Directory "E:/Workspace/org.eclipse.rap.rwt.q07"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> 3. Run the tests from http://127.0.0.1:8081/org.eclipse.rap.rwt.q07.jstest (my apache port is set to 8081 in the same cofig file)
We had issues in the past with tests failing in ceratin browser (i think webkit) when tests are run from the file-system.
If you only want to run certain tests, use the ?filer=XXXX syntax, then you can omit the filesystem-check.
e.g. http://127.0.0.1/Workspaces/WS_RAP/org.eclipse.rap.rwt.q07.jstest/index.html?filter=Button
Thanks for the tips. I need to run all of the tests as I changed just something and I don't know which tests could possibly affected. The apache http server setup looks "scary" to me. Sloppy said: "I am not in the mood to install and setup an HTTP server just to be able to once run some tests" The effort outweighs the benefit by far. Wouldn't it be way more inviting for adopters to press just one button to run te tests? If we assume that Jetty is around anyway, we could use Jetty to deliver the files. What do you think?
I would not say that the "effort outweighs the benefit by far", but using jetty is a neat idea.
(In reply to comment #6) > I would not say that the "effort outweighs the benefit by far", but using jetty > is a neat idea. RAP has always tried hard to be as easy to consume as possible, for framework-developers and for application-developers. For framework-developers this would mean: * get the suitable Eclipse Tooling * set up the target platform properly (this step could be improved) * check out the artefacts from the source code repository and you are done Having to install additional software breaks RAP's ease of use and may even tempt others to add even more dependencies. Thus using Jetty isn't just a neat idea but a must to keep the project on the right track on the long run.
There are some JavaScript tests that can produce false negatives when run from the file system (meaning that the tests succeed despite of problems). Therefore I think there's no alternative to running the tests from a server. I agree that we should definitely provide tooling support that lets developers run the tests from inside the IDE. This tooling should start a server internally and open the test suite in an internal browser.
Created attachment 191428 [details] Version 1 The patch provides support for java script tests. * Registers all needed resources of bundle 'org.eclipse.rap.rwt.q07.jstest' under the alias 'org.eclipse.rap.rwt.q07.jstest' and from bundle 'org.eclipse.rap.rwt.q07' under the alias 'org.eclipse.rap.rwt.q07'. * To execute the tests start the provided launch configuration and go to 'http://127.0.0.1:8081/org.eclipse.rap.rwt.q07.jstest/index.html' in your browser. * If you want to change the port open the 'Jetty Configurator' launch configuration and edit the VM argument 'Dorg.osgi.service.http.port'.
I forgot to mention that I didn't found a easy way to open the browser automatically. Therefore, for the first time we have to open the browser manually. Ideas are welcome.
(In reply to comment #10) > I forgot to mention that I didn't found a easy way to open the browser > automatically. Therefore, for the first time we have to open the browser > manually. Ideas are welcome. Could something like this be the way to go? Runtime.exec( "/path/to/org.eclipse.rap.rwt.q07.jstest/index.html" );
(In reply to comment #11) > Could something like this be the way to go? > Runtime.exec( "/path/to/org.eclipse.rap.rwt.q07.jstest/index.html" ); I also was looking at something like your suggestion but it is very OS specific what happens when you execute such a command. E.g under Windows following works but only if you have set a browser as the default application for HTML files: Runtime.getRuntime().exec( "cmd /c start C:/path/to/org.eclipse.rap.rwt.q07.jstest/index.html" ); I also think that we have to use Runtime.exec and implement OS specific solutions for Windows/Linux and Mac. It isn't complicated and I don't see other ways to do it.
Created attachment 192822 [details] Version 2 This patch prints additionally into the console the URL which can be used to start the JS tests. Browser isn't opened automatically. After some discussions with Rüdiger and Ralf we decided to not implement the browser activation because the implementation will be a little bit tricky.
I reviewed the changes together with Beyhan. After a little refactoring we applied the changes to CVS HEAD.