Package org.pentaho.platform.engine.services.audit

Examples of org.pentaho.platform.engine.services.audit.AuditConnection


    return SOLUTION_PATH;
  }

  public void testAuditConnection() {
    startTest();
    AuditConnection auditConnection = new AuditConnection();
    auditConnection.setUseNewDatasourceService( true ); // make sure we get a datasource from the object factory
    auditConnection.initialize();
    MockDataSourceService.setThrowExceptionOnGetConnection(false);
    try {
      Connection connection = auditConnection.getAuditConnection();
      System.out.println( "Audit Connection Is  " + connection ); //$NON-NLS-1$ 

      DataSource datasource = auditConnection.getAuditDatasource();
      System.out.println( "Datasource Is  " + datasource ); //$NON-NLS-1$     
    } catch ( Exception e ) {
      e.printStackTrace();
      fail( e.getMessage() );
    } finally {
View Full Code Here


  }

  public void testAuditConnectionNoConfigFile() {
    startTest();
    SOLUTION_PATH = ""; // We want to test what happens when the config file can't be found
    AuditConnection auditConnection = new AuditConnection();
    auditConnection.setUseNewDatasourceService( true ); // make sure we get a datasource from the object factory
    auditConnection.initialize();
    MockDataSourceService.setThrowExceptionOnGetConnection(false);
    try {
      Connection connection = auditConnection.getAuditConnection();
      System.out.println( "Audit Connection Is  " + connection ); //$NON-NLS-1$ 

      DataSource datasource = auditConnection.getAuditDatasource();
      System.out.println( "Datasource Is  " + datasource ); //$NON-NLS-1$     
    } catch ( Exception e ) {
      e.printStackTrace();
      fail( e.getMessage() );
    } finally {
View Full Code Here

      // Load mock object factory with mock datasource service that produces null datasources
      StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();
      factory.init( "test-res/solution/system/pentahoObjects.datasourceservice.null.spring.xml", null );
      PentahoSystem.registerObjectFactory( factory );

      AuditConnection auditConnection = new AuditConnection();
      auditConnection.setUseNewDatasourceService( true ); // make sure we get a datasource from the object factory
      auditConnection.initialize();
      MockDataSourceService.setThrowExceptionOnGetConnection(true);
      auditConnection.getAuditConnection();
      fail( "Expected exception when no audit connection could be established" );
    } catch ( SQLException ex ) {
      ex.printStackTrace();
      assertTrue( "Expected AUDSQLENT.ERROR_0001", ex.getMessage().contains( "AUDSQLENT.ERROR_0001" ) );
    } finally {
View Full Code Here

TOP

Related Classes of org.pentaho.platform.engine.services.audit.AuditConnection

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.