Package org.pentaho.platform.api.engine

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


    finishTest();
  }

  public void testResultSetWithoutRowValue() {
    startTest();
    IRuntimeContext context = run( "/test/rules/ResultSetTest_without_rowvalue.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$
    finishTest();
  }
View Full Code Here


    finishTest();
  }

  public void testResultSet_NullColumnHeader() {
    startTest();
    IRuntimeContext context = run( "/test/rules/ResultSetTest_NullColumnHeader.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$
    finishTest();
  }
View Full Code Here

    finishTest();
  }

  public void testResultSetTestWithDifferentDataTypes() {
    startTest();
    IRuntimeContext context = run( "/test/rules/ResultSetTestWithDifferentDataTypes.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$
    finishTest();
  }
View Full Code Here

    super.tearDown();
  }

  public void testKettleSuccessResult() {
    assertNotNull( session );
    IRuntimeContext context =
      run( "/test/etl/SampleTransformation.xaction", null, false, parameterProvider, outputHandler, session );
    assertEquals( IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() );

    assertSuccessResult( context, new Object[][] {
      { "Central", "Sales", "District Manager", "Hello, District Manager" },
      { "Central", "Sales", "Senior Sales Rep", "Hello, Senior Sales Rep" } } );
  }
View Full Code Here

      { "Central", "Sales", "District Manager", "Hello, District Manager" },
      { "Central", "Sales", "Senior Sales Rep", "Hello, Senior Sales Rep" } } );
  }

  public void testKettleValidatationFailure() {
    IRuntimeContext context =
      run( "/test/etl/SampleTransformationInvalid.xaction", null, false, parameterProvider, outputHandler, session );
    assertEquals( IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_FAIL, context.getStatus() );

    assertFailResult( context );
  }
View Full Code Here

    assertFailResult( context );
  }

  public void testKettleMissingTransform() {
    IRuntimeContext context =
      run( "/test/etl/SampleTransformationMissingKTR.xaction", null, false, parameterProvider, outputHandler, session );
    assertEquals( IRuntimeContext.RUNTIME_STATUS_FAILURE, context.getStatus() );

    assertFailResult( context );
  }
View Full Code Here

    return SOLUTION_PATH;
  }

  public void testRSExportComponent() {
    startTest();
    IRuntimeContext context = run( "/test/rules/ResultSetExportTest.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( "EXPORTRESULT" ); //$NON-NLS-1$
    assertNotNull( "Result is null", rtn ); //$NON-NLS-1$

    // Check that the data, Eastern, is in the result set
    String content = rtn.getStringValue();
    assertNotNull( "Exported content is null", content ); //$NON-NLS-1$
View Full Code Here

  /*
   * The test removes the result-set element from the action inputs.
   */
  public void testRSExportComponent_error1() {
    startTest();
    IRuntimeContext context = run( "/test/rules/ResultSetExportTest_error1.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

   * The test removes outputs and action-outputs. This causes ResultSetExportComponent's validateAction() to return
   * false.
   */
  public void testRSExportComponent_error2() {
    startTest();
    IRuntimeContext context = run( "/test/rules/ResultSetExportTest_error2.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

        n = reader.read( buffer );
      }
      String xactionStr = str.toString();

      solutionEngine.setSession( session );
      IRuntimeContext runtimeContext =
          solutionEngine
              .execute(
                xactionStr,
                "SetGlobalOutputTest.xaction", "empty action sequence test", false, true, instanceId, false,
                parameterProviderMap, null, null, urlFactory, messages ); //$NON-NLS-1$ //$NON-NLS-2$
      assertNotNull( "RuntimeContext is null", runtimeContext );
      assertEquals( "Action sequence execution failed", runtimeContext.getStatus(),
          IRuntimeContext.RUNTIME_STATUS_SUCCESS );
      IParameterProvider provider = PentahoSystem.getGlobalParameters();
      String parameter = provider.getStringParameter( "GLOBAL_TEST", null ); //$NON-NLS-1$
      assertNotNull( parameter );
      assertEquals( "This is a test", parameter ); //$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.