srr.setSession( session );
IRuntimeElement ele1 = srr.loadElementById( "instanceid", null ); //$NON-NLS-1$
IRuntimeElement ele2 = srr.newRuntimeElement( "parent", "parentType", true ); //$NON-NLS-1$ //$NON-NLS-2$
IRuntimeElement ele3 = srr.newRuntimeElement( "parentid", "parentType", "solutionId", true ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
SimpleRuntimeElement sre = (SimpleRuntimeElement) srr.loadElementById( "instanceid", null ); //$NON-NLS-1$
List list = sre.getMessages();
if ( list != null ) {
for ( int i = 0; i < list.size(); i++ ) {
System.out.println( "Message " + ( i + 1 ) + list.get( i ) ); //$NON-NLS-1$
}
sre.setParentId( "parentid1" ); //$NON-NLS-1$
sre.setParentType( "parentidType1" ); //$NON-NLS-1$
sre.setSolutionId( "solutionId1" ); //$NON-NLS-1$
sre.setReadOnly( true );
boolean isReadOnly = sre.getReadOnly();
String parentId = sre.getParentId();
String parentIdType = sre.getParentType();
String solutionId = sre.getSolutionId();
assertEquals( isReadOnly, true );
assertEquals( parentId, "parentid1" ); //$NON-NLS-1$
assertEquals( parentIdType, "parentidType1" ); //$NON-NLS-1$
assertEquals( solutionId, "solutionId1" ); //$NON-NLS-1$
}
int revision = sre.getRevision();
System.out.println( "Revision Value is" + revision ); //$NON-NLS-1$
sre.setStringProperty( "parentId", "value" ); //$NON-NLS-1$ //$NON-NLS-2$
BigDecimal tstBD = new BigDecimal( "2.4" ); //$NON-NLS-1$
ele2.setBigDecimalProperty( "junkBD", tstBD ); //$NON-NLS-1$
BigDecimal bd = ele2.getBigDecimalProperty( "junkBD" ); //$NON-NLS-1$
assertEquals( bd, tstBD );
Date tstDT = new Date();