db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "DerbyJUnitTesting" by DanDebrunner
Date Mon, 21 Aug 2006 19:31:15 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by DanDebrunner:
http://wiki.apache.org/db-derby/DerbyJUnitTesting

------------------------------------------------------------------------------
  [[TableOfContents]]
  
  == The junit test type ==
- The name of a Derby test is the argument supplied to `org.apache.derbyTesting.functionTests.harness.RunTest`
when the test is run. Derby JUnit test names always end with `.junit`, e.g. `somesuite/SomeTest.junit`.
In other words, the test type is `junit`. The file that implements a test is a java file,
e.g. `SomeTest.java`. The test harness uses the last part of the ''name'' to decide how it
should run the test. If the name ends with `.java`, the harness knows that the test is a java
class with a `main()` method. If the name ends with `.junit`, the harness knows it is a java
class which can be run by a JUnit test runner.
+ The name of a Derby test is the argument supplied to `org.apache.derbyTesting.functionTests.harness.RunTest`
when the test is run. Derby JUnit test names always end with `.junit`, e.g. `somesuite/SomeTest.junit`.
In other words, the test type is `junit`. The file that implements a test is a java file,
e.g. `SomeTest.java`. The test harness uses the last part of the ''name'' to decide how it
should run the test. If the name ends with `.java`, the harness knows that the test is a java
class with a `main()` method. If the name ends with `.junit`, the harness knows it is a java
class which can be run by a JUnit test runner. No actual file exists with the `.junit` suffix.
  
  == Base JUnit test classes ==
  After some discussion on derby-dev, a set of base classes to be used when writing JUnit
tests were created.
  These are:
-  * `org.apache.derbyTesting.functionTests.util.BaseTestCase`
+  * `org.apache.derbyTesting.junit.BaseTestCase`
-  * `org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase`
+  * `org.apache.derbyTesting.junit.BaseJDBCTestCase`
-  * `org.apache.derbyTesting.functionTests.util.BaseJDBCTestSetup`
+  * `org.apache.derbyTesting.junit.BaseJDBCTestSetup`
-  * `org.apache.derbyTesting.functionTests.util.TestConfiguration` 
+  * `org.apache.derbyTesting.junit.TestConfiguration` 
-  * `org.apache.derbyTesting.functionTests.util.JDBCClient`
+  * `org.apache.derbyTesting.junit.JDBCClient`
   * `org.apache.derbyTesting.functionTests.util.JDBC`
  
+ {i} These classes were moved to their current package from `org.apache.derbyTesting.functionTests.util`
as
+ they can apply to more than functional tests.
+ 
- <!> Note that the class `DerbyJUnitTest` in the same package is [http://www.mail-archive.com/derby-dev@db.apache.org/msg23272.html
deprecated].
+ <!> Note that the class `org.apache.derbyTesting.functionTests.util.DerbyJUnitTest`
is [http://www.mail-archive.com/derby-dev@db.apache.org/msg23272.html deprecated].
  
  To write a JUnit test that uses JDBC, make your test class extend `BaseJDBCTestCase`. This
class is subclass of [http://www.junit.org/junit/javadoc/3.8.1/junit/framework/TestCase.html
TestCase] in JUnit framework and you can add test methods, write your `setUp` and `tearDown`
methods and finally the `suite` method that returns a suite of tests to run (typically all
tests in the test class). `BaseJDBCTestCase` provides a set of often used functionality, for
instance the method `getConnection` to obtain a connection to the default database. If you
are missing something, ask on derby-dev or create a sub-task/link a Jira issue to DERBY-1122.
  
@@ -31, +34 @@

  
  `JDBC` holds test utility methods related to JDBC objects.
  
- Remember that the methods `setUp` and `tearDown` are run before and after each test method
in your class. If you want to run some code only once before or after all test methods in
your class, you can consider using a `BaseJDBCTestSetup` or `TestSetup` test decorator.
+ Remember that the methods `setUp` and `tearDown` are run before and after each test method
(fixture) in your class. If you want to run some code only once before or after all test methods
in your class, you can consider using a `BaseJDBCTestSetup` or `TestSetup` test decorator.
  
  Information about JUnit can be found at http://www.junit.org
  The usage of JUnit in Derby is currently based on JUnit 3.8.1.

Mime
View raw message