use of org.pentaho.reporting.libraries.repository.file.FileContentItem in project pentaho-platform by pentaho.
the class PentahoURLRewriterTest method testRewriteRoot.
@Test
public void testRewriteRoot() throws Exception {
String pattern = TEST_SRC + "/solution/test/reporting/system/{0}/param";
PentahoURLRewriter rewriter = new PentahoURLRewriter(pattern);
File dataDirectory = new File("/");
FileRepository dataRepository = new FileRepository(dataDirectory);
File contentEntryBackend = new File(TEST_SRC + "/solution/test/reporting/contentEntryBackend");
File dataEntityBackend = new File(TEST_SRC + "/solution/test/reporting/dataEntityBackend");
ContentEntity contentEntry = new FileContentItem(dataRepository.getRoot(), contentEntryBackend);
ContentEntity dataEntity = new FileContentItem(dataRepository.getRoot(), dataEntityBackend);
String result = rewriter.rewrite(contentEntry, dataEntity);
assertEquals(TEST_SRC + "/solution/test/reporting/system/dataEntityBackend/param", result);
}
use of org.pentaho.reporting.libraries.repository.file.FileContentItem in project pentaho-platform by pentaho.
the class PentahoURLRewriterTest method testRewriteWithSimplePattern.
@Test
public void testRewriteWithSimplePattern() throws Exception {
String pattern = TEST_SRC + "/solution/test/reporting/system";
PentahoURLRewriter rewriter = new PentahoURLRewriter(pattern);
File dataDirectory = new File(TEST_SRC + "/solution/test/reporting/");
FileRepository dataRepository = new FileRepository(dataDirectory);
File contentEntryBackend = new File(TEST_SRC + "/solution/test/reporting/contentEntryBackend");
File dataEntityBackend = new File(TEST_SRC + "/solution/test/reporting/dataEntityBackend");
ContentEntity contentEntry = new FileContentItem(dataRepository.getRoot(), contentEntryBackend);
ContentEntity dataEntity = new FileContentItem(dataRepository.getRoot(), dataEntityBackend);
String result = rewriter.rewrite(contentEntry, dataEntity);
assertEquals(pattern, result);
}
use of org.pentaho.reporting.libraries.repository.file.FileContentItem in project pentaho-platform by pentaho.
the class PentahoURLRewriterTest method testRewriteWithPatternParam.
@Test
public void testRewriteWithPatternParam() throws Exception {
String pattern = TEST_SRC + "/solution/test/reporting/system/{0}/param";
PentahoURLRewriter rewriter = new PentahoURLRewriter(pattern);
File dataDirectory = new File(TEST_SRC + "/solution/test/reporting/");
FileRepository dataRepository = new FileRepository(dataDirectory);
File contentEntryBackend = new File(TEST_SRC + "/solution/test/reporting/contentEntryBackend");
File dataEntityBackend = new File(TEST_SRC + "/solution/test/reporting/dataEntityBackend");
ContentEntity contentEntry = new FileContentItem(dataRepository.getRoot(), contentEntryBackend);
ContentEntity dataEntity = new FileContentItem(dataRepository.getRoot(), dataEntityBackend);
String result = rewriter.rewrite(contentEntry, dataEntity);
assertEquals(TEST_SRC + "/solution/test/reporting/system/dataEntityBackend/param", result);
}
use of org.pentaho.reporting.libraries.repository.file.FileContentItem in project pentaho-platform by pentaho.
the class PentahoURLRewriterTest method testRewriteWithNullPattern.
@Test
public void testRewriteWithNullPattern() throws Exception {
String pattern = null;
PentahoURLRewriter rewriter = new PentahoURLRewriter(pattern);
File dataDirectory = new File(TEST_SRC + "/solution/test/reporting/");
FileRepository dataRepository = new FileRepository(dataDirectory);
File contentEntryBackend = new File(TEST_SRC + "/solution/test/reporting/contentEntryBackend");
File dataEntityBackend = new File(TEST_SRC + "/solution/test/reporting/dataEntityBackend");
ContentEntity contentEntry = new FileContentItem(dataRepository.getRoot(), contentEntryBackend);
ContentEntity dataEntity = new FileContentItem(dataRepository.getRoot(), dataEntityBackend);
String result = rewriter.rewrite(contentEntry, dataEntity);
assertEquals("dataEntityBackend", result);
}
Aggregations