You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@any23.apache.org by an...@apache.org on 2012/08/10 02:40:22 UTC
svn commit: r1371537 [1/30] - in /incubator/any23/trunk: ./ core/
core/src/test/java/org/apache/any23/ core/src/test/java/org/apache/any23/cli/
core/src/test/java/org/apache/any23/extractor/
core/src/test/java/org/apache/any23/extractor/csv/ core/src/t...
Author: ansell
Date: Fri Aug 10 00:40:13 2012
New Revision: 1371537
URL: http://svn.apache.org/viewvc?rev=1371537&view=rev
Log:
ANY23-103 : Convert tests to use getResourceAsStream() instead of direct file access
Includes splitting out test resources into a new module to verify the split, and prepare for modularisation of the core module
Added:
incubator/any23/trunk/core/src/test/java/org/apache/any23/AbstractAny23TestBase.java
incubator/any23/trunk/test-resources/ (with props)
incubator/any23/trunk/test-resources/pom.xml
incubator/any23/trunk/test-resources/src/
incubator/any23/trunk/test-resources/src/test/
incubator/any23/trunk/test-resources/src/test/resources/
incubator/any23/trunk/test-resources/src/test/resources/application/
incubator/any23/trunk/test-resources/src/test/resources/application/atom/
incubator/any23/trunk/test-resources/src/test/resources/application/atom/atom.xml
incubator/any23/trunk/test-resources/src/test/resources/application/gzip/
incubator/any23/trunk/test-resources/src/test/resources/application/gzip/test1.gzip (with props)
incubator/any23/trunk/test-resources/src/test/resources/application/gzip/test2 (with props)
incubator/any23/trunk/test-resources/src/test/resources/application/hcalendar/
incubator/any23/trunk/test-resources/src/test/resources/application/hcalendar/test1
incubator/any23/trunk/test-resources/src/test/resources/application/hcalendar/test2
incubator/any23/trunk/test-resources/src/test/resources/application/messy_html/
incubator/any23/trunk/test-resources/src/test/resources/application/messy_html/test1.html
incubator/any23/trunk/test-resources/src/test/resources/application/nquads/
incubator/any23/trunk/test-resources/src/test/resources/application/nquads/test1.nq
incubator/any23/trunk/test-resources/src/test/resources/application/nquads/test2.nq
incubator/any23/trunk/test-resources/src/test/resources/application/rdfa/
incubator/any23/trunk/test-resources/src/test/resources/application/rdfa/false.test
incubator/any23/trunk/test-resources/src/test/resources/application/rdfa/london-gazette.html
incubator/any23/trunk/test-resources/src/test/resources/application/rdfa/mic.xhtml
incubator/any23/trunk/test-resources/src/test/resources/application/rdfa/test1.html
incubator/any23/trunk/test-resources/src/test/resources/application/rdfn3/
incubator/any23/trunk/test-resources/src/test/resources/application/rdfn3/test1
incubator/any23/trunk/test-resources/src/test/resources/application/rdfn3/test2
incubator/any23/trunk/test-resources/src/test/resources/application/rdfn3/test3
incubator/any23/trunk/test-resources/src/test/resources/application/rdfxml/
incubator/any23/trunk/test-resources/src/test/resources/application/rdfxml/error.rdf
incubator/any23/trunk/test-resources/src/test/resources/application/rdfxml/foaf
incubator/any23/trunk/test-resources/src/test/resources/application/rdfxml/physics.owl
incubator/any23/trunk/test-resources/src/test/resources/application/rdfxml/test1
incubator/any23/trunk/test-resources/src/test/resources/application/rdfxml/test2
incubator/any23/trunk/test-resources/src/test/resources/application/rdfxml/test3
incubator/any23/trunk/test-resources/src/test/resources/application/rss1/
incubator/any23/trunk/test-resources/src/test/resources/application/rss1/test1
incubator/any23/trunk/test-resources/src/test/resources/application/rss2/
incubator/any23/trunk/test-resources/src/test/resources/application/rss2/index.html
incubator/any23/trunk/test-resources/src/test/resources/application/rss2/rss2sample.xml
incubator/any23/trunk/test-resources/src/test/resources/application/rss2/test1
incubator/any23/trunk/test-resources/src/test/resources/application/trix/
incubator/any23/trunk/test-resources/src/test/resources/application/trix/test1.trx
incubator/any23/trunk/test-resources/src/test/resources/application/turtle/
incubator/any23/trunk/test-resources/src/test/resources/application/turtle/geolinkeddata.ttl
incubator/any23/trunk/test-resources/src/test/resources/application/turtle/test1
incubator/any23/trunk/test-resources/src/test/resources/application/turtle/test2
incubator/any23/trunk/test-resources/src/test/resources/application/turtle/test3
incubator/any23/trunk/test-resources/src/test/resources/application/wsdl/
incubator/any23/trunk/test-resources/src/test/resources/application/wsdl/error.wsdl
incubator/any23/trunk/test-resources/src/test/resources/application/wsdl/test1
incubator/any23/trunk/test-resources/src/test/resources/application/xhtml/
incubator/any23/trunk/test-resources/src/test/resources/application/xhtml/blank-file-header.xhtml
incubator/any23/trunk/test-resources/src/test/resources/application/xhtml/index.html
incubator/any23/trunk/test-resources/src/test/resources/application/xhtml/test1
incubator/any23/trunk/test-resources/src/test/resources/application/xhtml2/
incubator/any23/trunk/test-resources/src/test/resources/application/xhtml2/xhtml2.xml
incubator/any23/trunk/test-resources/src/test/resources/application/xoxo/
incubator/any23/trunk/test-resources/src/test/resources/application/xoxo/test1
incubator/any23/trunk/test-resources/src/test/resources/application/zip/
incubator/any23/trunk/test-resources/src/test/resources/application/zip/4_entries.zip (with props)
incubator/any23/trunk/test-resources/src/test/resources/application/zip/test1.zip (with props)
incubator/any23/trunk/test-resources/src/test/resources/application/zip/test2 (with props)
incubator/any23/trunk/test-resources/src/test/resources/cli/
incubator/any23/trunk/test-resources/src/test/resources/cli/rover-test1.nq
incubator/any23/trunk/test-resources/src/test/resources/html/
incubator/any23/trunk/test-resources/src/test/resources/html/default-language.html
incubator/any23/trunk/test-resources/src/test/resources/html/empty-span-broken.html
incubator/any23/trunk/test-resources/src/test/resources/html/empty-span-works.html
incubator/any23/trunk/test-resources/src/test/resources/html/encoding-test.html
incubator/any23/trunk/test-resources/src/test/resources/html/html-head-link-extractor.html
incubator/any23/trunk/test-resources/src/test/resources/html/html-head-meta-extractor.html
incubator/any23/trunk/test-resources/src/test/resources/html/html-turtle.html
incubator/any23/trunk/test-resources/src/test/resources/html/html-without-uf.html
incubator/any23/trunk/test-resources/src/test/resources/html/mixed/
incubator/any23/trunk/test-resources/src/test/resources/html/mixed/01-xfn-foaf.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/ansa_2010-02-26_12645863.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/base-handling.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/base-handling.xhtml
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/basic.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/drupal-test-frontpage.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/goodrelations-rdfa10-expected.nq
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/goodrelations-rdfa10.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/goodrelations-rdfa11.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/incomplete-triples.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/null-datatype-test.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/object-resource-test.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/opengraph-structured-properties.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/oreilly-invalid-datatype.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/rdfa-11-curies.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/rdfa-issue186-1.xhtml
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/rdfa-issue186-2.xhtml
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/rel-href.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/rel-rev.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/vocab.html
incubator/any23/trunk/test-resources/src/test/resources/html/rdfa/xmlliteral-datatype-test.html
incubator/any23/trunk/test-resources/src/test/resources/html/rff-test.html
incubator/any23/trunk/test-resources/src/test/resources/microdata/
incubator/any23/trunk/test-resources/src/test/resources/microdata/5.2.1-non-normative-example-1-expected.nquads
incubator/any23/trunk/test-resources/src/test/resources/microdata/5.2.1-non-normative-example-1.html
incubator/any23/trunk/test-resources/src/test/resources/microdata/5.2.1-non-normative-example-2-expected.nquads
incubator/any23/trunk/test-resources/src/test/resources/microdata/5.2.1-non-normative-example-2.html
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-basic-expected.properties
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-basic.html
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-itemref-expected.properties
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-itemref.html
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-json-serialization.json
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-nested-expected.nquads
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-nested-expected.properties
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-nested.html
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-richsnippet-expected.nquads
incubator/any23/trunk/test-resources/src/test/resources/microdata/microdata-richsnippet.html
incubator/any23/trunk/test-resources/src/test/resources/microdata/schemaorg-example-1-expected.nquads
incubator/any23/trunk/test-resources/src/test/resources/microdata/schemaorg-example-1.html
incubator/any23/trunk/test-resources/src/test/resources/microdata/schemaorg-example-2-expected.nquads
incubator/any23/trunk/test-resources/src/test/resources/microdata/schemaorg-example-2.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/01-component-vevent-dtstart-date.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/02-component-vevent-dtstart-datetime.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/03-component-vevent-dtend-date.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/04-component-vevent-dtend-datetime.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/05-calendar-simple.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/06-component-vevent-uri-relative.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/07-component-vevent-description-simple.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/08-component-vevent-multiple-classes.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/09-component-vevent-summary-in-img-alt.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/10-component-vevent-entity.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/11-component-vevent-summary-in-subelements.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/12-component-vevent-summary-url-in-same-class.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/13-component-vevent-summary-url-property.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/15-calendar-xml-lang.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/16-calendar-force-outlook.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/17-component-vevent-description-value-in-subelements.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/18-component-vevent-uid.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/19-attachments.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/empty-statcvs.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/example1.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/example2.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/example3.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/example5.3.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/example5.4.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/example5.5.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/example5.6.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcalendar/example5.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/01-tantek-basic.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/02-multiple-class-names-on-vcard.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/03-implied-n.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/04-ignore-unknowns.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/05-mailto-1.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/06-mailto-2.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/07-relative-url.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/08-relative-url-base.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/09-relative-url-xmlbase-1.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/10-relative-url-xmlbase-2.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/11-multiple-urls.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/12-img-src-url.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/13-photo-logo.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/14-img-src-data-url.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/15-honorific-additional-single.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/16-honorific-additional-multiple.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/17-email-not-uri.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/18-object-data-http-uri.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/19-object-data-data-uri.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/20-image-alt.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/21-tel.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/22-adr.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/23-abbr-title-everything.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/25-geo-abbr.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/26-ancestors.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/27-bday-date.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/28-bday-datetime.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/29-bday-datetime-timezone.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/30-fn-org.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/31-include.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/32-header.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/33-area.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/34-notes.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/35-include-pattern.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/36-categories.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/37-singleton.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/38-uid.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/40-fn-inside-adr.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/41-ignore-children.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/infinite-loop.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/lastfm-adr-multi-address.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/linkedin-michelemostarda.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hcard/performance.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/actions-lister-email-href.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/actions-lister-email.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/actions-lister-fn-tel.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/actions-lister-fn.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/actions-lister-tel.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/actions-lister-url.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/actions-lister.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/adr.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/description-complex.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/description.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/dtlisted-dtexpired.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/empty.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/full.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/item-fn-photo-href.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/item-fn-url-photo-img.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/item-fn-url.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/item-fn.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/item.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/kelkoo-full.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/kelkoo.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/multiple-actions-nested.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/multiple-actions.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/price.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/single-action-outside.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/single-action.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/summary-bookmark.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hlisting/summary.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hrecipe/
incubator/any23/trunk/test-resources/src/test/resources/microformats/hrecipe/01-spec.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hresume/
incubator/any23/trunk/test-resources/src/test/resources/microformats/hresume/ant.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hresume/steveganz.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hreview/
incubator/any23/trunk/test-resources/src/test/resources/microformats/hreview/01-spec.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hreview/02-spec-2.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hreview/03-spec-3.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hreview/04-spec-4.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/hreview/05-spec.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/license/
incubator/any23/trunk/test-resources/src/test/resources/microformats/license/apache.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/license/ccBy.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/license/empty.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/license/multiple-empty-href.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/license/multiple-mixed-case.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/license/multiple.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/microformat-domains.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/nested-microformats-a1.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/nested-microformats-a2.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/nested-microformats-a3.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/nested-microformats-managed.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/species/
incubator/any23/trunk/test-resources/src/test/resources/microformats/species/species-example-2.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/encoding-iso-8859-1.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/encoding-iso-8859-1.xhtml
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/encoding-utf-8-after-title.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/encoding-utf-8.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/encoding-utf-8.xhtml
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/me-and-sweetheart.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/mixed-case.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/multiple-friends.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/multiple-rel.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/no-rel.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/no-valid-rel.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/simple-friend.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/simple-me.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/some-links-without-rel.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/strip-spaces.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/tagsoup.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/upcase-href.html
incubator/any23/trunk/test-resources/src/test/resources/microformats/xfn/with-relative-uri.html
incubator/any23/trunk/test-resources/src/test/resources/org/
incubator/any23/trunk/test-resources/src/test/resources/org/apache/
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/any23-xml-mimetype.xml
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/csv/
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/csv/test-comma.csv
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/csv/test-semicolon.csv
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/csv/test-tab.csv
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/csv/test-type.csv
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/rdf/
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/rdf/testMalformedLiteral
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/xpath/
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/extractor/xpath/xpathextractor-test.html
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/validator/
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/validator/invalid-rdfa-about.html
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/validator/meta-name-misuse.html
incubator/any23/trunk/test-resources/src/test/resources/org/apache/any23/validator/missing-og-namespace.html
incubator/any23/trunk/test-resources/src/test/resources/rdf/
incubator/any23/trunk/test-resources/src/test/resources/rdf/rdf-issue183.ttl
incubator/any23/trunk/test-resources/src/test/resources/text/
incubator/any23/trunk/test-resources/src/test/resources/text/html/
incubator/any23/trunk/test-resources/src/test/resources/text/html/test1
Removed:
incubator/any23/trunk/core/src/test/resources/
incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/Any23OnlineTestBase.java
Modified:
incubator/any23/trunk/core/pom.xml
incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23OnlineTestBase.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23Test.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MicrodataParserTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MimeDetectorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/RoverTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/SingleDocumentExtractionTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVReaderBuilderTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AbstractExtractorTestCase.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AdrExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/DomUtilsTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/EncodingTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HCalendarExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HCardExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HListingExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HRecipeExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HResumeExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HReviewExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HTMLFixture.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HTMLMetaExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HeadLinkExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/LicenseExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/RDFMergerTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/SpeciesExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/TagSoupParserTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/TitleExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/TurtleHTMLExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/XFNExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/microdata/MicrodataExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/rdfa/AbstractRDFaExtractorTestCase.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/rdfa/RDFa11ExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/rdfa/RDFaExtractorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/mime/TikaMIMETypeDetectorTest.java
incubator/any23/trunk/core/src/test/java/org/apache/any23/mime/purifier/WhiteSpacesPurifierTest.java
incubator/any23/trunk/plugins/basic-crawler/pom.xml
incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/cli/CrawlerTest.java
incubator/any23/trunk/pom.xml
Modified: incubator/any23/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/pom.xml?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/pom.xml (original)
+++ incubator/any23/trunk/core/pom.xml Fri Aug 10 00:40:13 2012
@@ -31,6 +31,13 @@
<dependencies>
<dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>apache-any23-test-resources</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
@@ -190,6 +197,17 @@
</descriptors>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Added: incubator/any23/trunk/core/src/test/java/org/apache/any23/AbstractAny23TestBase.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/AbstractAny23TestBase.java?rev=1371537&view=auto
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/AbstractAny23TestBase.java (added)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/AbstractAny23TestBase.java Fri Aug 10 00:40:13 2012
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.any23;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.any23.source.DocumentSource;
+import org.apache.any23.source.FileDocumentSource;
+import org.apache.tika.io.IOUtils;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.rules.TemporaryFolder;
+
+/**
+ * This file encapsulates access to test resource files using temporary files that are automatically
+ * cleaned up by JUnit after each test.
+ *
+ * @author Peter Ansell p_ansell@yahoo.com
+ */
+public class AbstractAny23TestBase
+{
+
+ @Rule
+ public TemporaryFolder testFolder = new TemporaryFolder();
+ protected File tempDirectory;
+
+ public AbstractAny23TestBase()
+ {
+ super();
+ }
+
+ @Before
+ public void setUp() throws Exception
+ {
+ tempDirectory = testFolder.newFolder();
+ }
+
+ protected DocumentSource getDocumentSourceFromResource(String resourceLocation) throws IOException
+ {
+ return new FileDocumentSource(copyResourceToTempFile(resourceLocation));
+ }
+
+ protected DocumentSource getDocumentSourceFromResource(String resourceLocation, String baseUri) throws IOException
+ {
+ return new FileDocumentSource(copyResourceToTempFile(resourceLocation), baseUri);
+ }
+
+ /**
+ * Copies a resource to a temporary directory and returns a file handle that can be used to
+ * access the resource as a file from the temp directory.
+ *
+ * @param resourceLocation
+ * The absolute location of the resource in the classpath, which can be used with
+ * this.getClass().getResourceAsStream.
+ * @return
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ protected File copyResourceToTempFile(String resourceLocation) throws FileNotFoundException, IOException
+ {
+ Assert.assertNotNull("Temporary directory was null. Did you forget to call super.setUp() to initialise it?",
+ tempDirectory);
+ String fileEnding = resourceLocation.substring(resourceLocation.lastIndexOf("/") + 1);
+
+ File tempFile = File.createTempFile("any23test-", "-" + fileEnding, tempDirectory);
+
+ FileOutputStream output = new FileOutputStream(tempFile);
+
+ InputStream input = this.getClass().getResourceAsStream(resourceLocation);
+
+ Assert.assertNotNull("Test resource was not found: " + resourceLocation, input);
+
+ IOUtils.copy(input, output);
+
+ return tempFile;
+ }
+
+}
\ No newline at end of file
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23OnlineTestBase.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23OnlineTestBase.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23OnlineTestBase.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23OnlineTestBase.java Fri Aug 10 00:40:13 2012
@@ -26,7 +26,7 @@ import org.junit.Assume;
*
* @author Michele Mostarda (mostarda@fbk.eu)
*/
-public abstract class Any23OnlineTestBase {
+public abstract class Any23OnlineTestBase extends AbstractAny23TestBase {
public static final String ONLINE_TEST_DISABLED_FLAG = "any23.online.test.disabled";
@@ -36,5 +36,4 @@ public abstract class Any23OnlineTestBas
public static void assumeOnlineAllowed() {
Assume.assumeTrue(System.getProperty(ONLINE_TEST_DISABLED_FLAG, null) == null);
}
-
}
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23Test.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23Test.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23Test.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/Any23Test.java Fri Aug 10 00:40:13 2012
@@ -29,7 +29,6 @@ import org.apache.any23.filter.IgnoreTit
import org.apache.any23.http.DefaultHTTPClient;
import org.apache.any23.http.HTTPClient;
import org.apache.any23.source.DocumentSource;
-import org.apache.any23.source.FileDocumentSource;
import org.apache.any23.source.HTTPDocumentSource;
import org.apache.any23.source.StringDocumentSource;
import org.apache.any23.util.FileUtils;
@@ -58,7 +57,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayOutputStream;
-import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
@@ -116,7 +114,7 @@ public class Any23Test extends Any23Onli
throws Exception {
assertEncodingDetection(
"UTF-8",
- new File("src/test/resources/html/encoding-test.html"),
+ "/html/encoding-test.html",
"Knud M\u00F6ller"
);
}
@@ -136,7 +134,7 @@ public class Any23Test extends Any23Onli
throws Exception {
assertEncodingDetection(
null, // The encoding will be auto detected.
- new File("src/test/resources/html/encoding-test.html"),
+ "/html/encoding-test.html",
"Knud M\u00F6ller"
);
}
@@ -274,8 +272,8 @@ public class Any23Test extends Any23Onli
TripleHandler rdfWriter = new IgnoreAccidentalRDFa(handler);
ReportingTripleHandler reporting = new ReportingTripleHandler(rdfWriter);
- DocumentSource source = new FileDocumentSource(
- new File("src/test/resources/html/rdfa/ansa_2010-02-26_12645863.html"),
+ DocumentSource source = getDocumentSourceFromResource(
+ "/html/rdfa/ansa_2010-02-26_12645863.html",
"http://host.com/service");
Assert.assertTrue( any23.extract(source, reporting).hasMatchingExtractors() );
@@ -324,8 +322,8 @@ public class Any23Test extends Any23Onli
public void testExtractionParameters() throws IOException, ExtractionException, TripleHandlerException {
final int EXPECTED_TRIPLES = 6;
Any23 runner = new Any23();
- DocumentSource source = new FileDocumentSource(
- new File("src/test/resources/org/apache/any23/validator/missing-og-namespace.html"),
+ DocumentSource source = getDocumentSourceFromResource(
+ "/org/apache/any23/validator/missing-og-namespace.html",
"http://www.test.com"
);
@@ -374,8 +372,8 @@ public class Any23Test extends Any23Onli
throws IOException, ExtractionException, TripleHandlerException {
final int EXPECTED_TRIPLES = 19;
Any23 runner = new Any23();
- DocumentSource source = new FileDocumentSource(
- new File("src/test/resources/microformats/nested-microformats-a1.html"),
+ DocumentSource source = getDocumentSourceFromResource(
+ "/microformats/nested-microformats-a1.html",
"http://www.test.com"
);
@@ -419,8 +417,8 @@ public class Any23Test extends Any23Onli
@Test
public void testExceptionPropagation() throws IOException {
Any23 any23 = new Any23();
- DocumentSource source = new FileDocumentSource(
- new File("src/test/resources/application/turtle/geolinkeddata.ttl"),
+ DocumentSource source = getDocumentSourceFromResource(
+ "/application/turtle/geolinkeddata.ttl",
"http://www.test.com"
);
CountingTripleHandler cth1 = new CountingTripleHandler();
@@ -605,14 +603,13 @@ public class Any23Test extends Any23Onli
* @param expectedContent
* @throws Exception
*/
- private void assertEncodingDetection(String encoding, File input, String expectedContent)
+ private void assertEncodingDetection(String encoding, String input, String expectedContent)
throws Exception {
- FileDocumentSource fileDocumentSource;
+ DocumentSource fileDocumentSource = getDocumentSourceFromResource(input);
Any23 any23;
RepositoryConnection conn;
RepositoryWriter repositoryWriter;
-
- fileDocumentSource = new FileDocumentSource(input);
+
any23 = new Any23();
Sail store = new MemoryStore();
store.initialize();
@@ -674,5 +671,5 @@ public class Any23Test extends Any23Onli
}
return false;
}
-
+
}
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MicrodataParserTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MicrodataParserTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MicrodataParserTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MicrodataParserTest.java Fri Aug 10 00:40:13 2012
@@ -32,7 +32,7 @@ public class MicrodataParserTest extends
@Test
public void testRunOnFile() throws Exception {
- runToolCheckExit0("file:src/test/resources/microdata/microdata-nested.html");
+ runToolCheckExit0("file:"+copyResourceToTempFile("/microdata/microdata-nested.html").getAbsolutePath());
}
@Test
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MimeDetectorTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MimeDetectorTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MimeDetectorTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/MimeDetectorTest.java Fri Aug 10 00:40:13 2012
@@ -39,7 +39,7 @@ public class MimeDetectorTest extends To
@Test
public void testDetectFile() throws Exception {
assumeOnlineAllowed();
- runToolCheckExit0("file://./src/test/resources/application/trix/test1.trx");
+ runToolCheckExit0("file://"+copyResourceToTempFile("/application/trix/test1.trx").getAbsolutePath());
}
@Test
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/RoverTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/RoverTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/RoverTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/cli/RoverTest.java Fri Aug 10 00:40:13 2012
@@ -37,8 +37,8 @@ import java.io.File;
public class RoverTest extends ToolTestBase {
private static final String[] TARGET_FILES = {
- "src/test/resources/microdata/microdata-nested.html",
- "src/test/resources/org/apache/any23/extractor/csv/test-semicolon.csv"
+ "/microdata/microdata-nested.html",
+ "/org/apache/any23/extractor/csv/test-semicolon.csv"
};
private static final String[] TARGET_URLS = {
@@ -52,18 +52,27 @@ public class RoverTest extends ToolTestB
@Test
public void testRunMultiFiles() throws Exception {
- runWithMultiSourcesAndVerify(TARGET_FILES, 0);
+
+ String[] copiedTargets = new String[TARGET_FILES.length];
+ for(int i = 0; i < TARGET_FILES.length; i++)
+ {
+ File tempFile = copyResourceToTempFile(TARGET_FILES[i]);
+
+ copiedTargets[i] = tempFile.getAbsolutePath();
+ }
+
+ runWithMultiSourcesAndVerify(copiedTargets, 0);
}
@Test
public void testRunWithDefaultNS() throws Exception {
final String DEFAULT_GRAPH = "http://test/default/ns";
- final File outFile = File.createTempFile("rover-test", "out");
+ final File outFile = File.createTempFile("rover-test", "out", tempDirectory);
final int exitCode = runTool(
String.format(
"-o %s -f nquads -p -n %s -d %s",
outFile.getAbsolutePath(),
- "src/test/resources/cli/rover-test1.nq",
+ copyResourceToTempFile("/cli/rover-test1.nq").getAbsolutePath(),
DEFAULT_GRAPH
)
);
@@ -95,10 +104,8 @@ public class RoverTest extends ToolTestB
}
private void runWithMultiSourcesAndVerify(String[] targets, int expectedExit) throws Exception {
- final File outFile = File.createTempFile("rover-test", "out");
- final File logFile = File.createTempFile("rover-test", "log");
- outFile.delete();
- outFile.delete();
+ final File outFile = File.createTempFile("rover-test", "out", tempDirectory);
+ final File logFile = File.createTempFile("rover-test", "log", tempDirectory);
final int exitCode = runTool(
String.format(
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/SingleDocumentExtractionTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/SingleDocumentExtractionTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/SingleDocumentExtractionTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/SingleDocumentExtractionTest.java Fri Aug 10 00:40:13 2012
@@ -17,6 +17,7 @@
package org.apache.any23.extractor;
+import org.apache.any23.AbstractAny23TestBase;
import org.apache.any23.configuration.DefaultConfiguration;
import org.apache.any23.configuration.ModifiableConfiguration;
import org.apache.any23.extractor.html.HTMLFixture;
@@ -50,6 +51,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
import java.io.IOException;
/**
@@ -59,7 +61,7 @@ import java.io.IOException;
* @author Davide Palmisano (palmisano@fbk.eu)
*/
// TODO #20 - Solve issue that hreview item and vcard item have the same BNode due they have the same XPath DOM.
-public class SingleDocumentExtractionTest {
+public class SingleDocumentExtractionTest extends AbstractAny23TestBase {
private static final SINDICE vSINDICE = SINDICE.getInstance();
private static final ICAL vICAL = ICAL.getInstance();
@@ -83,7 +85,8 @@ public class SingleDocumentExtractionTes
RDFXMLWriter rdfxmlWriter;
@Before
- public void setUp() throws RepositoryException, SailException {
+ public void setUp() throws Exception {
+ super.setUp();
extractorGroup = ExtractorRegistry.getInstance().getExtractorGroup();
store = new MemoryStore();
store.initialize();
@@ -113,7 +116,7 @@ public class SingleDocumentExtractionTes
*/
@Test
public void testMicroformatDomains() throws IOException, ExtractionException, RepositoryException {
- singleDocumentExtraction = getInstance("microformats/microformat-domains.html");
+ singleDocumentExtraction = getInstance("/microformats/microformat-domains.html");
singleDocumentExtraction.run();
logStorageContent();
assertTripleCount(vSINDICE.getProperty(SINDICE.DOMAIN), "nested.test.com", 1);
@@ -134,7 +137,7 @@ public class SingleDocumentExtractionTes
*/
@Test
public void testNestedMicroformats() throws IOException, ExtractionException, RepositoryException {
- singleDocumentExtraction = getInstance("microformats/nested-microformats-a1.html");
+ singleDocumentExtraction = getInstance("/microformats/nested-microformats-a1.html");
singleDocumentExtraction.run();
logStorageContent();
@@ -157,7 +160,7 @@ public class SingleDocumentExtractionTes
*/
@Test
public void testNestedVCardAdr() throws IOException, ExtractionException, RepositoryException {
- singleDocumentExtraction = getInstance("microformats/nested-microformats-a3.html");
+ singleDocumentExtraction = getInstance("/microformats/nested-microformats-a3.html");
singleDocumentExtraction.run();
logStorageContent();
@@ -184,7 +187,7 @@ public class SingleDocumentExtractionTes
*/
@Test
public void testNestedMicroformatsInduced() throws IOException, ExtractionException, RepositoryException {
- singleDocumentExtraction = getInstance("microformats/nested-microformats-a2.html");
+ singleDocumentExtraction = getInstance("/microformats/nested-microformats-a2.html");
singleDocumentExtraction.run();
logStorageContent();
@@ -211,7 +214,7 @@ public class SingleDocumentExtractionTes
* show the triple property as double. Despite this the model contains it just once.
*/
public void testNestedMicroformatsManaged() throws IOException, ExtractionException, RepositoryException {
- singleDocumentExtraction = getInstance("microformats/nested-microformats-managed.html");
+ singleDocumentExtraction = getInstance("/microformats/nested-microformats-managed.html");
singleDocumentExtraction.run();
logStorageContent();
@@ -226,7 +229,7 @@ public class SingleDocumentExtractionTes
assertTripleCount(vSINDICE.getProperty(SINDICE.NESTING_ORIGINAL) , vREVIEW.hasReview, 1);
}
- private SingleDocumentExtraction getInstance(String file) {
+ private SingleDocumentExtraction getInstance(String file) throws FileNotFoundException, IOException {
baos = new ByteArrayOutputStream();
rdfxmlWriter = new RDFXMLWriter(baos);
repositoryWriter = new RepositoryWriter(conn);
@@ -239,7 +242,7 @@ public class SingleDocumentExtractionTes
configuration.setProperty("any23.extraction.metadata.domain.per.entity", "on");
SingleDocumentExtraction instance = new SingleDocumentExtraction(
configuration,
- new HTMLFixture(file).getOpener("http://nested.test.com"),
+ new HTMLFixture(copyResourceToTempFile(file)).getOpener("http://nested.test.com"),
extractorGroup,
cth
);
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVExtractorTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVExtractorTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVExtractorTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVExtractorTest.java Fri Aug 10 00:40:13 2012
@@ -45,7 +45,7 @@ public class CSVExtractorTest extends Ab
@Test
public void testExtractionCommaSeparated() throws RepositoryException {
CSV csv = CSV.getInstance();
- assertExtract("org/apache/any23/extractor/csv/test-comma.csv");
+ assertExtract("/org/apache/any23/extractor/csv/test-comma.csv");
logger.debug(dumpModelToRDFXML());
assertModelNotEmpty();
@@ -58,7 +58,7 @@ public class CSVExtractorTest extends Ab
@Test
public void testExtractionSemicolonSeparated() throws RepositoryException {
CSV csv = CSV.getInstance();
- assertExtract("org/apache/any23/extractor/csv/test-semicolon.csv");
+ assertExtract("/org/apache/any23/extractor/csv/test-semicolon.csv");
logger.debug(dumpModelToRDFXML());
assertModelNotEmpty();
@@ -71,7 +71,7 @@ public class CSVExtractorTest extends Ab
@Test
public void testExtractionTabSeparated() throws RepositoryException {
CSV csv = CSV.getInstance();
- assertExtract("org/apache/any23/extractor/csv/test-tab.csv");
+ assertExtract("/org/apache/any23/extractor/csv/test-tab.csv");
logger.debug(dumpModelToRDFXML());
assertModelNotEmpty();
@@ -84,7 +84,7 @@ public class CSVExtractorTest extends Ab
@Test
public void testTypeManagement() throws RepositoryException {
CSV csv = CSV.getInstance();
- assertExtract("org/apache/any23/extractor/csv/test-type.csv");
+ assertExtract("/org/apache/any23/extractor/csv/test-type.csv");
logger.debug(dumpModelToRDFXML());
assertModelNotEmpty();
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVReaderBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVReaderBuilderTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVReaderBuilderTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/csv/CSVReaderBuilderTest.java Fri Aug 10 00:40:13 2012
@@ -20,6 +20,7 @@ package org.apache.any23.extractor.csv;
import org.junit.Assert;
import org.junit.Test;
+import java.io.BufferedInputStream;
import java.io.IOException;
/**
@@ -38,15 +39,15 @@ public class CSVReaderBuilderTest {
public void testPositiveCSVDetection() throws IOException {
Assert.assertTrue(
"Builder cannot detect CVS stream.",
- CSVReaderBuilder.isCSV( this.getClass().getResourceAsStream("test-comma.csv") )
+ CSVReaderBuilder.isCSV( new BufferedInputStream(this.getClass().getResourceAsStream("test-comma.csv")) )
);
Assert.assertTrue(
"Builder cannot detect CVS stream.",
- CSVReaderBuilder.isCSV( this.getClass().getResourceAsStream("test-semicolon.csv") )
+ CSVReaderBuilder.isCSV( new BufferedInputStream(this.getClass().getResourceAsStream("test-semicolon.csv")) )
);
Assert.assertTrue(
"Builder cannot detect CVS stream.",
- CSVReaderBuilder.isCSV( this.getClass().getResourceAsStream("test-tab.csv") )
+ CSVReaderBuilder.isCSV( new BufferedInputStream(this.getClass().getResourceAsStream("test-tab.csv")) )
);
}
@@ -59,16 +60,16 @@ public class CSVReaderBuilderTest {
public void testNegativeCSVDetection() throws IOException {
Assert.assertFalse(
"Wrong CSV detection.",
- CSVReaderBuilder.isCSV( this.getClass().getResourceAsStream("/application/nquads/test1.nq") )
+ CSVReaderBuilder.isCSV( new BufferedInputStream(this.getClass().getResourceAsStream("/application/nquads/test1.nq")) )
);
Assert.assertFalse(
"Wrong CSV detection.",
- CSVReaderBuilder.isCSV( this.getClass().getResourceAsStream("/application/nquads/test2.nq") )
+ CSVReaderBuilder.isCSV( new BufferedInputStream(this.getClass().getResourceAsStream("/application/nquads/test2.nq")) )
);
Assert.assertFalse(
"Wrong CSV detection.",
CSVReaderBuilder.isCSV(
- this.getClass().getResourceAsStream("/org/apache/any23/extractor/rdf/example-ntriples.nt")
+ new BufferedInputStream(this.getClass().getResourceAsStream("/org/apache/any23/extractor/rdf/example-ntriples.nt"))
)
);
}
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AbstractExtractorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AbstractExtractorTestCase.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AbstractExtractorTestCase.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AbstractExtractorTestCase.java Fri Aug 10 00:40:13 2012
@@ -17,6 +17,7 @@
package org.apache.any23.extractor.html;
+import org.apache.any23.AbstractAny23TestBase;
import org.apache.any23.extractor.IssueReport;
import org.apache.any23.extractor.ExtractionException;
import org.apache.any23.extractor.ExtractorFactory;
@@ -58,7 +59,7 @@ import java.util.Map;
* Abstract class used to write {@link org.apache.any23.extractor.Extractor}
* specific test cases.
*/
-public abstract class AbstractExtractorTestCase {
+public abstract class AbstractExtractorTestCase extends AbstractAny23TestBase {
/**
* Base test document.
@@ -93,6 +94,7 @@ public abstract class AbstractExtractorT
*/
@Before
public void setUp() throws Exception {
+ super.setUp();
Sail store = new MemoryStore();
store.initialize();
conn = new SailRepository(store).getConnection();
@@ -163,7 +165,7 @@ public abstract class AbstractExtractorT
// tests should be based on mimetype detection.
protected void extract(String resource) throws ExtractionException, IOException {
SingleDocumentExtraction ex = new SingleDocumentExtraction(
- new HTMLFixture(resource).getOpener(baseURI.toString()),
+ new HTMLFixture(copyResourceToTempFile(resource)).getOpener(baseURI.toString()),
getExtractorFactory(), new RepositoryWriter(conn)
);
ex.setMIMETypeDetector(null);
@@ -277,7 +279,7 @@ public abstract class AbstractExtractorT
*/
protected void assertModelNotEmpty() throws RepositoryException {
Assert.assertFalse(
- "The model is expected to be empty." + getFailedExtractionMessage(),
+ "The model is expected to not be empty." + getFailedExtractionMessage(),
conn.isEmpty()
);
}
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AdrExtractorTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AdrExtractorTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AdrExtractorTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/AdrExtractorTest.java Fri Aug 10 00:40:13 2012
@@ -43,7 +43,7 @@ public class AdrExtractorTest extends Ab
@Test
public void testVCardMultiAddress() throws RepositoryException {
- assertExtract("microformats/hcard/lastfm-adr-multi-address.html");
+ assertExtract("/microformats/hcard/lastfm-adr-multi-address.html");
assertModelNotEmpty();
List<Resource> addresses = findSubjects(RDF.TYPE, vVCARD.Address);
int[] expectedStatementsPerAddress = new int[]{5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/DomUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/DomUtilsTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/DomUtilsTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/DomUtilsTest.java Fri Aug 10 00:40:13 2012
@@ -17,6 +17,7 @@
package org.apache.any23.extractor.html;
+import org.apache.any23.AbstractAny23TestBase;
import org.junit.Assert;
import org.junit.Test;
import org.w3c.dom.DOMImplementation;
@@ -32,6 +33,8 @@ import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
+
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
@@ -39,42 +42,42 @@ import java.util.List;
* Reference test class for the {@link DomUtils} class.
* @author Davide Palmisano (dpalmisano@gmail.com)
*/
-public class DomUtilsTest {
+public class DomUtilsTest extends AbstractAny23TestBase {
private final static XPath xPathEngine = XPathFactory.newInstance().newXPath();
@Test
- public void testGetXPathForNode() {
+ public void testGetXPathForNode() throws Exception {
check(
- "microformats/hcard/01-tantek-basic.html",
+ "/microformats/hcard/01-tantek-basic.html",
"//DIV[@class='vcard']",
"/HTML[1]/BODY[1]/DIV[1]"
);
check(
- "microformats/hcard/02-multiple-class-names-on-vcard.html",
+ "/microformats/hcard/02-multiple-class-names-on-vcard.html",
"//SPAN[@class='fn n']",
"/HTML[1]/BODY[1]/DIV[1]/SPAN[1]"
);
check(
- "microformats/hcard/02-multiple-class-names-on-vcard.html",
+ "/microformats/hcard/02-multiple-class-names-on-vcard.html",
"//SPAN/SPAN[@class='fn n']",
"/HTML[1]/BODY[1]/P[1]/SPAN[1]/SPAN[1]"
);
check(
- "microformats/hcard/02-multiple-class-names-on-vcard.html",
+ "/microformats/hcard/02-multiple-class-names-on-vcard.html",
"//SPAN/SPAN/*[@class='given-name']",
"/HTML[1]/BODY[1]/P[1]/SPAN[1]/SPAN[1]/SPAN[1]"
);
check(
- "microformats/hcard/02-multiple-class-names-on-vcard.html",
+ "/microformats/hcard/02-multiple-class-names-on-vcard.html",
"//SPAN/SPAN/*[@class='family-name']",
"/HTML[1]/BODY[1]/P[1]/SPAN[1]/SPAN[1]/SPAN[2]"
);
}
@Test
- public void testFindAllByClassName() {
- Node dom = new HTMLFixture("microformats/hcard/02-multiple-class-names-on-vcard.html").getDOM();
+ public void testFindAllByClassName() throws Exception {
+ Node dom = new HTMLFixture(copyResourceToTempFile("/microformats/hcard/02-multiple-class-names-on-vcard.html")).getDOM();
Assert.assertNotNull(dom);
List<Node> nodes = DomUtils.findAllByClassName(dom, "vcard");
NodeList nodeList = null;
@@ -95,8 +98,8 @@ public class DomUtilsTest {
}
@Test
- public void testFindAllByTag() {
- Node dom = new HTMLFixture("microformats/hcard/02-multiple-class-names-on-vcard.html").getDOM();
+ public void testFindAllByTag() throws Exception {
+ Node dom = new HTMLFixture(copyResourceToTempFile("/microformats/hcard/02-multiple-class-names-on-vcard.html")).getDOM();
Assert.assertNotNull(dom);
List<Node> nodes = DomUtils.findAllByTag(dom, "SPAN");
NodeList nodeList = null;
@@ -118,8 +121,8 @@ public class DomUtilsTest {
}
@Test
- public void testFindAllByTagAndClassName() {
- Node dom = new HTMLFixture("microformats/hcard/02-multiple-class-names-on-vcard.html").getDOM();
+ public void testFindAllByTagAndClassName() throws Exception {
+ Node dom = new HTMLFixture(copyResourceToTempFile("/microformats/hcard/02-multiple-class-names-on-vcard.html")).getDOM();
Assert.assertNotNull(dom);
List<Node> nodes = DomUtils.findAllByTagAndClassName(dom, "SPAN", "family-name");
NodeList nodeList = null;
@@ -142,8 +145,8 @@ public class DomUtilsTest {
}
@Test
- public void testHasClassName() {
- Node dom = new HTMLFixture("microformats/hcard/02-multiple-class-names-on-vcard.html").getDOM();
+ public void testHasClassName() throws Exception {
+ Node dom = new HTMLFixture(copyResourceToTempFile("/microformats/hcard/02-multiple-class-names-on-vcard.html")).getDOM();
Assert.assertNotNull(dom);
List<Node> nodes = DomUtils.findAllByClassName(dom, "vcard");
for(Node node : nodes) {
@@ -152,8 +155,8 @@ public class DomUtilsTest {
}
@Test
- public void testReadAttribute() {
- Node dom = new HTMLFixture("microformats/hcard/02-multiple-class-names-on-vcard.html").getDOM();
+ public void testReadAttribute() throws Exception {
+ Node dom = new HTMLFixture(copyResourceToTempFile("/microformats/hcard/02-multiple-class-names-on-vcard.html")).getDOM();
Assert.assertNotNull(dom);
List<Node> nodes = DomUtils.findAllByClassName(dom, "vcard");
for(Node node : nodes) {
@@ -185,8 +188,8 @@ public class DomUtilsTest {
);
}
- private void check(String file, String xpath, String reverseXPath) {
- Node dom = new HTMLFixture(file).getDOM();
+ private void check(String file, String xpath, String reverseXPath) throws FileNotFoundException, IOException {
+ Node dom = new HTMLFixture(copyResourceToTempFile(file)).getDOM();
Assert.assertNotNull(dom);
Node node;
try {
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/EncodingTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/EncodingTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/EncodingTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/EncodingTest.java Fri Aug 10 00:40:13 2012
@@ -17,6 +17,10 @@
package org.apache.any23.extractor.html;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.apache.any23.AbstractAny23TestBase;
import org.junit.Assert;
import org.junit.Test;
@@ -24,19 +28,19 @@ import org.junit.Test;
* Test class to ensure behaviors of {@link HTMLDocument} parser with encoding
* corner cases.
*/
-public class EncodingTest {
+public class EncodingTest extends AbstractAny23TestBase {
private final static String HELLO_WORLD = "Hell\u00F6 W\u00F6rld!";
@Test
- public void testEncodingHTML_ISO_8859_1() {
- HTMLDocument document = parseHTML("microformats/xfn/encoding-iso-8859-1.html");
+ public void testEncodingHTML_ISO_8859_1() throws Exception {
+ HTMLDocument document = parseHTML("/microformats/xfn/encoding-iso-8859-1.html");
Assert.assertEquals(HELLO_WORLD, document.find("//TITLE"));
}
@Test
- public void testEncodingHTML_UTF_8() {
- HTMLDocument document = parseHTML("microformats/xfn/encoding-utf-8.html");
+ public void testEncodingHTML_UTF_8() throws Exception {
+ HTMLDocument document = parseHTML("/microformats/xfn/encoding-utf-8.html");
Assert.assertEquals(HELLO_WORLD, document.find("//TITLE"));
}
@@ -50,24 +54,24 @@ public class EncodingTest {
* For this test we expect to not recognize the title.
*/
@Test
- public void testEncodingHTML_UTF_8_DeclarationAfterTitle() {
- HTMLDocument document = parseHTML("microformats/xfn/encoding-utf-8-after-title.html");
+ public void testEncodingHTML_UTF_8_DeclarationAfterTitle() throws Exception {
+ HTMLDocument document = parseHTML("/microformats/xfn/encoding-utf-8-after-title.html");
Assert.assertNotSame(HELLO_WORLD, document.find("//TITLE"));
}
@Test
- public void testEncodingXHTML_ISO_8859_1() {
- HTMLDocument document = parseHTML("microformats/xfn/encoding-iso-8859-1.xhtml");
+ public void testEncodingXHTML_ISO_8859_1() throws Exception {
+ HTMLDocument document = parseHTML("/microformats/xfn/encoding-iso-8859-1.xhtml");
Assert.assertEquals(HELLO_WORLD, document.find("//TITLE"));
}
@Test
- public void testEncodingXHTML_UTF_8() {
- HTMLDocument document = parseHTML("microformats/xfn/encoding-utf-8.xhtml");
+ public void testEncodingXHTML_UTF_8() throws Exception {
+ HTMLDocument document = parseHTML("/microformats/xfn/encoding-utf-8.xhtml");
Assert.assertEquals(HELLO_WORLD, document.find("//TITLE"));
}
- private HTMLDocument parseHTML(String filename) {
- return new HTMLFixture(filename).getHTMLDocument();
+ private HTMLDocument parseHTML(String filename) throws FileNotFoundException, IOException {
+ return new HTMLFixture(copyResourceToTempFile(filename)).getHTMLDocument();
}
}
Modified: incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HCalendarExtractorTest.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HCalendarExtractorTest.java?rev=1371537&r1=1371536&r2=1371537&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HCalendarExtractorTest.java (original)
+++ incubator/any23/trunk/core/src/test/java/org/apache/any23/extractor/html/HCalendarExtractorTest.java Fri Aug 10 00:40:13 2012
@@ -57,7 +57,7 @@ public class HCalendarExtractorTest exte
@Test
public void testOneVEvent() throws RepositoryException {
- assertExtract("microformats/hcalendar/example1.html");
+ assertExtract("/microformats/hcalendar/example1.html");
assertModelNotEmpty();
assertContains(baseURI, RDF.TYPE, vcal);
assertContains(null, RDF.TYPE, vevent);
@@ -84,7 +84,7 @@ public class HCalendarExtractorTest exte
@Test
public void testTransparentEvent() throws RepositoryException {
- assertExtract("microformats/hcalendar/example2.html");
+ assertExtract("/microformats/hcalendar/example2.html");
assertModelNotEmpty();
assertContains(baseURI, RDF.TYPE, vcal);
assertContains(null, RDF.TYPE, vevent);
@@ -112,7 +112,7 @@ public class HCalendarExtractorTest exte
@Test
public void testRepetitiveEvent() throws RepositoryException {
- assertExtract("microformats/hcalendar/example3.html");
+ assertExtract("/microformats/hcalendar/example3.html");
assertModelNotEmpty();
assertContains(baseURI, RDF.TYPE, vcal);
assertContains(null, RDF.TYPE, vevent);
@@ -140,7 +140,7 @@ public class HCalendarExtractorTest exte
@Test
public void testThreeDayEvent() throws RepositoryException {
- assertExtract("microformats/hcalendar/example5.html");
+ assertExtract("/microformats/hcalendar/example5.html");
assertModelNotEmpty();
assertContains(baseURI, RDF.TYPE, vcal);
assertContains(null, RDF.TYPE, vevent);
@@ -169,7 +169,7 @@ public class HCalendarExtractorTest exte
@Test
public void testHCalendarWithBudyInfo() throws RepositoryException {
- assertExtract("microformats/hcalendar/example5.5.html");
+ assertExtract("/microformats/hcalendar/example5.5.html");
assertModelNotEmpty();
assertContains(baseURI, RDF.TYPE, vcal);
assertContains(null, RDF.TYPE, vjournal);
@@ -177,21 +177,21 @@ public class HCalendarExtractorTest exte
@Test
public void test01() throws RepositoryException {
- assertDefault("microformats/hcalendar/01-component-vevent-dtstart-date.html");
+ assertDefault("/microformats/hcalendar/01-component-vevent-dtstart-date.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "19970903");
}
@Test
public void test02() throws RepositoryException {
- assertDefault("microformats/hcalendar/02-component-vevent-dtstart-datetime.html");
+ assertDefault("/microformats/hcalendar/02-component-vevent-dtstart-datetime.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "1997-09-05T18:00:00.000Z");
}
@Test
public void test03() throws RepositoryException {
- assertDefault("microformats/hcalendar/03-component-vevent-dtend-date.html");
+ assertDefault("/microformats/hcalendar/03-component-vevent-dtend-date.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "19970903");
assertContains(event, vICAL.dtend, "19970904");
@@ -199,7 +199,7 @@ public class HCalendarExtractorTest exte
@Test
public void test04() throws RepositoryException {
- assertDefault("microformats/hcalendar/04-component-vevent-dtend-datetime.html");
+ assertDefault("/microformats/hcalendar/04-component-vevent-dtend-datetime.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "1997-09-03T16:00:00.000Z");
assertContains(event, vICAL.dtend, "1997-09-03T18:00:00.000Z");
@@ -207,7 +207,7 @@ public class HCalendarExtractorTest exte
@Test
public void test05() throws RepositoryException {
- assertDefault("microformats/hcalendar/05-calendar-simple.html");
+ assertDefault("/microformats/hcalendar/05-calendar-simple.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "2005-10-05");
assertContains(event, vICAL.dtend, "2005-10-08");
@@ -218,7 +218,7 @@ public class HCalendarExtractorTest exte
@Test
public void test06() throws RepositoryException {
- assertDefault("microformats/hcalendar/06-component-vevent-uri-relative.html");
+ assertDefault("/microformats/hcalendar/06-component-vevent-uri-relative.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "20060115T000000");
assertContains(event, vICAL.summary, "Bad Movie Night - Gigli (blame mike spiegelman)");
@@ -227,7 +227,7 @@ public class HCalendarExtractorTest exte
@Test
public void test07() throws RepositoryException {
- assertDefault("microformats/hcalendar/07-component-vevent-description-simple.html");
+ assertDefault("/microformats/hcalendar/07-component-vevent-description-simple.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.description, "Project xyz Review Meeting Minutes");
assertNotContains(event, vICAL.url, (Resource) null);
@@ -235,7 +235,7 @@ public class HCalendarExtractorTest exte
@Test
public void test08() throws RepositoryException {
- assertDefault("microformats/hcalendar/08-component-vevent-multiple-classes.html");
+ assertDefault("/microformats/hcalendar/08-component-vevent-multiple-classes.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "2005-10-05");
assertContains(event, vICAL.dtend, "2005-10-08");
@@ -246,7 +246,7 @@ public class HCalendarExtractorTest exte
@Test
public void test09() throws RepositoryException {
- assertDefault("microformats/hcalendar/09-component-vevent-summary-in-img-alt.html");
+ assertDefault("/microformats/hcalendar/09-component-vevent-summary-in-img-alt.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtend, "20060310");
assertContains(event, vICAL.dtstart, "20060306");
@@ -257,7 +257,7 @@ public class HCalendarExtractorTest exte
@Test
public void test10() throws RepositoryException {
- assertDefault("microformats/hcalendar/10-component-vevent-entity.html");
+ assertDefault("/microformats/hcalendar/10-component-vevent-entity.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.summary, "Cricket & Tennis Centre");
assertContains(event, vICAL.description, "Melbourne's Cricket & Tennis Centres are in the heart of the city");
@@ -265,7 +265,7 @@ public class HCalendarExtractorTest exte
@Test
public void test11() throws RepositoryException {
- assertDefault("microformats/hcalendar/11-component-vevent-summary-in-subelements.html");
+ assertDefault("/microformats/hcalendar/11-component-vevent-summary-in-subelements.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "20051005T1630-0700");
@@ -275,7 +275,7 @@ public class HCalendarExtractorTest exte
@Test
public void test12() throws RepositoryException {
- assertDefault("microformats/hcalendar/12-component-vevent-summary-url-in-same-class.html");
+ assertDefault("/microformats/hcalendar/12-component-vevent-summary-url-in-same-class.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "20060125T000000");
assertContains(event, vICAL.url, RDFUtils.uri("http://www.laughingsquid.com/squidlist/calendar/12377/2006/1/25"));
@@ -284,7 +284,7 @@ public class HCalendarExtractorTest exte
@Test
public void test13() throws RepositoryException {
- assertDefault("microformats/hcalendar/13-component-vevent-summary-url-property.html");
+ assertDefault("/microformats/hcalendar/13-component-vevent-summary-url-property.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.url, RDFUtils.uri(
"http://dps1.travelocity.com/dparcobrand.ctl?smls=Y&Service=YHOE&.intl=us&aln_name=AA&flt_num=" +
@@ -295,7 +295,7 @@ public class HCalendarExtractorTest exte
@Test
public void test15() throws RepositoryException {
- assertDefault("microformats/hcalendar/15-calendar-xml-lang.html");
+ assertDefault("/microformats/hcalendar/15-calendar-xml-lang.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "2005-10-05");
assertContains(event, vICAL.dtend, "2005-10-08");
@@ -306,7 +306,7 @@ public class HCalendarExtractorTest exte
@Test
public void test16() throws RepositoryException {
- assertDefault("microformats/hcalendar/16-calendar-force-outlook.html");
+ assertDefault("/microformats/hcalendar/16-calendar-force-outlook.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "2005-10-05");
assertContains(event, vICAL.dtend, "2005-10-08");
@@ -315,7 +315,7 @@ public class HCalendarExtractorTest exte
@Test
public void test17() throws RepositoryException {
- assertDefault("microformats/hcalendar/17-component-vevent-description-value-in-subelements.html");
+ assertDefault("/microformats/hcalendar/17-component-vevent-description-value-in-subelements.html");
Resource event = getExactlyOneComponent(vevent);
assertContains(event, vICAL.dtstart, "2006-01-18");
assertContains(event, vICAL.dtend, "2006-01-20");
@@ -330,26 +330,26 @@ public class HCalendarExtractorTest exte
@Test
public void test18() throws RepositoryException {
- assertDefault("microformats/hcalendar/18-component-vevent-uid.html");
+ assertDefault("/microformats/hcalendar/18-component-vevent-uid.html");
assertStatementsSize(RDF.TYPE, vevent, 5);
assertStatementsSize(vICAL.uid, RDFUtils.literal("http://example.com/foo.html"), 5);
}
@Test
public void testNoMicroformats() throws RepositoryException, IOException, ExtractionException {
- extract("html/html-without-uf.html");
+ extract("/html/html-without-uf.html");
assertModelEmpty();
}
@Test
public void testNoMicroformatsInStatCvsPage() throws RepositoryException, IOException, ExtractionException {
- extract("microformats/hcalendar/empty-statcvs.html");
+ extract("/microformats/hcalendar/empty-statcvs.html");
assertModelEmpty();
}
@Test
public void testFullHCalendarClass() throws RepositoryException {
- assertExtract("microformats/hcalendar/example5.3.html");
+ assertExtract("/microformats/hcalendar/example5.3.html");
assertModelNotEmpty();
assertContains(baseURI, RDF.TYPE, vcal);
assertContains(null, RDF.TYPE, vevent);
@@ -357,7 +357,7 @@ public class HCalendarExtractorTest exte
@Test
public void testHCalendarClassWithTodo() throws RepositoryException {
- assertExtract("microformats/hcalendar/example5.4.html");
+ assertExtract("/microformats/hcalendar/example5.4.html");
assertModelNotEmpty();
assertContains(baseURI, RDF.TYPE, vcal);
assertContains(null, RDF.TYPE, vtodo);
@@ -365,7 +365,7 @@ public class HCalendarExtractorTest exte
@Test
public void testHCalendarClassWithJournal() throws RepositoryException {
- assertExtract("microformats/hcalendar/example5.5.html");
+ assertExtract("/microformats/hcalendar/example5.5.html");
assertModelNotEmpty();
assertContains(baseURI, RDF.TYPE, vcal);
assertContains(null, RDF.TYPE, vjournal);