use of org.apereo.portal.xml.ResourceLoaderURIResolver in project uPortal by Jasig.
the class XsltPortalUrlProviderTest 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())));
// Load the XML document so it reads the same way the rendering pipeline reads XML
final XMLInputFactory xmlInputFactory = XMLInputFactory.newFactory();
final XMLEventReader eventReader = xmlInputFactory.createXMLEventReader(this.getClass().getResourceAsStream("test.xml"));
final XMLStreamReader streamReader = new FixedXMLEventStreamReader(eventReader);
xmlSource = new StAXSource(streamReader);
xslTemplate = tFactory.newTemplates(new StreamSource(this.getClass().getResourceAsStream("test.xsl")));
expected = IOUtils.toString(this.getClass().getResourceAsStream("result.xml"));
}
use of org.apereo.portal.xml.ResourceLoaderURIResolver in project uPortal by Jasig.
the class XalanMessageHelperTest 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"));
}
use of org.apereo.portal.xml.ResourceLoaderURIResolver 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"));
}
use of org.apereo.portal.xml.ResourceLoaderURIResolver in project uPortal by Jasig.
the class XalanAuthorizationHelperTest 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"));
}
Aggregations