Commit 2415c89e authored by Stefan Huehner's avatar Stefan Huehner
Browse files

Fixes ISSUE-29853. Remove ant validate.database (broken since before 2015)

This task does not work cleanly since at least since 2015. The validations
done (implemented in DatabaseValidator) are also executed during ExportDatabase
(for the module being exported) so no functionality is actually lost.
parent bc9e0837
......@@ -459,10 +459,6 @@ export.database: exports database structure and data to xml files.
<ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true" />
</target>
<target name="validate.database">
<ant dir="${base.src}" target="validate.database" inheritAll="true" inheritRefs="true" />
</target>
<target name="validate.modules">
<ant dir="${base.src}" target="validate.modules" inheritAll="true" inheritRefs="true" />
</target>
......@@ -610,7 +606,6 @@ export.database: exports database structure and data to xml files.
<ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
<!--
<antcall target="validate.database" />
<antcall target="validate.modules" />
-->
</target>
......
......@@ -89,13 +89,6 @@ build.war: build a war file in the lib directory.
</sequential>
</macrodef>
<target name="validate.database">
<taskdef name="validateDatabase" classname="org.openbravo.service.system.SystemValidationTask">
<classpath refid="project.class.path" />
</taskdef>
<validateDatabase userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" type="database" />
</target>
<target name="validate.modules">
<taskdef name="validateModules" classname="org.openbravo.service.system.SystemValidationTask">
<classpath refid="project.class.path" />
......
......@@ -54,22 +54,6 @@ public class SystemValidationTask extends DalInitializingTask {
protected void doExecute() {
final Module module = getModule();
if (getType().contains("database")) {
final Database database = createDatabaseObject();
log.info("Validating Database and Application Dictionary");
final DatabaseValidator databaseValidator = new DatabaseValidator();
databaseValidator.setValidateModule(module);
databaseValidator.setDatabase(database);
final SystemValidationResult result = databaseValidator.validate();
if (result.getErrors().isEmpty() && result.getWarnings().isEmpty()) {
log.warn("Validation successfull no warnings or errors");
} else {
final String errors = SystemService.getInstance().logValidationResult(log, result);
if (failOnError) {
throw new OBException(errors);
}
}
}
// does both module and database
if (getType().contains("module")) {
log.info("Validating Modules");
......@@ -125,12 +109,6 @@ public class SystemValidationTask extends DalInitializingTask {
return PlatformFactory.createNewPlatformInstance(ds);
}
private Database createDatabaseObject() {
Platform platform = getPlatform();
platform.getModelLoader().setOnlyLoadTableColumns(true);
return platform.loadModelFromDatabase(null);
}
private Module getModule() {
if (getModuleJavaPackage() == null) {
return null;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment