Search in sources :

Example 1 with StyledHtmlAxisServiceLister

use of org.pentaho.platform.plugin.services.webservices.content.StyledHtmlAxisServiceLister in project pentaho-platform by pentaho.

the class AxisWebServiceManagerIT method testListingPageStyled.

@Test
public void testListingPageStyled() throws Exception {
    MockServletContext context = new MockServletContext();
    context.addResourcePaths("/", Arrays.asList("test-module/"));
    context.addResourcePaths("/test-module/", Arrays.asList("themes.xml"));
    context.addResourcePaths("/test-module/themes/onyx/", Arrays.asList("styles.css"));
    File themesDotXML = new File(microPlatform.getFilePath() + "system/axis/themes.xml");
    context.setResource("/test-module/themes.xml", themesDotXML.toURI().toURL());
    context.setResourceAsStream("/test-module/themes.xml", new FileInputStream(themesDotXML));
    File styleDotSCC = new File(microPlatform.getFilePath() + "system/axis/themes/onyx/styles.css");
    context.setResource("/test-module/themes/onyx/styles.css", styleDotSCC.toURI().toURL());
    context.setResourceAsStream("/test-module/themes/onyx/styles.css", new FileInputStream(styleDotSCC));
    PentahoSystem.getApplicationContext().setContext(context);
    IContentGenerator serviceLister = new StyledHtmlAxisServiceLister();
    String html = ContentGeneratorUtil.getContentAsString(serviceLister);
    System.out.println(html);
    assertTrue("style is missing", html.contains("styles.css"));
}
Also used : IContentGenerator(org.pentaho.platform.api.engine.IContentGenerator) File(java.io.File) StyledHtmlAxisServiceLister(org.pentaho.platform.plugin.services.webservices.content.StyledHtmlAxisServiceLister) MockServletContext(com.mockrunner.mock.web.MockServletContext) FileInputStream(java.io.FileInputStream) Test(org.junit.Test)

Example 2 with StyledHtmlAxisServiceLister

use of org.pentaho.platform.plugin.services.webservices.content.StyledHtmlAxisServiceLister in project pentaho-platform by pentaho.

the class AxisWebServiceManagerIT method testMetaInf.

@Test
public void testMetaInf() throws Exception {
    IContentGenerator serviceLister = new StyledHtmlAxisServiceLister();
    String html = ContentGeneratorUtil.getContentAsString(serviceLister);
    System.out.println(html);
    assertTrue("title is not displayed", html.contains("junit echo service"));
}
Also used : IContentGenerator(org.pentaho.platform.api.engine.IContentGenerator) StyledHtmlAxisServiceLister(org.pentaho.platform.plugin.services.webservices.content.StyledHtmlAxisServiceLister) Test(org.junit.Test)

Example 3 with StyledHtmlAxisServiceLister

use of org.pentaho.platform.plugin.services.webservices.content.StyledHtmlAxisServiceLister in project pentaho-platform by pentaho.

the class AxisWebServiceManagerIT method testExecuteUrlListed.

/*
   * The following tests are checking that the HtmlServiceLister (content generator) outputs the correct meta
   * information about the services defined in the test plugin. They are integration tests in the sense that all the
   * work of registering the plugin that defines the services and content generators is done by actual platform modules
   * as it would normally happen, and is not mocked for these tests.
   */
@Test
public void testExecuteUrlListed() throws Exception {
    IContentGenerator serviceLister = new StyledHtmlAxisServiceLister();
    String html = ContentGeneratorUtil.getContentAsString(serviceLister);
    System.out.println(html);
    assertTrue("Run URL is missing", html.contains("/content/ws-run/echoService"));
}
Also used : IContentGenerator(org.pentaho.platform.api.engine.IContentGenerator) StyledHtmlAxisServiceLister(org.pentaho.platform.plugin.services.webservices.content.StyledHtmlAxisServiceLister) Test(org.junit.Test)

Example 4 with StyledHtmlAxisServiceLister

use of org.pentaho.platform.plugin.services.webservices.content.StyledHtmlAxisServiceLister in project pentaho-platform by pentaho.

the class AxisWebServiceManagerIT method testWsdlUrlListed.

@Test
public void testWsdlUrlListed() throws Exception {
    IContentGenerator serviceLister = new StyledHtmlAxisServiceLister();
    String html = ContentGeneratorUtil.getContentAsString(serviceLister);
    System.out.println(html);
    assertTrue("WSDL URL is missing", html.contains("/content/ws-wsdl/echoService"));
}
Also used : IContentGenerator(org.pentaho.platform.api.engine.IContentGenerator) StyledHtmlAxisServiceLister(org.pentaho.platform.plugin.services.webservices.content.StyledHtmlAxisServiceLister) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 IContentGenerator (org.pentaho.platform.api.engine.IContentGenerator)4 StyledHtmlAxisServiceLister (org.pentaho.platform.plugin.services.webservices.content.StyledHtmlAxisServiceLister)4 MockServletContext (com.mockrunner.mock.web.MockServletContext)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1