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

EclipseLink/Development/Testing/DBWS/2.5.0 Server Tests


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

Future Considerations

The current DBWS server tests are simple, meaning there are no advanced JDBC type args (VArray, Object types, etc), no PL/SQL records or collection args, stored function tests, etc. The following test scenarios should be added:

  • Advanced JDBC IN/OUT/RETURN args
  • PL/SQL record/collection IN/OUT/RETURN args
  • Mix of advanced JDBC and PL/SQL args
  • Large BLOB tests (> 32K Oracle BLOB type test)
  •  %ROWType tests
  • Cursor tests

Back to the top