Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Http://wiki.eclipse.org/EclipseLink/Development/Testing/DBWS/2.5.0 Server Tests"

(Configuring to run using ANT)
(Configuring to run using ANT)
Line 215: Line 215:
 
== Configuring to run using ANT ==
 
== Configuring to run using ANT ==
 
The ANT build script will look for <code>test.properties</code> in the <code>user.home</code> folder.  All the db and server properties should be set here, notable ones being:
 
The ANT build script will look for <code>test.properties</code> in the <code>user.home</code> folder.  All the db and server properties should be set here, notable ones being:
* db.driver &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (default is 'oracle.jdbc.OracleDriver')
+
* <code>db.driver</code> (default is 'oracle.jdbc.OracleDriver')
* db.url &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (default is 'jdbc:oracle:thin:@localhost:1521:ORCL')
+
* <code>db.url</code> (default is 'jdbc:oracle:thin:@localhost:1521:ORCL')
* db.user &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (default is 'user')
+
* <code>db.user</code> (default is 'user')
* db.pwd &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (default is 'password')
+
* <code>db.pwd</code> (default is 'password')
* db.platform &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (default is 'org.eclipse.persistence.platform.database.oracle.Oracle11Platform')
+
* <code>db.platform</code> (default is 'org.eclipse.persistence.platform.database.oracle.Oracle11Platform')
  
* server.host &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(default is 'localhost')
+
* <code>server.host</code> (default is 'localhost')
* server.port &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(default is '7001')
+
* <code>server.port</code> (default is '7001')
* server.platform &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(default is 'wls')
+
* <code>server.platform</code> (default is 'wls')
* server.datasource &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(default is 'jdbc/DBWStestDS')
+
* <code>server.datasource</code> (default is 'jdbc/DBWStestDS')
  
 
Note that a number of required properties are set in antbuild.properties, and can be modified if desired:
 
Note that a number of required properties are set in antbuild.properties, and can be modified if desired:
* db.driver=oracle.jdbc.OracleDriver
+
* <code>db.driver=oracle.jdbc.OracleDriver</code>
* db.platform=org.eclipse.persistence.platform.database.oracle.Oracle11Platform
+
* <code>db.platform=org.eclipse.persistence.platform.database.oracle.Oracle11Platform</code>
* db.ddl.create=true
+
* <code>db.ddl.create=true</code>
* db.ddl.drop=true
+
* <code>db.ddl.drop=true</code>
* db.ddl.debug=false
+
* <code>db.ddl.debug=false</code>
  
 
== Configuring to run in the Eclipse IDE ==
 
== Configuring to run in the Eclipse IDE ==

Revision as of 12:12, 17 August 2012


Existing DBWS Server Tests

The current DBWS server tests are direct ports of the original DWBS examples. These basic examples were intended to be run against an EclipseLink install. The three main steps for running the examples are:

  • resetDatabase - execute SQL statements to generate tables, procedures, etc
  • build - run the DBWS builder to generate a web archive to be deployed manually to an active server instance
  • runClient - runs basic tests against the deployed service

The directory/file layout in the Git repository for each is as follows:
utils
  └── eclipselink.dbws.builder.test.oracle.server
        ├── attachedbinary
        │    ├── config
        │    │   ├── dbws-builder.xml
        │    │   ├── fixed.properties
        │    │   ├── fixed.xml
        │    │   ├── setup.sql
        │    │   ├── swaref.xsd
        │    │   └── teardown.sql
        │    ├── src
        │    │    └── test
        │    │        └── Client.java
        │    ├── .classpath
        │    ├── .project
        │    ├── build.cmd
        │    ├── build.xml
        │    ├── env.bat
        │    ├── resetDatabase.cmd
        │    └── runtime.properties
        ├── inlinebinary
        │    ├── config
        │    │   ├── dbws-builder.xml
        │    │   ├── fixed.properties
        │    │   ├── fixed.xml
        │    │   ├── setup.sql
        │    │   └── teardown.sql
        │    ├── src
        │    │    └── test
        │    │        └── Client.java
        │    ├── .classpath
        │    ├── .project
        │    ├── build.cmd
        │    ├── build.xml
        │    ├── env.bat
        │    ├── resetDatabase.cmd
        │    └── runtime.properties
        ├── mtom
        │    ├── config
        │    │   ├── dbws-builder.xml
        │    │   ├── fixed.properties
        │    │   ├── fixed.xml
        │    │   ├── setup.sql
        │    │   └── teardown.sql
        │    ├── src
        │    │    └── test
        │    │        └── Client.java
        │    ├── .classpath
        │    ├── .project
        │    ├── build.cmd
        │    ├── build.xml
        │    ├── env.bat
        │    ├── resetDatabase.cmd
        │    └── runtime.properties
        ├── simpleplsql
        │    ├── config
        │    │   ├── dbws-builder.xml
        │    │   ├── fixed.properties
        │    │   ├── fixed.xml
        │    │   ├── setup.sql
        │    ├── src
        │    │    └── test
        │    │        └── Client.java
        │    ├── build.cmd
        │    ├── build.sh
        │    ├── build.xml
        │    ├── env.bat
        │    ├── env.sh
        │    ├── readme.html
        │    ├── resetDatabase.cmd
        │    ├── resetDatabase.sh
        │    ├── runClient.cmd
        │    ├── runClient.sh
        │    └── runtime.properties
        ├── simplesp
        │    ├── config
        │    │   ├── dbws-builder.xml
        │    │   ├── fixed.properties
        │    │   ├── fixed.xml
        │    │   ├── setup.sql
        │    ├── src
        │    │    └── test
        │    │        └── Client.java
        │    ├── build.cmd
        │    ├── build.sh
        │    ├── build.xml
        │    ├── env.bat
        │    ├── env.sh
        │    ├── readme.html
        │    ├── resetDatabase.cmd
        │    ├── resetDatabase.sh
        │    ├── runClient.cmd
        │    ├── runClient.sh
        │    └── runtime.properties
        ├── simplesql
        │    ├── config
        │    │   ├── dbws-builder.xml
        │    │   ├── fixed.properties
        │    │   ├── fixed.xml
        │    │   ├── setup.sql
        │    ├── src
        │    │    └── test
        │    │        └── Client.java
        │    ├── build.cmd
        │    ├── build.sh
        │    ├── build.xml
        │    ├── env.bat
        │    ├── env.sh
        │    ├── readme.html
        │    ├── resetDatabase.cmd
        │    ├── resetDatabase.sh
        │    ├── runClient.cmd
        │    ├── runClient.sh
        │    └── runtime.properties
        ├── simpletable
        │    ├── config
        │    │   ├── dbws-builder.xml
        │    │   ├── fixed.properties
        │    │   ├── fixed.xml
        │    │   ├── setup.sql
        │    ├── src
        │    │    └── test
        │    │        └── Client.java
        │    ├── build.cmd
        │    ├── build.sh
        │    ├── build.xml
        │    ├── env.bat
        │    ├── env.sh
        │    ├── readme.html
        │    ├── resetDatabase.cmd
        │    ├── resetDatabase.sh
        │    ├── runClient.cmd
        │    ├── runClient.sh
        │    └── runtime.properties

Proposed changes

There are a number of changes that are to be made to get the DBWS server tests lined up with the existing DBWS JUnit suites:

  • The tests should be converted to JUnit test suites
  • The package should match those of the other DWBS tests
  • ANT scripts should be created with two main targets
  1. test-builder
  2. test-service
  • For running in the Eclipse IDE, two suites (and a .launch) will be added:
  1. AllBuilderTests
  2. AllServerTests
  • There should one .project and .classpath for these tests, as opposed to random ones scattered among the various tests
  • The basic workflow should be:
  1. Run the builder tests - these generate web archives for each test
  2. Manually deploy the generated .war files to an active server instance
  3. Run the service tests against the deployed web services

Package layout

Following is the new directory/file layout for the server tests:
utils
  └── eclipselink.dbws.builder.test.oracle.server
        ├── src
        │    ├── dbws
        │    │   ├── testing
        │    │   │    ├── attachedbinary
        │    │   │    │    ├── AttachedBinaryBuilderTestSuite.java
        │    │   │    │    └── AttachedBinaryServiceTestSuite.java
        │    │   │    ├── inlinebinary
        │    │   │    │    ├── InlineBinaryBuilderTestSuite.java
        │    │   │    │    └── InlineBinaryServiceTestSuite.java
        │    │   │    ├── mtom
        │    │   │    │    ├── MTOMBuilderTestSuite.java
        │    │   │    │    └── MTOMServiceTestSuite.java
        │    │   │    ├── simpleplsql
        │    │   │    │    ├── SimplePLSQLBuilderTestSuite.java
        │    │   │    │    └── SimplePLSQLServiceTestSuite.java
        │    │   │    ├── simplepsp
        │    │   │    │    ├── SimpleSPBuilderTestSuite.java
        │    │   │    │    └── SimpleSPServiceTestSuite.java
        │    │   │    ├── simplepsql
        │    │   │    │    ├── SimpleSQLBuilderTestSuite.java
        │    │   │    │    └── SimpleSQLServiceTestSuite.java
        │    │   │    ├── simpletable
        │    │   │    │    ├── SimpleTableBuilderTestSuite.java
        │    │   │    │    └── SimpleTableServiceTestSuite.java
        │    │   │    ├── AllBuilderTests.java
        │    │   │    ├── AllServerTests.java
        │    │   │    └── DBWSTestSuite.java
        ├── .classpath
        ├── .project
        ├── All server tests (builder).launch
        ├── All server tests (service).launch
        ├── antbuild.properties
        ├── antbuild.xml
        └── build.properties

Configuring to run using ANT

The ANT build script will look for test.properties in the user.home folder. All the db and server properties should be set here, notable ones being:

  • db.driver (default is 'oracle.jdbc.OracleDriver')
  • db.url (default is 'jdbc:oracle:thin:@localhost:1521:ORCL')
  • db.user (default is 'user')
  • db.pwd (default is 'password')
  • db.platform (default is 'org.eclipse.persistence.platform.database.oracle.Oracle11Platform')
  • server.host (default is 'localhost')
  • server.port (default is '7001')
  • server.platform (default is 'wls')
  • server.datasource (default is 'jdbc/DBWStestDS')

Note that a number of required properties are set in antbuild.properties, and can be modified if desired:

  • db.driver=oracle.jdbc.OracleDriver
  • db.platform=org.eclipse.persistence.platform.database.oracle.Oracle11Platform
  • db.ddl.create=true
  • db.ddl.drop=true
  • db.ddl.debug=false

Configuring to run in the Eclipse IDE

Two .launch files will be provided:

  1. All server tests (builder).launch
  2. All server tests (service).launch

Both require the following be set:

  • db.oracle.user (default is 'user')
  • db.oracle.pwd (default is 'password')
  • db.oracle.url (default is 'jdbc:oracle:thin:@localhost:1521:ORCL')
  • db.oracle.platform (default is 'org.eclipse.persistence.platform.database.oracle.Oracle11Platform')
  • db.oracle.driver (default is 'oracle.jdbc.OracleDriver')
  • db.ddl.create (default is 'true')
  • db.ddl.drop (default is 'true')
  • db.ddl.debug (default is 'false')
  • server.host (default is 'localhost')
  • server.port (default is '7001')
  • server.platform (default is 'wls')
  • server.datasource (default is 'jdbc/DBWStestDS')

These properties can be set as string values:

  • Window > Preferences > Run/Debug > String Substitution

Back to the top