package nl.tudelft.dsol.introspection;
import nl.tudelft.dsol.introspection.beans.SubTestBean2;
import nl.tudelft.simulation.introspection.Property;
import nl.tudelft.simulation.introspection.fields.FieldIntrospector;
import nl.tudelft.simulation.logger.Logger;
/**
* A test program for the field introspection implementation.
* @author (c) 2003 Delft University of Technology , Delft, the Netherlands
* Faculty of Technology, Policy and Management
* Department of System Engineering
* Main researcher : Dr. Ir. A. Verbraeck
* Assistant researchers Ir. P.H.M. Jacobs and Ir. N.A. Lang
*/
public final class FieldIntrospectionBeansTest
{
/**
* constructs a new PTestFieldIntrospector
*/
private FieldIntrospectionBeansTest()
{
super();
// unreachable code
}
/**
* executes the PTestFieldIntrospector
* @param args the commandline arguments
*/
public static void main(final String[] args)
{
try
{
Logger.info(FieldIntrospectionBeansTest.class, "main", "Running field introspector test");
Property[] props = (new FieldIntrospector()).getProperties(new SubTestBean2());
for (int i = 0; i < props.length; i++)
{
Logger.info(FieldIntrospectionBeansTest.class, "main", "Prop name: " + props[i].getName());
Logger.info(FieldIntrospectionBeansTest.class, "main", "Prop class: " + props[i].getType());
Logger.info(FieldIntrospectionBeansTest.class, "main", "Prop value: " + props[i].getValue());
Logger.info(FieldIntrospectionBeansTest.class, "main", "Setting Possible? ");
props[i].setValue("TEST");
Logger.info(FieldIntrospectionBeansTest.class, "main",
"If so, 'TEST' should be retrieved: " + props[i].getValue());
}
}
catch (Throwable throwable)
{
throwable.printStackTrace();
}
}
}