Search in sources :

Example 11 with Document

use of ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType.Document in project hale by halestudio.

the class TestModelRifToRifTranslator method testTranslateExample1NegationFilter.

/**
 * Tests that it is possible to translate the example 3 CP source dataset,
 * including a logical negation predicate filter.
 *
 * @throws TranslationException
 *             if any errors occurred during the translation
 * @throws JAXBException
 *             if unable to write out a DOM document containing the RIF-PRD
 */
@Test
public void testTranslateExample1NegationFilter() throws TranslationException, JAXBException {
    URL url = getClass().getClassLoader().getResource(// $NON-NLS-1$
    "com/onespatial/jrc/tnstg/proto/oml_to_rif/alignments/example1_tn_road.goml");
    org.w3._2007.rif.Document doc = translator.translate(url);
    assertNotNull(doc);
    assertNotNull(doc.getPayload());
    assertNotNull(doc.getPayload().getGroup());
    assertNotNull(doc.getPayload().getGroup().getSentence());
    // CHECKSTYLE:OFF
    assertThat(doc.getPayload().getGroup().getSentence().size(), is(3));
    // CHECKSTYLE:ON
    assertNotNull(doc.getPayload().getGroup().getSentence().get(0));
    writeDom(getDomFromRif(doc), System.out);
}
Also used : URL(java.net.URL) Document(org.w3._2007.rif.Document) DomBasedUnitTest(com.onespatial.jrc.tns.oml_to_rif.fixture.DomBasedUnitTest) Test(org.junit.Test)

Aggregations

DataHandler (javax.activation.DataHandler)5 ProvideAndRegisterDocumentSetRequestType (ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType)4 Document (ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType.Document)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 DataSource (javax.activation.DataSource)4 ByteArrayDataSource (javax.mail.util.ByteArrayDataSource)4 DirectDocuments (org.nhindirect.xd.common.DirectDocuments)4 Document (org.w3._2007.rif.Document)4 DomBasedUnitTest (com.onespatial.jrc.tns.oml_to_rif.fixture.DomBasedUnitTest)3 IOException (java.io.IOException)3 URL (java.net.URL)3 Test (org.junit.Test)3 TransformationException (org.nhindirect.xd.transform.exception.TransformationException)3 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2 InitialContext (javax.naming.InitialContext)2 RegistryResponseType (oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType)2 MailClient (org.nhind.xdm.MailClient)2 SmtpMailClient (org.nhind.xdm.impl.SmtpMailClient)2 DirectMessage (org.nhindirect.xd.common.DirectMessage)2