Package org.pentaho.platform.repository.runtime

Examples of org.pentaho.platform.repository.runtime.RuntimeRepository


  @SuppressWarnings( "unused" )
  private void doReadOnlyTest( String elementId ) {
    info( Messages.getInstance().getString( "RUNTIMEREPOTEST.USER_TESTINGREADONLY" ) ); //$NON-NLS-1$
    HibernateUtil.beginTransaction();
    try {
      IRuntimeRepository repo = new RuntimeRepository();
      repo.setSession( getPentahoSession() );
      RuntimeElement baseElement = (RuntimeElement) repo.loadElementById( elementId, null );
      info( Messages.getInstance().getString( "RUNTIMEREPOTEST.USER_SETTINGELEMENTTOREADONLY" ) ); //$NON-NLS-1$
      baseElement.setReadOnly( true );
    } finally {
      HibernateUtil.commitTransaction();
    }
    // Now, the element is read-only.
    // Flush the session and re-load the element to
    // test the "loaded" methods.
    HibernateUtil.flushSession();
    HibernateUtil.clear();
    // Now, reload the element.
    HibernateUtil.beginTransaction();
    try {
      info( Messages.getInstance().getString( "RUNTIMEREPOTEST.USER_LOADINGREADONLY" ) ); //$NON-NLS-1$
      IRuntimeRepository repo = new RuntimeRepository();
      repo.setSession( getPentahoSession() );
      RuntimeElement baseElement = (RuntimeElement) repo.loadElementById( elementId, null );
      boolean caughtException = false;
      try {
        info( Messages.getInstance().getString( "RUNTIMEREPOTEST.USER_TRYINGSETSTRINGPROPERTY" ) ); //$NON-NLS-1$
        baseElement
            .setStringProperty(
View Full Code Here


  }

  @SuppressWarnings( "unused" )
  private void cleanupElement( String elementId ) {
    HibernateUtil.beginTransaction();
    IRuntimeRepository repo = new RuntimeRepository();
    repo.setSession( getPentahoSession() );
    RuntimeElement re = (RuntimeElement) repo.loadElementById( elementId, null );
    HibernateUtil.makeTransient( re );
    HibernateUtil.commitTransaction();
    HibernateUtil.flushSession();
    HibernateUtil.clear();
  }
View Full Code Here

  @SuppressWarnings( "unused" )
  private void modifyAdd( RuntimeElement baseElement ) {
    HibernateUtil.beginTransaction();
    try {
      IRuntimeRepository repo = new RuntimeRepository();
      repo.setSession( getPentahoSession() );
      baseElement
          .setStringProperty(
              Messages.getInstance().getString( "RUNTIMEREPOTEST.MODIFY_NEW_STRING_KEY" ), Messages.getInstance().getString( "RUNTIMEREPOTEST.MODIFY_STRING_VALUE" ) ); //$NON-NLS-1$ //$NON-NLS-2$
    } finally {
      HibernateUtil.commitTransaction();
View Full Code Here

    }
  }

  @SuppressWarnings( "unused" )
  private RuntimeElement createRuntimeElement() {
    IRuntimeRepository repo = new RuntimeRepository();
    repo.setSession( getPentahoSession() );
    RuntimeElement ele = null;
    ele =
        (RuntimeElement) repo
            .newRuntimeElement(
                Messages.getInstance().getString( "RUNTIMEREPOTEST.CREATE_PARENT" ), Messages.getInstance().getString( "RUNTIMEREPOTEST.CREATE_PARENT_TYPE" ), false ); //$NON-NLS-1$ //$NON-NLS-2$
    try {
      assertNotNull( ele );
      info( Messages.getInstance().getString( "RUNTIMEREPOTEST.DEBUG_INSTANCE_ID" ) + ele.getInstanceId() ); //$NON-NLS-1$
View Full Code Here

  }

  @SuppressWarnings( "unused" )
  private void readElementTest( String instanceId ) {
    HibernateUtil.beginTransaction();
    IRuntimeRepository repo = new RuntimeRepository();
    repo.setSession( getPentahoSession() );
    RuntimeElement re = (RuntimeElement) repo.loadElementById( instanceId, null );
    checkValue( Messages.getInstance().getString( "RUNTIMEREPOTEST.SALES_SOLUTION" ), re.getSolutionId() ); //$NON-NLS-1$
    checkValue( longString.toString(), re.getStringProperty( Messages.getInstance().getString(
        "RUNTIMEREPOTEST.LONG_STRING_KEY" ) ) ); //$NON-NLS-1$
    checkValue(
        Messages.getInstance().getString( "RUNTIMEREPOTEST.SHORT_STRING_VALUE" ), re.getStringProperty( Messages.getInstance().getString( "RUNTIMEREPOTEST.SHORT_STRING_KEY" ) ) ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

TOP

Related Classes of org.pentaho.platform.repository.runtime.RuntimeRepository

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.