Adempiere Junit test

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Adempiere Junit test

Test Junit and make it work. Adempiere Junit test code is here:

Adempiere Junit test code


the codes in functional extend class AdempiereTestCase.and class AdempiereTestCase extends TestCase.

Junit test

  • First import adempiereTrunk source code into eclipse,build it.


  • The source codes of them at project adempiereTrunk -> extend/src -> test,test.functional,test.functional.inventory and test.performance.
  • The compiled codes at adempiereTrunk -> extend -> build -> test

Test example

  • Open test.functional ->
  • Right click it, select Run As -> JUnit Test,we will get information like follow at the console.
  • And pop up a window let you select "" file.
  • If we did not appoint file,the test will fail.

Review the failure Trace

  • Then use the "" file, and test again.
# cp

Edit it like this:

# nano
  • Save it to AdempiereProperties as the properties file when you installed adempiere.

Note: Here you can put "" file to directory adempiere_Home/,codes will find it automatically when testing.

Test again

right click test.functional ->,select Run As -> JUnit Test

appoint the "" file,hit the open button.

  • We will see the informations at console and the test result with 0 errors.

Functional Test Suite

There is a class test.functional ->, a test suite for most of classes in test.functional.

  • run it as JUnit.

The result


All tests successful

  • For classes such as AlertTest, MInvoiceTest,MMatchInvTest, MProductTest, MSessionTest, PackOutTest, WorkflowTest that are not in the test suite, we can add them to

Example add class AlertTest

  • If you want to run all tests in adempiere.right click project adempiereTrunk -> Run,and select it as follow.
  • Then hit run button.