Projects:Modulescripts ERP Version Update Expose/QA
Contents |
Introduction
The main goal of the QA-Test Plan of this project is to ensure that the new execution approach makes modulescripts be executed only when they are supposed to be executed, according to a possible dependency defined in the modulescript itself.
Automatic Tests
A new JUnit test case has been created and included as part of the ant task tests executed during CI.
This test covers all the possible dependencies that can be set for a modulescript execution when updating database. The code of the test can be found here.
Manual Tests
To test the new functionality inside Openbravo module installation infrastructure, some manual tests have been done. In order to execute this tests, the same module with different versions have been created:
- Modulescripts Version Update Expose, version 1.0.0: this module is the initial one.
- Modulescripts Version Update Expose, version 1.1.0: this module contains a modulescript with a dependency with this same module, and defines its last version as 1.1.0. It is defined as follows:
package org.openbravo.modulescript.expose; import org.apache.log4j.Logger; import org.openbravo.modulescript.ModuleScript; import org.openbravo.modulescript.ModuleScriptExecutionLimits; import org.openbravo.modulescript.OpenbravoVersion; public class ModuleScriptTest2 extends ModuleScript { private static final Logger log4j = Logger.getLogger(ModuleScriptTest.class); @Override public void execute() { log4j.info("Executing ModuleScriptTest..."); } @Override protected ModuleScriptExecutionLimits getModuleScriptExecutionLimits() { return new ModuleScriptExecutionLimits("62F8E0D24E11473B911EA76AED13C8DC", null, new OpenbravoVersion(1, 1, 0)); } }
- Modulescripts Version Update Expose, version 1.2.0: this module contains the same modulescript as in version 1.1.0 but it also overrides the executeOnInstall() method in order to return false instead of the default true value. This means that the modulescript must not be executed when directly installing this version.
@Override protected boolean executeOnInstall() { return false; }
- Modulescripts Version Update Expose, version 1.3.0: this module contains another modulescript with a dependency with core module. It defines a first and a last version for the execution as follows:
package org.openbravo.modulescript.expose; import org.apache.log4j.Logger; import org.openbravo.modulescript.ModuleScript; import org.openbravo.modulescript.ModuleScriptExecutionLimits; import org.openbravo.modulescript.OpenbravoVersion; public class ModuleScriptTest2 extends ModuleScript { private static final Logger log4j = Logger.getLogger(ModuleScriptTest.class); @Override public void execute() { log4j.info("Executing ModuleScriptTest2..."); } @Override protected ModuleScriptExecutionLimits getModuleScriptExecutionLimits() { return new ModuleScriptExecutionLimits("0", new OpenbravoVersion(3,0,27029), new OpenbravoVersion(3,0,27050)); } }
These four test modules can be downloaded from here.
Scenario 1
Test Plan
Through Module Management window:
- Install version 1.0.0
- Update to version 1.1.0. The modulescript ModuleScriptTest must be executed.
- Update to version 1.2.0. The modulescript ModuleScriptTest must not be executed.
Results
- Install version 1.0.0
- Update to version 1.1.0. Modulescript Executed
- Update to version 1.2.0. Modulescript NOT Executed
Test Result: CORRECT
Scenario 2
Test Plan
Through Module Management window:
- Install version 1.1.0. The modulescript ModuleScriptTest must be executed.
- Update to version 1.2.0. The modulescript ModuleScriptTest must not be executed.
Results
- Install version 1.1.0. Modulescript Executed
- Update to version 1.2.0. Modulescript NOT Executed
Test Result: CORRECT
Scenario 3
Test Plan
Through Module Management window:
- Install version 1.2.0. The modulescript ModuleScriptTest must not be executed.
Results
- Install version 1.2.0. Modulescript NOT Executed
Test Result: CORRECT
Scenario 4
Test Plan
Through Module Management window, having core version = 3.0.27029
- Install version 1.2.0
- Update to version 1.3.0. The modulescript ModuleScriptTest2 must not be executed.
- Update core to a version between the first and last versions defined for the modulescript. ModuleScriptTest2 must be executed.
- Update core to a version higher or equal than the last version defined for the modulescript. ModuleScriptTest2 must not be executed.
Results
- Install version 1.2.0.
- Update to version 1.3.0. Modulescript NOT Executed
- Update core to version 3.0.27030 Modulescript Executed
- Update core to version 3.0.27055 Modulescript NOT Executed
Test Result: CORRECT