Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "COSMOS/COSMOS TEST AUTO"

('''4) Test Automation Setup''')
(4) Test Automation Setup)
Line 58: Line 58:
 
== '''4) Test Automation Setup''' ==
 
== '''4) Test Automation Setup''' ==
  
Create a folder TestAuto. It should contain the following:
+
<pre>
 +
1) To create proper automation directory structure please checkout
 +
and run "create-test-structure.bat" as follows :  
  
1) the test script (testauto.xml)
+
    create-test-structure.bat D:\COSMOS\test-automation
  
2) apache-ant-1.7.0-bin
+
This will create following directory structure in test automation directory.
    http://ant.apache.org/bindownload.cgi
+
       
 +
        artifacts
 +
              |-ant
 +
              |-cvs
 +
              |-cosmos
 +
              |-tptp45
 +
              |-tptp441
 +
              |-webapp
 +
        bin
 +
        config
 +
        lib
 +
        logs
 +
        script
 +
        test-results
 +
</pre>
  
3) Folder ant_lib, this should contain <br/>
+
<pre>
    a) ant-tptp.jar <br/>
+
2) Install apache-ant-1.7.0-bin to "artifacts\ant" location.
          copy from eclipse\plugins\org.eclipse.hyades.execution_* <br/>
+
</pre>
    b) com.ibm.icu_*.jar<br/>
+
          copy from eclipse\plugins<br/>
+
    c) org.eclipse.osgi_*.jar<br/>
+
          copy from eclipse\plugins<br/>
+
    d) TestAuto.jar<br/>
+
  
4) Folder test_setup, this should contain<br/>
+
<pre>
    birt-report-framework-*.zip<br/>
+
3) Copy cvs.exe to "artifacts\cvs" location.
    dtp_*.zip<br/>
+
</pre>
    GEF-runtime-*.zip<br/>
+
    tptp.runtime.allInOne.*.zip<br/>
+
    <br/>
+
    You can download the test setup from - http://www.eclipse.org/tptp/home/downloads/  <br/><br/>
+
    You should download the following:<br/>
+
    <b>TPTP Plugins for Eclipse:</b><br/>
+
    1) TPTP all-in-one package <br/>
+
    2) Business Intelligence and Reporting Tools (BIRT) <br/>
+
    3) Graphics Editor Framework (GEF) <br/>
+
    4) Data Tools Platform (DTP) <br/>
+
    <br/>
+
    <b>Agent Controller</b> <br/>
+
    1) Runtime: WINDOWS-IA32/LINUX-IA32 <br/>
+
    <br/>
+
    <b>As-Is Components</b><br/>
+
    1) Business Intelligence and Reporting Tools (BIRT) Test Reports <br/>
+
  
 +
<pre>
 +
4) Copy following zip files to "artifacts\tptp45" location. 
 +
  These files can be found at TPTP 4.5 download page.
 +
  (For axis check apache web page) 
  
<b> To invoke test automation, do the following:</b>
+
      tptp.runtime.allInOne.win32.win32.x86-TPTP-4.5.0.zip
1) Set JAVA_HOME to Java 1.5<br/>
+
      org.eclipse.tptp.test.report.birt-TPTP-4.5.0.zip
    eg: JAVA_HOME=/opt/ibm/java
+
      birt-report-framework-2_3_0.zip
2) Set ANT_HOME to apache-ant-1.7.0-bin<br/>
+
      wtp-R-3.0-20080616152118a.zip
    eg: ANT_HOME=$TESTAUTO_HOME/apache-ant-1.7.0-bin
+
      GEF-runtime-3.4.0.zip
3) Set TESTAUTO_HOME to the point to the TestAuto folder you created above<br/>
+
      dtp_1.6.0.zip
    eg: TESTAUTO_HOME=/home/actk/COSMOS/TestAuto
+
      axis2-1.3-bin.zip
4) set PATH to include ANT and JAVA<br/>
+
    eg: PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
+
5) Run ant <br/>
+
    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
+
  
 +
</pre>
  
Note:<br/>  
+
<pre>
1) Make sure you have Agent Controller running before you start the test automation.<br/>
+
5) Copy following zip files to "artifacts\tptp441" location and then unzip them.
2) To use TPTP 441 for report generation, do the following:<br/>
+
  These files can be found at TPTP 4.4.1 download page.
    a) Install TPTP 441 with Reports<br/>
+
 
      http://www.eclipse.org/tptp/home/downloads/?ver=4.4.1 <br/><br/>
+
      tptp.runtime.allInOne.win32.win32.x86-TPTP-4.4.1.zip
       <b>TPTP all-in-one package </b><br/>
+
      birt-report-framework-2_2_2.zip
      a1) TPTP Plugins for Eclipse <br/>
+
      dtp_1.5.2_022008.zip
      a2) Business Intelligence and Reporting Tools (BIRT) <br/>
+
      GEF-runtime-3.3.2.zip
      a3) Graphics Editor Framework (GEF) <br/>
+
      wtp-R-2.0.2-20080223205547.zip
       a4) Data Tools Platform (DTP)<br/><br/>
+
 
    b) In builds.sh, you have to pass one more parameter which is the tptp 441 eclipse
+
</pre>
      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  <font color="blue">-Dtptp441_eclipse=/home/tptp441/eclipse </font> 1>$bldfolder/testauto.log 2>&1
+
<pre>
 +
6) Copy following files to "artifacts\webapp" location.
 +
 
 +
      apache-tomcat-5.5.26.zip
 +
      axis2.war
 +
      birt-runtime-2.3.0.zip
 +
      dojo-release-1.1.0.zip
 +
 
 +
</pre>
 +
 
 +
<pre>
 +
7) Copy "run_testauto.bat" file to "bin" directory and then modify following
 +
  variable in that batch file.
 +
 
 +
      set automation_home=D://COSMOS//test-automation
 +
      set cvspath=D:\COSMOS\test-automation\artifacts\cvs
 +
      set antpath=D:\COSMOS\test-automation\artifacts\ant\bin
 +
 
 +
  Make sure to use same file seperator character for variables as
 +
  given in batch file.
 +
 
 +
</pre>
 +
 
 +
<pre>
 +
8) Copy "testauto.properties" file to "config" directory and then modify following
 +
  variable in that file according to test machine environment.
 +
 
 +
      JAVA_HOME=C:/Program Files/IBM/Java50
 +
      cosmos-url=http://build.eclipse.org/technology/cosmos/downloads/COSMOS/1.0.0/
 +
       scp-user=build
 +
      scp-pwd=build-cosmos
 +
      scp-host=build.eclipse.org
 +
      scp-host-path=/shared/technology/cosmos/downloads/COSMOS/1.0.0
 +
 
 +
  Provide your eclipse user and password information for scp related settings. 
 +
</pre>
 +
 
 +
<pre>
 +
9) Copy following files to "script" directory.
 +
   
 +
       testauto.xml
 +
      testauto_setup.xml
 +
      testdc.xml
 +
      testdr.xml
 +
      testrm.xml
 +
</pre>
 +
 
 +
<pre>
 +
(10) To setup "lib" directory.
 +
 +
    Copy "ant-tptp.jar" to lib from
 +
    "tptp.runtime.allInOne.win32.win32.x86-TPTP-4.5.0.zip/eclipse\dropins\
 +
    eclipse\plugins\org.eclipse.hyades.execution_4.4.200.v200806120100".
 +
 
 +
    Copy "com.ibm.icu_3.8.1.v20080530.jar" to lib from
 +
    "tptp.runtime.allInOne.win32.win32.x86-TPTP-4.5.0.zip/eclipse/plugins".
 +
 
 +
    Copy "org.eclipse.osgi_3.4.0.v20080605-1900.jar" to lib from
 +
    "tptp.runtime.allInOne.win32.win32.x86-TPTP-4.5.0.zip/eclipse/plugins".
 +
 
 +
    Copy "jsch-0.1.29.jar" to lib. (This file used for ant scp task)
 +
 
 +
    Checkout "test-automation/src" from cvs,create Jar out of it
 +
    and copy it to lib.
 +
</pre>
 +
 
 +
<pre>
 +
11) Run "bin/run_testauto.bat" to run the test-automation.
 +
</pre>

Revision as of 15:52, 3 September 2008

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:
Cosmos cvs.jpg

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
1data-collectionorg.eclipse.cosmos.dc.cmdf.services.testsDavid Whitemanorg.eclipse.cosmos.common.testsThe 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
2data-collectionorg.eclipse.cosmos.dc.framework.test???Execution works fine, but all the test cases fails, need this to be deployed http://localhost:8080/cosmos/services
3data-collectionorg.eclipse.cosmos.dc.tests???The project cannot be compiled due to following dependency errors:

missing required Java projects:
1) org.apache.ibatis
2) org.eclipse.cosmos.dc.common
3) org.eclipse.cosmos.dc.local.registry
4) org.eclipse.cosmos.dc.remote.wsdm
5) org.eclipse.cosmos.dc.spec
6) org.eclipse.cosmos.management.common
7) org.eclipse.cosmos.management.wsdm

4data-collectionorg.eclipse.cosmos.example.mdr.registration.testsAli MehreganiCOSMOS environmentThis 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
1data-reportingorg.eclipse.cosmos.dr.tests.drs.service.handlerSheldon Lee-LoyThe COSMOS End 2 End should be deployed on http://localhost:8080The project cannot be compiled due to following dependency errors:

1) missing required Java project: 'org.eclipse.cosmos.dr.drs.service.handler'
2) Target runtime Apache Tomcat v5.5 is not defined

2data-reportingorg.eclipse.cosmos.dr.tests.drs.service.handler.tptpSheldon Lee-Loyorg.eclipse.cosmos.dr.tests.drs.service.handlerThe COSMOS End 2 End should be deployed on http://localhost:8080The project was not built since it depends on org.eclipse.cosmos.dr.tests.drs.service.handler, which has build path errors
1management-enablementorg.eclipse.cosmos.me.dmtoolkit.testsDavid Whitemanorg.eclipse.cosmos.common.tests, Webtools platformOne manual test in addition to a plugin test.InactiveProcessException while executing testcase
2management-enablementorg.eclipse.cosmos.me.management.tests???

The project cannot be compiled due to following dependency errors:
missing required Java projects:
1) org.apache.axis2.jaxws.api
2) org.apache.axis2.jws.api
3) org.eclipse.cosmos.me.management.common
4) org.eclipse.cosmos.me.management.wsdm

1resource-modelingorg.eclipse.cosmos.rm.repository.testsDavid Whitemanorg.eclipse.cosmos.common.testsSee 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-INFDone, only normal juints, no plugin junits. Configuration reqd as mentioned.
2resource-modelingorg.eclipse.cosmos.rm.smlif.testsDavid Whitemanorg.eclipse.cosmos.common.testsConfigure 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
3resource-modelingorg.eclipse.cosmos.rm.validation.testsDavid Whitemanorg.eclipse.cosmos.common.testsSee 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

 
1) To create proper automation directory structure please checkout 
and run "create-test-structure.bat" as follows : 

    create-test-structure.bat D:\COSMOS\test-automation 

This will create following directory structure in test automation directory.
         
        artifacts
              |-ant
              |-cvs
              |-cosmos
              |-tptp45
              |-tptp441
              |-webapp
         bin
         config
         lib
         logs
         script
         test-results
2) Install apache-ant-1.7.0-bin to "artifacts\ant" location.
3) Copy cvs.exe to "artifacts\cvs" location.
4) Copy following zip files to "artifacts\tptp45" location.   
   These files can be found at TPTP 4.5 download page.
   (For axis check apache web page)  

      tptp.runtime.allInOne.win32.win32.x86-TPTP-4.5.0.zip 
      org.eclipse.tptp.test.report.birt-TPTP-4.5.0.zip 
      birt-report-framework-2_3_0.zip 
      wtp-R-3.0-20080616152118a.zip 
      GEF-runtime-3.4.0.zip 
      dtp_1.6.0.zip 
      axis2-1.3-bin.zip 

5) Copy following zip files to "artifacts\tptp441" location and then unzip them.
   These files can be found at TPTP 4.4.1 download page. 

      tptp.runtime.allInOne.win32.win32.x86-TPTP-4.4.1.zip 
      birt-report-framework-2_2_2.zip 
      dtp_1.5.2_022008.zip 
      GEF-runtime-3.3.2.zip 
      wtp-R-2.0.2-20080223205547.zip 

6) Copy following files to "artifacts\webapp" location.
   
      apache-tomcat-5.5.26.zip 
      axis2.war 
      birt-runtime-2.3.0.zip 
      dojo-release-1.1.0.zip 
   
7) Copy "run_testauto.bat" file to "bin" directory and then modify following
   variable in that batch file.
   
      set automation_home=D://COSMOS//test-automation
      set cvspath=D:\COSMOS\test-automation\artifacts\cvs
      set antpath=D:\COSMOS\test-automation\artifacts\ant\bin
   
   Make sure to use same file seperator character for variables as 
   given in batch file.
   
8) Copy "testauto.properties" file to "config" directory and then modify following
   variable in that file according to test machine environment.
   
      JAVA_HOME=C:/Program Files/IBM/Java50
      cosmos-url=http://build.eclipse.org/technology/cosmos/downloads/COSMOS/1.0.0/
      scp-user=build
      scp-pwd=build-cosmos
      scp-host=build.eclipse.org
      scp-host-path=/shared/technology/cosmos/downloads/COSMOS/1.0.0

   Provide your eclipse user and password information for scp related settings.   
9) Copy following files to "script" directory.
     
      testauto.xml
      testauto_setup.xml
      testdc.xml
      testdr.xml
      testrm.xml
(10) To setup "lib" directory.
 
     Copy "ant-tptp.jar" to lib from 
     "tptp.runtime.allInOne.win32.win32.x86-TPTP-4.5.0.zip/eclipse\dropins\
     eclipse\plugins\org.eclipse.hyades.execution_4.4.200.v200806120100".

     Copy "com.ibm.icu_3.8.1.v20080530.jar" to lib from
     "tptp.runtime.allInOne.win32.win32.x86-TPTP-4.5.0.zip/eclipse/plugins".

     Copy "org.eclipse.osgi_3.4.0.v20080605-1900.jar" to lib from
     "tptp.runtime.allInOne.win32.win32.x86-TPTP-4.5.0.zip/eclipse/plugins".

     Copy "jsch-0.1.29.jar" to lib. (This file used for ant scp task)

     Checkout "test-automation/src" from cvs,create Jar out of it 
     and copy it to lib.
11) Run "bin/run_testauto.bat" to run the test-automation.

Back to the top