Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
COSMOS/COSMOS TEST AUTO
Contents
1) Introduction
This page provides information and links related to Test Automation of COSMOS junits.
2) Test Automation Overview
The COSMOS build is based on Eclipse PDE (Plug-in Development Environment) and it runs in the eclipse server. Currently the candidate drivers at the end of an iteration are manually tested by the respective component teams. This initiative is to define the process of testing and automate junit execution as part of the build. By automating and integrating with the build, testing can be done more often and bugs will be discovered early on.
The test cases are available in CVS at the following location:
Go to HEAD -> org.eclipse.cosmos -> tests
3) Test Details
The following table briefly explains the different contacts for the test cases as well as the pre reqs and test setup needed to execute it.
Sl No | Component | Test Project | Contact Person | Dependencies | Test Setup | Test Automation |
---|---|---|---|---|---|---|
1 | data-collection | org.eclipse.cosmos.dc.cmdf.services.tests | David Whiteman | org.eclipse.cosmos.common.tests | The directory in testTempDirectory in CMDBfTestMessages.properties will be created. This will need to be changed from the default for Linux testing. | Done, only normal junits, no plugin junits |
2 | data-collection | org.eclipse.cosmos.dc.framework.test | ? | ? | ? | Execution works fine, but all the test cases fails, need this to be deployed http://localhost:8080/cosmos/services |
3 | data-collection | org.eclipse.cosmos.dc.tests | ? | ? | ? | The project cannot be compiled due to following dependency errors: missing required Java projects: |
4 | data-collection | org.eclipse.cosmos.example.mdr.registration.tests | Ali Mehregani | COSMOS environment | This test requires the COSMOS environment to be running before the test is executed. It's meant to perform functional testing on the registration service. It's probably unrealistic to run this plug-in against each build. I would exclude this test from your test automation framework | |
1 | data-reporting | org.eclipse.cosmos.dr.tests.drs.service.handler | Sheldon Lee-Loy | The COSMOS End 2 End should be deployed on http://localhost:8080 | The project cannot be compiled due to following dependency errors: 1) missing required Java project: 'org.eclipse.cosmos.dr.drs.service.handler' | |
2 | data-reporting | org.eclipse.cosmos.dr.tests.drs.service.handler.tptp | Sheldon Lee-Loy | org.eclipse.cosmos.dr.tests.drs.service.handler | The COSMOS End 2 End should be deployed on http://localhost:8080 | The project was not built since it depends on org.eclipse.cosmos.dr.tests.drs.service.handler, which has build path errors |
1 | management-enablement | org.eclipse.cosmos.me.dmtoolkit.tests | David Whiteman | org.eclipse.cosmos.common.tests, Webtools platform | One manual test in addition to a plugin test. | InactiveProcessException while executing testcase |
2 | management-enablement | org.eclipse.cosmos.me.management.tests | ? | ? | ? |
The project cannot be compiled due to following dependency errors: |
1 | resource-modeling | org.eclipse.cosmos.rm.repository.tests | David Whiteman | org.eclipse.cosmos.common.tests | See org.eclipse.cosmos.rm.repository.tests/src/org/eclipse/cosmos/rm/repository/tests/common/testMessages.properties and org.eclipse.cosmos.rm.repository.tests/src/META-INF | Done, only normal juints, no plugin junits. Configuration reqd as mentioned. |
2 | resource-modeling | org.eclipse.cosmos.rm.smlif.tests | David Whiteman | org.eclipse.cosmos.common.tests | Configure artifacts in org.eclipse.cosmos.rm.smlif.tests/test-resources. Open the TPTP artifacts to see documentation on what is required. | Partially done, AllTests.testsuite works. Error while executing TPTP plugin junits - junit.framework.AssertionFailedError: The project P/org.eclipse.cosmos.rm.example.datacenter does not exist in the test workspace at E:/Bobz/workarea/COSMOS/TestAuto/tmp/test-workspace |
3 | resource-modeling | org.eclipse.cosmos.rm.validation.tests | David Whiteman | org.eclipse.cosmos.common.tests | See org.eclipse.cosmos.rm.validation.tests/src/org/eclipse/cosmos/rm/validation/internal/common/testMessages.properties. Also need to configure artifacts in org.eclipse.cosmos.rm.validation.tests/test-resources for plugin tests (open the artifacts to read documentation on doing this). | Done, both normal and plugin junits work. |
We will try to automate as much as possible from the above list using the TPTP Test Automation Framework.
4) Test Automation Setup
Create a folder TestAuto. It should contain the following:
1) the test script (testauto.xml)
2) apache-ant-1.7.0-bin http://ant.apache.org/bindownload.cgi
3) Folder ant_lib, this should contain
a) ant-tptp.jar
copy from eclipse\plugins\org.eclipse.hyades.execution_*
b) com.ibm.icu_*.jar
copy from eclipse\plugins
c) org.eclipse.osgi_*.jar
copy from eclipse\plugins
d) TestAuto.jar
4) Folder test_setup, this should contain
birt-report-framework-*.zip
dtp_*.zip
GEF-runtime-*.zip
tptp.runtime.allInOne.*.zip
You can download the test setup from - http://www.eclipse.org/tptp/home/downloads/
You should download the following:
TPTP Plugins for Eclipse:
1) TPTP all-in-one package
2) Business Intelligence and Reporting Tools (BIRT)
3) Graphics Editor Framework (GEF)
4) Data Tools Platform (DTP)
Agent Controller
1) Runtime: WINDOWS-IA32/LINUX-IA32
As-Is Components
1) Business Intelligence and Reporting Tools (BIRT) Test Reports
5) Create a folder Test_Results (Test reports are created here)
To invoke test automation, do the following:
1) Set JAVA_HOME to Java 1.5
eg: JAVA_HOME=/opt/ibm/java 2) Set ANT_HOME to apache-ant-1.7.0-bin
eg: ANT_HOME=$TESTAUTO_HOME/apache-ant-1.7.0-bin 3) Set TESTAUTO_HOME to the point to the TestAuto folder you created above
eg: TESTAUTO_HOME=/home/actk/COSMOS/TestAuto 4) set PATH to include ANT and JAVA
eg: PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH 5) Run ant
eg: $ANT_HOME/bin/ant -lib $TESTAUTO_HOME/ant_lib -f $TESTAUTO_HOME/testauto.xml -Dbuild_space=/home/actk/COSMOS/TestAuto/tmp -Dcosmos-output=$bldfolder -Dtest-setup=$TESTAUTO_HOME/test_setup 1>$bldfolder/testauto.log 2>&1
Note:
1) Make sure you have Agent Controller running before you start the test automation.
2) To use TPTP 441 for report generation, do the following:
a) Install TPTP 441 with Reports
http://www.eclipse.org/tptp/home/downloads/?ver=4.4.1
TPTP all-in-one package
a1) TPTP Plugins for Eclipse
a2) Business Intelligence and Reporting Tools (BIRT)
a3) Graphics Editor Framework (GEF)
a4) Data Tools Platform (DTP)
b) In builds.sh, you have to pass one more parameter which is the tptp 441 eclipse eg: $ANT_HOME/bin/ant -lib $TESTAUTO_HOME/ant_lib -f $TESTAUTO_HOME/testauto.xml -Dbuild_space=/home/actk/COSMOS/TestAuto/tmp -Dcosmos-output=$bldfolder -Dtest-setup=$TESTAUTO_HOME/test_setup -Dtptp441_eclipse=/home/tptp441/eclipse 1>$bldfolder/testauto.log 2>&1