@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(