Jump to: navigation, search

Difference between revisions of "EDT:Running Tests"

(egl.rest)
(thirdparty.stateful)
 
(20 intermediate revisions by the same user not shown)
Line 27: Line 27:
  
 
===thirdparty.stateful ===
 
===thirdparty.stateful ===
???
+
This test suite is incomplete and should not be run
  
 
== org.eclipse.edt.tests.services ==
 
== org.eclipse.edt.tests.services ==
Line 40: Line 40:
 
*Add the project "egl.rest" to the java build path of the newly generated project egl.rest.eunit.javascriptasync
 
*Add the project "egl.rest" to the java build path of the newly generated project egl.rest.eunit.javascriptasync
 
*Open the file name RunAllTests_rui.egl in the EGL Rick UI Editor.
 
*Open the file name RunAllTests_rui.egl in the EGL Rick UI Editor.
*To test the dedicated services:
+
**To test the dedicated services:
**Click on the preview tab to run the test suite.
+
***Click on the preview tab to run the test suite.
**View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)
+
***View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)
*To test the non-deployed services:
+
**To test the non-deployed services:
**In the Source pane, change the line: TestListMgr.bindingType = ServiceBindingType.DEDICATED; to:  TestListMgr.bindingType = ServiceBindingType.DEVELOP;
+
***In the Source pane, change the line: TestListMgr.bindingType = ServiceBindingType.DEDICATED; to:  TestListMgr.bindingType = ServiceBindingType.DEVELOP;
**Click on the preview tab to run the test suite.
+
***Click on the preview tab to run the test suite.
**View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)
+
***View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)
 +
**To test deployed services in a non-deployed RUI:
 +
***In the Source pane, make sure the binding type is set to DEPLOYED (TestListMgr.bindingType = ServiceBindingType.DEPLOYED)
 +
***Deploy the egl_restTgt.egldd file to a projet named egl.rest.tgt (use tomcat as the server)
 +
***Click on the preview tab to run the test suite.
 +
***View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)
  
  
*To test deployed services in a non-deployed RUI:
+
*To test deployed services in a deployed RUI:
 
**Make sure the binding type in RunAllTests_rui.egl is set to DEPLOYED (TestListMgr.bindingType = ServiceBindingType.DEPLOYED)
 
**Make sure the binding type in RunAllTests_rui.egl is set to DEPLOYED (TestListMgr.bindingType = ServiceBindingType.DEPLOYED)
 
**Deploy the egl_restTgt.egldd file to a projet named egl.rest.tgt (use tomcat as the server)
 
**Deploy the egl_restTgt.egldd file to a projet named egl.rest.tgt (use tomcat as the server)
**
+
**Deploy the egl_rest_eunut_javascriptasync.egldd file to egl.rest.tgt
 +
**Launch the RunAllTests_rui.html file on the server, this will run the test suite
 +
**View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)
 +
 
 +
 
 +
===chattygabby===
 +
*Load the chattygabby project from the containing project
 +
*Run the tests from non-deployed RUI
 +
**Open the ui.MainView.egl file in the EGL Rich UI editor
 +
**Open the preview pane and press the Request button.
 +
**Data should be returned to the message log area
 +
*Run the tests from a deployed RUI
 +
**Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
 +
**Launch the MainView.html file in the tomcat server
 +
**Press the Request button
 +
**Data should be returned to the message log area
 +
 
 +
===Colleges===
 +
*Load the Colleges project from the containing project.
 +
*Run the tests from non-deployed RUI
 +
**Open the client.handlers.Colleges.egl file in the EGL Rich UI editor
 +
**Open the previw pane
 +
**Run the test by using the List, Get, Add, Update, Delete features of the rui
 +
*Run the tests from a deployed RUI
 +
**Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
 +
**Launch the Colleges.html file in the tomcat server
 +
**Run the test by using the List, Get, Add, Update, Delete features of the rui
 +
 
 +
===CurrencyConverter===
 +
*Load the CurrencyConverter project from the containing project
 +
*Run the tests from a non-deployed RUI
 +
**Open the client.handlers.CurrencyConvertorHandler file in the EGL Rich UI editor
 +
**Open the preview pane
 +
**Run the test by selecting different currencies and clicking the invoke service button
 +
*Run the tests from a deployed RUI
 +
**Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
 +
**Launch the CurrencyConvertorHandler.html file in the tomcat server
 +
**Run the test by selecting different currencies and clicking the invoke service button
 +
 
 +
===GeoNames===
 +
*Load the GeoNames project from the containing project
 +
*Run the tests from a non-deployed RUI
 +
**Open the client.handler.GeoName.egl file in the EGL Rich UI editor
 +
**Open the preview pane
 +
**Run the test by invoking the service for JSON and  XML
 +
**Data should be displayed in the Results panel
 +
*Run the tests from a deployed RUI
 +
**Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
 +
**Launch the GeoName.html file in the tomcat server
 +
**Run the test by invoking the service for JSON and  XML
 +
**Data should be displayed in the Results panel
 +
 
 +
===Sunrise===
 +
*Load the Sunrise project from the containing project
 +
*Run the tests from a non-deployed RUI
 +
**Open the client.handlers.Sunrise.egl file in the EGL Rich UI editor
 +
**Open the preview pane
 +
**Run the test by selecting an address, month and day an pressing invoke service
 +
**Data should be returned from the service
 +
*Run the tests from a deployed RUI
 +
**Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
 +
**Launch the Sunrise.html file in the tomcat server
 +
**Run the test by selecting an address, month and day an pressing invoke service
 +
**Data should be returned from the service
 +
 
 +
===WeatherRest===
 +
*Load the WeatherRestproject from the containing project
 +
*Run the tests from a non-deployed RUI
 +
**Open the client.handlers.Weather.egl file in the EGL Rich UI editor
 +
**Open the preview pane
 +
**Run the test by entering a zip code and pressing the button to invoke the service
 +
**Pretty pictures and weather info should appear
 +
*Run the tests from a deployed RUI
 +
**Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
 +
**Launch the Weather.html file in the tomcat server
 +
**Run the test by entering a zip code and pressing the button to invoke the service
 +
**Pretty pictures and weather info should appear
 +
 
 +
==org.eclipse.edt.tests.sql==
 +
This project contains an EUnit test suite. To run the suite:
 +
*Create a derby connection using Database Development perspective. Use the embedded driver. Give the profile the name "DerbyConnection".
 +
*Load the project org.eclipse.edt.tests.sql
 +
*Select the project in the Project Explorer, right click and select Generate EGL Test Driver -> Java
 +
*Edit the properties of the generated project (org.eclipse.edt.tests.sql.eunit.java) and set  the development DD to the DD of the original project (org.eclipse.edt.tests.sql)
 +
*Select the RunAllTests_pgm.egl file, right click and select Run As -> EGL java Main Application
 +
*View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)
 +
 
 +
 
 +
 
 +
==org.eclipse.edt.tests.sql.jndi==
 +
To run the test:
 +
 
 +
*Create a Tomcat server (Tomcat 7 or higher is recommended)
 +
*Copy your derby.jar file into the lib directory of the tomcat installation location
 +
*Follow the instructions for org.eclipse.edt.tests.sql to set up the EUnit test project for that project (http://wiki.eclipse.org/EDT:Running_Tests#org.eclipse.edt.tests.sql)
 +
*Load the org.eclipse.edt.tests.sql.jndi project into the workspace
 +
*Open org.eclipse.edt.tests.sql.jndi\EGLSource\test\server\SqlTestService.egl and org.eclipse.edt.tests.sql.eunit.java\EGLSource\eunitgen\RunAllTests_pgm.egl in the editor. 
 +
*Copy the import statements from RunAllTests_pgm to SqlTestService. 
 +
*Copy all statements from RunAllTests_pgm.main() into SqlTestService.runTest().
 +
*Edit org.eclipse.edt.tests.sql\EGLSource\sql\test\Constants.egl.  Set the connectJndi variable to true
 +
*To run on the test server:
 +
**Edit org.eclipse.edt.tests.sql.jndi\EGLSource\test\client\SqlJndiConnectionTest.egl. 
 +
**Select the Preview tab and press the Run Test button. 
 +
**After a short pause the status field should turn green and tell you that the test has finished running.  This does not mean the test was successful, only that it has finished running. 
 +
**View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)
 +
**Edit org.eclipse.edt.tests.sql.jndi\EGLSource\org_eclipse_edt_tests_sql_jndi.egldd. 
 +
**On the Resource Bindings tab, change the JNDI name of the data source from jdbc/DerbyConnection to some other value. 
 +
**Press the Run Test button of SqlJndiConnectionTest and check the results of the new test. 
 +
**There should be many "name not found" failures while looking up the name jdbc/DerbyConnection.
 +
**Change the JNDI name back to jdbc/DerbyConnection.
 +
*To run on Tomcat:
 +
**Edit org.eclipse.edt.tests.sql.jndi\EGLSource\org_eclipse_edt_tests_sql_jndi.egldd. 
 +
**On the Overview tab, make a new Target Project for your Tomcat server.  Save and deploy the deployment descriptor.
 +
**Add your Target Project to the server.
 +
**Start the server and run SqlJndiConnectionTest.html.  Press the Run Test button. 
 +
**Check the results as you did when running in the test server.
 +
**If you're using Tomcat 6, two variations will fail.
 +
*To run on Tomcat with authentication:
 +
**Edit org.eclipse.edt.tests.sql.jndi\EGLSource\org_eclipse_edt_tests_sql_jndi.egldd. 
 +
**On the Resource Bindings tab, check the box for "Use application-based authentication". 
 +
**Stop your server and deploy again.
 +
**Edit your target project's WebContent\META-INF\context.xml file. 
 +
**You'll see a Resource has been defined for the database connection.  The value of "auth" should have been set to "Application" by deployment. 
 +
**Set the value of "username" to "x", and set "password" to "egl".
 +
**Now edit the run configuration of your Tomcat server.  On the Arguments tab, add these VM arguments:
 +
***-Dderby.connection.requireAuthentication=true
 +
***-Dderby.authentication.provider=BUILTIN
 +
***-Dderby.user.x=INVALID
 +
**Start the server and run the test again.  This time the results should show that most variations fail with user authentication errors.
 +
**Stop the server and edit the run configuration of your Tomcat server again.  On the arguments tab, change -Dderby.user.x=INVALID to -Dderby.user.x=egl
 +
**Start the server and run the test again.  Check the results again. 
 +
**If you're using Tomcat 6, two variations will fail.
  
  

Latest revision as of 13:55, 10 January 2013

Running the EDT Tests

org.eclipse.edt.tests.validation

This project holds JUnit tests that are designed to test the part binding, validation and IR serialization phase (no generation is performed). To run these tests:

  • Load the project (org.eclipse.edt.tests.validation).
  • Right click on the project in the Project Explorer Or Navigator and select "Run as -> JUnit test".
  • All tests should run with no errors or failures.

org.eclipse.edt.eunit.test

This contains a large number of tests that use the EUnit framework (see http://wiki.eclipse.org/EDT:EUnit_Testing) to test our core language features. To run this test:

  • Load the project (org.eclipse.edt.eunit.test).
  • Set up the compiler(s) you wish to use for the project. To do this, right click on the project in the Project Explorer and select properties. Then click on "EGL Compiler" on the properties page. Select the Java and/or JavaScript generator, depending on what is being tested and press OK.
  • Once compilation completes, right click on the project and select "Generate EGL Test Driver". Select either Java or JavaScript (depending on which environment you are testing).
  • After the test driver is generated, you can run the tests. Refer to http://wiki.eclipse.org/EDT:EUnit_Testing#How_to_run_tests_using_EUnit and the subsequent sections on how to run the tests and view the results.

org.eclipse.edt.eunit.test.ibmi

This project is made up of 2 projects:

thirdparty.programs

This contains an EUnit test suite. To run the tests:

thirdparty.stateful

This test suite is incomplete and should not be run

org.eclipse.edt.tests.services

To run the tests in this project, you will need to first create a "Web 2.0 Client Application with Services" project to ensure that the widget projects are imported into the workspace.

This project is made up of multiple projects:

egl.rest

This project contains an EUnit test suite. To run the tests:

  • Load the egl.rest project from the containing project
  • Select the project and generate the EGL test driver for "JavaScript Asynchronize"
  • Add the project "egl.rest" to the java build path of the newly generated project egl.rest.eunit.javascriptasync
  • Open the file name RunAllTests_rui.egl in the EGL Rick UI Editor.


  • To test deployed services in a deployed RUI:
    • Make sure the binding type in RunAllTests_rui.egl is set to DEPLOYED (TestListMgr.bindingType = ServiceBindingType.DEPLOYED)
    • Deploy the egl_restTgt.egldd file to a projet named egl.rest.tgt (use tomcat as the server)
    • Deploy the egl_rest_eunut_javascriptasync.egldd file to egl.rest.tgt
    • Launch the RunAllTests_rui.html file on the server, this will run the test suite
    • View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)


chattygabby

  • Load the chattygabby project from the containing project
  • Run the tests from non-deployed RUI
    • Open the ui.MainView.egl file in the EGL Rich UI editor
    • Open the preview pane and press the Request button.
    • Data should be returned to the message log area
  • Run the tests from a deployed RUI
    • Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
    • Launch the MainView.html file in the tomcat server
    • Press the Request button
    • Data should be returned to the message log area

Colleges

  • Load the Colleges project from the containing project.
  • Run the tests from non-deployed RUI
    • Open the client.handlers.Colleges.egl file in the EGL Rich UI editor
    • Open the previw pane
    • Run the test by using the List, Get, Add, Update, Delete features of the rui
  • Run the tests from a deployed RUI
    • Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
    • Launch the Colleges.html file in the tomcat server
    • Run the test by using the List, Get, Add, Update, Delete features of the rui

CurrencyConverter

  • Load the CurrencyConverter project from the containing project
  • Run the tests from a non-deployed RUI
    • Open the client.handlers.CurrencyConvertorHandler file in the EGL Rich UI editor
    • Open the preview pane
    • Run the test by selecting different currencies and clicking the invoke service button
  • Run the tests from a deployed RUI
    • Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
    • Launch the CurrencyConvertorHandler.html file in the tomcat server
    • Run the test by selecting different currencies and clicking the invoke service button

GeoNames

  • Load the GeoNames project from the containing project
  • Run the tests from a non-deployed RUI
    • Open the client.handler.GeoName.egl file in the EGL Rich UI editor
    • Open the preview pane
    • Run the test by invoking the service for JSON and XML
    • Data should be displayed in the Results panel
  • Run the tests from a deployed RUI
    • Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
    • Launch the GeoName.html file in the tomcat server
    • Run the test by invoking the service for JSON and XML
    • Data should be displayed in the Results panel

Sunrise

  • Load the Sunrise project from the containing project
  • Run the tests from a non-deployed RUI
    • Open the client.handlers.Sunrise.egl file in the EGL Rich UI editor
    • Open the preview pane
    • Run the test by selecting an address, month and day an pressing invoke service
    • Data should be returned from the service
  • Run the tests from a deployed RUI
    • Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
    • Launch the Sunrise.html file in the tomcat server
    • Run the test by selecting an address, month and day an pressing invoke service
    • Data should be returned from the service

WeatherRest

  • Load the WeatherRestproject from the containing project
  • Run the tests from a non-deployed RUI
    • Open the client.handlers.Weather.egl file in the EGL Rich UI editor
    • Open the preview pane
    • Run the test by entering a zip code and pressing the button to invoke the service
    • Pretty pictures and weather info should appear
  • Run the tests from a deployed RUI
    • Deploy the egldd file in the project to a project named egl.rest.tgt (use Tomcat Server)
    • Launch the Weather.html file in the tomcat server
    • Run the test by entering a zip code and pressing the button to invoke the service
    • Pretty pictures and weather info should appear

org.eclipse.edt.tests.sql

This project contains an EUnit test suite. To run the suite:

  • Create a derby connection using Database Development perspective. Use the embedded driver. Give the profile the name "DerbyConnection".
  • Load the project org.eclipse.edt.tests.sql
  • Select the project in the Project Explorer, right click and select Generate EGL Test Driver -> Java
  • Edit the properties of the generated project (org.eclipse.edt.tests.sql.eunit.java) and set the development DD to the DD of the original project (org.eclipse.edt.tests.sql)
  • Select the RunAllTests_pgm.egl file, right click and select Run As -> EGL java Main Application
  • View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)


org.eclipse.edt.tests.sql.jndi

To run the test:

  • Create a Tomcat server (Tomcat 7 or higher is recommended)
  • Copy your derby.jar file into the lib directory of the tomcat installation location
  • Follow the instructions for org.eclipse.edt.tests.sql to set up the EUnit test project for that project (http://wiki.eclipse.org/EDT:Running_Tests#org.eclipse.edt.tests.sql)
  • Load the org.eclipse.edt.tests.sql.jndi project into the workspace
  • Open org.eclipse.edt.tests.sql.jndi\EGLSource\test\server\SqlTestService.egl and org.eclipse.edt.tests.sql.eunit.java\EGLSource\eunitgen\RunAllTests_pgm.egl in the editor.
  • Copy the import statements from RunAllTests_pgm to SqlTestService.
  • Copy all statements from RunAllTests_pgm.main() into SqlTestService.runTest().
  • Edit org.eclipse.edt.tests.sql\EGLSource\sql\test\Constants.egl. Set the connectJndi variable to true
  • To run on the test server:
    • Edit org.eclipse.edt.tests.sql.jndi\EGLSource\test\client\SqlJndiConnectionTest.egl.
    • Select the Preview tab and press the Run Test button.
    • After a short pause the status field should turn green and tell you that the test has finished running. This does not mean the test was successful, only that it has finished running.
    • View the results (http://wiki.eclipse.org/EDT:EUnit_Testing#Viewing_the_results)
    • Edit org.eclipse.edt.tests.sql.jndi\EGLSource\org_eclipse_edt_tests_sql_jndi.egldd.
    • On the Resource Bindings tab, change the JNDI name of the data source from jdbc/DerbyConnection to some other value.
    • Press the Run Test button of SqlJndiConnectionTest and check the results of the new test.
    • There should be many "name not found" failures while looking up the name jdbc/DerbyConnection.
    • Change the JNDI name back to jdbc/DerbyConnection.
  • To run on Tomcat:
    • Edit org.eclipse.edt.tests.sql.jndi\EGLSource\org_eclipse_edt_tests_sql_jndi.egldd.
    • On the Overview tab, make a new Target Project for your Tomcat server. Save and deploy the deployment descriptor.
    • Add your Target Project to the server.
    • Start the server and run SqlJndiConnectionTest.html. Press the Run Test button.
    • Check the results as you did when running in the test server.
    • If you're using Tomcat 6, two variations will fail.
  • To run on Tomcat with authentication:
    • Edit org.eclipse.edt.tests.sql.jndi\EGLSource\org_eclipse_edt_tests_sql_jndi.egldd.
    • On the Resource Bindings tab, check the box for "Use application-based authentication".
    • Stop your server and deploy again.
    • Edit your target project's WebContent\META-INF\context.xml file.
    • You'll see a Resource has been defined for the database connection. The value of "auth" should have been set to "Application" by deployment.
    • Set the value of "username" to "x", and set "password" to "egl".
    • Now edit the run configuration of your Tomcat server. On the Arguments tab, add these VM arguments:
      • -Dderby.connection.requireAuthentication=true
      • -Dderby.authentication.provider=BUILTIN
      • -Dderby.user.x=INVALID
    • Start the server and run the test again. This time the results should show that most variations fail with user authentication errors.
    • Stop the server and edit the run configuration of your Tomcat server again. On the arguments tab, change -Dderby.user.x=INVALID to -Dderby.user.x=egl
    • Start the server and run the test again. Check the results again.
    • If you're using Tomcat 6, two variations will fail.