示例#1
0
  public void testForcePrompt() {
    startTest();
    SimpleParameterProvider parameterProvider = new SimpleParameterProvider();
    OutputStream outputStream =
        getOutputStream("RuntimeTest.testForcePrompt", ".html"); // $NON-NLS-1$ //$NON-NLS-2$
    SimpleOutputHandler outputHandler = new SimpleOutputHandler(outputStream, true);
    outputHandler.setOutputPreference(IOutputHandler.OUTPUT_TYPE_PARAMETERS);
    StandaloneSession session =
        new StandaloneSession(Messages.getString("BaseTest.DEBUG_JUNIT_SESSION")); // $NON-NLS-1$

    ISolutionEngine solutionEngine = PentahoSystem.get(ISolutionEngine.class, session);
    solutionEngine.setLoggingLevel(getLoggingLevel());
    solutionEngine.init(session);
    solutionEngine.setForcePrompt(true);
    IRuntimeContext context =
        run(
            solutionEngine,
            "test",
            "reporting",
            "jfreereport-reports-test-param.xaction",
            null,
            false,
            parameterProvider,
            outputHandler); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getString("BaseTest.USER_RUNNING_ACTION_SEQUENCE"),
        IRuntimeContext.RUNTIME_STATUS_SUCCESS,
        context.getStatus()); // $NON-NLS-1$

    finishTest();
  }
 public IOutputHandler getOutputHandler(OutputStream stream) {
   SimpleOutputHandler outputHandler =
       new SimpleOutputHandler(stream, true); // Allow feedback for this test
   outputHandler.setOutputPreference(IOutputHandler.OUTPUT_TYPE_DEFAULT);
   return outputHandler;
 }