|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fzi.kadmos.api.impl.AlignmentTestBase
public abstract class AlignmentTestBase
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.
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static OWLOntology ontology1
protected static OWLOntology ontology2
protected static OWLClass cls1
protected static OWLClass cls2
protected static OWLClass cls1a
protected static OWLClass cls2a
protected static OWLClass cls1NotInSig
protected static OWLClass cls2NotInSig
protected de.fzi.kadmos.api.impl.AlignmentTestBase.MockAlignmentListener listener1
protected de.fzi.kadmos.api.impl.AlignmentTestBase.MockAlignmentListener listener2
protected Alignment alignment
Constructor Detail |
---|
public AlignmentTestBase()
Method Detail |
---|
public static void setUpBeforeClass() throws Exception
Exception
public void setUp() throws Exception
Exception
protected abstract void initAlignment() throws Exception
alignment
field
with different alignment implementations.
Exception
public void tearDown() throws Exception
Exception
public final void testSimpleAlignmentOWLOntologyOWLOntology()
SimpleAlignment.SimpleAlignment(org.semanticweb.owlapi.model.OWLOntology, org.semanticweb.owlapi.model.OWLOntology)
.
After creating an instance of SimpleAlignment
for two
OWLOntology
s, the references to the ontologies can be
retrieved via the getter methods.
public final void testAttachListener() throws Exception
SimpleAlignment.attachListener(AlignmentListener)
.
Adding two different listeners and
one of them twice does not cause any problems.
Exception
public final void testAttachListenerNull() throws Exception
SimpleAlignment.attachListener(AlignmentListener)
.
Trying to attach a null
reference as listener
raises a NullPointerException
.
Exception
public final void testDetachListener() throws Exception
SimpleAlignment.detachListener(AlignmentListener)
.
Detaching an attached listener, and one that was not attached
does not cause any problem.
Exception
public final void testDetachListenerNull() throws Exception
SimpleAlignment.detachListener(AlignmentListener)
.
Trying to detach a null
reference as listener
raises a NullPointerException
.
Exception
public final void testAddCorrespondence() throws Exception
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.
Exception
public final void testAddCorrespondenceTwice() throws Exception
SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence)
.
Trying to add the same correspondence object twice
raises a MultiplicityException
.
Exception
public final void testAddTwoCorrespondencesForSameEntity1() throws Exception
SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence)
.
Trying to add two correspondences for the same entity 1
results in a MultiplicityException
.
MultiplicityException
Exception
public final void testAddTwoCorrespondencesForSameEntity2() throws Exception
SimpleAlignment.addCorrespondence(de.fzi.kadmos.api.Correspondence)
.
Trying to add two correspondences for the same entity 2
results in a MultiplicityException
.
MultiplicityException
Exception
public final void testAddDifferentCorrespondenceTypes() throws Exception
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
.
Exception
public final void testAddCorrespondenceEntity1NotInOntology() throws Exception
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
.
Exception
public final void testAddCorrespondenceEntity2NotInOntology() throws Exception
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
.
Exception
public final void testGetCorrespondences() throws Exception
SimpleAlignment.getCorrespondences()
.
Adding two correspondences to an alignment and retrieving the set of correspondences,
this set contains exactly the correspondences added.
Exception
public final void testGetCorrespondencesModifyRemove() throws Exception
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.
Exception
public final void testGetCorrespondencesModifyAdd() throws Exception
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.
Exception
public final void testGetEntity1CorrOWLEntity() throws Exception
SimpleAlignment.getEntity1Corr(org.semanticweb.owlapi.model.OWLEntity)
.
Exception
public final void testGetEntity2CorrOWLEntity() throws Exception
SimpleAlignment.getEntity2Corr(org.semanticweb.owlapi.model.OWLEntity)
.
Exception
public final void testGetEntity1CorrIRI() throws Exception
SimpleAlignment.getEntity1Corr(IRI)
.
Exception
public final void testGetEntity2CorrIRI() throws Exception
SimpleAlignment.getEntity2Corr(IRI)
.
Exception
public final void testRemoveCorrespondence() throws Exception
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.
Exception
public final void testClone() throws Exception
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.
Exception
public final void testIteratorCompleteness() throws Exception
SimpleAlignment.iterator()
.
All elements contained in the iterator are contained in the alignment.
Exception
public final void testIteratorRemoval() throws Exception
SimpleAlignment.iterator()
.
Removing an element via the iterator removes it from all internal
data structures of the alignment.
Exception
public final void testIteratorRemovalTwice() throws Exception
SimpleAlignment.iterator()
.
Trying to remove an element twice via the iterator results in
an IllegalStateException
.
Exception
public final void testIteratorRemovelWithoutNext() throws Exception
SimpleAlignment.iterator()
.
Trying to remove an element via the iterator without a prior call to
next()
results in an IllegalStateException
.
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |