db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myrna van Lunteren (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-949) Clean up tests to use common method to get connections
Date Sun, 12 Mar 2006 21:59:48 GMT
     [ http://issues.apache.org/jira/browse/DERBY-949?page=all ]

Myrna van Lunteren updated DERBY-949:
-------------------------------------

    Attachment: DERBY-949_2006_03_11.stat
                DERBY-949_2006_03_11.diff

Adding a patch to this issue.
The patch contains the following changes:
- replacing if (jsr 169) blocks in the tests closed, OnlineBackup*, logStream, BackupRecovery
and TestDurability.
- fixes TestUtil.getConnection so you can get a connection to datasource or drivermanager
even if there are no
   specific connection attributes to be used.
- modified the testing/README.htm to have 3 suggestions for writing tests to ensure new test
will work in various configuration that
   I currently care about (remote server testing, j2ME testing):    
    *      ensure the test cleans up any testobjects created. This is important for running
the tests in suites with a remote server, or with useprocess=false, because in those cases,
tests run against databases in the same directory.  Even if you do not anticipate your test
to run in those configurations, it makes good practice. You may also want to protect your
test from other tests leaving things behind by removing them before running also. The class
org.apache.derbyTesting.functionTests.util.TestUtil has a cleanUpTest method that may be useful.
    *      ensure that connections can be made with all supported jvms. This includes the
j2ME/CDC/JSR169 configuration, which only has java.sql.Datasource available, no java.sql.DriverManager.
One can use the method ij.startJBMS() to get an appropriate connection, or TestUtil.getConnection()
if one needs to specify connection properties different from what is defined in the <test>_app.properties
file. For instance, to shutdown a database one can use:
                            TestUtil("wombat","shutdown=true");
    *      ensure the test does not have hard coded 'localhost' for network connections. Instead,
use the method TestUtil.getHostName() to find if a hostName was specified for remote server
testing.


> Clean up tests to use common method to get connections
> ------------------------------------------------------
>
>          Key: DERBY-949
>          URL: http://issues.apache.org/jira/browse/DERBY-949
>      Project: Derby
>         Type: Test
>   Components: Test
>     Versions: 10.2.0.0
>     Reporter: Deepa Remesh
>     Assignee: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.2.0.0
>  Attachments: DERBY-949_2006_03_11.diff, DERBY-949_2006_03_11.stat
>
> Currently some tests have code to check the environment and get connection using DriverManager/DataSource.
This logic has been moved to TestUtil.getConnection method. Cleanup tests to use this method.
List of tests:
> store/TestDurabilityProperty.java
> store/backupRestore1.java
> store/OnlineBackup tests
> lang/logStream.java
> lang/closed.java
> Also, add comment to ij.startJBMS method mentioning TestUtil.getConnection method. See
https://issues.apache.org/jira/browse/DERBY-907#action_12365954

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message