Search in sources :

Example 41 with ClassRelativeResourceLoader

use of org.springframework.core.io.ClassRelativeResourceLoader in project uPortal by Jasig.

the class XalanGroupMembershipHelperTest method setup.

@Before
public void setup() throws Exception {
    final ResourceLoaderURIResolver resolver = new ResourceLoaderURIResolver(new ClassRelativeResourceLoader(getClass()));
    this.tFactory = TransformerFactory.newInstance();
    this.tFactory.setURIResolver(resolver);
    this.tFactory.setErrorListener(new SimpleTransformErrorListener(LogFactory.getLog(getClass())));
    this.xmlSource = new StreamSource(this.getClass().getResourceAsStream("test.xml"));
}
Also used : ResourceLoaderURIResolver(org.apereo.portal.xml.ResourceLoaderURIResolver) ClassRelativeResourceLoader(org.springframework.core.io.ClassRelativeResourceLoader) SimpleTransformErrorListener(org.springframework.util.xml.SimpleTransformErrorListener) StreamSource(javax.xml.transform.stream.StreamSource) Before(org.junit.Before)

Aggregations

ClassRelativeResourceLoader (org.springframework.core.io.ClassRelativeResourceLoader)41 Resource (org.springframework.core.io.Resource)34 ResourceLoader (org.springframework.core.io.ResourceLoader)34 Test (org.junit.Test)33 File (java.io.File)32 Before (org.junit.Before)5 StreamSource (javax.xml.transform.stream.StreamSource)4 ResourceLoaderURIResolver (org.apereo.portal.xml.ResourceLoaderURIResolver)4 SimpleTransformErrorListener (org.springframework.util.xml.SimpleTransformErrorListener)4 BufferedReader (java.io.BufferedReader)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 InputStreamReader (java.io.InputStreamReader)2 MessagingException (javax.mail.MessagingException)2 MimeMessage (javax.mail.internet.MimeMessage)2 JavaMailSenderImpl (org.springframework.mail.javamail.JavaMailSenderImpl)2 MimeMessageHelper (org.springframework.mail.javamail.MimeMessageHelper)2 XMLEventReader (javax.xml.stream.XMLEventReader)1 XMLInputFactory (javax.xml.stream.XMLInputFactory)1 XMLStreamReader (javax.xml.stream.XMLStreamReader)1