de.fzi.kadmos.parser.impl
Class INRIAFormatParserTest

java.lang.Object
  extended by de.fzi.kadmos.parser.impl.INRIAFormatParserTest

public class INRIAFormatParserTest
extends Object

Test class for the INRIAFormatParser.

Author:
Juergen Bock, Matthias Stumpp

Constructor Summary
INRIAFormatParserTest()
           
 
Method Summary
 void resetParserBeforeTest()
          Resets the parser before a test
 void testCorrectAlignmentFactory()
          If an AlignmentFactory is set, the parser should produce Alignments of the type, the factory creates.
 void testCorrectCorrespondenceFactory()
          If a CorrespondenceFactory is set, the parser should produce Correspondences of the type, the factory generates.
 void testDocumentNoOntologies()
          If an XML-String with invalid root element is given to the parser an AlignmentParserException is thrown.
 void testDocumentNoRoot()
          If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.
 void testDocumentNotWellFormed()
          If a non-well-formed XML-String is given as input to the parser, an AlignmentParserException is thrown.
 void testInstanceCaching()
          If two instances are requested using the same Reader, the same AlignmentParser instance is provided.
 void testMissingOntologySetOntologyInputStream()
          No locations for the ontologies are provided in the parsing document.
 void testMissingOntologySetOntologyOWLOntology()
          No locations for the ontologies are provided in the parsing document.
 void testMissingOntologySetOntologyURL()
          No locations for the ontologies are provided in the parsing document.
 void testParseAlignmentParserExceptionLevelONE()
          If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.
 void testParseAlignmentParserExceptionLEVELTHREE()
          If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.
 void testParseAlignmentParserExceptionLEVELTWO()
          If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.
 void testParseContainsIRI()
          If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.
 void testParseFile()
          If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.
 void testParseHasOWLOntologies()
          If an Alignment contains OWLOntologies contained in XML-String an AlignmentParserException is thrown.
 void testParseIncompatibleEntityTypesExceptionLevelONE()
          If a correspondence contains entites of different type and parsing level = 1 an AlignmentParserException is thrown.
 void testParseIncompatibleEntityTypesExceptionLEVELTHREE()
          If a correspondence contains entites of different type and parsing level = 3 an AlignmentParserException is thrown.
 void testParseIncompatibleEntityTypesExceptionLEVELTWO()
          If a correspondence contains entites of different type and parsing level = 2 an AlignmentParserException is thrown.
 void testParseInputSourceFromReader()
          If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.
 void testParseInputStream()
          If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.
 void testParseMultiplicityExceptionLevelONE()
          If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.
 void testParseMultiplicityExceptionLEVELTHREE()
          If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.
 void testParseMultiplicityExceptionLEVELTWO()
          If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.
 void testParseParseRenderParse()
          If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.
 void testParseReader()
          If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.
 void testParseStringAbsolutePath()
          If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.
 void testParseStringURI()
          If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.
 void testParseTwiceDifferentReader()
          If a parser is invoked twice with different readers, the parser should do the job twice without complaining.
 void testParseTwiceOneReader()
          If a parser is invoked twice with the same reader, the second call should throw exception
 void testParseURL()
          If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.
 void testRealAlignmentNoLocation()
          An alignment of ontologies where no physical URL is given is parsed.
 void testRealAlignmentWithLocation()
          An alignment of ontologies where a physical URL is given is parsed.
 void testUnresolvableLocationOntologySetOntologyOWLOntology()
          The ontologies in the document to be parsed are provided but have unresolvable locations.
 void testValidOntologySetOntologyOWLOntology()
          Resovable locations for the ontologies are provided in the document to be parsed.
static void updateAlignmentAbsolutePath()
          Updates absolute paths in alignment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

INRIAFormatParserTest

public INRIAFormatParserTest()
Method Detail

updateAlignmentAbsolutePath

public static void updateAlignmentAbsolutePath()
Updates absolute paths in alignment


resetParserBeforeTest

public void resetParserBeforeTest()
Resets the parser before a test


testInstanceCaching

public final void testInstanceCaching()
                               throws Exception
If two instances are requested using the same Reader, the same AlignmentParser instance is provided. If different Readers are used, different instances are provided.

Throws:
Exception

testDocumentNotWellFormed

public final void testDocumentNotWellFormed()
                                     throws Exception
If a non-well-formed XML-String is given as input to the parser, an AlignmentParserException is thrown.

Throws:
Exception

testDocumentNoRoot

public final void testDocumentNoRoot()
                              throws Exception
If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.

Throws:
Exception

testDocumentNoOntologies

public final void testDocumentNoOntologies()
                                    throws Exception
If an XML-String with invalid root element is given to the parser an AlignmentParserException is thrown.

Throws:
Exception

testParseFile

public final void testParseFile()
                         throws Exception
If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.

Throws:
Exception

testParseStringURI

public final void testParseStringURI()
                              throws Exception
If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.

Throws:
Exception

testParseStringAbsolutePath

public final void testParseStringAbsolutePath()
                                       throws Exception
If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.

Throws:
Exception

testParseURL

public final void testParseURL()
                        throws Exception
If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.

Throws:
Exception

testParseReader

public final void testParseReader()
                           throws Exception
If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.

Throws:
Exception

testParseTwiceOneReader

public final void testParseTwiceOneReader()
                                   throws Exception
If a parser is invoked twice with the same reader, the second call should throw exception

Throws:
Exception

testParseTwiceDifferentReader

public final void testParseTwiceDifferentReader()
                                         throws Exception
If a parser is invoked twice with different readers, the parser should do the job twice without complaining.

Throws:
Exception

testParseInputStream

public final void testParseInputStream()
                                throws Exception
If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.

Throws:
Exception

testParseInputSourceFromReader

public final void testParseInputSourceFromReader()
                                          throws Exception
If an XML-String with no root element is given to the parser an AlignmentParserException is thrown.

Throws:
Exception

testCorrectAlignmentFactory

public final void testCorrectAlignmentFactory()
                                       throws Exception
If an AlignmentFactory is set, the parser should produce Alignments of the type, the factory creates. If the AlignmentFactory is set to a different factory, the parser should consequently produce Alignments of the type, that new factory creates.

Throws:
Exception

testCorrectCorrespondenceFactory

public final void testCorrectCorrespondenceFactory()
                                            throws Exception
If a CorrespondenceFactory is set, the parser should produce Correspondences of the type, the factory generates. If the CorrespondenceFactory is set to a different factory, the parser should consequently produce Correspondences of the type, that new factory creates.

Throws:
Exception

testParseHasOWLOntologies

public final void testParseHasOWLOntologies()
                                     throws Exception
If an Alignment contains OWLOntologies contained in XML-String an AlignmentParserException is thrown.

Throws:
Exception

testParseContainsIRI

public final void testParseContainsIRI()
                                throws Exception
If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.

Throws:
Exception

testParseAlignmentParserExceptionLevelONE

public final void testParseAlignmentParserExceptionLevelONE()
                                                     throws Exception
If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.

Throws:
Exception

testParseAlignmentParserExceptionLEVELTWO

public final void testParseAlignmentParserExceptionLEVELTWO()
                                                     throws Exception
If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.

Throws:
Exception

testParseAlignmentParserExceptionLEVELTHREE

public final void testParseAlignmentParserExceptionLEVELTHREE()
                                                       throws Exception
If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.

Throws:
Exception

testParseMultiplicityExceptionLevelONE

public final void testParseMultiplicityExceptionLevelONE()
                                                  throws Exception
If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.

Throws:
Exception

testParseMultiplicityExceptionLEVELTWO

public final void testParseMultiplicityExceptionLEVELTWO()
                                                  throws Exception
If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.

Throws:
Exception

testParseMultiplicityExceptionLEVELTHREE

public final void testParseMultiplicityExceptionLEVELTHREE()
                                                    throws Exception
If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.

Throws:
Exception

testParseIncompatibleEntityTypesExceptionLevelONE

public final void testParseIncompatibleEntityTypesExceptionLevelONE()
                                                             throws Exception
If a correspondence contains entites of different type and parsing level = 1 an AlignmentParserException is thrown.

Throws:
Exception

testParseIncompatibleEntityTypesExceptionLEVELTWO

public final void testParseIncompatibleEntityTypesExceptionLEVELTWO()
                                                             throws Exception
If a correspondence contains entites of different type and parsing level = 2 an AlignmentParserException is thrown.

Throws:
Exception

testParseIncompatibleEntityTypesExceptionLEVELTHREE

public final void testParseIncompatibleEntityTypesExceptionLEVELTHREE()
                                                               throws Exception
If a correspondence contains entites of different type and parsing level = 3 an AlignmentParserException is thrown.

Throws:
Exception

testParseParseRenderParse

public final void testParseParseRenderParse()
                                     throws Exception
If an Alignment contains OWLEntities with IRIs contained in XML-String an AlignmentParserException is thrown.

Throws:
Exception

testRealAlignmentNoLocation

public final void testRealAlignmentNoLocation()
                                       throws Exception
An alignment of ontologies where no physical URL is given is parsed. It must contain the same content as the parser of the INRIA Alignment API returns.

Throws:
Exception

testRealAlignmentWithLocation

public final void testRealAlignmentWithLocation()
                                         throws Exception
An alignment of ontologies where a physical URL is given is parsed. It must contain the same content as the parser of the INRIA Alignment API returns.

Throws:
Exception

testMissingOntologySetOntologyOWLOntology

public final void testMissingOntologySetOntologyOWLOntology()
                                                     throws Exception
No locations for the ontologies are provided in the parsing document. This test tests the use of externally provided locations for the ontologies. The external ontology locations are provided as OWLOntology objects.

Throws:
Exception

testMissingOntologySetOntologyURL

public final void testMissingOntologySetOntologyURL()
                                             throws Exception
No locations for the ontologies are provided in the parsing document. This test tests the use of externally provided locations for the ontologies. The external ontology locations are provided as URL objects.

Throws:
Exception

testMissingOntologySetOntologyInputStream

public final void testMissingOntologySetOntologyInputStream()
                                                     throws Exception
No locations for the ontologies are provided in the parsing document. This test tests the use of externally provided locations for the ontologies. The external ontology locations are provided as InputStream objects.

Throws:
Exception

testValidOntologySetOntologyOWLOntology

public final void testValidOntologySetOntologyOWLOntology()
                                                   throws Exception
Resovable locations for the ontologies are provided in the document to be parsed. This test tests if externally provided ontologies are used instead of using the locations given in the document to be parsed.

Throws:
Exception

testUnresolvableLocationOntologySetOntologyOWLOntology

public final void testUnresolvableLocationOntologySetOntologyOWLOntology()
                                                                  throws Exception
The ontologies in the document to be parsed are provided but have unresolvable locations. This test tests if externally provided ontologies are used instead of trying to parse the ontology locations in the document to be parsed.

Throws:
Exception


Copyright © 2012. All Rights Reserved.