org.apache.any23
Class Any23Test

java.lang.Object
  extended by org.apache.any23.Any23OnlineTestBase
      extended by org.apache.any23.Any23Test

public class Any23Test
extends Any23OnlineTestBase

Test case for Any23 facade.

Author:
Davide Palmisano ( dpalmisano@gmail.com ), Michele Mostarda ( michele.mostarda@gmail.com )

Field Summary
 
Fields inherited from class org.apache.any23.Any23OnlineTestBase
ONLINE_TEST_DISABLED_FLAG
 
Constructor Summary
Any23Test()
           
 
Method Summary
 void testAbstractMethodErrorIssue186_1()
           
 void testAbstractMethodErrorIssue186_2()
           
 void testBlankNodesViaURL()
           
 void testDemoCodeSnippet1()
          Tests out the first code snipped used in Developer Manual.
 void testDemoCodeSnippet2()
          Tests out the second code snipped used in Developer Manual.
 void testExceptionPropagation()
           
 void testExplicitEncoding()
          This tests the behavior of Any23 to execute the extraction explicitly specifying the charset encoding of the input.
 void testExtractionParameters()
           
 void testExtractionParametersWithNestingDisabled()
           
 void testGZippedContent()
          This test checks if a URL that is supposed to be GZIPPED is correctly opened and parsed with the Any23 facade.
 void testHTMLBruteForceDetection()
           
 void testImplicitEncoding()
          This tests the behavior of Any23 to perform the extraction without passing it any charset encoding.
 void testMicrodataSupport()
           
 void testModifiableConfiguration_issue183()
           
 void testN3Detection1()
           
 void testN3Detection2()
           
 void testNTriplesDetectionAndExtraction()
           
 void testNturtleDetectionAndExtraction()
           
 void testProgrammaticExtraction()
          This test checks the extraction behavior when the library is used programatically.
 void testRDFXMLDetectionAndExtraction()
           
 void testTTLDetection()
           
 void testXMLMimeTypeManagement()
          Test correct management of general XML content.
 void testXMLMimeTypeManagementViaURL()
          Test correct management of general XML content from URL source.
 
Methods inherited from class org.apache.any23.Any23OnlineTestBase
assumeOnlineAllowed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Any23Test

public Any23Test()
Method Detail

testTTLDetection

public void testTTLDetection()
                      throws Exception
Throws:
Exception

testN3Detection1

public void testN3Detection1()
                      throws Exception
Throws:
Exception

testN3Detection2

public void testN3Detection2()
                      throws Exception
Throws:
Exception

testHTMLBruteForceDetection

public void testHTMLBruteForceDetection()
                                 throws Exception
Throws:
Exception

testExplicitEncoding

public void testExplicitEncoding()
                          throws Exception
This tests the behavior of Any23 to execute the extraction explicitly specifying the charset encoding of the input.

Throws:
org.apache.any23.extractor.ExtractionException
IOException
org.openrdf.sail.SailException
org.openrdf.repository.RepositoryException
Exception

testImplicitEncoding

public void testImplicitEncoding()
                          throws Exception
This tests the behavior of Any23 to perform the extraction without passing it any charset encoding. The encoding is therefore guessed using TikaEncodingDetector class.

Throws:
org.apache.any23.extractor.ExtractionException
IOException
org.openrdf.sail.SailException
org.openrdf.repository.RepositoryException
org.apache.any23.writer.TripleHandlerException
Exception

testRDFXMLDetectionAndExtraction

public void testRDFXMLDetectionAndExtraction()
                                      throws Exception
Throws:
Exception

testNTriplesDetectionAndExtraction

public void testNTriplesDetectionAndExtraction()
                                        throws Exception
Throws:
Exception

testNturtleDetectionAndExtraction

public void testNturtleDetectionAndExtraction()
                                       throws Exception
Throws:
Exception

testDemoCodeSnippet1

public void testDemoCodeSnippet1()
                          throws Exception
Tests out the first code snipped used in Developer Manual.

Throws:
IOException
org.apache.any23.extractor.ExtractionException
Exception

testDemoCodeSnippet2

public void testDemoCodeSnippet2()
                          throws Exception
Tests out the second code snipped used in Developer Manual.

Throws:
IOException
org.apache.any23.extractor.ExtractionException
Exception

testProgrammaticExtraction

public void testProgrammaticExtraction()
                                throws org.apache.any23.extractor.ExtractionException,
                                       IOException,
                                       URISyntaxException
This test checks the extraction behavior when the library is used programatically. This test is related to the issue #45, to verify the different behaviors between Maven and Ant. The behavior was related to a 2nd-level dependency introduced by Maven.

Throws:
org.apache.any23.extractor.ExtractionException
IOException
URISyntaxException

testGZippedContent

public void testGZippedContent()
                        throws IOException,
                               URISyntaxException,
                               org.apache.any23.extractor.ExtractionException
This test checks if a URL that is supposed to be GZIPPED is correctly opened and parsed with the Any23 facade.

Throws:
IOException
URISyntaxException
org.apache.any23.extractor.ExtractionException

testExtractionParameters

public void testExtractionParameters()
                              throws IOException,
                                     org.apache.any23.extractor.ExtractionException
Throws:
IOException
org.apache.any23.extractor.ExtractionException

testExtractionParametersWithNestingDisabled

public void testExtractionParametersWithNestingDisabled()
                                                 throws IOException,
                                                        org.apache.any23.extractor.ExtractionException,
                                                        org.apache.any23.writer.TripleHandlerException
Throws:
IOException
org.apache.any23.extractor.ExtractionException
org.apache.any23.writer.TripleHandlerException

testExceptionPropagation

public void testExceptionPropagation()
                              throws IOException
Throws:
IOException

testXMLMimeTypeManagement

public void testXMLMimeTypeManagement()
                               throws IOException,
                                      org.apache.any23.extractor.ExtractionException
Test correct management of general XML content.

Throws:
IOException
org.apache.any23.extractor.ExtractionException

testXMLMimeTypeManagementViaURL

public void testXMLMimeTypeManagementViaURL()
                                     throws IOException,
                                            org.apache.any23.extractor.ExtractionException
Test correct management of general XML content from URL source.

Throws:
IOException
org.apache.any23.extractor.ExtractionException

testBlankNodesViaURL

public void testBlankNodesViaURL()
                          throws IOException,
                                 org.apache.any23.extractor.ExtractionException
Throws:
IOException
org.apache.any23.extractor.ExtractionException

testMicrodataSupport

public void testMicrodataSupport()
                          throws Exception
Throws:
Exception

testAbstractMethodErrorIssue186_1

public void testAbstractMethodErrorIssue186_1()
                                       throws IOException,
                                              org.apache.any23.extractor.ExtractionException
Throws:
IOException
org.apache.any23.extractor.ExtractionException

testAbstractMethodErrorIssue186_2

public void testAbstractMethodErrorIssue186_2()
                                       throws IOException,
                                              org.apache.any23.extractor.ExtractionException
Throws:
IOException
org.apache.any23.extractor.ExtractionException

testModifiableConfiguration_issue183

public void testModifiableConfiguration_issue183()
                                          throws Exception
Throws:
Exception


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.