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:
Matt Ward
2011-10-26 16:01:38 +00:00
parent 7764900451
commit ec302df6ed
33 changed files with 896 additions and 30 deletions

View File

@@ -18,6 +18,9 @@
*/
package org.alfresco.util.schemacomp.model;
import static org.mockito.Mockito.verify;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -25,12 +28,41 @@ import org.junit.Test;
* Tests for the Sequence class.
* @author Matt Ward
*/
public class SequenceTest
public class SequenceTest extends DbObjectTestBase<Sequence>
{
@Ignore
@Test
public void noTestsRequired()
private Sequence thisSequence;
private Sequence thatSequence;
@Before
public void setUp()
{
// No functionality over and above AbstractDbObject at present.
thisSequence = new Sequence("this_sequence");
thatSequence = new Sequence("that_sequence");
}
@Test
public void acceptVisitor()
{
thisSequence.accept(visitor);
verify(visitor).visit(thisSequence);
}
@Override
protected Sequence getThisObject()
{
return thisSequence;
}
@Override
protected Sequence getThatObject()
{
return thatSequence;
}
@Override
protected void doDiffTests()
{
// Nothing extra to diff.
}
}