Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.IRuntimeContext


    String xaction = "/test/platform/VFSOutputTest_file.xaction";
    if ( System.getProperty( "os.name" ).startsWith( "Windows" ) ) {
      xaction = "/test/platform/VFSOutputTestWindows_file.xaction";
    }

    IRuntimeContext context =
        run( xaction, parameterProvider, "VFSOutputTest.testFileOutput", ".txt" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    finishTest();
  }
View Full Code Here


  }

  public void testIPreparedComponentSQLAvailable() {
    startTest();
    info( "Expected: Successful execution with object available" ); //$NON-NLS-1$
    IRuntimeContext context = run( "/test/ipreparedcomponents/ipreparedcomponent_sql_available.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn );
    IPreparedComponent preparedComponent = (IPreparedComponent) rtn.getValue();

    assertNotNull( preparedComponent );
View Full Code Here

   */

  public void testIPreparedComponentXQueryAvailable() {
    startTest();
    info( "Expected: Successful execution with object available" ); //$NON-NLS-1$
    IRuntimeContext context = run( "/test/ipreparedcomponents/ipreparedcomponent_xquery_available.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn );
    IPreparedComponent preparedComponent = (IPreparedComponent) rtn.getValue();

    assertNotNull( preparedComponent );

View Full Code Here

    finishTest();
  }

  public void testIPreparedComponentXQueryAvailableErrorNoDocument() {
    startTest();
    IRuntimeContext context =
        run( "/test/ipreparedcomponents/ipreparedcomponent_xquery_available_error_nodocument.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_FAILURE, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn );
    IPreparedComponent preparedComponent = (IPreparedComponent) rtn.getValue();

    assertNull( preparedComponent );
View Full Code Here

  }

  public void testIPreparedComponentXQueryAvailableErrorNoPrepareComponent() {
    startTest();
    info( "Expected: Successful execution with object available" ); //$NON-NLS-1$
    IRuntimeContext context =
        run( "/test/ipreparedcomponents/ipreparedcomponent_xquery_available_error_nopreparedcomponent.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_FAIL, context.getStatus() ); //$NON-NLS-1$

    finishTest();
  }
View Full Code Here

  }

  public void testIPreparedComponentXQueryPrepareLater() {
    startTest();
    info( "Expected: Successful execution with object available" ); //$NON-NLS-1$
    IRuntimeContext context = run( "/test/ipreparedcomponents/ipreparedcomponent_xquery_preparelater.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn1 = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn1 );
    IPreparedComponent preparedComponent1 = (IPreparedComponent) rtn1.getValue();
    assertNotNull( preparedComponent1 );
    IPentahoResultSet resultset1 = preparedComponent1.executePrepared( null );
    assertTrue( resultset1.getRowCount() >= 1 );
    Object val1 = resultset1.getValueAt( 0, 0 );

    IActionParameter rtn2 = context.getOutputParameter( "second_prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn2 );
    IPreparedComponent preparedComponent2 = (IPreparedComponent) rtn2.getValue();
    assertNotNull( preparedComponent2 );
    HashMap map = new HashMap();
    map.put( "POSITIONTITLE", "Engineer" ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

  }

  public void testIPreparedComponentXQueryShareConnection() {
    startTest();
    info( "Expected: Successful execution with object available" ); //$NON-NLS-1$
    IRuntimeContext context = run( "/test/ipreparedcomponents/ipreparedcomponent_xquery_shareconn.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn1 = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn1 );
    IPreparedComponent preparedComponent1 = (IPreparedComponent) rtn1.getValue();
    assertNotNull( preparedComponent1 );
    IPentahoResultSet resultset1 = preparedComponent1.executePrepared( null );
    assertTrue( resultset1.getRowCount() >= 1 );
View Full Code Here

  public void testHelloWorldComponent() {
    startTest();
    String testName = HW_TEST_NAME + System.currentTimeMillis();
    SimpleParameterProvider parameterProvider = new SimpleParameterProvider();
    IRuntimeContext context = run( "/test/platform/HelloWorld.xaction", parameterProvider, testName, HW_TEST_EXTN ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    InputStream is = this.getInputStreamFromOutput( testName, HW_TEST_EXTN );
    assertNotNull( is ); // Did the test execute properly...
    String lookingFor = "\nHello World. (2B || !2B) That is the question\n"; //$NON-NLS-1$ //$NON-NLS-2$
    String wasRead = FileHelper.getStringFromInputStream( is );
View Full Code Here

  public void testHQLConnection() {
    SimpleParameterProvider parameters = new SimpleParameterProvider();
    OutputStream outputStream = getOutputStream( SOLUTION_PATH, "Chart_Bubble", ".html" ); //$NON-NLS-1$ //$NON-NLS-2$
    SimpleOutputHandler outputHandler = new SimpleOutputHandler( outputStream, true );
    IRuntimeContext context =
        run( getSolutionPath() + "/test/datasource/", "HQL_Datasource.xaction", parameters, outputHandler ); //$NON-NLS-1$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$
  }
View Full Code Here

   */

  public void testSQLExecuteErrorDropTable() {
    startTest();
    info( "Expected: Failed execution - should error out at the drop table statement" ); //$NON-NLS-1$
    IRuntimeContext context = run( "/test/rules/sqlexecute_error1.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_FAILURE, context.getStatus() ); //$NON-NLS-1$
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.IRuntimeContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.