Resource implements IResource { @Override public String getOriginalContent() { ITemplateProcessor processor = getTemplateProcessor(); if (processor != null) { return getOriginalContent(processor, Urls.getContent(m_url)); } return Urls.getContent(m_url); } Resource(IResourceUrn urn, URL physicalUrl, IResourceLocale locale, IResourceLibrary libraryInfo);  Resource(Resource resource); @Override boolean equals(Object obj); @Override byte[] getBinaryContent(IResourceContext context); @Override String getContent(IResourceContext context); @Override List<IResource> getDependencies(); @Override long getLastModified(); @Override IResourceLibrary getLibrary(); @Override IResourceLocale getLocale(); @Override byte[] getOriginalBinaryContent(); @Override byte[] getOriginalBinaryContent(ITemplateContext context); @Override String getOriginalContent(); @Override String getOriginalContent(ITemplateContext context); @Override URL getOriginalUrl(); @Override String getUrl(IResourceContext context); @Override IResourceUrn getUrn(); @Override int hashCode(); @Override void setDependencies(List<IResource> dependencies); void setHandler(IResourceHandler handler); @Override String toString();  }
@Test public void testGetOriginalContent() throws UnsupportedEncodingException { Resource resource = (Resource)ResourceFactory.createResource("/js/sample/sample.js"); MockTemplateContext template = new MockTemplateContext(); template.setContextPath("/BaseResourceTest"); template.setResourceLocale(new ResourceLocale(new Locale("de_DE"))); template.setSecure(false); ResourceRuntimeContext.reset(); String expectedContent = "document.write(\"this is sample.js<br>\");"; String actualContent = resource.getOriginalContent(template); Assert.assertEquals(expectedContent, actualContent); ResourceRuntimeContext.reset(); byte[] actualBinaryContent = resource.getOriginalBinaryContent(template); Assert.assertEquals(expectedContent, new String(actualBinaryContent, "utf-8")); }