de.fzi.kadmos.api.impl
Class AlignmentTestBase

java.lang.Object
  extended by de.fzi.kadmos.api.impl.AlignmentTestBase
Direct Known Subclasses:
ForwardingAlignmentTest, SimpleAlignmentTest

public abstract class AlignmentTestBase
extends Object

Standard tests for implementations of an alignment. The class should be extended for any particular implementation and the setUp method should be overridden in order to initialise the field alignment with an instance of the implementation to test.

Author:
Juergen Bock

Field Summary
protected  Alignment alignment
           
protected static OWLClass cls1
           
protected static OWLClass cls1a
           
protected static OWLClass cls1NotInSig
           
protected static OWLClass cls2
           
protected static OWLClass cls2a
           
protected static OWLClass cls2NotInSig
           
protected  de.fzi.kadmos.api.impl.AlignmentTestBase.MockAlignmentListener listener1
           
protected  de.fzi.kadmos.api.impl.AlignmentTestBase.MockAlignmentListener listener2
           
protected static OWLOntology ontology1
           
protected static OWLOntology ontology2
           
 
Constructor Summary
AlignmentTestBase()
           
 
Method Summary
protected abstract  void initAlignment()
          Extend this in order to initialise the alignment field with different alignment implementations.
 void setUp()
          Initialises the listeners.
static void setUpBeforeClass()
           
 void tearDown()
          Reset the listeners.
 void testAddCorrespondence()
          Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence).
 void testAddCorrespondenceEntity1NotInOntology()
          Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence).
 void testAddCorrespondenceEntity2NotInOntology()
          Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence).
 void testAddCorrespondenceTwice()
          Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence).
 void testAddDifferentCorrespondenceTypes()
          Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence).
 void testAddTwoCorrespondencesForSameEntity1()
          Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence).
 void testAddTwoCorrespondencesForSameEntity2()
          Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence).
 void testAttachListener()
          Test method for SimpleAlignment.attachListener(AlignmentListener).
 void testAttachListenerNull()
          Test method for SimpleAlignment.attachListener(AlignmentListener).
 void testClone()
          Test method for SimpleAlignment.clone().
 void testDetachListener()
          Test method for SimpleAlignment.detachListener(AlignmentListener).
 void testDetachListenerNull()
          Test method for SimpleAlignment.detachListener(AlignmentListener).
 void testGetCorrespondences()
          Test method for SimpleAlignment.getCorrespondences().
 void testGetCorrespondencesModifyAdd()
          Test method for SimpleAlignment.getCorrespondences().
 void testGetCorrespondencesModifyRemove()
          Test method for SimpleAlignment.getCorrespondences().
 void testGetEntity1CorrIRI()
          Test method for SimpleAlignment.getEntity1Corr(IRI).
 void testGetEntity1CorrOWLEntity()
          Test method for SimpleAlignment.getEntity1Corr(org.semanticweb.owlapi.model.OWLEntity).
 void testGetEntity2CorrIRI()
          Test method for SimpleAlignment.getEntity2Corr(IRI).
 void testGetEntity2CorrOWLEntity()
          Test method for SimpleAlignment.getEntity2Corr(org.semanticweb.owlapi.model.OWLEntity).
 void testIteratorCompleteness()
          Test method for SimpleAlignment.iterator().
 void testIteratorRemoval()
          Test method for SimpleAlignment.iterator().
 void testIteratorRemovalTwice()
          Test method for SimpleAlignment.iterator().
 void testIteratorRemovelWithoutNext()
          Test method for SimpleAlignment.iterator().
 void testRemoveCorrespondence()
          Test method for SimpleAlignment.removeCorrespondence(de.fzi.kadmos.api.Correspondence).
 void testSimpleAlignmentOWLOntologyOWLOntology()
          Test method for SimpleAlignment.SimpleAlignment(org.semanticweb.owlapi.model.OWLOntology, org.semanticweb.owlapi.model.OWLOntology).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ontology1

protected static OWLOntology ontology1

ontology2

protected static OWLOntology ontology2

cls1

protected static OWLClass cls1

cls2

protected static OWLClass cls2

cls1a

protected static OWLClass cls1a

cls2a

protected static OWLClass cls2a

cls1NotInSig

protected static OWLClass cls1NotInSig

cls2NotInSig

protected static OWLClass cls2NotInSig

listener1

protected de.fzi.kadmos.api.impl.AlignmentTestBase.MockAlignmentListener listener1

listener2

protected de.fzi.kadmos.api.impl.AlignmentTestBase.MockAlignmentListener listener2

alignment

protected Alignment alignment
Constructor Detail

AlignmentTestBase

public AlignmentTestBase()
Method Detail

setUpBeforeClass

public static void setUpBeforeClass()
                             throws Exception
Throws:
Exception

setUp

public void setUp()
           throws Exception
Initialises the listeners.

Throws:
Exception

initAlignment

protected abstract void initAlignment()
                               throws Exception
Extend this in order to initialise the alignment field with different alignment implementations.

Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Reset the listeners.

Throws:
Exception

testSimpleAlignmentOWLOntologyOWLOntology

public final void testSimpleAlignmentOWLOntologyOWLOntology()
Test method for SimpleAlignment.SimpleAlignment(org.semanticweb.owlapi.model.OWLOntology, org.semanticweb.owlapi.model.OWLOntology). After creating an instance of SimpleAlignment for two OWLOntologys, the references to the ontologies can be retrieved via the getter methods.


testAttachListener

public final void testAttachListener()
                              throws Exception
Test method for SimpleAlignment.attachListener(AlignmentListener). Adding two different listeners and one of them twice does not cause any problems.

Throws:
Exception

testAttachListenerNull

public final void testAttachListenerNull()
                                  throws Exception
Test method for SimpleAlignment.attachListener(AlignmentListener). Trying to attach a null reference as listener raises a NullPointerException.

Throws:
Exception

testDetachListener

public final void testDetachListener()
                              throws Exception
Test method for SimpleAlignment.detachListener(AlignmentListener). Detaching an attached listener, and one that was not attached does not cause any problem.

Throws:
Exception

testDetachListenerNull

public final void testDetachListenerNull()
                                  throws Exception
Test method for SimpleAlignment.detachListener(AlignmentListener). Trying to detach a null reference as listener raises a NullPointerException.

Throws:
Exception

testAddCorrespondence

public final void testAddCorrespondence()
                                 throws Exception
Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence). After adding a correspondence to the SimpleAlignment, the correspondence is contained in the alignment, a correspondence between the two entities is contained, a correspondence for entity 1 is contained, a correspondence for entity 2 is contained, and the size of the alignment is 1.

Throws:
Exception

testAddCorrespondenceTwice

public final void testAddCorrespondenceTwice()
                                      throws Exception
Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence). Trying to add the same correspondence object twice raises a MultiplicityException.

Throws:
Exception

testAddTwoCorrespondencesForSameEntity1

public final void testAddTwoCorrespondencesForSameEntity1()
                                                   throws Exception
Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence). Trying to add two correspondences for the same entity 1 results in a MultiplicityException.

Throws:
MultiplicityException
Exception

testAddTwoCorrespondencesForSameEntity2

public final void testAddTwoCorrespondencesForSameEntity2()
                                                   throws Exception
Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence). Trying to add two correspondences for the same entity 2 results in a MultiplicityException.

Throws:
MultiplicityException
Exception

testAddDifferentCorrespondenceTypes

public final void testAddDifferentCorrespondenceTypes()
                                               throws Exception
Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence). Adding two correspondences of different types, but which represent correspondences of the same entities, results in a MultiplicityException.

Throws:
Exception

testAddCorrespondenceEntity1NotInOntology

public final void testAddCorrespondenceEntity1NotInOntology()
                                                     throws Exception
Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence). Adding a correspondence whose entity 1 is not contained in the signature of ontology 1 results in an IncompatibleOntologyException.

Throws:
Exception

testAddCorrespondenceEntity2NotInOntology

public final void testAddCorrespondenceEntity2NotInOntology()
                                                     throws Exception
Test method for SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence). Adding a correspondence whose entity 2 is not contained in the signature of ontology 2 results in an IncompatibleOntologyException.

Throws:
Exception

testGetCorrespondences

public final void testGetCorrespondences()
                                  throws Exception
Test method for SimpleAlignment.getCorrespondences(). Adding two correspondences to an alignment and retrieving the set of correspondences, this set contains exactly the correspondences added.

Throws:
Exception

testGetCorrespondencesModifyRemove

public final void testGetCorrespondencesModifyRemove()
                                              throws Exception
Test method for SimpleAlignment.getCorrespondences(). Retrieving the set of correspondences and removing a correspondence from this set does not affect the alignment where the set was obtained from.

Throws:
Exception

testGetCorrespondencesModifyAdd

public final void testGetCorrespondencesModifyAdd()
                                           throws Exception
Test method for SimpleAlignment.getCorrespondences(). Retrieving the set of correspondences and adding a correspondence to this set does not affect the alignment where the set was obtained from.

Throws:
Exception

testGetEntity1CorrOWLEntity

public final void testGetEntity1CorrOWLEntity()
                                       throws Exception
Test method for SimpleAlignment.getEntity1Corr(org.semanticweb.owlapi.model.OWLEntity).

Throws:
Exception

testGetEntity2CorrOWLEntity

public final void testGetEntity2CorrOWLEntity()
                                       throws Exception
Test method for SimpleAlignment.getEntity2Corr(org.semanticweb.owlapi.model.OWLEntity).

Throws:
Exception

testGetEntity1CorrIRI

public final void testGetEntity1CorrIRI()
                                 throws Exception
Test method for SimpleAlignment.getEntity1Corr(IRI).

Throws:
Exception

testGetEntity2CorrIRI

public final void testGetEntity2CorrIRI()
                                 throws Exception
Test method for SimpleAlignment.getEntity2Corr(IRI).

Throws:
Exception

testRemoveCorrespondence

public final void testRemoveCorrespondence()
                                    throws Exception
Test method for SimpleAlignment.removeCorrespondence(de.fzi.kadmos.api.Correspondence). After adding two correspondences to an alignment and removing one of them afterwards, the alignment does not contain this correspondence anymore, but still contains the other one. After removing the other correspondence, the alignment is empty.

Throws:
Exception

testClone

public final void testClone()
                     throws Exception
Test method for SimpleAlignment.clone(). After creating an alignment containing two correspondences and cloning it, the original and its clone are not identical, are equal, refer to the same ontology objects, have the same size, contain the equal correspondences, but not identical correspondence objects, the confidence is the same.

Throws:
Exception

testIteratorCompleteness

public final void testIteratorCompleteness()
                                    throws Exception
Test method for SimpleAlignment.iterator(). All elements contained in the iterator are contained in the alignment.

Throws:
Exception

testIteratorRemoval

public final void testIteratorRemoval()
                               throws Exception
Test method for SimpleAlignment.iterator(). Removing an element via the iterator removes it from all internal data structures of the alignment.

Throws:
Exception

testIteratorRemovalTwice

public final void testIteratorRemovalTwice()
                                    throws Exception
Test method for SimpleAlignment.iterator(). Trying to remove an element twice via the iterator results in an IllegalStateException.

Throws:
Exception

testIteratorRemovelWithoutNext

public final void testIteratorRemovelWithoutNext()
                                          throws Exception
Test method for SimpleAlignment.iterator(). Trying to remove an element via the iterator without a prior call to next() results in an IllegalStateException.

Throws:
Exception


Copyright © 2012. All Rights Reserved.