mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-10771: adding validation to schema compare tool
Added support to DbObjects to accept visitors Added ValidatingVisitor to invoke suitable validator on each DbObject Added NameValidator and NullValidator to operate on DbObject types Added test suites git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31494 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -23,10 +23,14 @@ import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.inOrder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.alfresco.util.schemacomp.DbObjectVisitor;
|
||||
import org.alfresco.util.schemacomp.DiffContext;
|
||||
import org.alfresco.util.schemacomp.Differences;
|
||||
import org.alfresco.util.schemacomp.Result.Strength;
|
||||
import org.alfresco.util.schemacomp.Result.Where;
|
||||
import org.alfresco.util.schemacomp.ValidationResult;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -55,7 +59,7 @@ public class AbstractDbObjectTest
|
||||
public void setUp() throws Exception
|
||||
{
|
||||
dbObject = new ConcreteDbObject("the_object");
|
||||
ctx = new DiffContext(dialect, differences);
|
||||
ctx = new DiffContext(dialect, differences, new ArrayList<ValidationResult>());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -116,5 +120,10 @@ public class AbstractDbObjectTest
|
||||
Differences differences = ctx.getDifferences();
|
||||
differences.add(Where.IN_BOTH_BUT_DIFFERENCE, "left", "right");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(DbObjectVisitor visitor)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user